1 | import { ModuleFn } from '../index';
|
2 | export declare const isMacLike: () => boolean;
|
3 | export declare const controlOrMetaKey: () => "meta" | "control";
|
4 | export declare function keys<O>(o: O): (keyof O)[];
|
5 | export interface SubState {
|
6 | shortcuts: Shortcuts;
|
7 | }
|
8 | export interface SubAPI {
|
9 | getShortcutKeys(): Shortcuts;
|
10 | getDefaultShortcuts(): Shortcuts | AddonShortcutDefaults;
|
11 | getAddonsShortcuts(): AddonShortcuts;
|
12 | getAddonsShortcutLabels(): AddonShortcutLabels;
|
13 | getAddonsShortcutDefaults(): AddonShortcutDefaults;
|
14 | setShortcuts(shortcuts: Shortcuts): Promise<Shortcuts>;
|
15 | setShortcut(action: Action, value: KeyCollection): Promise<KeyCollection>;
|
16 | setAddonShortcut(addon: string, shortcut: AddonShortcut): Promise<AddonShortcut>;
|
17 | restoreAllDefaultShortcuts(): Promise<Shortcuts>;
|
18 | restoreDefaultShortcut(action: Action): Promise<KeyCollection>;
|
19 | handleKeydownEvent(event: Event): void;
|
20 | handleShortcutFeature(feature: Action): void;
|
21 | }
|
22 | export declare type KeyCollection = string[];
|
23 | export interface Shortcuts {
|
24 | fullScreen: KeyCollection;
|
25 | togglePanel: KeyCollection;
|
26 | panelPosition: KeyCollection;
|
27 | toggleNav: KeyCollection;
|
28 | toolbar: KeyCollection;
|
29 | search: KeyCollection;
|
30 | focusNav: KeyCollection;
|
31 | focusIframe: KeyCollection;
|
32 | focusPanel: KeyCollection;
|
33 | prevComponent: KeyCollection;
|
34 | nextComponent: KeyCollection;
|
35 | prevStory: KeyCollection;
|
36 | nextStory: KeyCollection;
|
37 | shortcutsPage: KeyCollection;
|
38 | aboutPage: KeyCollection;
|
39 | escape: KeyCollection;
|
40 | collapseAll: KeyCollection;
|
41 | expandAll: KeyCollection;
|
42 | }
|
43 | export declare type Action = keyof Shortcuts;
|
44 | interface AddonShortcut {
|
45 | label: string;
|
46 | defaultShortcut: KeyCollection;
|
47 | actionName: string;
|
48 | showInMenu?: boolean;
|
49 | action: (...args: any[]) => any;
|
50 | }
|
51 | declare type AddonShortcuts = Record<string, AddonShortcut>;
|
52 | declare type AddonShortcutLabels = Record<string, string>;
|
53 | declare type AddonShortcutDefaults = Record<string, KeyCollection>;
|
54 | export declare const defaultShortcuts: Shortcuts;
|
55 | export interface Event extends KeyboardEvent {
|
56 | target: {
|
57 | tagName: string;
|
58 | addEventListener(): void;
|
59 | removeEventListener(): boolean;
|
60 | dispatchEvent(event: Event): boolean;
|
61 | getAttribute(attr: string): string | null;
|
62 | };
|
63 | }
|
64 | export declare const init: ModuleFn;
|
65 | export {};
|