import { KeyboardEvent } from 'react';
import { VisibleNode } from './types';
/**
 * Options for the keyboard event handler.
 * @property visibleNodes - The current flat list of visible nodes.
 * @property activeIndex - Index into visibleNodes of the currently focused node, or -1.
 * @property setActiveIndex - Setter for the active index.
 * @property isExpanded - Returns whether a node is expanded.
 * @property toggleExpand - Expands or collapses a branch node.
 * @property toggleNode - Toggles selection for a node.
 */
export type UseTreeKeyboardOptions = {
    visibleNodes: VisibleNode[];
    activeIndex: number;
    setActiveIndex: (index: number) => void;
    isExpanded: (id: string | number) => boolean;
    toggleExpand: (id: string | number) => void;
    toggleNode: (id: string | number) => void;
};
/**
 * Handles keyboard navigation for a tree widget rooted on a combobox input.
 *
 * Focus stays on the input at all times; the tree uses aria-activedescendant
 * to convey the focused node. Returns `true` when the key was handled so the
 * caller can decide whether to let the event propagate (e.g. ArrowLeft/Right
 * falling through to cursor movement inside the input).
 *
 * - ArrowDown: move to next visible node
 * - ArrowUp: move to previous visible node
 * - ArrowRight: expand collapsed branch or move to first child; returns false
 *   when there is nothing to do so the cursor can move inside the input
 * - ArrowLeft: collapse expanded branch or move to parent; returns false when
 *   there is nothing to do so the cursor can move inside the input
 * - Home: move to first visible node
 * - End: move to last visible node
 * - Enter: toggle selection of focused node
 *
 * @param e - The keyboard event.
 * @param options - The current tree state and callbacks.
 * @returns Whether the key was handled by tree navigation.
 */
export declare function handleTreeKeyDown(e: KeyboardEvent, options: UseTreeKeyboardOptions): boolean;
