Base search provider interface

It is implemented by subprovider like searching on a single cell.

interface IBaseSearchProvider {
    currentMatchIndex: null | number;
    isDisposed: boolean;
    matchesCount: null | number;
    stateChanged: ISignal<IBaseSearchProvider, void>;
    clearHighlight(): Promise<void>;
    dispose(): void;
    endQuery(): Promise<void>;
    highlightNext(loop?: boolean): Promise<undefined | ISearchMatch>;
    highlightPrevious(loop?: boolean): Promise<undefined | ISearchMatch>;
    replaceAllMatches(
        newText: string,
        options?: IReplaceOptions,
    ): Promise<boolean>;
    replaceCurrentMatch(
        newText: string,
        loop?: boolean,
        options?: IReplaceOptions,
    ): Promise<boolean>;
    startQuery(query: RegExp, filters: IFilters): Promise<void>;
}

Hierarchy (View Summary)

Implemented by

Properties

currentMatchIndex: null | number

The current index of the selected match.

isDisposed: boolean

Test whether the object has been disposed.

This property is always safe to access.

matchesCount: null | number

The number of matches.

stateChanged: ISignal<IBaseSearchProvider, void>

Signal indicating that something in the search has changed, so the UI should update

Methods

  • Dispose of the resources held by the object.

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

  • Replace the currently selected match with the provided text and highlight the next match.

    Parameters

    • newText: string

      The replacement text

    • Optionalloop: boolean

      Whether to loop within the matches list.

    • Optionaloptions: IReplaceOptions

    Returns Promise<boolean>

    A promise that resolves with a boolean indicating whether a replace occurred.