summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts/hotkey.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/client/src/scripts/hotkey.ts')
-rw-r--r--packages/client/src/scripts/hotkey.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/client/src/scripts/hotkey.ts b/packages/client/src/scripts/hotkey.ts
index fd9c74f6c8..bd8c3b6cab 100644
--- a/packages/client/src/scripts/hotkey.ts
+++ b/packages/client/src/scripts/hotkey.ts
@@ -1,6 +1,8 @@
import keyCode from './keycode';
-type Keymap = Record<string, Function>;
+type Callback = (ev: KeyboardEvent) => void;
+
+type Keymap = Record<string, Callback>;
type Pattern = {
which: string[];
@@ -11,14 +13,14 @@ type Pattern = {
type Action = {
patterns: Pattern[];
- callback: Function;
+ callback: Callback;
allowRepeat: boolean;
};
const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, callback]): Action => {
const result = {
patterns: [],
- callback: callback,
+ callback,
allowRepeat: true
} as Action;