UNPKG

keyboard-event-to-string

Version:

Converts a JavaScript keyboard event object into a humanly readable string

29 lines (28 loc) 721 B
declare type Options = { cmd: string; ctrl: string; alt: string; shift: string; joinWith: string; hideKey: HideKeyType; }; declare type HideKeyType = 'never' | 'always' | 'alpha' | 'alphanumeric'; declare type UserOptions = Partial<Options>; declare type Modifiers = { alt: boolean; cmd: boolean; ctrl: boolean; shift: boolean; }; declare type KeyMap = { character: string | null; modifiers: Modifiers; }; export declare function details(e: KeyboardEvent): { hasKey: boolean; hasModifier: boolean; map: KeyMap; }; export declare function setOptions(userOptions: UserOptions): UserOptions; export declare const toString: (e: KeyboardEvent) => string; export {};