feat: improve store typing
This commit is contained in:
27
src/types/shims-vue.d.ts
vendored
27
src/types/shims-vue.d.ts
vendored
@ -1,13 +1,30 @@
|
||||
// https://next.vuex.vuejs.org/guide/migrating-to-4-0-from-3-x.html#typescript-support
|
||||
import { Store } from 'vuex'
|
||||
|
||||
import type {
|
||||
RootStoreState,
|
||||
AttachmentState,
|
||||
AuthState,
|
||||
ConfigState,
|
||||
KanbanState,
|
||||
LabelState,
|
||||
ListState,
|
||||
NamespaceState,
|
||||
TaskState,
|
||||
} from '@/store/types'
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
// Declare your own store states.
|
||||
interface State {
|
||||
count: number
|
||||
}
|
||||
|
||||
interface ComponentCustomProperties {
|
||||
$store: Store<State>
|
||||
$store: Store<RootStoreState & {
|
||||
config: ConfigState,
|
||||
auth: AuthState,
|
||||
namespaces: NamespaceState,
|
||||
kanban: KanbanState,
|
||||
tasks: TaskState,
|
||||
lists: ListState,
|
||||
attachments: AttachmentState,
|
||||
labels: LabelState,
|
||||
}>
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user