Class SearchProvider<T>Abstract

Abstract class implementing the search provider interface.

Type Parameters

Hierarchy

Implements

Constructors

  • Constructor

    Type Parameters

    Parameters

    • widget: T

      The widget to search in

    Returns SearchProvider<T>

Properties

_disposed: any
_filtersChanged: Signal<SearchProvider<T>, void>
_stateChanged: Signal<SearchProvider<T>, void>
widget: T

Accessors

  • get currentMatchIndex(): number
  • The current index of the selected match.

    Returns number

  • get filtersChanged(): ISignal<this, void>
  • Signal indicating that filter definition changed.

    Returns ISignal<this, void>

  • get isDisposed(): boolean
  • Whether the search provider is disposed or not.

    Returns boolean

  • get 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.

    Returns boolean

  • get matchesCount(): number
  • The number of matches.

    Returns number

  • get stateChanged(): ISignal<this, void>
  • Signal indicating that something in the search has changed, so the UI should update

    Returns ISignal<this, void>

Methods

  • Dispose of the resources held by the search provider.

    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 search provider.

    Returns Promise<void>

  • Get the filters for the given provider.

    Returns {
        [key: string]: IFilter;
    }

    The filters.

    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.

  • 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

    Parameters

    • newText: string

      The replacement text

    • Optional loop: boolean
    • Optional options: IReplaceOptions

    Returns Promise<boolean>

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

  • Start a search using the provided options.

    Parameters

    • query: RegExp

      A RegExp to be use to perform the search

    • filters: IFilters

      Filter parameters to pass to provider

    Returns Promise<void>

  • Utility for copying the letter case from old to new text.

    Parameters

    • oldText: string
    • newText: string

    Returns string

Generated using TypeDoc