import { type RefObject } from 'react'; import type { KeyboardShortcutKeys } from '../../types/keyboard-shortcut-keys.js'; /** * Accepted options for the `useKeyboardShortcut` hook. * @public */ export interface UseKeyboardShortcutOptions { /** * The combination that triggers the shortcut. */ keys: KeyboardShortcutKeys; /** * Runs when the combination matches. */ onTrigger: (event: KeyboardEvent) => void; /** * Where the listener is attached. A ref may still be `null` on the first * render; the listener attaches once it resolves. * @defaultValue document.body */ eventTarget?: HTMLElement | RefObject; /** * Whether the shortcut currently listens. * @defaultValue true */ enabled?: boolean; /** * Whether the browser's default action for the combination is suppressed on a * match. * @defaultValue true */ preventDefault?: boolean; /** * Whether the listener runs in the capture phase, ahead of descendants that * call `stopPropagation`. * @defaultValue false */ capture?: boolean; /** * Suppresses the shortcut when it returns `true` for the event's target. * @defaultValue isValueEntryTarget */ shouldIgnoreTarget?: (target: EventTarget | null) => boolean; } /** * The `useKeyboardShortcut` hook registers a `keydown` listener for a key * combination in `aria-keyshortcuts` format and runs `onTrigger` when the user * presses it. On top of that, the hook accepts `mod`, which resolves to * `Meta` on macOS and to `Control` on every other platform. * @public */ export declare function useKeyboardShortcut({ keys, onTrigger, eventTarget, enabled, preventDefault, capture, shouldIgnoreTarget, }: UseKeyboardShortcutOptions): void; //# sourceMappingURL=useKeyboardShortcut.d.ts.map