effector-storage 6.1.1 → 7.1.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} +34 -58
- package/tools/index.d.ts +34 -58
- package/tools/index.js.flow +19 -16
- 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/index.cjs.d.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { Unit, Subscription, Store, Event, Effect } from 'effector'
|
|
2
|
-
export { AsyncStorageConfig, asyncStorage } from './async-storage'
|
|
3
|
-
export { BroadcastConfig, broadcast } from './broadcast'
|
|
4
|
-
export { LocalStorageConfig, local } from './local'
|
|
5
|
-
export { LogConfig, log } from './log'
|
|
6
|
-
export { MemoryConfig, memory } from './memory'
|
|
7
|
-
export { NilConfig, nil } from './nil'
|
|
8
|
-
export { QueryConfig, query } from './query'
|
|
9
|
-
export { SessionStorageConfig, session } from './session'
|
|
10
|
-
export { StorageConfig, storage } from './storage'
|
|
11
|
-
export { async, either, farcached } from './tools'
|
|
12
|
-
|
|
13
|
-
interface StorageAdapter {
|
|
14
|
-
<State>(key: string, update: (raw?: any) => any): {
|
|
15
|
-
get(raw?: any, ctx?: any): State | Promise<State | undefined> | undefined
|
|
16
|
-
set(value: State, ctx?: any): void
|
|
17
|
-
}
|
|
18
|
-
keyArea?: any
|
|
19
|
-
noop?: boolean
|
|
20
|
-
}
|
|
21
|
-
interface StorageAdapterFactory<AdapterConfig> {
|
|
22
|
-
(config?: AdapterConfig): StorageAdapter
|
|
23
|
-
factory: true
|
|
24
|
-
}
|
|
25
|
-
type Contract<Data> =
|
|
26
|
-
| ((raw: unknown) => raw is Data)
|
|
27
|
-
| {
|
|
28
|
-
isData: (raw: unknown) => raw is Data
|
|
29
|
-
getErrorMessages: (raw: unknown) => string[]
|
|
30
|
-
}
|
|
31
|
-
type Done<State> = {
|
|
32
|
-
key: string
|
|
33
|
-
keyPrefix: string
|
|
34
|
-
operation: 'set' | 'get'
|
|
35
|
-
value: State
|
|
36
|
-
}
|
|
37
|
-
type Fail<Err> = {
|
|
38
|
-
key: string
|
|
39
|
-
keyPrefix: string
|
|
40
|
-
operation: 'set' | 'get'
|
|
41
|
-
error: Err
|
|
42
|
-
value?: any
|
|
43
|
-
}
|
|
44
|
-
type Finally<State, Err> =
|
|
45
|
-
| (Done<State> & {
|
|
46
|
-
status: 'done'
|
|
47
|
-
})
|
|
48
|
-
| (Fail<Err> & {
|
|
49
|
-
status: 'fail'
|
|
50
|
-
})
|
|
51
|
-
interface ConfigPersist {
|
|
52
|
-
pickup?: Unit<any>
|
|
53
|
-
context?: Unit<any>
|
|
54
|
-
keyPrefix?: string
|
|
55
|
-
contract?: Contract<any>
|
|
56
|
-
}
|
|
57
|
-
interface ConfigAdapter {
|
|
58
|
-
adapter: StorageAdapter
|
|
59
|
-
}
|
|
60
|
-
interface ConfigAdapterFactory<AdapterConfig> {
|
|
61
|
-
adapter: StorageAdapterFactory<AdapterConfig>
|
|
62
|
-
}
|
|
63
|
-
interface ConfigCommon<State, Err = Error> {
|
|
64
|
-
clock?: Unit<any>
|
|
65
|
-
done?: Unit<Done<State>>
|
|
66
|
-
fail?: Unit<Fail<Err>>
|
|
67
|
-
finally?: Unit<Finally<State, Err>>
|
|
68
|
-
pickup?: Unit<any>
|
|
69
|
-
context?: Unit<any>
|
|
70
|
-
key?: string
|
|
71
|
-
keyPrefix?: string
|
|
72
|
-
contract?: Contract<State | undefined>
|
|
73
|
-
}
|
|
74
|
-
interface ConfigJustStore<State> {
|
|
75
|
-
store: Store<State>
|
|
76
|
-
}
|
|
77
|
-
interface ConfigJustSourceTarget<State> {
|
|
78
|
-
source: Store<State> | Event<State> | Effect<State, any, any>
|
|
79
|
-
target: Store<State> | Event<State> | Effect<State, any, any>
|
|
80
|
-
}
|
|
81
|
-
interface ConfigStore<State, Err = Error>
|
|
82
|
-
extends ConfigCommon<State, Err>,
|
|
83
|
-
ConfigJustStore<State> {}
|
|
84
|
-
interface ConfigSourceTarget<State, Err = Error>
|
|
85
|
-
extends ConfigCommon<State, Err>,
|
|
86
|
-
ConfigJustSourceTarget<State> {}
|
|
87
|
-
interface Persist {
|
|
88
|
-
<State, Err = Error>(
|
|
89
|
-
config: ConfigAdapter & ConfigSourceTarget<State, Err>
|
|
90
|
-
): Subscription
|
|
91
|
-
<State, Err = Error>(
|
|
92
|
-
config: ConfigAdapter & ConfigStore<State, Err>
|
|
93
|
-
): Subscription
|
|
94
|
-
<AdapterConfig, State, Err = Error>(
|
|
95
|
-
config: ConfigAdapterFactory<AdapterConfig> &
|
|
96
|
-
ConfigSourceTarget<State, Err> &
|
|
97
|
-
AdapterConfig
|
|
98
|
-
): Subscription
|
|
99
|
-
<AdapterConfig, State, Err = Error>(
|
|
100
|
-
config: ConfigAdapterFactory<AdapterConfig> &
|
|
101
|
-
ConfigStore<State, Err> &
|
|
102
|
-
AdapterConfig
|
|
103
|
-
): Subscription
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Creates custom `persist`
|
|
108
|
-
*/
|
|
109
|
-
declare function createPersist(defaults?: ConfigPersist): Persist
|
|
110
|
-
/**
|
|
111
|
-
* Default `persist`
|
|
112
|
-
*/
|
|
113
|
-
declare const persist: Persist
|
|
114
|
-
|
|
115
|
-
export {
|
|
116
|
-
ConfigPersist,
|
|
117
|
-
ConfigSourceTarget,
|
|
118
|
-
ConfigStore,
|
|
119
|
-
Contract,
|
|
120
|
-
Done,
|
|
121
|
-
Fail,
|
|
122
|
-
Finally,
|
|
123
|
-
Persist,
|
|
124
|
-
StorageAdapter,
|
|
125
|
-
StorageAdapterFactory,
|
|
126
|
-
createPersist,
|
|
127
|
-
persist,
|
|
128
|
-
}
|
package/local/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 LocalStorageConfig {
|
|
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 LocalStorageConfig,
|
|
85
|
-
ConfigStore$1<State, Err> {}
|
|
86
|
-
interface ConfigSourceTarget<State, Err = Error>
|
|
87
|
-
extends LocalStorageConfig,
|
|
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 local(config?: LocalStorageConfig): StorageAdapter
|
|
94
|
-
declare namespace local {
|
|
95
|
-
var factory: true
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Creates custom partially applied `persist`
|
|
99
|
-
* with predefined `localStorage` 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
|
-
LocalStorageConfig,
|
|
116
|
-
Persist,
|
|
117
|
-
StorageAdapter,
|
|
118
|
-
StorageAdapterFactory,
|
|
119
|
-
createPersist,
|
|
120
|
-
local,
|
|
121
|
-
persist,
|
|
122
|
-
}
|
package/log/index.cjs.d.ts
DELETED
|
@@ -1,19 +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 LogConfig {
|
|
11
|
-
keyArea?: any
|
|
12
|
-
logger?: (msg: string) => void
|
|
13
|
-
}
|
|
14
|
-
declare function log({ keyArea, logger }?: LogConfig): StorageAdapter
|
|
15
|
-
declare namespace log {
|
|
16
|
-
var factory: true
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { LogConfig, log }
|
package/memory/index.cjs.d.ts
DELETED
|
@@ -1,114 +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 MemoryConfig {
|
|
73
|
-
area?: Map<string, any>
|
|
74
|
-
}
|
|
75
|
-
declare function adapter({ area }?: MemoryConfig): StorageAdapter
|
|
76
|
-
declare namespace adapter {
|
|
77
|
-
var factory: true
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
interface ConfigPersist extends ConfigPersist$1 {}
|
|
81
|
-
interface ConfigStore<State, Err = Error> extends ConfigStore$1<State, Err> {}
|
|
82
|
-
interface ConfigSourceTarget<State, Err = Error>
|
|
83
|
-
extends ConfigSourceTarget$1<State, Err> {}
|
|
84
|
-
interface Persist {
|
|
85
|
-
<State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription
|
|
86
|
-
<State, Err = Error>(config: ConfigStore<State, Err>): Subscription
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Creates custom partially applied `persist`
|
|
91
|
-
* with predefined `memory` adapter
|
|
92
|
-
*/
|
|
93
|
-
declare function createPersist(defaults?: ConfigPersist): Persist
|
|
94
|
-
/**
|
|
95
|
-
* Default partially applied `persist`
|
|
96
|
-
*/
|
|
97
|
-
declare const persist: Persist
|
|
98
|
-
|
|
99
|
-
export {
|
|
100
|
-
ConfigPersist,
|
|
101
|
-
ConfigSourceTarget,
|
|
102
|
-
ConfigStore,
|
|
103
|
-
Contract,
|
|
104
|
-
Done,
|
|
105
|
-
Fail,
|
|
106
|
-
Finally,
|
|
107
|
-
MemoryConfig,
|
|
108
|
-
Persist,
|
|
109
|
-
StorageAdapter,
|
|
110
|
-
StorageAdapterFactory,
|
|
111
|
-
createPersist,
|
|
112
|
-
adapter as memory,
|
|
113
|
-
persist,
|
|
114
|
-
}
|
package/nil/index.cjs.d.ts
DELETED
|
@@ -1,18 +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 NilConfig {
|
|
11
|
-
keyArea?: any
|
|
12
|
-
}
|
|
13
|
-
declare function nil({ keyArea }?: NilConfig): StorageAdapter
|
|
14
|
-
declare namespace nil {
|
|
15
|
-
var factory: true
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { NilConfig, nil }
|
package/query/index.cjs.d.ts
DELETED
|
@@ -1,137 +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
|
-
type ChangeMethod = (params: URLSearchParams | string, erase?: boolean) => void
|
|
73
|
-
type StateBehavior = 'keep' | 'erase'
|
|
74
|
-
interface QueryConfig {
|
|
75
|
-
method?: ChangeMethod
|
|
76
|
-
state?: StateBehavior
|
|
77
|
-
serialize?: (value: any) => string
|
|
78
|
-
deserialize?: (value: string) => any
|
|
79
|
-
timeout?: number
|
|
80
|
-
def?: any
|
|
81
|
-
}
|
|
82
|
-
declare const pushState: ChangeMethod
|
|
83
|
-
declare const replaceState: ChangeMethod
|
|
84
|
-
declare const locationAssign: ChangeMethod
|
|
85
|
-
declare const locationReplace: ChangeMethod
|
|
86
|
-
|
|
87
|
-
interface ConfigPersist extends ConfigPersist$1 {
|
|
88
|
-
method?: ChangeMethod
|
|
89
|
-
state?: StateBehavior
|
|
90
|
-
timeout?: number
|
|
91
|
-
}
|
|
92
|
-
interface ConfigStore<State, Err = Error>
|
|
93
|
-
extends QueryConfig,
|
|
94
|
-
ConfigStore$1<State, Err> {}
|
|
95
|
-
interface ConfigSourceTarget<State, Err = Error>
|
|
96
|
-
extends QueryConfig,
|
|
97
|
-
ConfigSourceTarget$1<State, Err> {}
|
|
98
|
-
interface Persist {
|
|
99
|
-
<State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription
|
|
100
|
-
<State, Err = Error>(config: ConfigStore<State, Err>): Subscription
|
|
101
|
-
}
|
|
102
|
-
declare function query(config?: QueryConfig): StorageAdapter
|
|
103
|
-
declare namespace query {
|
|
104
|
-
var factory: true
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Creates custom partially applied `persist`
|
|
108
|
-
* with predefined `query` adapter
|
|
109
|
-
*/
|
|
110
|
-
declare function createPersist(defaults?: ConfigPersist): Persist
|
|
111
|
-
/**
|
|
112
|
-
* Default partially applied `persist`
|
|
113
|
-
*/
|
|
114
|
-
declare const persist: Persist
|
|
115
|
-
|
|
116
|
-
export {
|
|
117
|
-
ChangeMethod,
|
|
118
|
-
ConfigPersist,
|
|
119
|
-
ConfigSourceTarget,
|
|
120
|
-
ConfigStore,
|
|
121
|
-
Contract,
|
|
122
|
-
Done,
|
|
123
|
-
Fail,
|
|
124
|
-
Finally,
|
|
125
|
-
Persist,
|
|
126
|
-
QueryConfig,
|
|
127
|
-
StateBehavior,
|
|
128
|
-
StorageAdapter,
|
|
129
|
-
StorageAdapterFactory,
|
|
130
|
-
createPersist,
|
|
131
|
-
locationAssign,
|
|
132
|
-
locationReplace,
|
|
133
|
-
persist,
|
|
134
|
-
pushState,
|
|
135
|
-
query,
|
|
136
|
-
replaceState,
|
|
137
|
-
}
|
package/rn/async/index.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var r=require("../../core/index.cjs"),e=require("../../async-storage/index.cjs"),s=require("@react-native-async-storage/async-storage");function t(r){return e.asyncStorage({storage:()=>s,...r})}function a(e){return s=>r.persist({adapter:t,...e,...s})}t.factory=!0;var c=a();exports.async=t,exports.createPersist=a,exports.persist=c;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
package/rn/async/index.cjs.d.ts
DELETED
|
@@ -1,120 +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
|
-
interface AsyncStorageConfig {
|
|
74
|
-
serialize?: (value: any) => string
|
|
75
|
-
deserialize?: (value: string) => any
|
|
76
|
-
}
|
|
77
|
-
interface ConfigStore<State, Err = Error>
|
|
78
|
-
extends AsyncStorageConfig,
|
|
79
|
-
ConfigStore$1<State, Err> {}
|
|
80
|
-
interface ConfigSourceTarget<State, Err = Error>
|
|
81
|
-
extends AsyncStorageConfig,
|
|
82
|
-
ConfigSourceTarget$1<State, Err> {}
|
|
83
|
-
interface Persist {
|
|
84
|
-
<State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription
|
|
85
|
-
<State, Err = Error>(config: ConfigStore<State, Err>): Subscription
|
|
86
|
-
}
|
|
87
|
-
declare function async(config?: AsyncStorageConfig): StorageAdapter
|
|
88
|
-
declare namespace async {
|
|
89
|
-
var factory: true
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Creates custom partially applied `persist`
|
|
93
|
-
* with predefined `AsyncStorage` adapter
|
|
94
|
-
*
|
|
95
|
-
* @deprecated use @effector-storage/react-native-async-storage instead
|
|
96
|
-
*/
|
|
97
|
-
declare function createPersist(defaults?: ConfigPersist): Persist
|
|
98
|
-
/**
|
|
99
|
-
* Default partially applied `persist`
|
|
100
|
-
*
|
|
101
|
-
* @deprecated use @effector-storage/react-native-async-storage instead
|
|
102
|
-
*/
|
|
103
|
-
declare const persist: Persist
|
|
104
|
-
|
|
105
|
-
export {
|
|
106
|
-
AsyncStorageConfig,
|
|
107
|
-
ConfigPersist,
|
|
108
|
-
ConfigSourceTarget,
|
|
109
|
-
ConfigStore,
|
|
110
|
-
Contract,
|
|
111
|
-
Done,
|
|
112
|
-
Fail,
|
|
113
|
-
Finally,
|
|
114
|
-
Persist,
|
|
115
|
-
StorageAdapter,
|
|
116
|
-
StorageAdapterFactory,
|
|
117
|
-
async,
|
|
118
|
-
createPersist,
|
|
119
|
-
persist,
|
|
120
|
-
}
|
package/rn/async/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/rn/async/index.ts"],"sourcesContent":["import type { Subscription } from 'effector'\nimport type {\n ConfigPersist as BaseConfigPersist,\n ConfigStore as BaseConfigStore,\n ConfigSourceTarget as BaseConfigSourceTarget,\n StorageAdapter,\n} from '../../types'\nimport { persist as base } from '../../core'\nimport { asyncStorage } from '../../async-storage'\nimport AsyncStorage from '@react-native-async-storage/async-storage'\n\nexport type {\n Contract,\n Done,\n Fail,\n Finally,\n StorageAdapter,\n StorageAdapterFactory,\n} from '../../types'\n\nexport interface ConfigPersist extends BaseConfigPersist {}\n\nexport interface AsyncStorageConfig {\n serialize?: (value: any) => string\n deserialize?: (value: string) => any\n}\n\nexport interface ConfigStore<State, Err = Error>\n extends AsyncStorageConfig,\n BaseConfigStore<State, Err> {}\n\nexport interface ConfigSourceTarget<State, Err = Error>\n extends AsyncStorageConfig,\n BaseConfigSourceTarget<State, Err> {}\n\nexport interface Persist {\n <State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription\n <State, Err = Error>(config: ConfigStore<State, Err>): Subscription\n}\n\n/**\n * Creates `AsyncStorage` adapter\n *\n * @deprecated use @effector-storage/react-native-async-storage instead\n */\nasync.factory = true as const\nexport function async(config?: AsyncStorageConfig): StorageAdapter {\n return asyncStorage({\n storage: () => AsyncStorage,\n ...config,\n })\n}\n\n/**\n * Creates custom partially applied `persist`\n * with predefined `AsyncStorage` adapter\n *\n * @deprecated use @effector-storage/react-native-async-storage instead\n */\nexport function createPersist(defaults?: ConfigPersist): Persist {\n return (config) =>\n base({\n adapter: async,\n ...defaults,\n ...config,\n })\n}\n\n/**\n * Default partially applied `persist`\n *\n * @deprecated use @effector-storage/react-native-async-storage instead\n */\nexport const persist = createPersist()\n"],"names":["async","config","asyncStorage","storage","AsyncStorage","createPersist","defaults","base","adapter","factory","persist"],"mappings":"qJA8CO,SAASA,EAAMC,GACpB,OAAOC,eAAa,CAClBC,QAASA,IAAMC,KACZH,GAEP,CAQO,SAASI,EAAcC,GAC5B,OAAQL,GACNM,EAAAA,QAAK,CACHC,QAASR,KACNM,KACAL,GAET,CArBAD,EAAMS,SAAU,EA4BHC,IAAAA,EAAUL"}
|