mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 18:07:31 -07:00
fix lint @typescript-eslint/ban-types
This commit is contained in:
parent
7cbd70bd36
commit
9538815980
5 changed files with 7 additions and 10 deletions
|
@ -13,9 +13,6 @@ const props = defineProps<{
|
||||||
router?: Router;
|
router?: Router;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const router = props.router ?? inject('router');
|
const router = props.router ?? inject('router');
|
||||||
|
|
||||||
if (router == null) {
|
if (router == null) {
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
import { onMounted, ref, watch, PropType, onBeforeUnmount } from 'vue';
|
import { onMounted, ref, watch, PropType, onBeforeUnmount } from 'vue';
|
||||||
import tinycolor from 'tinycolor2';
|
import tinycolor from 'tinycolor2';
|
||||||
|
|
||||||
const props = defineProps<{}>();
|
|
||||||
|
|
||||||
const loaded = !!window.TagCanvas;
|
const loaded = !!window.TagCanvas;
|
||||||
const SAFE_FOR_HTML_ID = 'abcdefghijklmnopqrstuvwxyz';
|
const SAFE_FOR_HTML_ID = 'abcdefghijklmnopqrstuvwxyz';
|
||||||
const computedStyle = getComputedStyle(document.documentElement);
|
const computedStyle = getComputedStyle(document.documentElement);
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class Autocomplete {
|
||||||
x: Ref<number>;
|
x: Ref<number>;
|
||||||
y: Ref<number>;
|
y: Ref<number>;
|
||||||
q: Ref<string | null>;
|
q: Ref<string | null>;
|
||||||
close: Function;
|
close: () => void;
|
||||||
} | null;
|
} | null;
|
||||||
private textarea: HTMLInputElement | HTMLTextAreaElement;
|
private textarea: HTMLInputElement | HTMLTextAreaElement;
|
||||||
private currentType: string;
|
private currentType: string;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import keyCode from './keycode';
|
import keyCode from './keycode';
|
||||||
|
|
||||||
type Keymap = Record<string, Function>;
|
type Callback = (ev: KeyboardEvent) => void;
|
||||||
|
|
||||||
|
type Keymap = Record<string, Callback>;
|
||||||
|
|
||||||
type Pattern = {
|
type Pattern = {
|
||||||
which: string[];
|
which: string[];
|
||||||
|
@ -11,14 +13,14 @@ type Pattern = {
|
||||||
|
|
||||||
type Action = {
|
type Action = {
|
||||||
patterns: Pattern[];
|
patterns: Pattern[];
|
||||||
callback: Function;
|
callback: Callback;
|
||||||
allowRepeat: boolean;
|
allowRepeat: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, callback]): Action => {
|
const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, callback]): Action => {
|
||||||
const result = {
|
const result = {
|
||||||
patterns: [],
|
patterns: [],
|
||||||
callback: callback,
|
callback,
|
||||||
allowRepeat: true
|
allowRepeat: true
|
||||||
} as Action;
|
} as Action;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export function query(obj: {}): string {
|
export function query(obj: Record<string, any>): string {
|
||||||
const params = Object.entries(obj)
|
const params = Object.entries(obj)
|
||||||
.filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined)
|
.filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined)
|
||||||
.reduce((a, [k, v]) => (a[k] = v, a), {} as Record<string, any>);
|
.reduce((a, [k, v]) => (a[k] = v, a), {} as Record<string, any>);
|
||||||
|
|
Loading…
Reference in a new issue