/** * Key Utilities * * Utilities for working with keyboard input and key identification. */ /** * Key object from Ink's useInput hook */ export interface Key { upArrow: boolean; downArrow: boolean; leftArrow: boolean; rightArrow: boolean; pageDown: boolean; pageUp: boolean; return: boolean; escape: boolean; ctrl: boolean; shift: boolean; tab: boolean; backspace: boolean; delete: boolean; meta: boolean; } /** * Normalize a key input to a standard identifier string. * * This converts the input character and key modifiers into a * consistent string format for validation. * * @param input - The input character from useInput * @param key - The key object from useInput * @returns Normalized key identifier * * @example * getKeyIdentifier('c', { ctrl: true, ... }) // 'ctrl+c' * getKeyIdentifier('', { escape: true, ... }) // 'escape' * getKeyIdentifier('', { return: true, ... }) // 'enter' * getKeyIdentifier('', { upArrow: true, ... }) // 'up' * getKeyIdentifier('', { tab: true, shift: true, ... }) // 'shift+tab' * getKeyIdentifier('a', { ... }) // 'a' */ export declare function getKeyIdentifier(input: string, key: Key): string; /** * Check if a key is a modifier key (doesn't produce input on its own) */ export declare function isModifierKey(key: Key): boolean; /** * Check if input is a printable character * * @param input - The input string from useInput * @returns Whether the input is a printable character */ export declare function isPrintableChar(input: string): boolean; /** * Check if the key combination is the quit shortcut (Ctrl+C) */ export declare function isQuitShortcut(input: string, key: Key): boolean; /** * Check if the key is a navigation key */ export declare function isNavigationKey(keyId: string): boolean; /** * Check if the key is an action key */ export declare function isActionKey(keyId: string): boolean; /** * Check if the key is a number key (1-9) */ export declare function isNumberKey(input: string): boolean; /** * Check if the key is a global shortcut */ export declare function isGlobalShortcut(keyId: string): boolean; /** * Get a human-readable description of a key */ export declare function describeKey(keyId: string): string; /** * Format a key identifier for display (with proper styling hints) */ export declare function formatKeyForDisplay(keyId: string): string; //# sourceMappingURL=key-utils.d.ts.map