import { MaybeRefOrGetter, Ref } from "vue"; //#region src/composables/useHotkey/index.d.ts interface UseHotkeyOptions { /** * The keyboard event type to listen for. * @default 'keydown' */ event?: MaybeRefOrGetter<'keydown' | 'keyup'>; /** * Whether to trigger the callback when an input element is focused. * @default false */ inputs?: MaybeRefOrGetter; /** * Whether to prevent the default browser action. * @default true */ preventDefault?: MaybeRefOrGetter; /** * Whether to stop event propagation. * @default false */ stopPropagation?: MaybeRefOrGetter; /** * Timeout in ms before a key sequence resets. * @default 1000 */ sequenceTimeout?: MaybeRefOrGetter; } interface UseHotkeyReturn { /** * Whether the hotkey listener is currently active (listening for keys). * False when paused, when keys is undefined, or in SSR. */ readonly isActive: Readonly>; /** * Whether the hotkey listener is currently paused. */ readonly isPaused: Readonly>; /** * Pause listening (removes listener but keeps configuration). */ pause: () => void; /** * Resume listening after pause. */ resume: () => void; /** * Stop listening and clean up (removes listener). */ stop: () => void; } /** * Platform context for testing platform-specific behavior. * @internal */ interface PlatformContext { isMac: boolean; } /** * A composable that listens for hotkey combinations and sequences. * * @param keys - The hotkey string (e.g., 'ctrl+k', 'g-h') * @param callback - The function to call when the hotkey is triggered * @param options - Configuration options * @returns An object with state refs and control methods * * @see https://0.vuetifyjs.com/composables/system/use-hotkey * * @example * ```ts * import { useHotkey } from '@vuetify/v0' * * // Simple combination * const { isActive, pause, resume } = useHotkey('ctrl+k', () => { * console.log('Command palette opened') * }) * * // Key sequence (GitHub-style) * useHotkey('g-h', () => console.log('Go home')) * * // With options * useHotkey('escape', closeModal, { inputs: true }) * * // Pause/resume control * pause() // Temporarily disable * resume() // Re-enable * ``` */ declare function useHotkey(keys: MaybeRefOrGetter, callback: (e: KeyboardEvent) => void, options?: UseHotkeyOptions, _platform?: PlatformContext): UseHotkeyReturn; //#endregion export { PlatformContext, UseHotkeyOptions, UseHotkeyReturn, useHotkey };