import { type KeyboardEventHandler } from 'react'; import { type BasedAdditionalProps, type SelectBoxOption } from '../SelectBox.types'; type UseKeyboardNavigationProps = { /** * Whether the option panel is currently open. */ isOptionPanelOpen: boolean; /** * Whether the component is in loading state. */ loading: boolean; /** * Whether search functionality is enabled. */ enableSearchOptions: boolean; /** * Currently selected option. */ localSelectedOption: SelectBoxOption | null; /** * Flat array of all selectable options. */ flatOptions: SelectBoxOption[]; /** * Filtered options (after search and other filters). */ filteredOptions: (SelectBoxOption | null | undefined)[]; /** * Auto-scroll configuration for selected options. */ enableAutoScrollToSelectedOption?: boolean | ScrollIntoViewOptions; /** * Callback when an option is selected. */ onSelectOption: (option: SelectBoxOption) => void; /** * Callback to close the option panel. */ onCloseOptionPanel: () => void; /** * Reference to the option panel container. */ optionPanelRef: React.RefObject; /** * Reference to the search input element. */ searchInputRef: React.RefObject; /** * Scroll to a specific option index (for virtualization). */ scrollToIndex?: (index: number, options?: { align?: 'start' | 'center' | 'end' | 'auto'; behavior?: 'auto' | 'smooth'; }) => void; /** * Whether the option list is virtualized. */ isVirtualized?: boolean; }; /** * Hook to manage keyboard navigation and interaction for options in SelectBox * * This hook handles: * - Tracking which option should be tabbable * - Arrow key navigation between options * - Enter/Space key selection * - Escape key to close panel * - Focus management and auto-scrolling * * @returns Object with handlers and state for option keyboard navigation */ export declare function useKeyboardNavigation({ isOptionPanelOpen, loading, enableSearchOptions, localSelectedOption, flatOptions, filteredOptions, enableAutoScrollToSelectedOption, onSelectOption, onCloseOptionPanel, optionPanelRef, searchInputRef, scrollToIndex, isVirtualized, }: UseKeyboardNavigationProps): { tabbableOptionIndex: number; handleOptionFocus: (optionIndex: number) => void; createKeyDownHandler: (option: SelectBoxOption) => KeyboardEventHandler; }; export {};