1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/jaywcjlove-hotkeys

Клонировать/Скачать
index.d.ts 1.5 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Selphine Отправлено 04.04.2023 20:01 bb7481e
export interface HotkeysEvent {
key: string;
method: KeyHandler;
mods: number[];
scope: string;
shortcut: string;
}
export interface KeyHandler {
(keyboardEvent: KeyboardEvent, hotkeysEvent: HotkeysEvent): void | boolean;
}
type Options = {
scope?: string;
element?: HTMLElement | null;
keyup?: boolean | null;
keydown?: boolean | null;
capture?: boolean
splitKey?: string;
}
export interface Hotkeys {
(key: string, method: KeyHandler): void;
(key: string, scope: string, method: KeyHandler): void;
(key: string, options: Options, method: KeyHandler): void;
shift: boolean;
ctrl: boolean;
alt: boolean;
option: boolean;
control: boolean;
cmd: boolean;
command: boolean;
keyMap: Record<string, number>;
modifier: Record<string, number>;
modifierMap: Record<string, number | string>;
setScope(scopeName: string): void;
getScope(): string;
deleteScope(scopeName: string, newScopeName?: string): void;
noConflict(): Hotkeys;
trigger(shortcut: string, scope?: string): void;
unbind(key?: string): void;
unbind(key: string, scopeName: string): void;
unbind(key: string, scopeName: string, method: KeyHandler): void;
unbind(key: string, method: KeyHandler): void;
isPressed(keyCode: number): boolean;
isPressed(keyCode: string): boolean;
getPressedKeyCodes(): number[];
getPressedKeyString(): string[];
filter(event: KeyboardEvent): boolean;
}
// https://github.com/eiriklv/react-masonry-component/issues/57
declare var hotkeys: Hotkeys;
export default hotkeys;

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/jaywcjlove-hotkeys.git
git@api.gitlife.ru:oschina-mirror/jaywcjlove-hotkeys.git
oschina-mirror
jaywcjlove-hotkeys
jaywcjlove-hotkeys
master