export interface SearchConfigInterface { /** * Placeholder text to display when the input field is empty. * @default 'Search...' */ placeholderRenderer?: string | HTMLElement; /** * Whether the search component is disabled. * @default false */ disabled?: boolean; /** * Whether to open the suggestion list above the input field instead of below. * @default false */ openListUpwards?: boolean; /** * Callback invoked when the input value changes. * This callback should be used to process the query, retrieve matching items, and return them. * @param value - The current value of the input field * @param results - An array of found items of type T matching the current query * @param event - The input event object */ onInput?: (value: string, results: T[], event: InputEvent) => void; /** * The debounce duration (in milliseconds) used to delay the onInput callback. * Helps prevent excessive callback invocations during rapid typing. * @default 300 */ debounceTime?: number; /** * Function that asynchronously retrieves suggestion items based on the search query. * This function should process the query to find specific items in the data. * The results are then returned to be used in onInput and onEnter callbacks. * @param query - The current search query * @param limit - Optional. The maximum number of suggestion items to return * @returns A promise that resolves to an array of suggestion items of type T */ searchFn?: (query: string, limit?: number) => Promise; /** * The maximum number of suggestions to retrieve and include in the results. * When the number of suggestions exceeds this limit, the rest will be omitted. * This can be tweaked to improve performance when dealing with large data sets. * @default 50 */ suggestionsLimit?: number; /** * The maximum items visible in the suggestions dropdown at once. * When the number of suggestions exceeds this value, a scrollbar will be added. * @default 10 */ maxVisibleItems?: number; /** * Callback triggered when a suggestion from the autosuggest list is selected. * @param suggestion - The selected suggestion item of type T */ onSelect?: (suggestion: T) => void; /** * Customize how each suggestion is rendered. * @param suggestion - The suggestion item of type T to render * @returns A string containing HTML or an HTMLElement representing the rendered suggestion */ suggestionRenderer?: (suggestion: T, value?: string) => string | HTMLElement; /** * Function to convert a suggestion item to a string for display in the input field after selection. * @param suggestion - The suggestion item to convert * @param value - The current value of the input field * @returns The string representation of the suggestion */ selectedSuggestionRenderer?: (suggestion: T, value?: string) => string; /** * Custom CSS class name to apply to the search input field. * @default undefined */ inputClassName?: string; /** * Custom CSS class name to apply to the autosuggest list container. * @default undefined */ suggestionListClassName?: string; /** * The minimum number of characters required to trigger a search. * @default 2 */ minSearchLength?: number; /** * Callback invoked when the return (Enter) key is pressed. * This callback should process the current input value to find the matching items and return them. * @param value - The current value of the input field when Enter is pressed * @param results - An array of found items of type T matching the current query */ onEnter?: (value: string, results: T[]) => void; /** * Callback invoked when the clear button is clicked. */ onClear?: () => void; /** * Whether to highlight the matching text in the suggestions. * @default true */ highlightMatch?: boolean; /** * Text to display when no search results are found. * Set to null to hide the no results message. * @default 'No results found' */ noResultsText?: string | null; /** * Optional footer component to render below the suggestion list. * Can be used for additional actions like "Select All" or other custom functionality. * @default undefined */ footerComponent?: HTMLElement; } export declare const defaultSearchConfig: SearchConfigInterface;