UNPKG

search-client

Version:

Javascript library for executing searches in the Haive search-index via the SearchManager REST interface.

48 lines (47 loc) 1.8 kB
/** * These are the triggers that define when and when not to trigger an autocomplete lookup. */ export declare class AutocompleteTriggers { /** * Whether or not an autocomplete lookup should be done when the maxSuggestions setting is changed. * * Note: Requires queryChanged to be true. */ maxSuggestionsChanged?: boolean; /** * Turns on or off all query-related triggers. */ queryChange?: boolean; /** * Delay triggers until changes has not been made to the query for a certain time (milliseconds). * This is to avoid executing searches constantly while the user is typing. * * The queryChangeInstantRegex has precedence. This delay is only considered when that regex doesn't match. * Set value to less than zero to make sure we only trigger when the queryChangeInstantRegex matches. * * Note: Requires queryChanged to be true. * Note: Requires query to be longer than queryMinLength. */ queryChangeDelay?: number; /** * Triggers action immediately instead of delayed when the query matches the regex. * * Note: Requires queryChange to be true. * Note: Requires query to be longer than queryChangeMinLength. * * Default: Trigger on first whitespace after non-whitespace */ queryChangeInstantRegex?: RegExp; /** * Min length before triggering. * * Note: Requires queryChange to be true. */ queryChangeMinLength?: number; /** * Creates an AutocompleteTrigger object for you, based on AutocompleteTrigger defaults and the overrides provided as a param. * * @param triggers - The trigger defined here will override the default AutocompleteTrigger. */ constructor(triggers?: AutocompleteTriggers); }