import { KeyboardShortcut, UseKeyboardShortcutsReturn, PlatformKeys } from './types'; export interface UseKeyboardShortcutsOptions { /** Whether shortcuts are enabled */ enabled?: boolean; /** Whether to prevent default browser behavior */ preventDefault?: boolean; /** Whether to stop event propagation */ stopPropagation?: boolean; /** Whether to ignore shortcuts in input fields */ ignoreInputFields?: boolean; /** Enable shortcuts on tablet devices (default: false) */ enableOnTablet?: boolean; /** Timeout for key sequences in milliseconds (default: 1000) */ sequenceTimeout?: number; /** * Shortcut IDs that should always fire even inside input fields. * Useful for global shortcuts like search (Cmd+K) or help (?). * These bypass the ignoreInputFields check. */ globalShortcutIds?: string[]; } /** * Hook for managing keyboard shortcuts with sequence support * * Features: * - Platform-specific key definitions (Mac vs Windows/Linux) * - Key sequence support (e.g., "g h" for "go home") * - Automatic mobile/tablet detection and disabling * - Input field detection (skip shortcuts in text inputs) * - Configurable preventDefault and stopPropagation * * @example * ```tsx * const shortcuts = [ * { * id: 'search', * keys: { mac: ['cmd+k'], windows: ['ctrl+k'], linux: ['ctrl+k'] }, * description: 'Open search', * action: () => openSearch(), * }, * { * id: 'go-home', * keys: ['g h'], // Key sequence: press g, then h * description: 'Go to home', * action: () => navigate('/'), * }, * { * id: 'help', * keys: ['?'], // Single key * description: 'Show help', * action: () => showHelp(), * }, * ]; * * useKeyboardShortcuts(shortcuts, { * enabled: true, * preventDefault: true, * }); * ``` */ export declare function useKeyboardShortcuts(shortcuts?: KeyboardShortcut[], options?: UseKeyboardShortcutsOptions): UseKeyboardShortcutsReturn; /** * Hook for managing a single keyboard shortcut * * @example * ```tsx * useKeyboardShortcut('ctrl+k', () => { * openSearch(); * }); * * // Platform-specific * useKeyboardShortcut({ mac: ['cmd+k'], windows: ['ctrl+k'] }, () => { * openSearch(); * }); * * // Key sequence * useKeyboardShortcut('g h', () => { * navigate('/'); * }); * ``` */ export declare function useKeyboardShortcut(keys: string | string[] | PlatformKeys, action: () => void, options?: Omit & { enabled?: boolean; }): void; /** * Get the current platform type * Useful for displaying platform-specific key labels in UI */ export { detectPlatform } from './utils'; /** * Check if current device supports keyboard shortcuts */ export { shouldEnableKeyboardShortcuts, isMobileDevice, isTabletDevice } from './utils'; //# sourceMappingURL=useKeyboardShortcuts.d.ts.map