mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
feat(types): add vuex definition (#5946)
This commit is contained in:
parent
86d4613d9c
commit
1b634779f8
3
packages/vue-app/types/index.d.ts
vendored
3
packages/vue-app/types/index.d.ts
vendored
@ -9,6 +9,9 @@ import './process'
|
|||||||
// augment typings of Vue.js
|
// augment typings of Vue.js
|
||||||
import './vue'
|
import './vue'
|
||||||
|
|
||||||
|
// augment typings of Vuex
|
||||||
|
import './vuex'
|
||||||
|
|
||||||
type Dictionary<T> = { [key: string]: T }
|
type Dictionary<T> = { [key: string]: T }
|
||||||
|
|
||||||
type NuxtState = Dictionary<any>
|
type NuxtState = Dictionary<any>
|
||||||
|
10
packages/vue-app/types/vuex.d.ts
vendored
Normal file
10
packages/vue-app/types/vuex.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import Store from 'vuex'
|
||||||
|
import VueRouter from 'vue-router'
|
||||||
|
import { NuxtAppOptions } from '.'
|
||||||
|
|
||||||
|
declare module 'vuex/types/index' {
|
||||||
|
interface Store<S> {
|
||||||
|
app: NuxtAppOptions
|
||||||
|
$router: VueRouter
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user