nuxt-typed-vuex
Advanced tools
Comparing version
@@ -21,2 +21,3 @@ import { Store, GetterTree, MutationTree, ActionTree, DispatchOptions, CommitOptions } from 'vuex'; | ||
interface BlankStore { | ||
state: {}; | ||
getters: {}; | ||
@@ -26,3 +27,2 @@ mutations: {}; | ||
modules: {}; | ||
state: () => ({}); | ||
} | ||
@@ -36,5 +36,3 @@ interface NuxtStore { | ||
} | ||
declare type NuxtModules = Record<string, Partial<NuxtStore> & { | ||
state: () => unknown; | ||
}>; | ||
declare type NuxtModules = Record<string, Partial<NuxtStore>>; | ||
interface NuxtStoreInput<T extends State, G, M, A, S extends { | ||
@@ -71,5 +69,3 @@ [key: string]: Partial<NuxtStore>; | ||
export declare type RootGettersHelper<T extends Required<NuxtStore>> = GettersTransformer<T['getters']> & ModuleTransformer<T['modules'], 'getters'>; | ||
export declare const getStoreType: <T extends Record<string, any>, G, M, A, S extends Record<string, Partial<NuxtStore> & { | ||
state: () => unknown; | ||
}>>(store: NuxtStoreInput<T, G, M, A, S>) => { | ||
export declare const getStoreType: <T extends Record<string, any>, G, M, A, S extends Record<string, Partial<NuxtStore>>>(store: NuxtStoreInput<T, G, M, A, S>) => { | ||
actionContext: ActionContext<NuxtStoreInput<T, G, M, A, S> & BlankStore>; | ||
@@ -80,9 +76,5 @@ rootState: RootStateHelper<NuxtStoreInput<T, G, M, A, S> & BlankStore>; | ||
}; | ||
export declare const getAccessorType: <T extends Record<string, any>, G extends GetterTree<StateType<T>, any>, M extends MutationTree<StateType<T>>, A extends ActionTree<StateType<T>, any>, S extends Record<string, Partial<NuxtStore> & { | ||
state: () => unknown; | ||
}>>(store: Partial<NuxtStoreInput<T, G, M, A, S>>) => MergedStoreType<Partial<NuxtStoreInput<T, G, M, A, S>> & BlankStore, string>; | ||
export declare const useAccessor: <T extends Record<string, any>, G extends GetterTree<StateType<T>, any>, M extends MutationTree<StateType<T>>, A extends ActionTree<StateType<T>, any>, S extends Record<string, Partial<NuxtStore> & { | ||
state: () => unknown; | ||
}>>(store: Store<StateType<T>>, input: Partial<NuxtStoreInput<T, G, M, A, S>>) => MergedStoreType<Partial<NuxtStoreInput<T, G, M, A, S>> & BlankStore, string>; | ||
export declare const getAccessorFromStore: (pattern: any) => (store: Store<any>) => any; | ||
export declare const getAccessorType: <T extends Record<string, any>, G extends GetterTree<StateType<T>, any>, M extends MutationTree<StateType<T>>, A extends ActionTree<StateType<T>, any>, S extends Record<string, Partial<NuxtStore>>>(store: Partial<NuxtStoreInput<T, G, M, A, S>>) => MergedStoreType<Partial<NuxtStoreInput<T, G, M, A, S>> & BlankStore, string>; | ||
export declare const useAccessor: <T extends Record<string, any>, G extends GetterTree<StateType<T>, any>, M extends MutationTree<StateType<T>>, A extends ActionTree<StateType<T>, any>, S extends Record<string, Partial<NuxtStore>>>(store: Store<any>, input: Partial<NuxtStoreInput<T, G, M, A, S>>) => MergedStoreType<Partial<NuxtStoreInput<T, G, M, A, S>> & BlankStore, string>; | ||
export declare const getAccessorFromStore: (pattern: any) => (store: Store<any>) => MergedStoreType<Partial<NuxtStoreInput<Record<string, any>, GetterTree<Record<string, any>, any>, MutationTree<Record<string, any>>, ActionTree<Record<string, any>, any>, Record<string, Partial<NuxtStore>>>> & BlankStore, string>; | ||
export declare const getterTree: <S, T extends GetterTree<StateType<S>, any>>(_state: S, tree: T) => T; | ||
@@ -89,0 +81,0 @@ export declare const mutationTree: <S, T extends MutationTree<StateType<S>>>(_state: S, tree: T) => T; |
{ | ||
"name": "nuxt-typed-vuex", | ||
"version": "0.1.9-beta.5", | ||
"version": "0.1.9-beta.6", | ||
"description": "A typed store accessor for Nuxt.", | ||
@@ -5,0 +5,0 @@ "repository": "danielroe/nuxt-typed-vuex", |
Sorry, the diff of this file is not supported yet
20062
0.41%183
-2.66%