create-packer 1.19.2 → 1.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.19.2",
3
+ "version": "1.19.3",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -12,13 +12,15 @@ export type actionsType<S, OptionAction, InsideActions = unknown> = (
12
12
  actions: insideActionsType<S> & InsideActions,
13
13
  store: StoreApi<S>
14
14
  ) => OptionAction
15
+
16
+ export type defGetterStateType<S> = Record<string, (state: S) => any>
15
17
  export interface optionsType<S, G, OptionAction> {
16
18
  state: () => S
17
19
  getter: () => G
18
20
  actions: actionsType<S, OptionAction>
19
21
  }
20
22
 
21
- type GenGetterStateType<S, G extends Record<string, (state: S) => any>> = G extends Record<
23
+ type GenGetterStateType<S, G extends defGetterStateType<S>> = G extends Record<
22
24
  infer K,
23
25
  (state: S) => infer V
24
26
  >
@@ -26,7 +28,7 @@ type GenGetterStateType<S, G extends Record<string, (state: S) => any>> = G exte
26
28
  : unknown
27
29
  export function define<
28
30
  S extends Record<string, any>,
29
- G extends Record<string, (state: S) => any>,
31
+ G extends defGetterStateType<S>,
30
32
  OptionActions extends Record<string, any>
31
33
  >(options: optionsType<S, G, OptionActions>) {
32
34
  function createDefState() {
@@ -12,13 +12,15 @@ export type actionsType<S, OptionAction, InsideActions = unknown> = (
12
12
  actions: insideActionsType<S> & InsideActions,
13
13
  store: StoreApi<S>
14
14
  ) => OptionAction
15
+
16
+ export type defGetterStateType<S> = Record<string, (state: S) => any>
15
17
  export interface optionsType<S, G, OptionAction> {
16
18
  state: () => S
17
19
  getter: () => G
18
20
  actions: actionsType<S, OptionAction>
19
21
  }
20
22
 
21
- type GenGetterStateType<S, G extends Record<string, (state: S) => any>> = G extends Record<
23
+ type GenGetterStateType<S, G extends defGetterStateType<S>> = G extends Record<
22
24
  infer K,
23
25
  (state: S) => infer V
24
26
  >
@@ -26,7 +28,7 @@ type GenGetterStateType<S, G extends Record<string, (state: S) => any>> = G exte
26
28
  : unknown
27
29
  export function define<
28
30
  S extends Record<string, any>,
29
- G extends Record<string, (state: S) => any>,
31
+ G extends defGetterStateType<S>,
30
32
  OptionActions extends Record<string, any>
31
33
  >(options: optionsType<S, G, OptionActions>) {
32
34
  function createDefState() {