import { SearchConfigInterface } from './config'; /** * A plain TypeScript and HTML implementation of an autosuggest search component. * * This component renders a text input and an autosuggest list. * It uses the provided search function to find specific items in the data and returns them via onInput and onEnter callbacks. * * @typeParam T - The type of suggestion item. */ export declare class Search { private _container; private _inputElement; private _suggestionList; private _dropdownContainer; private _footerContainer; private _clearButton; private _config; private _debounceTimeout; private _placeholderElement; private _handleFocus; private _handleBlur; private _handleClearClick; private _handleMouseDown?; /** * Creates an instance of the Search component. * * @param container The HTML element that will contain the search component. * @param config Optional configuration for the search component. */ constructor(container: HTMLElement, config?: SearchConfigInterface); get suggestionList(): HTMLElement; get dropdownContainer(): HTMLElement; private _handleInput; private _handleKeyDown; private _createPlaceholderElement; private _updatePlaceholderVisibility; private _createSuggestionElement; private _renderSuggestions; private _renderLoading; private _handleSuggestionClick; private _performSearch; /** * Returns a highlighted match of the input text if {@link SearchConfigInterface.highlightMatch `highlightMatch`} is `true`. * Automatically applied if {@link SearchConfigInterface.suggestionRenderer `suggestionRenderer`} is `undefined` or returns string. * * @param text The text to highlight. * @returns The text marked with a tag of highlighted match or the original text if {@link SearchConfigInterface.highlightMatch `highlightMatch`} is `false` or no match is found. */ getHighlightedMatch(text: string): string; /** * Sets the disabled state of the search component. * * @param disabled Whether the search component should be disabled. */ setDisabled(disabled: boolean): void; /** * Returns whether the search component is currently disabled. * * @returns True if the search component is disabled, false otherwise. */ isDisabled(): boolean; /** * Sets the configuration for the search component. * * @param config The new configuration to apply. */ setConfig(config?: SearchConfigInterface): void; /** * Destroys the component and cleans up DOM elements and event listeners. */ destroy(): void; /** * Clears the input and suggestion list. */ clearInput(): void; /** * Hides the suggestion dropdown without altering the current input value. */ hideSuggestions(): void; focus(): void; blur(): void; } export type { SearchConfigInterface };