import { SearchBarGroup, SearchBarOption, SearchBarProps } from './types'; export type SearchBarRow = { kind: 'category'; key: string; label: string; } | { kind: 'option'; key: string; option: SearchBarOption; index: number; }; export declare const matchesSearch: (label: string, value: string) => boolean; /** * The `filter` mode (Figma: Sync): keeps the options whose label contains the * typed text and drops the groups left empty. An empty text keeps everything. */ export declare const filterSearchBarOptions: (options: Array, value: string) => (SearchBarOption | SearchBarGroup)[]; /** * Flattens `options` (loose options and titled groups) into the rows the list * renders. `index` counts only the options, which is what the keyboard walks. */ export declare const getSearchBarRows: (options: Array) => SearchBarRow[]; type UseSearchBarArgs = Pick; export declare const useSearchBar: ({ value, defaultValue, options, filter, loading, emptyText, disabled, onChange, onSearch, onSelect, onClear, }: UseSearchBarArgs) => { value: string; rows: SearchBarRow[]; isOpen: boolean; showEmpty: boolean; activeIndex: number | null; inputRef: import('react').RefObject; listRef: import('react').RefObject; selectOption: (option: SearchBarOption) => void; clear: () => void; search: () => void; handleChange: (event: React.ChangeEvent) => void; handleFocus: () => void; handleBlur: () => void; handleKeyDown: (event: React.KeyboardEvent) => void; handleListMouseDown: (event: React.MouseEvent) => void; handleListMouseMove: () => void; }; export {};