diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-07-04 16:46:48 +0200 |
|---|---|---|
| committer | Johann150 <johann.galle@protonmail.com> | 2022-07-04 16:46:48 +0200 |
| commit | a228d1ddaa66c8b1acafc38b05a958b497582a6a (patch) | |
| tree | c352d7e0ec2aa862938951dec73e6baadad258af /packages/client/src/scripts | |
| parent | fix lint no-prototype-builtins (diff) | |
| download | sharkey-a228d1ddaa66c8b1acafc38b05a958b497582a6a.tar.gz sharkey-a228d1ddaa66c8b1acafc38b05a958b497582a6a.tar.bz2 sharkey-a228d1ddaa66c8b1acafc38b05a958b497582a6a.zip | |
fix lint @typescript-eslint/ban-types
Diffstat (limited to 'packages/client/src/scripts')
| -rw-r--r-- | packages/client/src/scripts/autocomplete.ts | 2 | ||||
| -rw-r--r-- | packages/client/src/scripts/hotkey.ts | 8 | ||||
| -rw-r--r-- | packages/client/src/scripts/url.ts | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/packages/client/src/scripts/autocomplete.ts b/packages/client/src/scripts/autocomplete.ts index 8d9bdee8f5..3ef6224175 100644 --- a/packages/client/src/scripts/autocomplete.ts +++ b/packages/client/src/scripts/autocomplete.ts @@ -8,7 +8,7 @@ export class Autocomplete { x: Ref<number>; y: Ref<number>; q: Ref<string | null>; - close: Function; + close: () => void; } | null; private textarea: HTMLInputElement | HTMLTextAreaElement; private currentType: string; 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; diff --git a/packages/client/src/scripts/url.ts b/packages/client/src/scripts/url.ts index 542b00e0f0..86735de9f0 100644 --- a/packages/client/src/scripts/url.ts +++ b/packages/client/src/scripts/url.ts @@ -1,4 +1,4 @@ -export function query(obj: {}): string { +export function query(obj: Record<string, any>): string { const params = Object.entries(obj) .filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined) .reduce((a, [k, v]) => (a[k] = v, a), {} as Record<string, any>); |