fix lint @typescript-eslint/ban-types

This commit is contained in:
Johann150 2022-07-04 16:46:48 +02:00 committed by Chloe Kudryavtsev
parent 5560de4b7f
commit 0102ea066a
4 changed files with 7 additions and 8 deletions

View file

@ -13,9 +13,6 @@ const props = defineProps<{
router?: Router;
}>();
const emit = defineEmits<{
}>();
const router = props.router ?? inject('router');
if (router == null) {

View file

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

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;

View file

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