effector-storage 7.1.0 → 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 +105 -26
  11. package/broadcast/index.d.ts +105 -26
  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 +99 -21
  17. package/core/index.d.ts +99 -21
  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 +101 -22
  24. package/index.d.ts +101 -22
  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 +105 -26
  30. package/local/index.d.ts +105 -26
  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 +105 -26
  42. package/memory/index.d.ts +105 -26
  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 +105 -26
  55. package/query/index.d.ts +105 -26
  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 +105 -26
  61. package/session/index.d.ts +105 -26
  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,113 +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 {
63
- pickup?: Unit<any>;
64
- context?: Unit<any>;
65
- keyPrefix?: string;
66
- contract?: Contract<any>;
67
- }
68
- declare interface ConfigAdapter {
69
- adapter: StorageAdapter;
70
- }
71
- declare interface ConfigAdapterFactory<AdapterConfig> {
72
- adapter: StorageAdapterFactory<AdapterConfig>;
73
- }
74
- declare interface ConfigCommon<State, Err = Error> {
75
- clock?: Unit<any>;
76
- done?: Unit<Done<State>>;
77
- fail?: Unit<Fail<Err>>;
78
- finally?: Unit<Finally<State, Err>>;
79
- pickup?: Unit<any>;
80
- context?: Unit<any>;
81
- key?: string;
82
- keyPrefix?: string;
83
- contract?: Contract<State | void>;
84
- }
85
- declare interface ConfigJustStore<State> {
86
- store: Store<State>;
87
- }
88
- declare interface ConfigJustSourceTarget<State> {
89
- source: Store<State> | Event<State> | Effect<State, any, any>;
90
- target: Store<State> | Event<State> | Effect<State, any, any>;
91
- }
92
- declare type ConfigStore<State, Err = Error> = { ... } & ConfigCommon<
93
- State,
94
- Err
95
- > &
96
- ConfigJustStore<State>;
97
- declare type ConfigSourceTarget<State, Err = Error> = { ... } & ConfigCommon<
98
- State,
99
- Err
100
- > &
101
- ConfigJustSourceTarget<State>;
102
- declare function persist<State, Err>(
103
- config: $Rest<
104
- {
105
- ...ConfigAdapter | ConfigAdapterFactory<any>,
106
- ...ConfigPersist,
107
- ...ConfigStore<State, Err>,
108
- ...ConfigSourceTarget<State, Err>,
109
- },
110
- { ... }
111
- >
112
- ): Subscription;
113
- declare export { persist };
package/index.js.flow DELETED
@@ -1,146 +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, Subscription, Store, Event, Effect } from "effector";
9
- declare export { AsyncStorageConfig, asyncStorage } from "./async-storage";
10
- declare export { BroadcastConfig, broadcast } from "./broadcast";
11
- declare export { LocalStorageConfig, local } from "./local";
12
- declare export { LogConfig, log } from "./log";
13
- declare export { MemoryConfig, memory } from "./memory";
14
- declare export { NilConfig, nil } from "./nil";
15
- declare export { QueryConfig, query } from "./query";
16
- declare export { SessionStorageConfig, session } from "./session";
17
- declare export { StorageConfig, storage } from "./storage";
18
- declare export { async, either, farcached } from "./tools";
19
- declare interface StorageAdapter {
20
- <State>(
21
- key: string,
22
- update: (raw?: any) => void
23
- ): {
24
- get(raw?: any, ctx?: any): State | Promise<State | void> | void,
25
- set(value: State, ctx?: any): void,
26
- ...
27
- };
28
- keyArea?: any;
29
- noop?: boolean;
30
- }
31
- declare interface StorageAdapterFactory<AdapterConfig> {
32
- (config?: AdapterConfig): StorageAdapter;
33
- factory: true;
34
- }
35
- declare type Contract<Data> =
36
- | ((raw: mixed) => boolean)
37
- | {
38
- isData: (raw: mixed) => boolean,
39
- getErrorMessages: (raw: mixed) => string[],
40
- ...
41
- };
42
- declare type Done<State> = {
43
- key: string,
44
- keyPrefix: string,
45
- operation: "set" | "get",
46
- value: State,
47
- ...
48
- };
49
- declare type Fail<Err> = {
50
- key: string,
51
- keyPrefix: string,
52
- operation: "set" | "get",
53
- error: Err,
54
- value?: any,
55
- ...
56
- };
57
- declare type Finally<State, Err> =
58
- | {
59
- ...Done<State>,
60
- ...{
61
- status: "done",
62
- ...
63
- },
64
- }
65
- | {
66
- ...Fail<Err>,
67
- ...{
68
- status: "fail",
69
- ...
70
- },
71
- };
72
- declare interface ConfigPersist {
73
- pickup?: Unit<any>;
74
- context?: Unit<any>;
75
- keyPrefix?: string;
76
- contract?: Contract<any>;
77
- }
78
- declare interface ConfigAdapter {
79
- adapter: StorageAdapter;
80
- }
81
- declare interface ConfigAdapterFactory<AdapterConfig> {
82
- adapter: StorageAdapterFactory<AdapterConfig>;
83
- }
84
- declare interface ConfigCommon<State, Err = Error> {
85
- clock?: Unit<any>;
86
- done?: Unit<Done<State>>;
87
- fail?: Unit<Fail<Err>>;
88
- finally?: Unit<Finally<State, Err>>;
89
- pickup?: Unit<any>;
90
- context?: Unit<any>;
91
- key?: string;
92
- keyPrefix?: string;
93
- contract?: Contract<State | void>;
94
- }
95
- declare interface ConfigJustStore<State> {
96
- store: Store<State>;
97
- }
98
- declare interface ConfigJustSourceTarget<State> {
99
- source: Store<State> | Event<State> | Effect<State, any, any>;
100
- target: Store<State> | Event<State> | Effect<State, any, any>;
101
- }
102
- declare type ConfigStore<State, Err = Error> = { ... } & ConfigCommon<
103
- State,
104
- Err
105
- > &
106
- ConfigJustStore<State>;
107
- declare type ConfigSourceTarget<State, Err = Error> = { ... } & ConfigCommon<
108
- State,
109
- Err
110
- > &
111
- ConfigJustSourceTarget<State>;
112
- declare interface Persist {
113
- <State, Err>(config: {
114
- ...ConfigAdapter,
115
- ...ConfigSourceTarget<State, Err>,
116
- }): Subscription;
117
- <State, Err>(config: {
118
- ...ConfigAdapter,
119
- ...ConfigStore<State, Err>,
120
- }): Subscription;
121
- <AdapterConfig, State, Err>(config: {
122
- ...ConfigAdapterFactory<AdapterConfig>,
123
- ...ConfigSourceTarget<State, Err>,
124
- ...AdapterConfig,
125
- }): Subscription;
126
- <AdapterConfig, State, Err>(config: {
127
- ...ConfigAdapterFactory<AdapterConfig>,
128
- ...ConfigStore<State, Err>,
129
- ...AdapterConfig,
130
- }): Subscription;
131
- }
132
- declare function createPersist(defaults?: ConfigPersist): Persist;
133
- declare var persist: Persist;
134
- export type {
135
- ConfigPersist,
136
- ConfigSourceTarget,
137
- ConfigStore,
138
- Contract,
139
- Done,
140
- Fail,
141
- Finally,
142
- Persist,
143
- StorageAdapter,
144
- StorageAdapterFactory,
145
- };
146
- declare export { createPersist, persist };
@@ -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>;
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>;
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 LocalStorageConfig {
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> = { ... } & LocalStorageConfig &
109
- ConfigStore$1<State, Err>;
110
- declare type ConfigSourceTarget<State, Err = Error> = {
111
- ...
112
- } & LocalStorageConfig &
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 local: typeof npm$namespace$local;
119
-
120
- declare var npm$namespace$local: {|
121
- (config?: LocalStorageConfig): StorageAdapter,
122
- factory: typeof local$factory,
123
- |};
124
- declare var local$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
- LocalStorageConfig,
136
- Persist,
137
- StorageAdapter,
138
- StorageAdapterFactory,
139
- };
140
- declare export { createPersist, local, persist };
package/log/index.js.flow DELETED
@@ -1,32 +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 LogConfig {
21
- keyArea?: any;
22
- logger?: (msg: string) => void;
23
- }
24
- declare var log: typeof npm$namespace$log;
25
-
26
- declare var npm$namespace$log: {|
27
- (x?: LogConfig): StorageAdapter,
28
- factory: typeof log$factory,
29
- |};
30
- declare var log$factory: true;
31
- export type { LogConfig };
32
- declare export { log };
@@ -1,133 +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>;
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>;
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 interface MemoryConfig {
97
- area?: Map<string, any>;
98
- }
99
- declare var adapter: typeof npm$namespace$adapter;
100
-
101
- declare var npm$namespace$adapter: {|
102
- (x?: MemoryConfig): StorageAdapter,
103
- factory: typeof adapter$factory,
104
- |};
105
- declare var adapter$factory: true;
106
- declare type ConfigPersist = { ... } & ConfigPersist$1;
107
- declare type ConfigStore<State, Err = Error> = { ... } & ConfigStore$1<
108
- State,
109
- Err
110
- >;
111
- declare type ConfigSourceTarget<State, Err = Error> = {
112
- ...
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 function createPersist(defaults?: ConfigPersist): Persist;
119
- declare var persist: Persist;
120
- export type {
121
- ConfigPersist,
122
- ConfigSourceTarget,
123
- ConfigStore,
124
- Contract,
125
- Done,
126
- Fail,
127
- Finally,
128
- MemoryConfig,
129
- Persist,
130
- StorageAdapter,
131
- StorageAdapterFactory,
132
- };
133
- declare export { createPersist, adapter as memory, persist };
package/nil/index.js.flow DELETED
@@ -1,31 +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 NilConfig {
21
- keyArea?: any;
22
- }
23
- declare var nil: typeof npm$namespace$nil;
24
-
25
- declare var npm$namespace$nil: {|
26
- (x?: NilConfig): StorageAdapter,
27
- factory: typeof nil$factory,
28
- |};
29
- declare var nil$factory: true;
30
- export type { NilConfig };
31
- declare export { nil };