pdfrx_web
    Preparing search index...

    Interface PdfSearch

    Search state and actions returned by usePdfSearch.

    interface PdfSearch {
        currentIndex: number | null;
        currentMatch: SearchMatch | null;
        goToMatch: (index: number) => Promise<number>;
        goToNext: () => Promise<number>;
        goToPrevious: () => Promise<number>;
        isSearching: boolean;
        matchCount: number;
        matches: readonly SearchMatch[];
        progress: number | null;
        query: string;
        reset: () => void;
        setQuery: (
            query: string,
            options?: StartTextSearchOptions & { force?: boolean },
        ) => void;
    }
    Index
    currentIndex: number | null

    Index of the active match within matches, or null.

    currentMatch: SearchMatch | null

    The active match, or null.

    goToMatch: (index: number) => Promise<number>

    Scrolls to a match by index. Returns -1 if the index is out of range.

    goToNext: () => Promise<number>

    Scrolls to the next match. Does not wrap past the last one.

    goToPrevious: () => Promise<number>

    Scrolls to the previous match. Does not wrap past the first one.

    isSearching: boolean

    Whether pages are still being scanned.

    matchCount: number

    Total number of matches found so far.

    matches: readonly SearchMatch[]

    Every match found so far, in page then in-page order. Grows while scanning.

    progress: number | null

    Scan progress in [0, 1], or null before a search starts.

    query: string

    The current search text. Bind this to your input's value.

    reset: () => void

    Clears the query, the matches and the painted highlights.

    setQuery: (
        query: string,
        options?: StartTextSearchOptions & { force?: boolean },
    ) => void

    Sets the search text and (re)starts the search. Debounced by 500 ms unless told otherwise.