@ramstack/vue-hotkey
Version:
A lightweight package simplifies the handling of keyboard shortcuts within Vue applications. No external dependencies
16 lines (15 loc) • 563 B
TypeScript
import { ObjectDirective, ObjectPlugin } from "vue";
import { registerHotkey } from "@ramstack/hotkey";
/**
* Represents an event triggered by a hotkey.
* Extends the standard {@link KeyboardEvent} to include additional {@link hotkey} property.
*/
export interface HotkeyEvent extends KeyboardEvent {
/**
* Gets the hotkey that triggered this event.
*/
readonly hotkey: string;
}
export declare const vHotkey: ObjectDirective<HTMLElement, (e: HotkeyEvent) => void>;
export declare const HotkeyPlugin: ObjectPlugin;
export { registerHotkey };