@mudssky/jsutils
    Preparing search index...

    Interface HighlightCallbacks

    高亮事件回调接口

    interface HighlightCallbacks {
        onHighlightApplied?: (matchCount: number, keywords: string[]) => void;
        onHighlightRemoved?: () => void;
        onNavigate?: (
            currentIndex: number,
            totalCount: number,
            element: HTMLElement,
        ) => void;
    }
    Index

    Properties

    onHighlightApplied?: (matchCount: number, keywords: string[]) => void

    高亮应用完成时的回调

    Type declaration

      • (matchCount: number, keywords: string[]): void
      • Parameters

        • matchCount: number

          匹配项总数

        • keywords: string[]

          高亮的关键词数组

        Returns void

    onHighlightRemoved?: () => void

    高亮移除时的回调

    onNavigate?: (
        currentIndex: number,
        totalCount: number,
        element: HTMLElement,
    ) => void

    导航到新匹配项时的回调

    Type declaration

      • (currentIndex: number, totalCount: number, element: HTMLElement): void
      • Parameters

        • currentIndex: number

          当前索引

        • totalCount: number

          总匹配数

        • element: HTMLElement

          当前激活的元素

        Returns void