direct-vuex
Advanced tools
Comparing version 0.2.4 to 0.2.5
{ | ||
"name": "direct-vuex", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Just Vuex with typing. Compatible with the Vue 3 composition API.", | ||
@@ -5,0 +5,0 @@ "author": "Paleo", |
@@ -14,4 +14,4 @@ import { Store } from "vuex" | ||
export type DirectState<O extends StoreOrModuleOptions> = | ||
O["state"] | ||
type DirectState<O extends StoreOrModuleOptions> = | ||
ToStateObj<O["state"]> | ||
& GetStateInModules<OrEmpty<O["modules"]>> | ||
@@ -23,5 +23,7 @@ | ||
type ToStateObj<T> = T extends () => any ? ReturnType<T> : T; | ||
// Getters | ||
export type DirectGetters<O extends StoreOrModuleOptions> = | ||
type DirectGetters<O extends StoreOrModuleOptions> = | ||
ToDirectGetters<OrEmpty<O["getters"]>> | ||
@@ -35,3 +37,3 @@ & GetGettersInModules<FilterNamespaced<OrEmpty<O["modules"]>>> | ||
export type ToDirectGetters<T extends GettersImpl> = { | ||
type ToDirectGetters<T extends GettersImpl> = { | ||
[K in keyof T]: ReturnType<T[K]> | ||
@@ -44,3 +46,3 @@ } | ||
export type DirectMutations<O extends StoreOrModuleOptions> = | ||
type DirectMutations<O extends StoreOrModuleOptions> = | ||
ToDirectMutations<OrEmpty<O["mutations"]>> | ||
@@ -54,3 +56,3 @@ & GetMutationsInModules<FilterNamespaced<OrEmpty<O["modules"]>>> | ||
export type ToDirectMutations<T extends MutationsImpl> = { | ||
type ToDirectMutations<T extends MutationsImpl> = { | ||
[K in keyof T]: Parameters<T[K]>[1] extends undefined | ||
@@ -65,3 +67,3 @@ ? (() => void) | ||
export type DirectActions<O extends StoreOrModuleOptions> = | ||
type DirectActions<O extends StoreOrModuleOptions> = | ||
ToDirectActions<OrEmpty<O["actions"]>> | ||
@@ -75,3 +77,3 @@ & GetActionsInModules<FilterNamespaced<OrEmpty<O["modules"]>>> | ||
export type ToDirectActions<T extends ActionsImpl> = { | ||
type ToDirectActions<T extends ActionsImpl> = { | ||
[K in keyof T]: Parameters<T[K]>[1] extends undefined | ||
@@ -78,0 +80,0 @@ ? (() => PromiseOf<ReturnType<T[K]>>) |
@@ -10,3 +10,3 @@ import { ToDirectStore } from "./direct-types" | ||
export interface StoreOrModuleOptions { | ||
state?: any, | ||
state?: (() => any) | any, | ||
getters?: GettersImpl | ||
@@ -13,0 +13,0 @@ mutations?: MutationsImpl |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22553
404