export interface UseTypeaheadOptions {
    /**
     * Returns the current, in-DOM-order list of item labels to match against.
     * An entry may be `null`/empty to mark a non-matchable slot (its index is
     * preserved so it maps 1:1 to the caller's items).
     */
    getItemLabels: () => ReadonlyArray<string | null | undefined>;
    /**
     * Called with the index of the matched item so the caller can focus/select
     * it (e.g. `useListFocus`'s `focusItem`).
     */
    onMatch: (index: number) => void;
    /**
     * The index to start searching from — typically the currently focused item,
     * so repeated presses of the same letter cycle through matches. Defaults to
     * -1 (search from the top).
     */
    getCurrentIndex?: () => number;
    /**
     * Milliseconds of inactivity after which the typed buffer resets.
     * @default 750
     */
    resetMs?: number;
    /**
     * Whether an index should be skipped (e.g. disabled items).
     */
    isDisabled?: (index: number) => boolean;
}
export interface UseTypeaheadReturn {
    /**
     * Keydown handler. Call it (or let it fall through) from the collection's
     * own key handler. Returns `true` when it handled a printable character (so
     * the caller can `preventDefault`/stop further handling), `false` otherwise.
     */
    onKeyDown: (e: React.KeyboardEvent | KeyboardEvent) => boolean;
    /** Clear the pending buffer (e.g. on close). */
    reset: () => void;
}
/**
 * First-character ("type-ahead") search for a collection.
 *
 * Buffers printable keystrokes (resetting after `resetMs` of inactivity),
 * matches items whose label starts with the buffer, and cycles from the
 * current index — so pressing "s" repeatedly walks through the "s" items
 * instead of sticking on the first. Space is reserved for activation and is
 * only treated as typeahead while a buffer is already active.
 *
 * Additive and collection-agnostic: it does not move focus itself; the caller
 * wires `onMatch` to its own focus/selection (e.g. `useListFocus.focusItem`).
 *
 * @example
 * ```
 * const {listRef, handleKeyDown, focusItem, getItems} = useListFocus(...);
 * const typeahead = useTypeahead({
 *   getItemLabels: () => getItems().map(el => el.textContent),
 *   onMatch: focusItem,
 *   getCurrentIndex: () => getItems().findIndex(el => el === document.activeElement),
 * });
 * const onKeyDown = (e) => { if (!typeahead.onKeyDown(e)) handleKeyDown(e); };
 * ```
 */
export declare function useTypeahead(options: UseTypeaheadOptions): UseTypeaheadReturn;
//# sourceMappingURL=useTypeahead.d.ts.map