fix lint @typescript-eslint/ban-types

This commit is contained in:
Johann150
2022-07-04 16:46:48 +02:00
parent d748ba2c51
commit a228d1ddaa
5 changed files with 7 additions and 10 deletions

View File

@@ -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;