refactor(frontend): asとanyをすぐなおせる範囲で除去 (#14848)

* refactor(frontend): できるだけanyを除去

* refactor

* lint

* fix

* remove unused

* Update packages/frontend/src/components/MkReactionsViewer.details.vue

* Update packages/frontend/src/components/MkUsersTooltip.vue

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
かっこかり
2024-10-31 13:46:42 +09:00
committed by GitHub
parent 7fc8a2a7b0
commit 17d9aca5a7
56 changed files with 250 additions and 192 deletions

View File

@@ -11,6 +11,7 @@ import darkTheme from '@@/themes/d-green-lime.json5';
import { miLocalStorage } from './local-storage.js';
import type { SoundType } from '@/scripts/sound.js';
import { Storage } from '@/pizzax.js';
import type { Ast } from '@syuilo/aiscript';
interface PostFormAction {
title: string,
@@ -516,7 +517,7 @@ export type Plugin = {
token: string;
src: string | null;
version: string;
ast: any[];
ast: Ast.Node[];
author?: string;
description?: string;
permissions?: string[];
@@ -554,13 +555,13 @@ export class ColdDeviceStorage {
}
public static getAll(): Partial<typeof this.default> {
return (Object.keys(this.default) as (keyof typeof this.default)[]).reduce((acc, key) => {
return (Object.keys(this.default) as (keyof typeof this.default)[]).reduce<Partial<typeof this.default>>((acc, key) => {
const value = localStorage.getItem(PREFIX + key);
if (value != null) {
acc[key] = JSON.parse(value);
}
return acc;
}, {} as any);
}, {});
}
public static set<T extends keyof typeof ColdDeviceStorage.default>(key: T, value: typeof ColdDeviceStorage.default[T]): void {
@@ -605,7 +606,7 @@ export class ColdDeviceStorage {
get: () => {
return valueRef.value;
},
set: (value: unknown) => {
set: (value: typeof ColdDeviceStorage.default[K]) => {
const val = value;
ColdDeviceStorage.set(key, val);
},