Interface ISearchProviderFactory<T>

Interface for search provider factory

interface ISearchProviderFactory<T extends Widget = Widget> {
    createNew: (widget: T, translator?: ITranslator) => ISearchProvider;
    isApplicable: (domain: Widget) => domain is T;
}

Type Parameters

Properties

createNew: (widget: T, translator?: ITranslator) => ISearchProvider

Instantiate a search provider for the widget.

The widget provided is always checked using isApplicable before calling this factory.

Type declaration

isApplicable: (domain: Widget) => domain is T

Report whether or not this provider has the ability to search on the given widget. The function is a type guard, meaning that it returns a boolean, but has a type predicate (x is T) for its return signature.

Type declaration

    • (domain: Widget): domain is T
    • Parameters

      Returns domain is T