effector-storage 6.1.0 → 7.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.
- package/README.md +7 -40
- package/async-storage/index.cjs.map +1 -1
- package/async-storage/index.d.cts +24 -0
- package/async-storage/index.d.ts +14 -18
- package/async-storage/index.js.flow +6 -5
- package/async-storage/index.js.map +1 -1
- package/async-storage/package.json +15 -2
- package/broadcast/index.cjs.map +1 -1
- package/broadcast/index.d.cts +94 -0
- package/broadcast/index.d.ts +63 -85
- package/broadcast/index.js.flow +23 -25
- package/broadcast/index.js.map +1 -1
- package/broadcast/package.json +15 -2
- package/core/index.cjs +1 -1
- package/core/index.cjs.map +1 -1
- package/core/index.d.cts +77 -0
- package/core/index.d.ts +53 -66
- package/core/index.js +1 -1
- package/core/index.js.flow +14 -14
- package/core/index.js.map +1 -1
- package/core/package.json +15 -2
- package/index.d.cts +97 -0
- package/index.d.ts +68 -99
- package/index.js.flow +27 -28
- package/local/index.d.cts +99 -0
- package/local/index.d.ts +67 -90
- package/local/index.js.flow +25 -27
- package/local/package.json +15 -2
- package/log/index.cjs.map +1 -1
- package/log/index.d.cts +19 -0
- package/log/index.d.ts +11 -11
- package/log/index.js.flow +6 -5
- package/log/index.js.map +1 -1
- package/log/package.json +15 -2
- package/memory/index.d.cts +95 -0
- package/memory/index.d.ts +63 -82
- package/memory/index.js.flow +23 -25
- package/memory/package.json +15 -2
- package/nil/index.cjs.map +1 -1
- package/nil/index.d.cts +18 -0
- package/nil/index.d.ts +10 -10
- package/nil/index.js.flow +6 -5
- package/nil/index.js.map +1 -1
- package/nil/package.json +15 -2
- package/package.json +101 -57
- package/query/index.cjs.map +1 -1
- package/query/index.d.cts +108 -0
- package/query/index.d.ts +75 -104
- package/query/index.js.flow +30 -28
- package/query/index.js.map +1 -1
- package/query/package.json +15 -2
- package/session/index.d.cts +99 -0
- package/session/index.d.ts +67 -90
- package/session/index.js.flow +25 -27
- package/session/package.json +15 -2
- package/storage/index.cjs.map +1 -1
- package/storage/index.d.cts +23 -0
- package/storage/index.d.ts +15 -22
- package/storage/index.js.flow +7 -6
- package/storage/index.js.map +1 -1
- package/storage/package.json +15 -2
- package/tools/index.cjs.map +1 -1
- package/tools/{index.cjs.d.ts → index.d.cts} +33 -58
- package/tools/index.d.ts +33 -58
- package/tools/index.js.flow +13 -10
- package/tools/index.js.map +1 -1
- package/tools/package.json +15 -2
- package/async-storage/index.cjs.d.ts +0 -28
- package/broadcast/index.cjs.d.ts +0 -116
- package/core/index.cjs.d.ts +0 -90
- package/index.cjs.d.ts +0 -128
- package/local/index.cjs.d.ts +0 -122
- package/log/index.cjs.d.ts +0 -19
- package/memory/index.cjs.d.ts +0 -114
- package/nil/index.cjs.d.ts +0 -18
- package/query/index.cjs.d.ts +0 -137
- package/rn/async/index.cjs +0 -2
- package/rn/async/index.cjs.d.ts +0 -120
- package/rn/async/index.cjs.map +0 -1
- package/rn/async/index.d.ts +0 -120
- package/rn/async/index.js +0 -2
- package/rn/async/index.js.flow +0 -135
- package/rn/async/index.js.map +0 -1
- package/rn/async/package.json +0 -8
- package/rn/encrypted/index.cjs +0 -2
- package/rn/encrypted/index.cjs.d.ts +0 -120
- package/rn/encrypted/index.cjs.map +0 -1
- package/rn/encrypted/index.d.ts +0 -120
- package/rn/encrypted/index.js +0 -2
- package/rn/encrypted/index.js.flow +0 -137
- package/rn/encrypted/index.js.map +0 -1
- package/rn/encrypted/package.json +0 -8
- package/session/index.cjs.d.ts +0 -122
- package/storage/index.cjs.d.ts +0 -30
package/session/index.cjs.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Unit, Store, Event, Effect, Subscription } from 'effector'
|
|
2
|
-
|
|
3
|
-
interface StorageAdapter {
|
|
4
|
-
<State>(key: string, update: (raw?: any) => any): {
|
|
5
|
-
get(raw?: any, ctx?: any): State | Promise<State | undefined> | undefined
|
|
6
|
-
set(value: State, ctx?: any): void
|
|
7
|
-
}
|
|
8
|
-
keyArea?: any
|
|
9
|
-
noop?: boolean
|
|
10
|
-
}
|
|
11
|
-
interface StorageAdapterFactory<AdapterConfig> {
|
|
12
|
-
(config?: AdapterConfig): StorageAdapter
|
|
13
|
-
factory: true
|
|
14
|
-
}
|
|
15
|
-
type Contract<Data> =
|
|
16
|
-
| ((raw: unknown) => raw is Data)
|
|
17
|
-
| {
|
|
18
|
-
isData: (raw: unknown) => raw is Data
|
|
19
|
-
getErrorMessages: (raw: unknown) => string[]
|
|
20
|
-
}
|
|
21
|
-
type Done<State> = {
|
|
22
|
-
key: string
|
|
23
|
-
keyPrefix: string
|
|
24
|
-
operation: 'set' | 'get'
|
|
25
|
-
value: State
|
|
26
|
-
}
|
|
27
|
-
type Fail<Err> = {
|
|
28
|
-
key: string
|
|
29
|
-
keyPrefix: string
|
|
30
|
-
operation: 'set' | 'get'
|
|
31
|
-
error: Err
|
|
32
|
-
value?: any
|
|
33
|
-
}
|
|
34
|
-
type Finally<State, Err> =
|
|
35
|
-
| (Done<State> & {
|
|
36
|
-
status: 'done'
|
|
37
|
-
})
|
|
38
|
-
| (Fail<Err> & {
|
|
39
|
-
status: 'fail'
|
|
40
|
-
})
|
|
41
|
-
interface ConfigPersist$1 {
|
|
42
|
-
pickup?: Unit<any>
|
|
43
|
-
context?: Unit<any>
|
|
44
|
-
keyPrefix?: string
|
|
45
|
-
contract?: Contract<any>
|
|
46
|
-
}
|
|
47
|
-
interface ConfigCommon<State, Err = Error> {
|
|
48
|
-
clock?: Unit<any>
|
|
49
|
-
done?: Unit<Done<State>>
|
|
50
|
-
fail?: Unit<Fail<Err>>
|
|
51
|
-
finally?: Unit<Finally<State, Err>>
|
|
52
|
-
pickup?: Unit<any>
|
|
53
|
-
context?: Unit<any>
|
|
54
|
-
key?: string
|
|
55
|
-
keyPrefix?: string
|
|
56
|
-
contract?: Contract<State | undefined>
|
|
57
|
-
}
|
|
58
|
-
interface ConfigJustStore<State> {
|
|
59
|
-
store: Store<State>
|
|
60
|
-
}
|
|
61
|
-
interface ConfigJustSourceTarget<State> {
|
|
62
|
-
source: Store<State> | Event<State> | Effect<State, any, any>
|
|
63
|
-
target: Store<State> | Event<State> | Effect<State, any, any>
|
|
64
|
-
}
|
|
65
|
-
interface ConfigStore$1<State, Err = Error>
|
|
66
|
-
extends ConfigCommon<State, Err>,
|
|
67
|
-
ConfigJustStore<State> {}
|
|
68
|
-
interface ConfigSourceTarget$1<State, Err = Error>
|
|
69
|
-
extends ConfigCommon<State, Err>,
|
|
70
|
-
ConfigJustSourceTarget<State> {}
|
|
71
|
-
|
|
72
|
-
interface ConfigPersist extends ConfigPersist$1 {
|
|
73
|
-
sync?: boolean | 'force'
|
|
74
|
-
timeout?: number
|
|
75
|
-
}
|
|
76
|
-
interface SessionStorageConfig {
|
|
77
|
-
sync?: boolean | 'force'
|
|
78
|
-
serialize?: (value: any) => string
|
|
79
|
-
deserialize?: (value: string) => any
|
|
80
|
-
timeout?: number
|
|
81
|
-
def?: any
|
|
82
|
-
}
|
|
83
|
-
interface ConfigStore<State, Err = Error>
|
|
84
|
-
extends SessionStorageConfig,
|
|
85
|
-
ConfigStore$1<State, Err> {}
|
|
86
|
-
interface ConfigSourceTarget<State, Err = Error>
|
|
87
|
-
extends SessionStorageConfig,
|
|
88
|
-
ConfigSourceTarget$1<State, Err> {}
|
|
89
|
-
interface Persist {
|
|
90
|
-
<State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription
|
|
91
|
-
<State, Err = Error>(config: ConfigStore<State, Err>): Subscription
|
|
92
|
-
}
|
|
93
|
-
declare function session(config?: SessionStorageConfig): StorageAdapter
|
|
94
|
-
declare namespace session {
|
|
95
|
-
var factory: true
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Creates custom partially applied `persist`
|
|
99
|
-
* with predefined `sessionStorage` adapter
|
|
100
|
-
*/
|
|
101
|
-
declare function createPersist(defaults?: ConfigPersist): Persist
|
|
102
|
-
/**
|
|
103
|
-
* Default partially applied `persist`
|
|
104
|
-
*/
|
|
105
|
-
declare const persist: Persist
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
ConfigPersist,
|
|
109
|
-
ConfigSourceTarget,
|
|
110
|
-
ConfigStore,
|
|
111
|
-
Contract,
|
|
112
|
-
Done,
|
|
113
|
-
Fail,
|
|
114
|
-
Finally,
|
|
115
|
-
Persist,
|
|
116
|
-
SessionStorageConfig,
|
|
117
|
-
StorageAdapter,
|
|
118
|
-
StorageAdapterFactory,
|
|
119
|
-
createPersist,
|
|
120
|
-
persist,
|
|
121
|
-
session,
|
|
122
|
-
}
|
package/storage/index.cjs.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
interface StorageAdapter {
|
|
2
|
-
<State>(key: string, update: (raw?: any) => any): {
|
|
3
|
-
get(raw?: any, ctx?: any): State | Promise<State | undefined> | undefined
|
|
4
|
-
set(value: State, ctx?: any): void
|
|
5
|
-
}
|
|
6
|
-
keyArea?: any
|
|
7
|
-
noop?: boolean
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface StorageConfig {
|
|
11
|
-
storage: () => Storage
|
|
12
|
-
sync?: boolean | 'force'
|
|
13
|
-
serialize?: (value: any) => string
|
|
14
|
-
deserialize?: (value: string) => any
|
|
15
|
-
timeout?: number
|
|
16
|
-
def?: any
|
|
17
|
-
}
|
|
18
|
-
declare function storage({
|
|
19
|
-
storage,
|
|
20
|
-
sync,
|
|
21
|
-
serialize,
|
|
22
|
-
deserialize,
|
|
23
|
-
timeout,
|
|
24
|
-
def,
|
|
25
|
-
}: StorageConfig): StorageAdapter
|
|
26
|
-
declare namespace storage {
|
|
27
|
-
var factory: true
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { StorageConfig, storage }
|