Options
All
  • Public
  • Public/Protected
  • All
Menu

Use this interface to add or remove SearchResult entries.

This interface is always provided as the second argument to Plugin.search().

Example

function search(query, res) {
     // Add an entry to the result set
     res.add({
         id:    'temp',
         title: 'Fetching...',
         desc:  'Please wait a second',
     });

     // Remove entry 'temp' after `1000ms`
     setTimeout(() =>
         res.remove('temp'),
     1000);
}

Methods

  • Add a SearchResult to the result-set

    Parameters

    result:  SearchResult | SearchResult[]

    The result to be added to the list of searchable values

  • remove(id: string): void
  • You can remove a SearchResult from the result-set that you previously added

    Parameters

    id:  string

    The id property of the SearchResult previously added

Generated using TypeDoc