fix lint @typescript-eslint/ban-types
This commit is contained in:
parent
d748ba2c51
commit
a228d1ddaa
5 changed files with 7 additions and 10 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue