Installation
npm install --save @types/is-hotkey
Summary
This package contains type definitions for is-hotkey (https://github.com/ianstormtaylor/is-hotkey#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is-hotkey.
export interface KeyboardEventLike {
key: string;
which: number;
altKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
shiftKey: boolean;
}
export interface HotKeyOptions {
byKey: boolean;
}
export interface HotKey {
which?: number | undefined;
key?: string | undefined;
altKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
shiftKey: boolean;
}
export function isHotkey(
hotkey: string | ReadonlyArray<string>,
options?: HotKeyOptions,
): (event: KeyboardEventLike) => boolean;
export function isHotkey(hotkey: string | ReadonlyArray<string>, event: KeyboardEventLike): boolean;
export function isHotkey(
hotkey: string | ReadonlyArray<string>,
options: HotKeyOptions,
event: KeyboardEventLike,
): boolean;
export function isCodeHotkey(hotkey: string | ReadonlyArray<string>): (event: KeyboardEventLike) => boolean;
export function isCodeHotkey(hotkey: string | ReadonlyArray<string>, event: KeyboardEventLike): boolean;
export function isKeyHotkey(hotkey: string | ReadonlyArray<string>): (event: KeyboardEventLike) => boolean;
export function isKeyHotkey(hotkey: string | ReadonlyArray<string>, event: KeyboardEventLike): boolean;
export function parseHotkey(hotkey: string, options?: HotKeyOptions): HotKey;
export function compareHotkey(object: HotKey, event: KeyboardEventLike): boolean;
export function toKeyCode(name: string): number;
export function toKeyName(name: string): string;
export default isHotkey;
Additional Details
- Last updated: Wed, 18 Oct 2023 01:17:35 GMT
- Dependencies: none
Credits
These definitions were written by Alex Kondratyuk.