import * as React$1 from "react"; //#region src/libs/list-navigation.d.ts declare const NAVIGATION_KEYS: readonly ["ArrowUp", "ArrowDown", "Home", "End"]; declare const SELECTION_KEYS: string[]; /** Focus first candidate that accepts focus, scrolling into view. */ declare function focusFirst(candidates: Array): void; /** Ordered arrow-key candidates: reversed for Up/End, sliced past current for Up/Down. */ declare function getNavigationCandidates(items: HTMLElement[], key: string, activeElement: Element | null): HTMLElement[]; /** `wrapArray(['a','b','c','d'], 2) === ['c','d','a','b']` */ declare function wrapArray(array: T[], startIndex: number): T[]; /** * Find next typeahead match. Repeated chars (e.g. 'aaa') collapse to one char and cycle * starting after currentItem; a fresh single char searches from the top of the list. */ declare function findNextItem(items: T[], search: string, currentItem?: T): T | undefined; /** * Typeahead search with 1s auto-reset. Returns [searchRef, handleTypeaheadSearch, reset]. * `externalSearchRef` lets callers share state via context. `onSearchChange` may return * a replacement string to store (used for fallback-to-last-key behavior). */ declare function useTypeaheadSearch(onSearchChange: (search: string, key: string) => string | undefined, externalSearchRef?: React$1.RefObject): readonly [React$1.RefObject, (key: string) => void, () => void]; interface ITypeaheadListState { activeElement: Element | null; lastMatchedElement: HTMLElement | null; } interface ITypeaheadListNavigationOptions { /** Candidates to search; callers must pre-filter disabled/hidden items. */ getItems: () => T[]; getItemElement: (item: T) => HTMLElement | null; /** Searchable text; empty strings are skipped. */ getItemTextValue: (item: T) => string; onMatch: (item: T) => void; /** Override current-item (e.g. SelectTrigger uses selected value instead of focus). */ getCurrentItem?: (items: T[], state: ITypeaheadListState) => T | undefined; /** Share typeahead state via context. */ externalSearchRef?: React$1.RefObject; } /** * Typeahead list navigation. Falls back to latest key when accumulated search misses, * and tracks last matched element so consecutive keys stay stable across async focus shifts. */ declare function useTypeaheadListNavigation(options: ITypeaheadListNavigationOptions): readonly [React$1.RefObject, (key: string) => void, () => void]; interface IVimNavigationOptions { onNavigate?: () => void; ggTimeoutMs?: number; } /** * Vim-style list bindings: `gg` (two g within ggTimeoutMs) -> first item, `G` -> last item. * Handler returns true when a command fired (caller must skip typeahead/nav). The first * `g` returns false so typeahead still fires on items starting with 'g'. */ declare function useVimNavigation(options?: IVimNavigationOptions): (event: KeyboardEvent | React$1.KeyboardEvent, items: HTMLElement[]) => boolean; //#endregion export { NAVIGATION_KEYS, SELECTION_KEYS, findNextItem, focusFirst, getNavigationCandidates, useTypeaheadListNavigation, useTypeaheadSearch, useVimNavigation, wrapArray };