refactor(frontend): reduce type errors

This commit is contained in:
syuilo 2024-01-05 12:33:47 +09:00
parent fa9c4a19b9
commit 2cd32b2248
2 changed files with 6 additions and 3 deletions

View file

@ -140,8 +140,8 @@ const profile = reactive({
location: $i.location,
birthday: $i.birthday,
lang: $i.lang,
isBot: $i.isBot,
isCat: $i.isCat,
isBot: $i.isBot ?? false,
isCat: $i.isCat ?? false,
});
watch(() => profile, () => {

View file

@ -225,7 +225,10 @@ export class Storage<T extends StateDef> {
* getter/setterを作ります
* vue場で設定コントロールのmodelとして使う用
*/
public makeGetterSetter<K extends keyof T>(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]) {
public makeGetterSetter<K extends keyof T>(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]): {
get: () => T[K]['default'];
set: (value: T[K]['default']) => void;
} {
const valueRef = ref(this.state[key]);
const stop = watch(this.reactiveState[key], val => {