mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 01:22:49 +00:00
22 lines
750 B
TypeScript
22 lines
750 B
TypeScript
export type KeyboardModifiers = {
|
|
alt: boolean;
|
|
ctrl: boolean;
|
|
meta: boolean;
|
|
mod: boolean;
|
|
shift: boolean;
|
|
plus: boolean;
|
|
};
|
|
export type Hotkey = KeyboardModifiers & {
|
|
key?: string;
|
|
};
|
|
type CheckHotkeyMatch = (event: KeyboardEvent) => boolean;
|
|
export declare function parseHotkey(hotkey: string): Hotkey;
|
|
export declare function getHotkeyMatcher(hotkey: string, usePhysicalKeys?: boolean): CheckHotkeyMatch;
|
|
export interface HotkeyItemOptions {
|
|
preventDefault?: boolean;
|
|
usePhysicalKeys?: boolean;
|
|
}
|
|
type HotkeyItem = [string, (event: any) => void, HotkeyItemOptions?];
|
|
export declare function getHotkeyHandler(hotkeys: HotkeyItem[]): (event: React.KeyboardEvent<HTMLElement> | KeyboardEvent) => void;
|
|
export {};
|