UNPKG

angular2-hotkeys

Version:

Angular 16 and Ivy Compatible. Older versions might work but isn't officially tested.

26 lines (25 loc) 1.17 kB
export interface ExtendedKeyboardEvent extends KeyboardEvent { returnValue: boolean; } export declare class Hotkey { combo: string | string[]; callback: (event: KeyboardEvent, combo: string) => ExtendedKeyboardEvent | boolean; allowIn?: string[]; description?: string | Function; action?: string; persistent?: boolean; private formattedHotkey; static symbolize(combo: string): string; /** * Creates a new Hotkey for Mousetrap binding * * @param combo mousetrap key binding * @param callback method to call when key is pressed * @param allowIn an array of tag names to allow this combo in ('INPUT', 'SELECT', and/or 'TEXTAREA') * @param description description for the help menu * @param action the type of event to listen for (for mousetrap) * @param persistent if true, the binding is preserved upon route changes */ constructor(combo: string | string[], callback: (event: KeyboardEvent, combo: string) => ExtendedKeyboardEvent | boolean, allowIn?: string[], description?: string | Function, action?: string, persistent?: boolean); get formatted(): string[]; }