import { ChangeEvent, KeyboardEvent, RefObject } from "react"; import { AutoCompleteItem, AutoCompleteProps } from ".."; /** Return type of {@link useAutoComplete} */ export type UseAutoCompleteResult = { /** Unique HTML `id` for the `` element */ inputId: string; /** Current text inside the input */ inputValue: string; /** Whether the suggestions dropdown is visible */ isOpen: boolean; /** Whether a search operation is in progress (internal or external) */ isSearching: boolean; /** Whether the current input text failed blur validation */ isInvalid: boolean; /** Index of the keyboard-highlighted suggestion (`-1` when none) */ activeIndex: number; /** Currently confirmed selected item, if any */ selectedItem: AutoCompleteItem | undefined; /** Filtered / fetched suggestion list */ suggestions: AutoCompleteItem[]; /** Whether the clear (×) button should be rendered */ showClearButton: boolean; /** Ref to attach to the root container element (used for outside-click detection) */ containerRef: RefObject; /** Handler for `` — updates value, triggers debounced search */ handleInputChange: (e: ChangeEvent) => void; /** Handler for `` — arrow navigation, Enter, Escape */ handleKeyDown: (e: KeyboardEvent) => void; /** Handler for `` — blur validation and auto-selection */ handleBlur: () => void; /** Clears the input and resets selection */ handleClear: () => void; /** Opens the dropdown on focus / click */ openDropdown: () => void; /** Confirms selection of a suggestion item */ selectItem: (item: AutoCompleteItem) => void; /** Marks the next blur as caused by the clear button (prevents blur validation) */ setClearPending: () => void; }; /** Options accepted by {@link useAutoComplete} — a subset of {@link AutoCompleteProps} */ export type UseAutoCompleteOptions = Pick; /** Shared logic for AutoComplete variants */ export declare const useAutoComplete: ({ items: staticItems, onSearch, debounce: debounceMs, onSelect, onValueChange, maxSuggestions, isSearching: externalSearching, clearable, defaultValue, loading, }: UseAutoCompleteOptions) => UseAutoCompleteResult; //# sourceMappingURL=useAutoComplete.d.ts.map