Interface AutocompleteConfig<State>

Type Parameters

  • State

Hierarchy

  • AutocompleteConfig

Properties

dropdownSelector: string | Element | Element[] | NodeListOf<Element> | ((input) => string | Element | Element[] | NodeListOf<Element>)

The dropdown element to attach the autocomplete to

Type declaration

    • (input): string | Element | Element[] | NodeListOf<Element>
    • Parameters

      • input: HTMLInputElement

      Returns string | Element | Element[] | NodeListOf<Element>

fetch: InputSearchQueryWithFields | ((input) => PromiseLike<State>)

The function to use to fetch the search state

Type declaration

    • (input): PromiseLike<State>
    • Parameters

      • input: string

      Returns PromiseLike<State>

googleAnalytics?: boolean | GoogleAnalyticsConfig

Google Analytics configuration. Set to false to disable.

historyEnabled?: boolean

Enable history

historySize?: number

Max number of history items to show

inputSelector: string | Element | Element[] | NodeListOf<Element>

The input element to attach the autocomplete to

minQueryLength?: number

Minimum length of the query before searching

nostoAnalytics?: boolean

Enable Nosto Analytics

render: ((container, state) => void | PromiseLike<void>)

Type declaration

    • (container, state): void | PromiseLike<void>
    • The function to use to render the dropdown

      Parameters

      • container: HTMLElement
      • state: State

      Returns void | PromiseLike<void>

submit?: ((query, config, options?) => void)

Type declaration

    • (query, config, options?): void
    • The function to use to submit the search

      Parameters

      • query: string
      • config: AutocompleteConfig<State>
      • Optional options: SearchAutocompleteOptions

      Returns void

Generated using TypeDoc