import { default as React } from 'react'; /** * Keyboard shortcut definition */ export interface KeyboardShortcut { /** Unique identifier for the shortcut */ id: string; /** Human-readable description of what the shortcut does */ description: string; /** Key combination (e.g., 'Ctrl+S', 'Escape', 'Alt+N') */ keys: string; /** Category for grouping shortcuts */ category?: string; /** Whether the shortcut is enabled */ enabled?: boolean; /** The handler function to execute */ handler: (event: KeyboardEvent) => void; } /** * Options for the keyboard shortcuts hook */ export interface UseKeyboardShortcutsOptions { /** Whether to prevent default behavior when a shortcut is triggered */ preventDefault?: boolean; /** Whether to stop propagation when a shortcut is triggered */ stopPropagation?: boolean; /** Scope element (defaults to document) */ scope?: HTMLElement | null; /** Whether shortcuts are globally enabled */ enabled?: boolean; } /** * Format a key combination for display */ export declare function formatKeyCombo(keys: string): string; /** * Hook for managing keyboard shortcuts with documentation * * @example * ```tsx * function MyComponent() { * const { shortcuts } = useKeyboardShortcuts([ * { * id: 'save', * description: 'Save changes', * keys: 'Ctrl+S', * category: 'Actions', * handler: () => saveDocument(), * }, * { * id: 'close', * description: 'Close panel', * keys: 'Escape', * category: 'Navigation', * handler: () => closePanel(), * }, * ]); * * return ( *
* *
* ); * } * ``` */ export declare function useKeyboardShortcuts(shortcuts: KeyboardShortcut[], options?: UseKeyboardShortcutsOptions): { shortcuts: KeyboardShortcut[]; shortcutsByCategory: Record; enableShortcut: (id: string) => void; disableShortcut: (id: string) => void; toggleShortcut: (id: string) => void; /** Whether keyboard shortcuts are globally enabled via feature flag */ isFeatureEnabled: boolean; }; /** * Component to display keyboard shortcuts help * * @example * ```tsx * * ``` */ export interface KeyboardShortcutsHelpProps { shortcuts: KeyboardShortcut[]; title?: string; className?: string; style?: React.CSSProperties; } export declare function KeyboardShortcutsHelp({ shortcuts, title, className, style, }: KeyboardShortcutsHelpProps): React.ReactElement;