/** Keyboard modifier key: 'meta' (Cmd/Win), 'ctrl', 'alt', 'shift', or '' for no modifier */ export type Modifier = 'meta' | 'ctrl' | 'alt' | 'shift' | ''; export type UseHotkeyProps = { /** The key to listen for (e.g. 'k', 'Enter', 'Escape') */ key: string; /** Modifier key or array of modifier keys required for the shortcut */ modifier: Modifier | Modifier[]; /** Callback invoked when the hotkey combination is pressed */ callback: () => void; /** Whether to call preventDefault on the keyboard event (default: true) */ isPreventDefault?: boolean; /** Whether the hotkey listener is active (default: true) */ isEnabled?: boolean; }; /** * Listens for keyboard shortcuts and invokes a callback when the key combination is pressed. * Ignores events originating from input fields, textareas, selects, and contenteditable elements. * * @example * // Cmd+K to open search * useHotkey({ key: 'k', modifier: 'meta', callback: openSearch }); * * // Ctrl+Shift+P to open command palette * useHotkey({ key: 'p', modifier: ['ctrl', 'shift'], callback: openPalette }); * * // Escape to close modal (no modifier) * useHotkey({ key: 'Escape', modifier: '', callback: closeModal }); */ export declare const useHotkey: ({ key, modifier, callback, isPreventDefault, isEnabled, }: UseHotkeyProps) => void; //# sourceMappingURL=useHotkey.d.ts.map