/** * Keyboard Service * Provides normalized keyboard event handling and shortcut management * Handles cross-platform shortcuts (Ctrl/Cmd combinations) */ export interface KeyboardShortcut { key: string; ctrlKey?: boolean; shiftKey?: boolean; altKey?: boolean; metaKey?: boolean; handler: (event: Event) => void; } export interface KeyboardShortcutOptions { key: string; ctrl?: boolean; shift?: boolean; alt?: boolean; meta?: boolean; handler: (event: KeyboardEvent) => void; preventDefault?: boolean; } /** * KeyboardService - Centralized keyboard event management * Provides: * - Normalized keyboard shortcuts (handles Ctrl vs Cmd on Mac) * - Cross-platform shortcut registration * - Event cleanup and teardown */ export declare class KeyboardService { private shortcuts; private listeners; /** * Register a keyboard shortcut * @param id - Unique identifier for this shortcut * @param options - Shortcut configuration */ registerShortcut(id: string, options: KeyboardShortcutOptions): void; /** * Register a shortcut that works with Ctrl on Windows/Linux and Cmd on Mac * @param id - Unique identifier for this shortcut * @param key - The key to listen for * @param handler - Callback when shortcut is triggered * @param preventDefault - Whether to prevent default browser behavior */ registerCtrlOrCmdShortcut(id: string, key: string, handler: (event: KeyboardEvent) => void, preventDefault?: boolean): void; /** * Unregister a keyboard shortcut * @param id - The identifier of the shortcut to remove */ unregisterShortcut(id: string): void; /** * Unregister all shortcuts and clean up */ cleanup(): void; /** * Check if a keyboard event matches a specific key combination * @param event - The keyboard event to check * @param key - The key to match * @param ctrl - Whether Ctrl/Cmd should be pressed * @param shift - Whether Shift should be pressed * @param alt - Whether Alt should be pressed */ matchesShortcut(event: KeyboardEvent, key: string, ctrl?: boolean, shift?: boolean, alt?: boolean): boolean; } /** * Get the singleton KeyboardService instance */ export declare function getKeyboardService(): KeyboardService; /** * Create a new isolated KeyboardService instance * Useful for testing or when you need independent event handling */ export declare function createKeyboardService(): KeyboardService;