Interface ISearchProvider

Search provider interface

Hierarchy

Implemented by

Properties

currentMatchIndex: number

The current index of the selected match.

filtersChanged?: ISignal<ISearchProvider, void>

Signal emitted when filter definition changed.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

isReadOnly: boolean

Set to true if the widget under search is read-only, false if it is editable. Will be used to determine whether to show the replace option.

matchesCount: number

The number of matches.

replaceOptionsSupport?: IReplaceOptionsSupport

Specifies which replace options are supported by provider.

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.

    Notes

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

    Undefined Behavior

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

    Returns void

  • Stop a search and clear any internal state of the provider

    Returns Promise<void>

  • Get the filters definition for the given provider.

    Returns {
        [key: string]: IFilter;
    }

    The filters definition.

    Notes

    TODO For now it only supports boolean filters (represented with checkboxes)

  • Get an initial query value if applicable so that it can be entered into the search box as an initial query

    Returns string

    Initial value used to populate the search box.

  • Is there one or more objects selected?

    The selection can be made of one or more lines, notebook cells, or other objects (e.g. spreadsheet cells). The provider can decide whether it counts multiple characters (as opposed to lines) as multiple selection or not, which will influence the heuristic auto-enabling "search in selection" mode.

    Returns SelectionState

  • Replace all matches in the widget with the provided text

    Parameters

    Returns Promise<boolean>

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

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

    Parameters

    • newText: string

      The replacement text

    • Optional loop: boolean

      Whether to loop within the matches list.

    • Optional options: IReplaceOptions

    Returns Promise<boolean>

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

  • Start a search

    Parameters

    • query: RegExp

      Regular expression to test for

    • filters: IFilters

      Filters to apply when searching

    Returns Promise<void>

  • Validate a new filter value for the widget.

    Parameters

    • name: string

      The filter name

    • value: boolean

      The filter value candidate

    Returns Promise<boolean>

    The valid filter value

Generated using TypeDoc