: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
export declare const enum EventTrigger {
export interface AutocompleteItem {
export interface AutocompleteSettings<T extends AutocompleteItem> {
render?: (item: T, currentValue: string) => HTMLDivElement | undefined;
renderGroup?: (name: string, currentValue: string) => HTMLDivElement | undefined;
onSelect: (item: T, input: HTMLInputElement) => void;
* Show autocomplete on focus event. Focus event will ignore the `minLength` property and will always call `fetch`.
fetch: (text: string, update: (items: T[] | false) => void, trigger: EventTrigger) => void;
* Callback for additional autocomplete customization
* @param {HTMLInputElement} input - input box associated with autocomplete
* @param {ClientRect | DOMRect} inputRect - size of the input box and its position relative to the viewport
* @param {HTMLDivElement} container - container with suggestions
* @param {number} maxHeight - max height that can be used by autocomplete
customize?: (input: HTMLInputElement, inputRect: ClientRect | DOMRect, container: HTMLDivElement, maxHeight: number) => void;
* Prevents automatic form submit when ENTER is pressed
export interface AutocompleteResult {
export default function autocomplete<T extends AutocompleteItem>(settings: AutocompleteSettings<T>): AutocompleteResult;