atom.io 0.9.10 → 0.10.1
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/dist/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +36 -56
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -55
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +30 -19
- package/internal/dist/index.d.ts +30 -19
- package/internal/dist/index.js +158 -186
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +159 -187
- package/internal/dist/index.mjs.map +1 -1
- package/internal/src/atom/create-atom.ts +5 -5
- package/internal/src/atom/delete-atom.ts +9 -2
- package/internal/src/caching.ts +5 -5
- package/internal/src/get-state-internal.ts +4 -4
- package/internal/src/mutable/create-mutable-atom.ts +2 -2
- package/internal/src/mutable/tracker.ts +1 -1
- package/internal/src/operation.ts +7 -7
- package/internal/src/selector/create-read-write-selector.ts +2 -8
- package/internal/src/selector/create-readonly-selector.ts +1 -1
- package/internal/src/selector/create-selector.ts +5 -3
- package/internal/src/selector/register-selector.ts +4 -11
- package/internal/src/selector/update-selector-atoms.ts +14 -14
- package/internal/src/set-state/copy-mutable-if-needed.ts +1 -1
- package/internal/src/set-state/copy-mutable-in-transaction.ts +1 -1
- package/internal/src/set-state/emit-update.ts +3 -3
- package/internal/src/set-state/evict-downstream.ts +5 -6
- package/internal/src/set-state/set-atom.ts +1 -4
- package/internal/src/set-state/stow-update.ts +10 -4
- package/internal/src/store/store.ts +27 -10
- package/internal/src/store/withdraw-new-family-member.ts +1 -1
- package/internal/src/store/withdraw.ts +1 -1
- package/internal/src/subscribe/recall-state.ts +2 -2
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +3 -3
- package/internal/src/timeline/add-atom-to-timeline.ts +8 -8
- package/internal/src/timeline/time-travel-internal.ts +12 -12
- package/internal/src/timeline/timeline-internal.ts +2 -2
- package/internal/src/transaction/abort-transaction.ts +3 -3
- package/internal/src/transaction/apply-transaction.ts +6 -6
- package/internal/src/transaction/build-transaction.ts +2 -3
- package/internal/src/transaction/redo-transaction.ts +1 -1
- package/internal/src/transaction/transaction-internal.ts +2 -2
- package/internal/src/transaction/undo-transaction.ts +1 -1
- package/package.json +10 -6
- package/react-devtools/dist/index.d.mts +3 -3
- package/react-devtools/dist/index.d.ts +3 -3
- package/realtime-client/dist/index.js +6 -9
- package/realtime-client/dist/index.js.map +1 -1
- package/realtime-client/dist/index.mjs +6 -9
- package/realtime-client/dist/index.mjs.map +1 -1
- package/realtime-client/src/use-server-action.ts +6 -8
- package/src/atom.ts +3 -0
- package/src/logger.ts +25 -36
- package/src/subscribe.ts +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transactors, FamilyMetadata, SelectorOptions, SelectorToken, ReadonlySelectorOptions, ReadonlySelectorToken, StateToken, ƒn, TransactionUpdate, TransactionOptions, TransactionToken, AtomToken, MutableAtomOptions, MutableAtomToken, MutableAtomFamilyOptions, MutableAtomFamily, AtomFamily, StateUpdate, TimelineUpdate, TimelineOptions, TimelineToken, ReadonlySelectorFamily, SelectorFamily, Logger, AtomOptions, AtomFamilyOptions, ReadonlySelectorFamilyOptions, SelectorFamilyOptions } from 'atom.io';
|
|
1
|
+
import { Transactors, FamilyMetadata as FamilyMetadata$1, SelectorOptions, SelectorToken, ReadonlySelectorOptions, ReadonlySelectorToken, StateToken, ƒn, TransactionUpdate, TransactionOptions, TransactionToken, AtomToken as AtomToken$1, MutableAtomOptions, MutableAtomToken, MutableAtomFamilyOptions, MutableAtomFamily, AtomFamily, StateUpdate, TimelineUpdate, TimelineOptions, TimelineToken, ReadonlySelectorFamily, SelectorFamily, AtomIOLogger, Logger, AtomOptions, AtomFamilyOptions, ReadonlySelectorFamilyOptions, SelectorFamilyOptions } from 'atom.io';
|
|
2
2
|
import { Json } from 'atom.io/json';
|
|
3
3
|
|
|
4
4
|
type AtomKey<T> = string & {
|
|
@@ -34,7 +34,7 @@ declare class Subject<T> {
|
|
|
34
34
|
type Selector<T> = {
|
|
35
35
|
key: string;
|
|
36
36
|
type: `selector`;
|
|
37
|
-
family?: FamilyMetadata;
|
|
37
|
+
family?: FamilyMetadata$1;
|
|
38
38
|
install: (store: Store) => void;
|
|
39
39
|
subject: Subject<{
|
|
40
40
|
newValue: T;
|
|
@@ -46,7 +46,7 @@ type Selector<T> = {
|
|
|
46
46
|
type ReadonlySelector<T> = {
|
|
47
47
|
key: string;
|
|
48
48
|
type: `readonly_selector`;
|
|
49
|
-
family?: FamilyMetadata;
|
|
49
|
+
family?: FamilyMetadata$1;
|
|
50
50
|
install: (store: Store) => void;
|
|
51
51
|
subject: Subject<{
|
|
52
52
|
newValue: T;
|
|
@@ -54,8 +54,8 @@ type ReadonlySelector<T> = {
|
|
|
54
54
|
}>;
|
|
55
55
|
get: () => T;
|
|
56
56
|
};
|
|
57
|
-
declare function createSelector<T>(options: SelectorOptions<T>, family?: FamilyMetadata, store?: Store): SelectorToken<T>;
|
|
58
|
-
declare function createSelector<T>(options: ReadonlySelectorOptions<T>, family?: FamilyMetadata, store?: Store): ReadonlySelectorToken<T>;
|
|
57
|
+
declare function createSelector<T>(options: SelectorOptions<T>, family?: FamilyMetadata$1, store?: Store): SelectorToken<T>;
|
|
58
|
+
declare function createSelector<T>(options: ReadonlySelectorOptions<T>, family?: FamilyMetadata$1, store?: Store): ReadonlySelectorToken<T>;
|
|
59
59
|
|
|
60
60
|
declare const traceSelectorAtoms: (selectorKey: string, directDependencyKey: StateKey<unknown>, store: Store) => AtomKey<unknown>[];
|
|
61
61
|
declare const traceAllSelectorAtoms: (selectorKey: string, store: Store) => AtomKey<unknown>[];
|
|
@@ -94,7 +94,7 @@ type TransactionIdle = {
|
|
|
94
94
|
};
|
|
95
95
|
type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
|
|
96
96
|
|
|
97
|
-
declare function deposit<T>(state: Atom<T>): AtomToken<T>;
|
|
97
|
+
declare function deposit<T>(state: Atom<T>): AtomToken$1<T>;
|
|
98
98
|
declare function deposit<T>(state: Selector<T>): SelectorToken<T>;
|
|
99
99
|
declare function deposit<T>(state: Atom<T> | Selector<T>): StateToken<T>;
|
|
100
100
|
declare function deposit<T>(state: ReadonlySelector<T>): ReadonlySelectorToken<T>;
|
|
@@ -181,9 +181,9 @@ declare function createMutableAtomFamily<Core extends Transceiver<any>, Serializ
|
|
|
181
181
|
|
|
182
182
|
declare const getJsonToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => SelectorToken<SerializableCore>;
|
|
183
183
|
|
|
184
|
-
declare const getUpdateToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => AtomToken<Signal<Core>>;
|
|
184
|
+
declare const getUpdateToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => AtomToken$1<Signal<Core>>;
|
|
185
185
|
|
|
186
|
-
declare function isAtomTokenMutable(token: AtomToken<any>): token is MutableAtomToken<any, any>;
|
|
186
|
+
declare function isAtomTokenMutable(token: AtomToken$1<any>): token is MutableAtomToken<any, any>;
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
189
|
* @internal Give the tracker a transceiver state and a store, and it will
|
|
@@ -197,7 +197,7 @@ declare class Tracker<Mutable extends Transceiver<any>> {
|
|
|
197
197
|
private observeCore;
|
|
198
198
|
private updateCore;
|
|
199
199
|
mutableState: MutableAtomToken<Mutable, Json.Serializable>;
|
|
200
|
-
latestUpdateState: AtomToken<typeof this.Update | null>;
|
|
200
|
+
latestUpdateState: AtomToken$1<typeof this.Update | null>;
|
|
201
201
|
constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store?: Store);
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -231,7 +231,7 @@ type TimelineAtomUpdate = StateUpdate<unknown> & {
|
|
|
231
231
|
key: string;
|
|
232
232
|
type: `atom_update`;
|
|
233
233
|
timestamp: number;
|
|
234
|
-
family?: FamilyMetadata;
|
|
234
|
+
family?: FamilyMetadata$1;
|
|
235
235
|
};
|
|
236
236
|
type TimelineSelectorUpdate = {
|
|
237
237
|
key: string;
|
|
@@ -258,7 +258,7 @@ type Timeline = {
|
|
|
258
258
|
};
|
|
259
259
|
declare function timeline__INTERNAL(options: TimelineOptions, store?: Store, data?: Timeline | null): TimelineToken;
|
|
260
260
|
|
|
261
|
-
declare const addAtomToTimeline: (atomToken: AtomToken<any>, tl: Timeline, store?: Store) => void;
|
|
261
|
+
declare const addAtomToTimeline: (atomToken: AtomToken$1<any>, tl: Timeline, store?: Store) => void;
|
|
262
262
|
|
|
263
263
|
declare const redo__INTERNAL: (token: TimelineToken, store?: Store) => void;
|
|
264
264
|
declare const undo__INTERNAL: (token: TimelineToken, store?: Store) => void;
|
|
@@ -280,7 +280,7 @@ declare class Store {
|
|
|
280
280
|
source: string;
|
|
281
281
|
}>;
|
|
282
282
|
subject: {
|
|
283
|
-
atomCreation: Subject<AtomToken<unknown>>;
|
|
283
|
+
atomCreation: Subject<AtomToken$1<unknown>>;
|
|
284
284
|
selectorCreation: Subject<SelectorToken<unknown> | ReadonlySelectorToken<unknown>>;
|
|
285
285
|
transactionCreation: Subject<TransactionToken<ƒn>>;
|
|
286
286
|
timelineCreation: Subject<TimelineToken>;
|
|
@@ -290,9 +290,9 @@ declare class Store {
|
|
|
290
290
|
transactionStatus: TransactionStatus<ƒn>;
|
|
291
291
|
config: {
|
|
292
292
|
name: string;
|
|
293
|
-
logger: Logger | null;
|
|
294
|
-
logger__INTERNAL: Logger;
|
|
295
293
|
};
|
|
294
|
+
loggers: AtomIOLogger[];
|
|
295
|
+
logger: Logger;
|
|
296
296
|
constructor(name: string, store?: Store | null);
|
|
297
297
|
}
|
|
298
298
|
declare const IMPLICIT: {
|
|
@@ -301,7 +301,7 @@ declare const IMPLICIT: {
|
|
|
301
301
|
};
|
|
302
302
|
declare const clearStore: (store?: Store) => void;
|
|
303
303
|
|
|
304
|
-
declare function withdraw<T>(token: AtomToken<T>, store: Store): Atom<T> | undefined;
|
|
304
|
+
declare function withdraw<T>(token: AtomToken$1<T>, store: Store): Atom<T> | undefined;
|
|
305
305
|
declare function withdraw<T>(token: SelectorToken<T>, store: Store): Selector<T> | undefined;
|
|
306
306
|
declare function withdraw<T>(token: StateToken<T>, store: Store): Atom<T> | Selector<T> | undefined;
|
|
307
307
|
declare function withdraw<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T> | undefined;
|
|
@@ -309,7 +309,7 @@ declare function withdraw<T>(token: TransactionToken<T>, store: Store): Transact
|
|
|
309
309
|
declare function withdraw<T>(token: ReadonlySelectorToken<T> | StateToken<T>, store: Store): Atom<T> | ReadonlySelector<T> | Selector<T> | undefined;
|
|
310
310
|
declare function withdraw<T>(token: TimelineToken, store: Store): Timeline | undefined;
|
|
311
311
|
|
|
312
|
-
declare function withdrawNewFamilyMember<T>(token: AtomToken<T>, store: Store): Atom<T> | undefined;
|
|
312
|
+
declare function withdrawNewFamilyMember<T>(token: AtomToken$1<T>, store: Store): Atom<T> | undefined;
|
|
313
313
|
declare function withdrawNewFamilyMember<T>(token: SelectorToken<T>, store: Store): Selector<T> | undefined;
|
|
314
314
|
declare function withdrawNewFamilyMember<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T> | undefined;
|
|
315
315
|
declare function withdrawNewFamilyMember<T>(token: StateToken<T>, store: Store): Atom<T> | Selector<T> | undefined;
|
|
@@ -318,7 +318,7 @@ declare function withdrawNewFamilyMember<T>(token: ReadonlySelectorToken<T> | St
|
|
|
318
318
|
type Atom<T> = {
|
|
319
319
|
key: string;
|
|
320
320
|
type: `atom`;
|
|
321
|
-
family?: FamilyMetadata;
|
|
321
|
+
family?: FamilyMetadata$1;
|
|
322
322
|
install: (store: Store) => void;
|
|
323
323
|
subject: Subject<{
|
|
324
324
|
newValue: T;
|
|
@@ -326,9 +326,20 @@ type Atom<T> = {
|
|
|
326
326
|
}>;
|
|
327
327
|
default: T;
|
|
328
328
|
};
|
|
329
|
-
declare function createAtom<T>(options: AtomOptions<T> | MutableAtomOptions<any, any>, family?: FamilyMetadata, store?: Store): AtomToken<T>;
|
|
329
|
+
declare function createAtom<T>(options: AtomOptions<T> | MutableAtomOptions<any, any>, family?: FamilyMetadata$1, store?: Store): AtomToken$1<T>;
|
|
330
|
+
|
|
331
|
+
type AtomToken<_> = {
|
|
332
|
+
key: string;
|
|
333
|
+
type: `atom`;
|
|
334
|
+
family?: FamilyMetadata;
|
|
335
|
+
__brand?: _;
|
|
336
|
+
};
|
|
337
|
+
type FamilyMetadata = {
|
|
338
|
+
key: string;
|
|
339
|
+
subKey: string;
|
|
340
|
+
};
|
|
330
341
|
|
|
331
|
-
declare function deleteAtom(
|
|
342
|
+
declare function deleteAtom(atomToken: AtomToken<unknown>, store?: Store): void;
|
|
332
343
|
|
|
333
344
|
declare const isAtomDefault: (key: string, store?: Store) => boolean;
|
|
334
345
|
declare const markAtomAsDefault: (key: string, store?: Store) => void;
|
package/internal/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transactors, FamilyMetadata, SelectorOptions, SelectorToken, ReadonlySelectorOptions, ReadonlySelectorToken, StateToken, ƒn, TransactionUpdate, TransactionOptions, TransactionToken, AtomToken, MutableAtomOptions, MutableAtomToken, MutableAtomFamilyOptions, MutableAtomFamily, AtomFamily, StateUpdate, TimelineUpdate, TimelineOptions, TimelineToken, ReadonlySelectorFamily, SelectorFamily, Logger, AtomOptions, AtomFamilyOptions, ReadonlySelectorFamilyOptions, SelectorFamilyOptions } from 'atom.io';
|
|
1
|
+
import { Transactors, FamilyMetadata as FamilyMetadata$1, SelectorOptions, SelectorToken, ReadonlySelectorOptions, ReadonlySelectorToken, StateToken, ƒn, TransactionUpdate, TransactionOptions, TransactionToken, AtomToken as AtomToken$1, MutableAtomOptions, MutableAtomToken, MutableAtomFamilyOptions, MutableAtomFamily, AtomFamily, StateUpdate, TimelineUpdate, TimelineOptions, TimelineToken, ReadonlySelectorFamily, SelectorFamily, AtomIOLogger, Logger, AtomOptions, AtomFamilyOptions, ReadonlySelectorFamilyOptions, SelectorFamilyOptions } from 'atom.io';
|
|
2
2
|
import { Json } from 'atom.io/json';
|
|
3
3
|
|
|
4
4
|
type AtomKey<T> = string & {
|
|
@@ -34,7 +34,7 @@ declare class Subject<T> {
|
|
|
34
34
|
type Selector<T> = {
|
|
35
35
|
key: string;
|
|
36
36
|
type: `selector`;
|
|
37
|
-
family?: FamilyMetadata;
|
|
37
|
+
family?: FamilyMetadata$1;
|
|
38
38
|
install: (store: Store) => void;
|
|
39
39
|
subject: Subject<{
|
|
40
40
|
newValue: T;
|
|
@@ -46,7 +46,7 @@ type Selector<T> = {
|
|
|
46
46
|
type ReadonlySelector<T> = {
|
|
47
47
|
key: string;
|
|
48
48
|
type: `readonly_selector`;
|
|
49
|
-
family?: FamilyMetadata;
|
|
49
|
+
family?: FamilyMetadata$1;
|
|
50
50
|
install: (store: Store) => void;
|
|
51
51
|
subject: Subject<{
|
|
52
52
|
newValue: T;
|
|
@@ -54,8 +54,8 @@ type ReadonlySelector<T> = {
|
|
|
54
54
|
}>;
|
|
55
55
|
get: () => T;
|
|
56
56
|
};
|
|
57
|
-
declare function createSelector<T>(options: SelectorOptions<T>, family?: FamilyMetadata, store?: Store): SelectorToken<T>;
|
|
58
|
-
declare function createSelector<T>(options: ReadonlySelectorOptions<T>, family?: FamilyMetadata, store?: Store): ReadonlySelectorToken<T>;
|
|
57
|
+
declare function createSelector<T>(options: SelectorOptions<T>, family?: FamilyMetadata$1, store?: Store): SelectorToken<T>;
|
|
58
|
+
declare function createSelector<T>(options: ReadonlySelectorOptions<T>, family?: FamilyMetadata$1, store?: Store): ReadonlySelectorToken<T>;
|
|
59
59
|
|
|
60
60
|
declare const traceSelectorAtoms: (selectorKey: string, directDependencyKey: StateKey<unknown>, store: Store) => AtomKey<unknown>[];
|
|
61
61
|
declare const traceAllSelectorAtoms: (selectorKey: string, store: Store) => AtomKey<unknown>[];
|
|
@@ -94,7 +94,7 @@ type TransactionIdle = {
|
|
|
94
94
|
};
|
|
95
95
|
type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
|
|
96
96
|
|
|
97
|
-
declare function deposit<T>(state: Atom<T>): AtomToken<T>;
|
|
97
|
+
declare function deposit<T>(state: Atom<T>): AtomToken$1<T>;
|
|
98
98
|
declare function deposit<T>(state: Selector<T>): SelectorToken<T>;
|
|
99
99
|
declare function deposit<T>(state: Atom<T> | Selector<T>): StateToken<T>;
|
|
100
100
|
declare function deposit<T>(state: ReadonlySelector<T>): ReadonlySelectorToken<T>;
|
|
@@ -181,9 +181,9 @@ declare function createMutableAtomFamily<Core extends Transceiver<any>, Serializ
|
|
|
181
181
|
|
|
182
182
|
declare const getJsonToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => SelectorToken<SerializableCore>;
|
|
183
183
|
|
|
184
|
-
declare const getUpdateToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => AtomToken<Signal<Core>>;
|
|
184
|
+
declare const getUpdateToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => AtomToken$1<Signal<Core>>;
|
|
185
185
|
|
|
186
|
-
declare function isAtomTokenMutable(token: AtomToken<any>): token is MutableAtomToken<any, any>;
|
|
186
|
+
declare function isAtomTokenMutable(token: AtomToken$1<any>): token is MutableAtomToken<any, any>;
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
189
|
* @internal Give the tracker a transceiver state and a store, and it will
|
|
@@ -197,7 +197,7 @@ declare class Tracker<Mutable extends Transceiver<any>> {
|
|
|
197
197
|
private observeCore;
|
|
198
198
|
private updateCore;
|
|
199
199
|
mutableState: MutableAtomToken<Mutable, Json.Serializable>;
|
|
200
|
-
latestUpdateState: AtomToken<typeof this.Update | null>;
|
|
200
|
+
latestUpdateState: AtomToken$1<typeof this.Update | null>;
|
|
201
201
|
constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store?: Store);
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -231,7 +231,7 @@ type TimelineAtomUpdate = StateUpdate<unknown> & {
|
|
|
231
231
|
key: string;
|
|
232
232
|
type: `atom_update`;
|
|
233
233
|
timestamp: number;
|
|
234
|
-
family?: FamilyMetadata;
|
|
234
|
+
family?: FamilyMetadata$1;
|
|
235
235
|
};
|
|
236
236
|
type TimelineSelectorUpdate = {
|
|
237
237
|
key: string;
|
|
@@ -258,7 +258,7 @@ type Timeline = {
|
|
|
258
258
|
};
|
|
259
259
|
declare function timeline__INTERNAL(options: TimelineOptions, store?: Store, data?: Timeline | null): TimelineToken;
|
|
260
260
|
|
|
261
|
-
declare const addAtomToTimeline: (atomToken: AtomToken<any>, tl: Timeline, store?: Store) => void;
|
|
261
|
+
declare const addAtomToTimeline: (atomToken: AtomToken$1<any>, tl: Timeline, store?: Store) => void;
|
|
262
262
|
|
|
263
263
|
declare const redo__INTERNAL: (token: TimelineToken, store?: Store) => void;
|
|
264
264
|
declare const undo__INTERNAL: (token: TimelineToken, store?: Store) => void;
|
|
@@ -280,7 +280,7 @@ declare class Store {
|
|
|
280
280
|
source: string;
|
|
281
281
|
}>;
|
|
282
282
|
subject: {
|
|
283
|
-
atomCreation: Subject<AtomToken<unknown>>;
|
|
283
|
+
atomCreation: Subject<AtomToken$1<unknown>>;
|
|
284
284
|
selectorCreation: Subject<SelectorToken<unknown> | ReadonlySelectorToken<unknown>>;
|
|
285
285
|
transactionCreation: Subject<TransactionToken<ƒn>>;
|
|
286
286
|
timelineCreation: Subject<TimelineToken>;
|
|
@@ -290,9 +290,9 @@ declare class Store {
|
|
|
290
290
|
transactionStatus: TransactionStatus<ƒn>;
|
|
291
291
|
config: {
|
|
292
292
|
name: string;
|
|
293
|
-
logger: Logger | null;
|
|
294
|
-
logger__INTERNAL: Logger;
|
|
295
293
|
};
|
|
294
|
+
loggers: AtomIOLogger[];
|
|
295
|
+
logger: Logger;
|
|
296
296
|
constructor(name: string, store?: Store | null);
|
|
297
297
|
}
|
|
298
298
|
declare const IMPLICIT: {
|
|
@@ -301,7 +301,7 @@ declare const IMPLICIT: {
|
|
|
301
301
|
};
|
|
302
302
|
declare const clearStore: (store?: Store) => void;
|
|
303
303
|
|
|
304
|
-
declare function withdraw<T>(token: AtomToken<T>, store: Store): Atom<T> | undefined;
|
|
304
|
+
declare function withdraw<T>(token: AtomToken$1<T>, store: Store): Atom<T> | undefined;
|
|
305
305
|
declare function withdraw<T>(token: SelectorToken<T>, store: Store): Selector<T> | undefined;
|
|
306
306
|
declare function withdraw<T>(token: StateToken<T>, store: Store): Atom<T> | Selector<T> | undefined;
|
|
307
307
|
declare function withdraw<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T> | undefined;
|
|
@@ -309,7 +309,7 @@ declare function withdraw<T>(token: TransactionToken<T>, store: Store): Transact
|
|
|
309
309
|
declare function withdraw<T>(token: ReadonlySelectorToken<T> | StateToken<T>, store: Store): Atom<T> | ReadonlySelector<T> | Selector<T> | undefined;
|
|
310
310
|
declare function withdraw<T>(token: TimelineToken, store: Store): Timeline | undefined;
|
|
311
311
|
|
|
312
|
-
declare function withdrawNewFamilyMember<T>(token: AtomToken<T>, store: Store): Atom<T> | undefined;
|
|
312
|
+
declare function withdrawNewFamilyMember<T>(token: AtomToken$1<T>, store: Store): Atom<T> | undefined;
|
|
313
313
|
declare function withdrawNewFamilyMember<T>(token: SelectorToken<T>, store: Store): Selector<T> | undefined;
|
|
314
314
|
declare function withdrawNewFamilyMember<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T> | undefined;
|
|
315
315
|
declare function withdrawNewFamilyMember<T>(token: StateToken<T>, store: Store): Atom<T> | Selector<T> | undefined;
|
|
@@ -318,7 +318,7 @@ declare function withdrawNewFamilyMember<T>(token: ReadonlySelectorToken<T> | St
|
|
|
318
318
|
type Atom<T> = {
|
|
319
319
|
key: string;
|
|
320
320
|
type: `atom`;
|
|
321
|
-
family?: FamilyMetadata;
|
|
321
|
+
family?: FamilyMetadata$1;
|
|
322
322
|
install: (store: Store) => void;
|
|
323
323
|
subject: Subject<{
|
|
324
324
|
newValue: T;
|
|
@@ -326,9 +326,20 @@ type Atom<T> = {
|
|
|
326
326
|
}>;
|
|
327
327
|
default: T;
|
|
328
328
|
};
|
|
329
|
-
declare function createAtom<T>(options: AtomOptions<T> | MutableAtomOptions<any, any>, family?: FamilyMetadata, store?: Store): AtomToken<T>;
|
|
329
|
+
declare function createAtom<T>(options: AtomOptions<T> | MutableAtomOptions<any, any>, family?: FamilyMetadata$1, store?: Store): AtomToken$1<T>;
|
|
330
|
+
|
|
331
|
+
type AtomToken<_> = {
|
|
332
|
+
key: string;
|
|
333
|
+
type: `atom`;
|
|
334
|
+
family?: FamilyMetadata;
|
|
335
|
+
__brand?: _;
|
|
336
|
+
};
|
|
337
|
+
type FamilyMetadata = {
|
|
338
|
+
key: string;
|
|
339
|
+
subKey: string;
|
|
340
|
+
};
|
|
330
341
|
|
|
331
|
-
declare function deleteAtom(
|
|
342
|
+
declare function deleteAtom(atomToken: AtomToken<unknown>, store?: Store): void;
|
|
332
343
|
|
|
333
344
|
declare const isAtomDefault: (key: string, store?: Store) => boolean;
|
|
334
345
|
declare const markAtomAsDefault: (key: string, store?: Store) => void;
|