chore: make Preferences' lint happy

This commit is contained in:
CrescentLeaf
2025-10-07 23:05:34 +08:00
parent 4b91bc9dbb
commit 8d7ddd46be
7 changed files with 63 additions and 36 deletions

View File

@@ -1,6 +1,9 @@
import React from 'react'
export default class PreferenceStore {
declare value: { [key: string]: unknown }
declare setter: React.Dispatch<React.SetStateAction<{ [key: string]: unknown }>>
declare onUpdate: (value: unknown) => void
constructor() {
const _ = React.useState<{ [key: string]: unknown }>({})
this.value = _[0]
@@ -17,7 +20,7 @@ export default class PreferenceStore {
this.onUpdate?.(newValue)
}
}
setOnUpdate(onUpdate) {
setOnUpdate(onUpdate: (value: unknown) => void) {
this.onUpdate = onUpdate
}
}