@types/is-hotkey
TypeScript icon, indicating that this package has built-in type declarations

0.1.10 • Public • Published

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.

index.d.ts

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;
}

/**
 * Is hotkey?
 */
export function isHotkey(
    hotkey: string | readonly string[],
    options?: HotKeyOptions,
): (event: KeyboardEventLike) => boolean;

export function isHotkey(hotkey: string | readonly string[], event: KeyboardEventLike): boolean;

export function isHotkey(
    hotkey: string | readonly string[],
    options: HotKeyOptions,
    event: KeyboardEventLike,
): boolean;

export function isCodeHotkey(hotkey: string | readonly string[]): (event: KeyboardEventLike) => boolean;
export function isCodeHotkey(hotkey: string | readonly string[], event: KeyboardEventLike): boolean;

export function isKeyHotkey(hotkey: string | readonly string[]): (event: KeyboardEventLike) => boolean;
export function isKeyHotkey(hotkey: string | readonly string[], event: KeyboardEventLike): boolean;

/**
 * Parse.
 */
export function parseHotkey(hotkey: string, options?: HotKeyOptions): HotKey;

/**
 * Compare.
 */
export function compareHotkey(object: HotKey, event: KeyboardEventLike): boolean;

/**
 * Utils.
 */
export function toKeyCode(name: string): number;
export function toKeyName(name: string): string;

/**
 * Export.
 */
export default isHotkey;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Alex Kondratyuk.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.10450,198ts5.7
0.1.10450,198ts5.6
0.1.10450,198latest
0.1.10450,198ts4.5
0.1.10450,198ts4.6
0.1.10450,198ts4.7
0.1.10450,198ts4.8
0.1.10450,198ts4.9
0.1.10450,198ts5.0
0.1.10450,198ts5.1
0.1.10450,198ts5.2
0.1.10450,198ts5.3
0.1.10450,198ts5.4
0.1.10450,198ts5.5
0.1.10450,198ts5.8
0.1.7103,970ts3.8
0.1.7103,970ts3.9
0.1.7103,970ts4.0
0.1.7103,970ts4.1
0.1.7103,970ts4.2
0.1.7103,970ts4.3
0.1.7103,970ts4.4
0.1.229,339ts3.1
0.1.229,339ts3.2
0.1.229,339ts3.3
0.1.229,339ts3.4
0.1.229,339ts3.5
0.1.510,506ts3.7
0.1.12,878ts2.0
0.1.12,878ts2.1
0.1.12,878ts2.2
0.1.12,878ts2.3
0.1.12,878ts2.4
0.1.12,878ts2.5
0.1.12,878ts2.6
0.1.12,878ts2.7
0.1.12,878ts2.8
0.1.12,878ts2.9
0.1.12,878ts3.0
0.1.3532ts3.6

Version History

VersionDownloads (Last 7 Days)Published
0.1.10450,198
0.1.95,968
0.1.811,273
0.1.7103,970
0.1.6162
0.1.510,506
0.1.419,041
0.1.3532
0.1.229,339
0.1.12,878
0.1.00

Package Sidebar

Install

npm i @types/is-hotkey

Weekly Downloads

633,867

Version

0.1.10

License

MIT

Unpacked Size

5.68 kB

Total Files

5

Last publish

Collaborators

  • types