effector-storage 7.1.1 → 8.0.0

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.
Files changed (88) hide show
  1. package/README.md +12 -9
  2. package/async-storage/index.cjs +1 -1
  3. package/async-storage/index.cjs.map +1 -1
  4. package/async-storage/index.d.cts +20 -9
  5. package/async-storage/index.d.ts +20 -9
  6. package/async-storage/index.js +1 -1
  7. package/async-storage/index.js.map +1 -1
  8. package/broadcast/index.cjs +1 -1
  9. package/broadcast/index.cjs.map +1 -1
  10. package/broadcast/index.d.cts +103 -24
  11. package/broadcast/index.d.ts +103 -24
  12. package/broadcast/index.js +1 -1
  13. package/broadcast/index.js.map +1 -1
  14. package/core/index.cjs +1 -1
  15. package/core/index.cjs.map +1 -1
  16. package/core/index.d.cts +97 -19
  17. package/core/index.d.ts +97 -19
  18. package/core/index.js +1 -1
  19. package/core/index.js.map +1 -1
  20. package/core/package.json +3 -0
  21. package/index.cjs +1 -1
  22. package/index.cjs.map +1 -1
  23. package/index.d.cts +99 -20
  24. package/index.d.ts +99 -20
  25. package/index.js +1 -1
  26. package/index.js.map +1 -1
  27. package/local/index.cjs +1 -1
  28. package/local/index.cjs.map +1 -1
  29. package/local/index.d.cts +103 -24
  30. package/local/index.d.ts +103 -24
  31. package/local/index.js +1 -1
  32. package/local/index.js.map +1 -1
  33. package/log/index.cjs +1 -1
  34. package/log/index.cjs.map +1 -1
  35. package/log/index.d.cts +21 -9
  36. package/log/index.d.ts +21 -9
  37. package/log/index.js +1 -1
  38. package/log/index.js.map +1 -1
  39. package/memory/index.cjs +1 -1
  40. package/memory/index.cjs.map +1 -1
  41. package/memory/index.d.cts +103 -24
  42. package/memory/index.d.ts +103 -24
  43. package/memory/index.js +1 -1
  44. package/memory/index.js.map +1 -1
  45. package/nil/index.cjs +1 -1
  46. package/nil/index.cjs.map +1 -1
  47. package/nil/index.d.cts +20 -9
  48. package/nil/index.d.ts +20 -9
  49. package/nil/index.js +1 -1
  50. package/nil/index.js.map +1 -1
  51. package/package.json +3 -3
  52. package/query/index.cjs +1 -1
  53. package/query/index.cjs.map +1 -1
  54. package/query/index.d.cts +103 -24
  55. package/query/index.d.ts +103 -24
  56. package/query/index.js +1 -1
  57. package/query/index.js.map +1 -1
  58. package/session/index.cjs +1 -1
  59. package/session/index.cjs.map +1 -1
  60. package/session/index.d.cts +103 -24
  61. package/session/index.d.ts +103 -24
  62. package/session/index.js +1 -1
  63. package/session/index.js.map +1 -1
  64. package/storage/index.cjs +1 -1
  65. package/storage/index.cjs.map +1 -1
  66. package/storage/index.d.cts +20 -9
  67. package/storage/index.d.ts +20 -9
  68. package/storage/index.js +1 -1
  69. package/storage/index.js.map +1 -1
  70. package/tools/index.cjs +1 -1
  71. package/tools/index.cjs.map +1 -1
  72. package/tools/index.d.cts +18 -9
  73. package/tools/index.d.ts +18 -9
  74. package/tools/index.js +1 -1
  75. package/tools/index.js.map +1 -1
  76. package/tools/package.json +3 -0
  77. package/async-storage/index.js.flow +0 -37
  78. package/broadcast/index.js.flow +0 -132
  79. package/core/index.js.flow +0 -113
  80. package/index.js.flow +0 -146
  81. package/local/index.js.flow +0 -140
  82. package/log/index.js.flow +0 -32
  83. package/memory/index.js.flow +0 -133
  84. package/nil/index.js.flow +0 -31
  85. package/query/index.js.flow +0 -159
  86. package/session/index.js.flow +0 -140
  87. package/storage/index.js.flow +0 -36
  88. package/tools/index.js.flow +0 -104
@@ -1,159 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
-
8
- import { Unit, Store, Event, Effect, Subscription } from "effector";
9
- declare interface StorageAdapter {
10
- <State>(
11
- key: string,
12
- update: (raw?: any) => void
13
- ): {
14
- get(raw?: any, ctx?: any): State | Promise<State | void> | void,
15
- set(value: State, ctx?: any): void,
16
- ...
17
- };
18
- keyArea?: any;
19
- noop?: boolean;
20
- }
21
- declare interface StorageAdapterFactory<AdapterConfig> {
22
- (config?: AdapterConfig): StorageAdapter;
23
- factory: true;
24
- }
25
- declare type Contract<Data> =
26
- | ((raw: mixed) => boolean)
27
- | {
28
- isData: (raw: mixed) => boolean,
29
- getErrorMessages: (raw: mixed) => string[],
30
- ...
31
- };
32
- declare type Done<State> = {
33
- key: string,
34
- keyPrefix: string,
35
- operation: "set" | "get",
36
- value: State,
37
- ...
38
- };
39
- declare type Fail<Err> = {
40
- key: string,
41
- keyPrefix: string,
42
- operation: "set" | "get",
43
- error: Err,
44
- value?: any,
45
- ...
46
- };
47
- declare type Finally<State, Err> =
48
- | {
49
- ...Done<State>,
50
- ...{
51
- status: "done",
52
- ...
53
- },
54
- }
55
- | {
56
- ...Fail<Err>,
57
- ...{
58
- status: "fail",
59
- ...
60
- },
61
- };
62
- declare interface ConfigPersist$1 {
63
- pickup?: Unit<any> | Unit<any>[];
64
- context?: Unit<any>;
65
- keyPrefix?: string;
66
- contract?: Contract<any>;
67
- }
68
- declare interface ConfigCommon<State, Err = Error> {
69
- clock?: Unit<any>;
70
- done?: Unit<Done<State>>;
71
- fail?: Unit<Fail<Err>>;
72
- finally?: Unit<Finally<State, Err>>;
73
- pickup?: Unit<any> | Unit<any>[];
74
- context?: Unit<any>;
75
- key?: string;
76
- keyPrefix?: string;
77
- contract?: Contract<State | void>;
78
- }
79
- declare interface ConfigJustStore<State> {
80
- store: Store<State>;
81
- }
82
- declare interface ConfigJustSourceTarget<State> {
83
- source: Store<State> | Event<State> | Effect<State, any, any>;
84
- target: Store<State> | Event<State> | Effect<State, any, any>;
85
- }
86
- declare type ConfigStore$1<State, Err = Error> = { ... } & ConfigCommon<
87
- State,
88
- Err
89
- > &
90
- ConfigJustStore<State>;
91
- declare type ConfigSourceTarget$1<State, Err = Error> = { ... } & ConfigCommon<
92
- State,
93
- Err
94
- > &
95
- ConfigJustSourceTarget<State>;
96
- declare type ChangeMethod = (
97
- params: URLSearchParams | string,
98
- erase?: boolean
99
- ) => void;
100
- declare type StateBehavior = "keep" | "erase";
101
- declare interface QueryConfig {
102
- method?: ChangeMethod;
103
- state?: StateBehavior;
104
- serialize?: (value: any) => string;
105
- deserialize?: (value: string) => any;
106
- timeout?: number;
107
- def?: any;
108
- }
109
- declare var pushState: ChangeMethod;
110
- declare var replaceState: ChangeMethod;
111
- declare var locationAssign: ChangeMethod;
112
- declare var locationReplace: ChangeMethod;
113
- declare type ConfigPersist = {
114
- method?: ChangeMethod,
115
- state?: StateBehavior,
116
- timeout?: number,
117
- ...
118
- } & ConfigPersist$1;
119
- declare type ConfigStore<State, Err = Error> = { ... } & QueryConfig &
120
- ConfigStore$1<State, Err>;
121
- declare type ConfigSourceTarget<State, Err = Error> = { ... } & QueryConfig &
122
- ConfigSourceTarget$1<State, Err>;
123
- declare interface Persist {
124
- <State, Err>(config: ConfigSourceTarget<State, Err>): Subscription;
125
- <State, Err>(config: ConfigStore<State, Err>): Subscription;
126
- }
127
- declare var query: typeof npm$namespace$query;
128
-
129
- declare var npm$namespace$query: {|
130
- (config?: QueryConfig): StorageAdapter,
131
- factory: typeof query$factory,
132
- |};
133
- declare var query$factory: true;
134
- declare function createPersist(defaults?: ConfigPersist): Persist;
135
- declare var persist: Persist;
136
- export type {
137
- ChangeMethod,
138
- ConfigPersist,
139
- ConfigSourceTarget,
140
- ConfigStore,
141
- Contract,
142
- Done,
143
- Fail,
144
- Finally,
145
- Persist,
146
- QueryConfig,
147
- StateBehavior,
148
- StorageAdapter,
149
- StorageAdapterFactory,
150
- };
151
- declare export {
152
- createPersist,
153
- locationAssign,
154
- locationReplace,
155
- persist,
156
- pushState,
157
- query,
158
- replaceState,
159
- };
@@ -1,140 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
-
8
- import { Unit, Store, Event, Effect, Subscription } from "effector";
9
- declare interface StorageAdapter {
10
- <State>(
11
- key: string,
12
- update: (raw?: any) => void
13
- ): {
14
- get(raw?: any, ctx?: any): State | Promise<State | void> | void,
15
- set(value: State, ctx?: any): void,
16
- ...
17
- };
18
- keyArea?: any;
19
- noop?: boolean;
20
- }
21
- declare interface StorageAdapterFactory<AdapterConfig> {
22
- (config?: AdapterConfig): StorageAdapter;
23
- factory: true;
24
- }
25
- declare type Contract<Data> =
26
- | ((raw: mixed) => boolean)
27
- | {
28
- isData: (raw: mixed) => boolean,
29
- getErrorMessages: (raw: mixed) => string[],
30
- ...
31
- };
32
- declare type Done<State> = {
33
- key: string,
34
- keyPrefix: string,
35
- operation: "set" | "get",
36
- value: State,
37
- ...
38
- };
39
- declare type Fail<Err> = {
40
- key: string,
41
- keyPrefix: string,
42
- operation: "set" | "get",
43
- error: Err,
44
- value?: any,
45
- ...
46
- };
47
- declare type Finally<State, Err> =
48
- | {
49
- ...Done<State>,
50
- ...{
51
- status: "done",
52
- ...
53
- },
54
- }
55
- | {
56
- ...Fail<Err>,
57
- ...{
58
- status: "fail",
59
- ...
60
- },
61
- };
62
- declare interface ConfigPersist$1 {
63
- pickup?: Unit<any> | Unit<any>[];
64
- context?: Unit<any>;
65
- keyPrefix?: string;
66
- contract?: Contract<any>;
67
- }
68
- declare interface ConfigCommon<State, Err = Error> {
69
- clock?: Unit<any>;
70
- done?: Unit<Done<State>>;
71
- fail?: Unit<Fail<Err>>;
72
- finally?: Unit<Finally<State, Err>>;
73
- pickup?: Unit<any> | Unit<any>[];
74
- context?: Unit<any>;
75
- key?: string;
76
- keyPrefix?: string;
77
- contract?: Contract<State | void>;
78
- }
79
- declare interface ConfigJustStore<State> {
80
- store: Store<State>;
81
- }
82
- declare interface ConfigJustSourceTarget<State> {
83
- source: Store<State> | Event<State> | Effect<State, any, any>;
84
- target: Store<State> | Event<State> | Effect<State, any, any>;
85
- }
86
- declare type ConfigStore$1<State, Err = Error> = { ... } & ConfigCommon<
87
- State,
88
- Err
89
- > &
90
- ConfigJustStore<State>;
91
- declare type ConfigSourceTarget$1<State, Err = Error> = { ... } & ConfigCommon<
92
- State,
93
- Err
94
- > &
95
- ConfigJustSourceTarget<State>;
96
- declare type ConfigPersist = {
97
- sync?: boolean | "force",
98
- timeout?: number,
99
- ...
100
- } & ConfigPersist$1;
101
- declare interface SessionStorageConfig {
102
- sync?: boolean | "force";
103
- serialize?: (value: any) => string;
104
- deserialize?: (value: string) => any;
105
- timeout?: number;
106
- def?: any;
107
- }
108
- declare type ConfigStore<State, Err = Error> = { ... } & SessionStorageConfig &
109
- ConfigStore$1<State, Err>;
110
- declare type ConfigSourceTarget<State, Err = Error> = {
111
- ...
112
- } & SessionStorageConfig &
113
- ConfigSourceTarget$1<State, Err>;
114
- declare interface Persist {
115
- <State, Err>(config: ConfigSourceTarget<State, Err>): Subscription;
116
- <State, Err>(config: ConfigStore<State, Err>): Subscription;
117
- }
118
- declare var session: typeof npm$namespace$session;
119
-
120
- declare var npm$namespace$session: {|
121
- (config?: SessionStorageConfig): StorageAdapter,
122
- factory: typeof session$factory,
123
- |};
124
- declare var session$factory: true;
125
- declare function createPersist(defaults?: ConfigPersist): Persist;
126
- declare var persist: Persist;
127
- export type {
128
- ConfigPersist,
129
- ConfigSourceTarget,
130
- ConfigStore,
131
- Contract,
132
- Done,
133
- Fail,
134
- Finally,
135
- Persist,
136
- SessionStorageConfig,
137
- StorageAdapter,
138
- StorageAdapterFactory,
139
- };
140
- declare export { createPersist, persist, session };
@@ -1,36 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
-
8
- declare interface StorageAdapter {
9
- <State>(
10
- key: string,
11
- update: (raw?: any) => void
12
- ): {
13
- get(raw?: any, ctx?: any): State | Promise<State | void> | void,
14
- set(value: State, ctx?: any): void,
15
- ...
16
- };
17
- keyArea?: any;
18
- noop?: boolean;
19
- }
20
- declare interface StorageConfig {
21
- storage: () => Storage;
22
- sync?: boolean | "force";
23
- serialize?: (value: any) => string;
24
- deserialize?: (value: string) => any;
25
- timeout?: number;
26
- def?: any;
27
- }
28
- declare var storage: typeof npm$namespace$storage;
29
-
30
- declare var npm$namespace$storage: {|
31
- (x: StorageConfig): StorageAdapter,
32
- factory: typeof storage$factory,
33
- |};
34
- declare var storage$factory: true;
35
- export type { StorageConfig };
36
- declare export { storage };
@@ -1,104 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
-
8
- // see https://gist.github.com/thecotne/6e5969f4aaf8f253985ed36b30ac9fe0
9
- type $FlowGen$If<X: boolean, Then, Else = empty> = $Call<
10
- ((true, Then, Else) => Then) & ((false, Then, Else) => Else),
11
- X,
12
- Then,
13
- Else
14
- >;
15
-
16
- type $FlowGen$Assignable<A, B> = $Call<
17
- ((...r: [B]) => true) & ((...r: [A]) => false),
18
- A
19
- >;
20
-
21
- import { StoreWritable, Effect, EventCallable } from "effector";
22
- declare interface StorageAdapter {
23
- <State>(
24
- key: string,
25
- update: (raw?: any) => void
26
- ): {
27
- get(raw?: any, ctx?: any): State | Promise<State | void> | void,
28
- set(value: State, ctx?: any): void,
29
- ...
30
- };
31
- keyArea?: any;
32
- noop?: boolean;
33
- }
34
- declare interface StorageAdapterFactory<AdapterConfig> {
35
- (config?: AdapterConfig): StorageAdapter;
36
- factory: true;
37
- }
38
- declare function async<A: StorageAdapter | StorageAdapterFactory<any>>(
39
- adapter: A
40
- ): $FlowGen$If<
41
- $FlowGen$Assignable<A, StorageAdapterFactory<T>>,
42
- StorageAdapterFactory<T>,
43
- StorageAdapter
44
- >;
45
- declare function either<
46
- A1: StorageAdapter | StorageAdapterFactory<any>,
47
- A2: StorageAdapter | StorageAdapterFactory<any>
48
- >(
49
- one: A1,
50
- another: A2
51
- ): $FlowGen$If<
52
- $FlowGen$Assignable<A1, StorageAdapterFactory<T1>>,
53
- $FlowGen$If<
54
- $FlowGen$Assignable<A2, StorageAdapterFactory<T2>>,
55
- StorageAdapterFactory<{ ...T1, ...T2 }>,
56
- StorageAdapterFactory<T1>
57
- >,
58
- $FlowGen$If<
59
- $FlowGen$Assignable<A2, StorageAdapterFactory<T2>>,
60
- StorageAdapterFactory<T2>,
61
- StorageAdapter
62
- >
63
- >;
64
- declare type CacheAdapter = {
65
- __: {
66
- $instance: StoreWritable<CacheAdapterInstance>,
67
- ...
68
- },
69
- ...
70
- } & CacheAdapterInstance;
71
- declare interface CacheAdapterInstance {
72
- get: Effect<
73
- {
74
- key: string,
75
- ...
76
- },
77
- {
78
- value: mixed,
79
- cachedAt: number,
80
- ...
81
- } | null
82
- >;
83
- set: Effect<
84
- {
85
- key: string,
86
- value: mixed,
87
- ...
88
- },
89
- void
90
- >;
91
- purge: EventCallable<void>;
92
- unset: Effect<
93
- {
94
- key: string,
95
- ...
96
- },
97
- void
98
- >;
99
- }
100
- declare function farcached(
101
- adapter: CacheAdapter,
102
- keyArea?: any
103
- ): StorageAdapter;
104
- declare export { async, either, farcached };