/**
 * Keyboard navigation utilities for web components
 * @countermeasure/web-components/utils/keyboard
 *
 * Provides key constants, grid/tree/list navigation helpers
 * for accessible widget patterns.
 */
export declare const Keys: {
    readonly ARROW_UP: "ArrowUp";
    readonly ARROW_DOWN: "ArrowDown";
    readonly ARROW_LEFT: "ArrowLeft";
    readonly ARROW_RIGHT: "ArrowRight";
    readonly ENTER: "Enter";
    readonly SPACE: " ";
    readonly ESCAPE: "Escape";
    readonly TAB: "Tab";
    readonly HOME: "Home";
    readonly END: "End";
    readonly PAGE_UP: "PageUp";
    readonly PAGE_DOWN: "PageDown";
    readonly BACKSPACE: "Backspace";
    readonly DELETE: "Delete";
};
export type KeyName = (typeof Keys)[keyof typeof Keys];
export interface GridNavOptions {
    /** Number of columns in the grid */
    columns: number;
    /** Number of rows in the grid */
    rows: number;
    /** Current column index (0-based) */
    currentCol: number;
    /** Current row index (0-based) */
    currentRow: number;
    /** Whether to wrap at edges (default: false) */
    wrap?: boolean;
    /** Callback to check if a cell is disabled */
    isCellDisabled?: (row: number, col: number) => boolean;
}
export interface GridNavResult {
    /** Whether the key was handled */
    handled: boolean;
    /** New column index */
    col: number;
    /** New row index */
    row: number;
}
export interface TreeNavOptions {
    /** Array of visible node indices in DOM order */
    visibleNodes: number[];
    /** Currently focused node index */
    currentIndex: number;
    /** Whether the current node is expanded */
    isExpanded: boolean;
    /** Whether the current node has children */
    hasChildren: boolean;
    /** Index of parent node (-1 if root) */
    parentIndex: number;
    /** First child index (-1 if no children) */
    firstChildIndex: number;
}
export interface TreeNavResult {
    /** Whether the key was handled */
    handled: boolean;
    /** Action to perform */
    action: 'focus' | 'expand' | 'collapse' | 'select' | 'none';
    /** Target index for focus action */
    targetIndex?: number;
}
export interface ListNavOptions {
    /** Current active index */
    activeIndex: number;
    /** Total number of items */
    itemCount: number;
    /** Whether to wrap at edges (default: true) */
    wrap?: boolean;
    /** Orientation for arrow key handling */
    orientation?: 'horizontal' | 'vertical' | 'both';
    /** Callback to check if an item is disabled */
    isItemDisabled?: (index: number) => boolean;
}
export interface ListNavResult {
    /** Whether the key was handled */
    handled: boolean;
    /** New active index */
    index: number;
    /** Whether Enter/Space was pressed for activation */
    activated: boolean;
}
/**
 * Handle keyboard navigation within a grid pattern (DataTable, Calendar, etc.)
 * Implements ARIA Grid pattern keyboard interactions.
 */
export declare function gridNavigate(event: KeyboardEvent, options: GridNavOptions): GridNavResult;
/**
 * Handle keyboard navigation within a tree view pattern.
 * Implements ARIA Tree pattern keyboard interactions.
 */
export declare function treeNavigate(event: KeyboardEvent, options: TreeNavOptions): TreeNavResult;
/**
 * Handle keyboard navigation within a list (menu, combobox options, etc.)
 * Returns the new active index based on key press.
 */
export declare function listNavigate(event: KeyboardEvent, options: ListNavOptions): ListNavResult;
export interface TypeAheadOptions {
    /** Items to search (should have a text/label property) */
    items: {
        label: string;
        disabled?: boolean;
    }[];
    /** Timeout for resetting search buffer (default: 500ms) */
    timeout?: number;
}
export interface TypeAheadController {
    /** Handle a keypress and return matching index or -1 */
    handleKey: (char: string) => number;
    /** Reset the search buffer */
    reset: () => void;
}
/**
 * Create a type-ahead search controller for navigating lists by typing.
 */
export declare function createTypeAhead(options: TypeAheadOptions): TypeAheadController;
/**
 * Check if an event is a printable character key.
 */
export declare function isPrintableKey(event: KeyboardEvent): boolean;
/**
 * Check if the event target is an input element.
 */
export declare function isInputElement(target: EventTarget | null): boolean;
/**
 * Get a keyboard shortcut string from an event (e.g., "Ctrl+Shift+S").
 */
export declare function getShortcutFromEvent(event: KeyboardEvent): string;
//# sourceMappingURL=keyboard.d.ts.map