1 | import Key, { HeldKey } from '../keys';
|
2 | export interface Data {
|
3 | node: HTMLElement | null | undefined;
|
4 | ordered: Key[];
|
5 | held?: HeldKey;
|
6 | ignoreInput: boolean;
|
7 | onMatch(matched: {
|
8 | ordered: Key[];
|
9 | held?: HeldKey;
|
10 | }): void;
|
11 | allowDefault: boolean;
|
12 | }
|
13 | export default class ShortcutManager {
|
14 | private keysPressed;
|
15 | private shortcuts;
|
16 | private shortcutsMatched;
|
17 | private timer;
|
18 | setup(): void;
|
19 | subscribe(data: Data): {
|
20 | unsubscribe(): void;
|
21 | };
|
22 | private resetKeys;
|
23 | private handleKeyDown;
|
24 | private allModifiersAreHeld;
|
25 | private updateMatchingShortcuts;
|
26 | private callMatchedShortcut;
|
27 | }
|