atom.io 0.43.2 → 0.44.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/{chunk-CTAAG5j7.js → chunk-Bp6m_JJh.js} +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/internal/index.d.ts +270 -270
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/introspection/index.d.ts +3 -3
- package/dist/introspection/index.d.ts.map +1 -1
- package/dist/json/index.d.ts +10 -10
- package/dist/json/index.d.ts.map +1 -1
- package/dist/main/index.d.ts +146 -146
- package/dist/main/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react-devtools/index.d.ts +12 -12
- package/dist/react-devtools/index.d.ts.map +1 -1
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.d.ts.map +1 -1
- package/dist/realtime-server/index.d.ts +3 -3
- package/dist/realtime-server/index.d.ts.map +1 -1
- package/dist/realtime-testing/index.d.ts +4 -4
- package/dist/realtime-testing/index.d.ts.map +1 -1
- package/dist/struct/index.d.ts +1 -1
- package/dist/{utility-types-aZkJVERa.d.ts → utility-types-B6_rGUbz.d.ts} +2 -2
- package/dist/{utility-types-aZkJVERa.d.ts.map → utility-types-B6_rGUbz.d.ts.map} +1 -1
- package/dist/web/index.d.ts +3 -3
- package/dist/web/index.d.ts.map +1 -1
- package/package.json +24 -24
- package/src/react/use-loadable.ts +4 -3
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as Fn, i as Flat, n as Ctor, o as Refinement, r as Each, t as Count } from "../utility-types-B6_rGUbz.js";
|
|
2
2
|
import { Above, ActorToolkit, AtomFamilyToken, AtomIOLogger, AtomIOToken, AtomToken, AtomUpdateEvent, CompoundFrom, CompoundTypedKey, FamilyMetadata, HeldSelectorFamilyToken, HeldSelectorToken, Hierarchy, JoinOptions, JoinStates, JoinToken, Logger, MoleculeCreationEvent, MoleculeDisposalEvent, MoleculeTransferEvent, MutableAtomFamilyOptions, MutableAtomFamilyToken, MutableAtomOptions, MutableAtomToken, PureSelectorFamilyToken, PureSelectorToken, ReadableFamilyToken, ReadableToken, ReadonlyHeldSelectorFamilyOptions, ReadonlyHeldSelectorFamilyToken, ReadonlyHeldSelectorOptions, ReadonlyHeldSelectorToken, ReadonlyPureSelectorFamilyOptions, ReadonlyPureSelectorFamilyToken, ReadonlyPureSelectorOptions, ReadonlyPureSelectorToken, ReadonlySelectorFamilyToken, ReadonlySelectorToken, RegularAtomFamilyOptions, RegularAtomFamilyToken, RegularAtomOptions, RegularAtomToken, SelectorFamilyToken, SelectorToken, Setter, SingularTypedKey, StateCreationEvent, StateDisposalEvent, StateLifecycleEvent, StateUpdate, TimelineEvent, TimelineManageable, TimelineOptions, TimelineSelectorUpdateEvent, TimelineToken, TransactionOptions, TransactionOutcomeEvent, TransactionToken, TransactionUpdateHandler, UpdateHandler, ValidKey, Vassal, ViewOf, WritableFamilyToken, WritableHeldSelectorFamilyOptions, WritableHeldSelectorFamilyToken, WritableHeldSelectorOptions, WritableHeldSelectorToken, WritablePureSelectorFamilyOptions, WritablePureSelectorFamilyToken, WritablePureSelectorOptions, WritablePureSelectorToken, WritableSelectorFamilyToken, WritableSelectorToken, WritableToken, WriterToolkit } from "atom.io";
|
|
3
3
|
import { Canonical, Json, stringified } from "atom.io/json";
|
|
4
4
|
import { UList } from "atom.io/transceivers/u-list";
|
|
@@ -7,15 +7,15 @@ import { UList } from "atom.io/transceivers/u-list";
|
|
|
7
7
|
declare function arbitrary(random?: () => number): string;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/internal/store/circular-buffer.d.ts
|
|
10
|
-
declare class CircularBuffer<T
|
|
11
|
-
protected _buffer: T
|
|
10
|
+
declare class CircularBuffer<T> {
|
|
11
|
+
protected _buffer: T[];
|
|
12
12
|
protected _index: number;
|
|
13
|
-
constructor(array: T
|
|
13
|
+
constructor(array: T[]);
|
|
14
14
|
constructor(length: number);
|
|
15
|
-
get buffer(): ReadonlyArray<T
|
|
15
|
+
get buffer(): ReadonlyArray<T | undefined>;
|
|
16
16
|
get index(): number;
|
|
17
|
-
add(item: T
|
|
18
|
-
copy(): CircularBuffer<T
|
|
17
|
+
add(item: T): void;
|
|
18
|
+
copy(): CircularBuffer<T>;
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/internal/mutable/transceiver.d.ts
|
|
@@ -28,61 +28,61 @@ interface Transceiver<V extends {
|
|
|
28
28
|
subscribe: (key: string, fn: (update: S$1) => void) => () => void;
|
|
29
29
|
toJSON: () => J$1;
|
|
30
30
|
}
|
|
31
|
-
type TransceiverConstructor<J$1 extends Json.Serializable, T
|
|
32
|
-
fromJSON: (json: J$1) => T
|
|
31
|
+
type TransceiverConstructor<J$1 extends Json.Serializable, T extends Transceiver<any, any, J$1>> = (new () => T) & {
|
|
32
|
+
fromJSON: (json: J$1) => T;
|
|
33
33
|
};
|
|
34
34
|
declare function isTransceiver(value: unknown): value is Transceiver<any, Json.Serializable, Json.Serializable>;
|
|
35
35
|
type TransceiverMode = `playback` | `record` | `transaction`;
|
|
36
|
-
type SignalFrom<T
|
|
37
|
-
type AsJSON<T
|
|
38
|
-
type ConstructorOf<T
|
|
36
|
+
type SignalFrom<T extends Transceiver<any, any, any>> = T extends Transceiver<any, infer S, any> ? S : never;
|
|
37
|
+
type AsJSON<T extends Transceiver<any, any, any>> = T extends Transceiver<any, any, infer J> ? J : never;
|
|
38
|
+
type ConstructorOf<T extends Transceiver<any, any, any>> = TransceiverConstructor<AsJSON<T>, T>;
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/internal/mutable/create-mutable-atom.d.ts
|
|
41
|
-
declare function createMutableAtom<T
|
|
41
|
+
declare function createMutableAtom<T extends Transceiver<any, any, any>>(store: Store, options: MutableAtomOptions<T>, family: FamilyMetadata | undefined): MutableAtomToken<T>;
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/internal/overlays/map-overlay.d.ts
|
|
44
|
-
declare class MapOverlay<K
|
|
45
|
-
deleted: Set<K
|
|
46
|
-
changed: Set<K
|
|
47
|
-
protected readonly source: Map<K
|
|
48
|
-
constructor(source: Map<K
|
|
49
|
-
get(key: K
|
|
50
|
-
set(key: K
|
|
51
|
-
hasOwn(key: K
|
|
52
|
-
has(key: K
|
|
53
|
-
delete(key: K
|
|
44
|
+
declare class MapOverlay<K, V> extends Map<K, V> {
|
|
45
|
+
deleted: Set<K>;
|
|
46
|
+
changed: Set<K>;
|
|
47
|
+
protected readonly source: Map<K, V>;
|
|
48
|
+
constructor(source: Map<K, V>);
|
|
49
|
+
get(key: K): V | undefined;
|
|
50
|
+
set(key: K, value: V): this;
|
|
51
|
+
hasOwn(key: K): boolean;
|
|
52
|
+
has(key: K): boolean;
|
|
53
|
+
delete(key: K): boolean;
|
|
54
54
|
clear(): void;
|
|
55
|
-
[Symbol.iterator](): MapIterator<[K
|
|
56
|
-
entries(): MapIterator<[K
|
|
57
|
-
keys(): MapIterator<K
|
|
55
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
56
|
+
entries(): MapIterator<[K, V]>;
|
|
57
|
+
keys(): MapIterator<K>;
|
|
58
58
|
values(): MapIterator<V>;
|
|
59
|
-
forEach(callbackfn: (value: V, key: K
|
|
59
|
+
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void): void;
|
|
60
60
|
get size(): number;
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/internal/overlays/relations-overlay.d.ts
|
|
64
|
-
declare class RelationsOverlay<K
|
|
65
|
-
deleted: Set<K
|
|
66
|
-
protected readonly source: Map<K
|
|
67
|
-
constructor(source: Map<K
|
|
68
|
-
get(key: K
|
|
69
|
-
set(key: K
|
|
70
|
-
has(key: K
|
|
71
|
-
delete(key: K
|
|
64
|
+
declare class RelationsOverlay<K, V extends Set<any>> extends Map<K, V> {
|
|
65
|
+
deleted: Set<K>;
|
|
66
|
+
protected readonly source: Map<K, V>;
|
|
67
|
+
constructor(source: Map<K, V>);
|
|
68
|
+
get(key: K): V | undefined;
|
|
69
|
+
set(key: K, value: V): this;
|
|
70
|
+
has(key: K): boolean;
|
|
71
|
+
delete(key: K): boolean;
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region src/internal/overlays/set-overlay.d.ts
|
|
75
|
-
declare class SetOverlay<T
|
|
76
|
-
deleted: Set<T
|
|
77
|
-
source: Set<T
|
|
78
|
-
constructor(source: Set<T
|
|
79
|
-
add(value: T
|
|
80
|
-
hasOwn(member: T
|
|
81
|
-
has(key: T
|
|
82
|
-
delete(key: T
|
|
75
|
+
declare class SetOverlay<T> extends Set<T> {
|
|
76
|
+
deleted: Set<T>;
|
|
77
|
+
source: Set<T>;
|
|
78
|
+
constructor(source: Set<T>);
|
|
79
|
+
add(value: T): this;
|
|
80
|
+
hasOwn(member: T): boolean;
|
|
81
|
+
has(key: T): boolean;
|
|
82
|
+
delete(key: T): boolean;
|
|
83
83
|
clear(): void;
|
|
84
|
-
[Symbol.iterator](): SetIterator<T
|
|
85
|
-
iterateOwn(): SetIterator<T
|
|
84
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
85
|
+
iterateOwn(): SetIterator<T>;
|
|
86
86
|
get size(): number;
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
@@ -178,9 +178,9 @@ type JunctionOverlay<AName extends string, A extends string, BName extends strin
|
|
|
178
178
|
//#region src/internal/transaction/transaction-meta-progress.d.ts
|
|
179
179
|
declare const TRANSACTION_PHASES: readonly ["idle", "building", "applying"];
|
|
180
180
|
type TransactionPhase = (typeof TRANSACTION_PHASES)[number];
|
|
181
|
-
type TransactionProgress<F
|
|
181
|
+
type TransactionProgress<F extends Fn> = {
|
|
182
182
|
phase: `applying` | `building`;
|
|
183
|
-
update: TransactionOutcomeEvent<TransactionToken<F
|
|
183
|
+
update: TransactionOutcomeEvent<TransactionToken<F>>;
|
|
184
184
|
toolkit: ActorToolkit;
|
|
185
185
|
};
|
|
186
186
|
type TransactionEpoch = {
|
|
@@ -207,10 +207,10 @@ declare function isChildStore(store: Store): store is ChildStore;
|
|
|
207
207
|
declare const abortTransaction: (target: ChildStore) => void;
|
|
208
208
|
//#endregion
|
|
209
209
|
//#region src/internal/transaction/act-upon-store.d.ts
|
|
210
|
-
declare function actUponStore<F
|
|
210
|
+
declare function actUponStore<F extends Fn>(store: Store, token: TransactionToken<F>, id: string): (...parameters: Parameters<F>) => ReturnType<F>;
|
|
211
211
|
//#endregion
|
|
212
212
|
//#region src/internal/transaction/apply-transaction.d.ts
|
|
213
|
-
declare function applyTransaction<F
|
|
213
|
+
declare function applyTransaction<F extends Fn>(store: ChildStore, output: ReturnType<F>): void;
|
|
214
214
|
//#endregion
|
|
215
215
|
//#region src/internal/transaction/assign-transaction-to-continuity.d.ts
|
|
216
216
|
declare function assignTransactionToContinuity(store: RootStore, continuityKey: string, transactionKey: string): void;
|
|
@@ -219,28 +219,28 @@ declare function assignTransactionToContinuity(store: RootStore, continuityKey:
|
|
|
219
219
|
declare const buildTransaction: (store: RootStore, token: TransactionToken<any>, params: any[], id: string) => ChildStore;
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/internal/subject.d.ts
|
|
222
|
-
declare class Subject<T
|
|
223
|
-
Subscriber: (value: T
|
|
222
|
+
declare class Subject<T> {
|
|
223
|
+
Subscriber: (value: T) => void;
|
|
224
224
|
subscribers: Map<string, this[`Subscriber`]>;
|
|
225
225
|
subscribe(key: string, subscriber: this[`Subscriber`]): () => void;
|
|
226
226
|
private unsubscribe;
|
|
227
|
-
next(value: T
|
|
227
|
+
next(value: T): void;
|
|
228
228
|
}
|
|
229
|
-
declare class StatefulSubject<T
|
|
230
|
-
state: T
|
|
231
|
-
constructor(initialState: T
|
|
232
|
-
next(value: T
|
|
229
|
+
declare class StatefulSubject<T> extends Subject<T> {
|
|
230
|
+
state: T;
|
|
231
|
+
constructor(initialState: T);
|
|
232
|
+
next(value: T): void;
|
|
233
233
|
}
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region src/internal/transaction/create-transaction.d.ts
|
|
236
|
-
type Transaction<F
|
|
236
|
+
type Transaction<F extends Fn> = {
|
|
237
237
|
key: string;
|
|
238
238
|
type: `transaction`;
|
|
239
239
|
install: (store: RootStore) => void;
|
|
240
|
-
subject: Subject<TransactionOutcomeEvent<TransactionToken<F
|
|
241
|
-
run: (parameters: Parameters<F
|
|
240
|
+
subject: Subject<TransactionOutcomeEvent<TransactionToken<F>>>;
|
|
241
|
+
run: (parameters: Parameters<F>, id?: string) => ReturnType<F>;
|
|
242
242
|
};
|
|
243
|
-
declare function createTransaction<F
|
|
243
|
+
declare function createTransaction<F extends Fn>(store: RootStore, options: TransactionOptions<F>): TransactionToken<F>;
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region src/internal/transaction/get-epoch-number.d.ts
|
|
246
246
|
declare function getContinuityKey(store: RootStore, transactionKey: string): string | undefined;
|
|
@@ -252,22 +252,22 @@ declare function setEpochNumberOfContinuity(store: RootStore, continuityKey: str
|
|
|
252
252
|
declare function setEpochNumberOfAction(store: RootStore, transactionKey: string, newEpoch: number): void;
|
|
253
253
|
//#endregion
|
|
254
254
|
//#region src/internal/mutable/create-mutable-atom-family.d.ts
|
|
255
|
-
declare function createMutableAtomFamily<T
|
|
255
|
+
declare function createMutableAtomFamily<T extends Transceiver<any, any, any>, K extends Canonical>(store: RootStore, options: MutableAtomFamilyOptions<T, K>, internalRoles?: string[]): MutableAtomFamilyToken<T, K>;
|
|
256
256
|
//#endregion
|
|
257
257
|
//#region src/internal/timeline/create-timeline.d.ts
|
|
258
|
-
type Timeline<ManagedAtom
|
|
258
|
+
type Timeline<ManagedAtom extends TimelineManageable> = {
|
|
259
259
|
type: `timeline`;
|
|
260
260
|
key: string;
|
|
261
261
|
at: number;
|
|
262
262
|
timeTraveling: `into_future` | `into_past` | null;
|
|
263
|
-
history: TimelineEvent<ManagedAtom
|
|
263
|
+
history: TimelineEvent<ManagedAtom>[];
|
|
264
264
|
selectorTime: number | null;
|
|
265
265
|
transactionKey: string | null;
|
|
266
266
|
install: (store: RootStore) => void;
|
|
267
|
-
subject: Subject<TimelineEvent<ManagedAtom
|
|
267
|
+
subject: Subject<TimelineEvent<ManagedAtom> | `redo` | `undo`>;
|
|
268
268
|
subscriptions: Map<string, () => void>;
|
|
269
269
|
};
|
|
270
|
-
declare function createTimeline<ManagedAtom
|
|
270
|
+
declare function createTimeline<ManagedAtom extends TimelineManageable>(store: RootStore, options: TimelineOptions<ManagedAtom>, data?: Timeline<ManagedAtom>): TimelineToken<ManagedAtom>;
|
|
271
271
|
//#endregion
|
|
272
272
|
//#region src/internal/timeline/time-travel.d.ts
|
|
273
273
|
declare const timeTravel: (store: Store, action: `redo` | `undo`, token: TimelineToken<any>) => void;
|
|
@@ -279,107 +279,107 @@ type AtomIOState = {
|
|
|
279
279
|
install: (store: RootStore) => void;
|
|
280
280
|
subject: Subject<StateUpdate<any>>;
|
|
281
281
|
};
|
|
282
|
-
type RegularAtom<T
|
|
282
|
+
type RegularAtom<T, E> = Flat<AtomIOState & {
|
|
283
283
|
type: `atom`;
|
|
284
|
-
default: T
|
|
284
|
+
default: T | (() => T);
|
|
285
285
|
cleanup?: () => void;
|
|
286
286
|
internalRoles?: InternalRole[];
|
|
287
|
-
catch?: readonly Ctor<E
|
|
288
|
-
__T?: T
|
|
289
|
-
__E?: E
|
|
287
|
+
catch?: readonly Ctor<E>[];
|
|
288
|
+
__T?: T;
|
|
289
|
+
__E?: E;
|
|
290
290
|
}>;
|
|
291
|
-
type MutableAtom<T
|
|
291
|
+
type MutableAtom<T extends Transceiver<any, any, any>> = Flat<AtomIOState & {
|
|
292
292
|
type: `mutable_atom`;
|
|
293
|
-
class: ConstructorOf<T
|
|
293
|
+
class: ConstructorOf<T>;
|
|
294
294
|
cleanup?: () => void;
|
|
295
|
-
__T?: T
|
|
295
|
+
__T?: T;
|
|
296
296
|
}>;
|
|
297
|
-
type Atom<T
|
|
298
|
-
type WritableHeldSelector<T
|
|
297
|
+
type Atom<T, E> = RegularAtom<T, E> | (T extends Transceiver<any, any, any> ? MutableAtom<T> : never);
|
|
298
|
+
type WritableHeldSelector<T> = Flat<AtomIOState & {
|
|
299
299
|
type: `writable_held_selector`;
|
|
300
|
-
const: T
|
|
301
|
-
getFrom: (target: Store) => T
|
|
302
|
-
setSelf: (newValue: T
|
|
303
|
-
__T?: T
|
|
300
|
+
const: T;
|
|
301
|
+
getFrom: (target: Store) => T;
|
|
302
|
+
setSelf: (newValue: T) => void;
|
|
303
|
+
__T?: T;
|
|
304
304
|
}>;
|
|
305
|
-
type ReadonlyHeldSelector<T
|
|
305
|
+
type ReadonlyHeldSelector<T> = Flat<AtomIOState & {
|
|
306
306
|
type: `readonly_held_selector`;
|
|
307
|
-
const: T
|
|
308
|
-
getFrom: (target: Store) => T
|
|
309
|
-
__T?: T
|
|
307
|
+
const: T;
|
|
308
|
+
getFrom: (target: Store) => T;
|
|
309
|
+
__T?: T;
|
|
310
310
|
}>;
|
|
311
|
-
type WritablePureSelector<T
|
|
311
|
+
type WritablePureSelector<T, E> = Flat<AtomIOState & {
|
|
312
312
|
type: `writable_pure_selector`;
|
|
313
|
-
getFrom: (target: Store) => E
|
|
314
|
-
setSelf: (newValue: T
|
|
315
|
-
catch?: readonly Ctor<E
|
|
316
|
-
__T?: T
|
|
317
|
-
__E?: E
|
|
313
|
+
getFrom: (target: Store) => E | T;
|
|
314
|
+
setSelf: (newValue: T) => void;
|
|
315
|
+
catch?: readonly Ctor<E>[];
|
|
316
|
+
__T?: T;
|
|
317
|
+
__E?: E;
|
|
318
318
|
}>;
|
|
319
|
-
type ReadonlyPureSelector<T
|
|
319
|
+
type ReadonlyPureSelector<T, E> = Flat<AtomIOState & {
|
|
320
320
|
type: `readonly_pure_selector`;
|
|
321
|
-
getFrom: (target: Store) => E
|
|
322
|
-
catch?: readonly Ctor<E
|
|
323
|
-
__T?: T
|
|
324
|
-
__E?: E
|
|
321
|
+
getFrom: (target: Store) => E | T;
|
|
322
|
+
catch?: readonly Ctor<E>[];
|
|
323
|
+
__T?: T;
|
|
324
|
+
__E?: E;
|
|
325
325
|
}>;
|
|
326
|
-
type ReadonlySelector<T
|
|
327
|
-
type WritableSelector<T
|
|
328
|
-
type HeldSelector<T
|
|
329
|
-
type PureSelector<T
|
|
330
|
-
type Selector<T
|
|
331
|
-
type WritableState<T
|
|
332
|
-
type ReadableState<T
|
|
333
|
-
type RegularAtomFamily<T
|
|
334
|
-
create: <Key extends K
|
|
335
|
-
default: T
|
|
326
|
+
type ReadonlySelector<T, E> = ReadonlyHeldSelector<T> | ReadonlyPureSelector<T, E>;
|
|
327
|
+
type WritableSelector<T, E> = WritableHeldSelector<T> | WritablePureSelector<T, E>;
|
|
328
|
+
type HeldSelector<T> = ReadonlyHeldSelector<T> | WritableHeldSelector<T>;
|
|
329
|
+
type PureSelector<T, E> = ReadonlyPureSelector<T, E> | WritablePureSelector<T, E>;
|
|
330
|
+
type Selector<T, E> = ReadonlyHeldSelector<T> | ReadonlyPureSelector<T, E> | WritableHeldSelector<T> | WritablePureSelector<T, E>;
|
|
331
|
+
type WritableState<T, E> = Atom<T, E> | WritableSelector<T, E>;
|
|
332
|
+
type ReadableState<T, E> = Atom<T, E> | Selector<T, E>;
|
|
333
|
+
type RegularAtomFamily<T, K extends Canonical, E = never> = Flat<RegularAtomFamilyToken<T, K, E> & {
|
|
334
|
+
create: <Key extends K>(key: Key) => RegularAtomToken<T, Key, E>;
|
|
335
|
+
default: T | ((key: K) => T);
|
|
336
336
|
install: (store: RootStore) => void;
|
|
337
337
|
internalRoles: string[] | undefined;
|
|
338
|
-
subject: Subject<StateLifecycleEvent<RegularAtomToken<T
|
|
338
|
+
subject: Subject<StateLifecycleEvent<RegularAtomToken<T, K, E>>>;
|
|
339
339
|
}>;
|
|
340
|
-
type MutableAtomFamily<T
|
|
341
|
-
create: <Key extends K
|
|
342
|
-
class: ConstructorOf<T
|
|
340
|
+
type MutableAtomFamily<T extends Transceiver<any, any, any>, K extends Canonical> = Flat<MutableAtomFamilyToken<T, K> & {
|
|
341
|
+
create: <Key extends K>(key: Key) => MutableAtomToken<T, Key>;
|
|
342
|
+
class: ConstructorOf<T>;
|
|
343
343
|
install: (store: RootStore) => void;
|
|
344
344
|
internalRoles: string[] | undefined;
|
|
345
|
-
subject: Subject<StateLifecycleEvent<MutableAtomToken<T
|
|
345
|
+
subject: Subject<StateLifecycleEvent<MutableAtomToken<T>>>;
|
|
346
346
|
}>;
|
|
347
|
-
type AtomFamily<T
|
|
348
|
-
type WritablePureSelectorFamily<T
|
|
349
|
-
create: <Key extends K
|
|
350
|
-
default: (key: K
|
|
347
|
+
type AtomFamily<T, K extends Canonical, E> = MutableAtomFamily<T extends Transceiver<any, any, any> ? T : never, K> | RegularAtomFamily<T, K, E>;
|
|
348
|
+
type WritablePureSelectorFamily<T, K extends Canonical, E> = Flat<WritablePureSelectorFamilyToken<T, K, E> & {
|
|
349
|
+
create: <Key extends K>(key: Key) => WritablePureSelectorToken<T, Key, E>;
|
|
350
|
+
default: (key: K) => T;
|
|
351
351
|
install: (store: RootStore) => void;
|
|
352
352
|
internalRoles: string[] | undefined;
|
|
353
|
-
subject: Subject<StateLifecycleEvent<WritablePureSelectorToken<T
|
|
353
|
+
subject: Subject<StateLifecycleEvent<WritablePureSelectorToken<T, K, E>>>;
|
|
354
354
|
}>;
|
|
355
|
-
type WritableHeldSelectorFamily<T
|
|
356
|
-
create: <Key extends K
|
|
357
|
-
default: (key: K
|
|
355
|
+
type WritableHeldSelectorFamily<T, K extends Canonical> = Flat<WritableHeldSelectorFamilyToken<T, K> & {
|
|
356
|
+
create: <Key extends K>(key: Key) => WritableHeldSelectorToken<T, Key>;
|
|
357
|
+
default: (key: K) => T;
|
|
358
358
|
install: (store: RootStore) => void;
|
|
359
359
|
internalRoles: string[] | undefined;
|
|
360
|
-
subject: Subject<StateLifecycleEvent<WritableHeldSelectorToken<T
|
|
360
|
+
subject: Subject<StateLifecycleEvent<WritableHeldSelectorToken<T, K>>>;
|
|
361
361
|
}>;
|
|
362
|
-
type ReadonlyPureSelectorFamily<T
|
|
363
|
-
create: <Key extends K
|
|
364
|
-
default: (key: K
|
|
362
|
+
type ReadonlyPureSelectorFamily<T, K extends Canonical, E> = Flat<ReadonlyPureSelectorFamilyToken<T, K, E> & {
|
|
363
|
+
create: <Key extends K>(key: Key) => ReadonlyPureSelectorToken<T, Key, E>;
|
|
364
|
+
default: (key: K) => T;
|
|
365
365
|
install: (store: RootStore) => void;
|
|
366
366
|
internalRoles: string[] | undefined;
|
|
367
|
-
subject: Subject<StateLifecycleEvent<ReadonlyPureSelectorToken<T
|
|
367
|
+
subject: Subject<StateLifecycleEvent<ReadonlyPureSelectorToken<T, K, E>>>;
|
|
368
368
|
}>;
|
|
369
|
-
type ReadonlyHeldSelectorFamily<T
|
|
370
|
-
create: <Key extends K
|
|
371
|
-
default: (key: K
|
|
369
|
+
type ReadonlyHeldSelectorFamily<T, K extends Canonical> = Flat<ReadonlyHeldSelectorFamilyToken<T, K> & {
|
|
370
|
+
create: <Key extends K>(key: Key) => ReadonlyHeldSelectorToken<T, Key>;
|
|
371
|
+
default: (key: K) => T;
|
|
372
372
|
install: (store: RootStore) => void;
|
|
373
373
|
internalRoles: string[] | undefined;
|
|
374
|
-
subject: Subject<StateLifecycleEvent<ReadonlyHeldSelectorToken<T
|
|
374
|
+
subject: Subject<StateLifecycleEvent<ReadonlyHeldSelectorToken<T>>>;
|
|
375
375
|
}>;
|
|
376
|
-
type PureSelectorFamily<T
|
|
377
|
-
type HeldSelectorFamily<T
|
|
378
|
-
type ReadonlySelectorFamily<T
|
|
379
|
-
type WritableSelectorFamily<T
|
|
380
|
-
type SelectorFamily<T
|
|
381
|
-
type WritableFamily<T
|
|
382
|
-
type ReadableFamily<T
|
|
376
|
+
type PureSelectorFamily<T, K extends Canonical, E> = ReadonlyPureSelectorFamily<T, K, E> | WritablePureSelectorFamily<T, K, E>;
|
|
377
|
+
type HeldSelectorFamily<T, K extends Canonical> = ReadonlyHeldSelectorFamily<T, K> | WritableHeldSelectorFamily<T, K>;
|
|
378
|
+
type ReadonlySelectorFamily<T, K extends Canonical, E> = ReadonlyHeldSelectorFamily<T, K> | ReadonlyPureSelectorFamily<T, K, E>;
|
|
379
|
+
type WritableSelectorFamily<T, K extends Canonical, E> = WritableHeldSelectorFamily<T, K> | WritablePureSelectorFamily<T, K, E>;
|
|
380
|
+
type SelectorFamily<T, K extends Canonical, E> = HeldSelectorFamily<T, K> | PureSelectorFamily<T, K, E>;
|
|
381
|
+
type WritableFamily<T, K extends Canonical, E> = AtomFamily<T, K, E> | WritableSelectorFamily<T, K, E>;
|
|
382
|
+
type ReadableFamily<T, K extends Canonical, E> = AtomFamily<T, K, E> | SelectorFamily<T, K, E>;
|
|
383
383
|
type AtomIOInternalResource = ReadableFamily<any, any, any> | ReadableState<any, any> | Timeline<any> | Transaction<any>;
|
|
384
384
|
//#endregion
|
|
385
385
|
//#region src/internal/mutable/get-json-family.d.ts
|
|
@@ -400,44 +400,44 @@ declare const getUpdateToken: <T extends Transceiver<any, any, any>>(mutableAtom
|
|
|
400
400
|
* subscribe to the transceiver's inner value. When the inner value changes,
|
|
401
401
|
* the tracker will update its own state to reflect the change.
|
|
402
402
|
*/
|
|
403
|
-
declare class Tracker<T
|
|
403
|
+
declare class Tracker<T extends Transceiver<any, any, any>> {
|
|
404
404
|
private initializeSignalAtom;
|
|
405
405
|
private unsubscribeFromInnerValue;
|
|
406
406
|
private unsubscribeFromState;
|
|
407
407
|
private captureSignalsFromCore;
|
|
408
408
|
private supplySignalsToCore;
|
|
409
|
-
mutableAtomToken: MutableAtomToken<T
|
|
410
|
-
latestSignalToken: RegularAtomToken<SignalFrom<T
|
|
409
|
+
mutableAtomToken: MutableAtomToken<T>;
|
|
410
|
+
latestSignalToken: RegularAtomToken<SignalFrom<T> | null>;
|
|
411
411
|
[Symbol.dispose]: () => void;
|
|
412
|
-
constructor(mutableAtomToken: MutableAtomToken<T
|
|
412
|
+
constructor(mutableAtomToken: MutableAtomToken<T>, store: Store);
|
|
413
413
|
}
|
|
414
414
|
//#endregion
|
|
415
415
|
//#region src/internal/mutable/tracker-family.d.ts
|
|
416
|
-
declare class FamilyTracker<T
|
|
416
|
+
declare class FamilyTracker<T extends Transceiver<any, any, any>, K extends Canonical> {
|
|
417
417
|
private trackers;
|
|
418
|
-
readonly latestSignalAtoms: RegularAtomFamily<SignalFrom<T
|
|
419
|
-
readonly mutableAtoms: MutableAtomFamily<T
|
|
420
|
-
constructor(mutableAtoms: MutableAtomFamily<T
|
|
418
|
+
readonly latestSignalAtoms: RegularAtomFamily<SignalFrom<T> | null, K>;
|
|
419
|
+
readonly mutableAtoms: MutableAtomFamily<T, K>;
|
|
420
|
+
constructor(mutableAtoms: MutableAtomFamily<T, K>, store: RootStore);
|
|
421
421
|
}
|
|
422
422
|
//#endregion
|
|
423
423
|
//#region src/internal/store/deposit.d.ts
|
|
424
|
-
declare function deposit<T
|
|
425
|
-
declare function deposit<T
|
|
426
|
-
declare function deposit<T
|
|
427
|
-
declare function deposit<T
|
|
428
|
-
declare function deposit<T
|
|
429
|
-
declare function deposit<T
|
|
430
|
-
declare function deposit<T
|
|
431
|
-
declare function deposit<T
|
|
432
|
-
declare function deposit<T
|
|
433
|
-
declare function deposit<T
|
|
434
|
-
declare function deposit<T
|
|
435
|
-
declare function deposit<T
|
|
436
|
-
declare function deposit<T
|
|
437
|
-
declare function deposit<T
|
|
438
|
-
declare function deposit<T
|
|
439
|
-
declare function deposit<T
|
|
440
|
-
declare function deposit<T
|
|
424
|
+
declare function deposit<T, E>(state: RegularAtom<T, E>): RegularAtomToken<T, Canonical, E>;
|
|
425
|
+
declare function deposit<T extends Transceiver<any, any, any>>(state: MutableAtom<T>): MutableAtomToken<T>;
|
|
426
|
+
declare function deposit<T, E>(state: Atom<T, E>): AtomToken<T, Canonical, E>;
|
|
427
|
+
declare function deposit<T, E>(state: WritablePureSelector<T, E>): WritablePureSelectorToken<T, any, E>;
|
|
428
|
+
declare function deposit<T, E>(state: ReadonlyPureSelector<T, E>): ReadonlyPureSelectorToken<T, any, E>;
|
|
429
|
+
declare function deposit<T, E>(state: Selector<T, E>): SelectorToken<T, any, E>;
|
|
430
|
+
declare function deposit<T, E>(state: WritableState<T, E>): WritableToken<T, any, E>;
|
|
431
|
+
declare function deposit<T, E>(state: ReadableState<T, E>): ReadableToken<T, any, E>;
|
|
432
|
+
declare function deposit<T, K extends Canonical, E>(state: RegularAtomFamily<T, K, E>): RegularAtomFamilyToken<T, K, E>;
|
|
433
|
+
declare function deposit<T extends Transceiver<any, any, any>, K extends Canonical>(state: MutableAtomFamily<T, K>): MutableAtomFamilyToken<T, K>;
|
|
434
|
+
declare function deposit<T, E>(state: AtomFamily<T, any, E>): AtomFamilyToken<T, any, E>;
|
|
435
|
+
declare function deposit<T, E>(state: WritablePureSelectorFamily<T, any, E>): WritablePureSelectorFamilyToken<T, any, E>;
|
|
436
|
+
declare function deposit<T, E>(state: ReadonlyPureSelectorFamily<T, any, E>): ReadonlyPureSelectorFamilyToken<T, any, E>;
|
|
437
|
+
declare function deposit<T, E>(state: SelectorFamily<T, any, E>): SelectorFamilyToken<T, any, E>;
|
|
438
|
+
declare function deposit<T, E>(state: WritableFamily<T, any, E>): WritableFamilyToken<T, any, E>;
|
|
439
|
+
declare function deposit<T, E>(state: ReadableFamily<T, any, E>): ReadableFamilyToken<T, any, E>;
|
|
440
|
+
declare function deposit<T extends Fn>(state: Transaction<T>): TransactionToken<T>;
|
|
441
441
|
declare function deposit<M extends TimelineManageable>(state: Timeline<M>): TimelineToken<M>;
|
|
442
442
|
declare function deposit(resource: AtomIOInternalResource): AtomIOToken;
|
|
443
443
|
//#endregion
|
|
@@ -475,19 +475,19 @@ interface Lineage {
|
|
|
475
475
|
parent: typeof this | null;
|
|
476
476
|
child: typeof this | null;
|
|
477
477
|
}
|
|
478
|
-
declare function newest<T
|
|
479
|
-
declare function eldest<T
|
|
478
|
+
declare function newest<T extends Lineage>(scion: T): Exclude<T[`child`], null> | T;
|
|
479
|
+
declare function eldest<T extends Lineage>(scion: T): Exclude<T[`parent`], T[`child`] | null>;
|
|
480
480
|
//#endregion
|
|
481
481
|
//#region src/internal/molecule.d.ts
|
|
482
|
-
type Molecule<K
|
|
483
|
-
readonly key: K
|
|
484
|
-
readonly stringKey: stringified<K
|
|
482
|
+
type Molecule<K extends Canonical> = {
|
|
483
|
+
readonly key: K;
|
|
484
|
+
readonly stringKey: stringified<K>;
|
|
485
485
|
readonly dependsOn: `all` | `any`;
|
|
486
486
|
readonly subject: Subject<void>;
|
|
487
487
|
};
|
|
488
488
|
declare function makeRootMoleculeInStore<S$1 extends string>(store: Store, key: S$1): S$1;
|
|
489
489
|
declare function allocateIntoStore<H extends Hierarchy, V extends Vassal<H>, A extends Above<V, H>>(store: Store, provenance: A, key: V, dependsOn?: `all` | `any`): ValidKey<V>;
|
|
490
|
-
declare function fuseWithinStore<H extends Hierarchy, C extends CompoundFrom<H>, T
|
|
490
|
+
declare function fuseWithinStore<H extends Hierarchy, C extends CompoundFrom<H>, T extends (C extends CompoundTypedKey<infer t, any, any> ? t : never), A extends (C extends CompoundTypedKey<any, infer a, any> ? a : never), B extends (C extends CompoundTypedKey<any, any, infer b> ? b : never)>(store: Store, type: T, sideA: SingularTypedKey<A>, sideB: SingularTypedKey<B>): ValidKey<CompoundTypedKey<T, A, B>>;
|
|
491
491
|
declare function createDeallocateTX<H extends Hierarchy, V extends Exclude<Vassal<H>, CompoundTypedKey>>(store: RootStore): TransactionToken<(claim: ValidKey<V>) => void>;
|
|
492
492
|
declare function deallocateFromStore<H extends Hierarchy, V extends Vassal<H>>(target: Store, claim: ValidKey<V>): void;
|
|
493
493
|
declare function createClaimTX<H extends Hierarchy, V extends Exclude<Vassal<H>, CompoundTypedKey>, A extends Above<V, H>>(store: RootStore): TransactionToken<(newProvenance: A, claim: ValidKey<V>, exclusive?: `exclusive`) => void>;
|
|
@@ -578,38 +578,38 @@ declare const IMPLICIT: {
|
|
|
578
578
|
declare const clearStore: (store: Store) => void;
|
|
579
579
|
//#endregion
|
|
580
580
|
//#region src/internal/store/withdraw.d.ts
|
|
581
|
-
declare function withdraw<T
|
|
582
|
-
declare function withdraw<T
|
|
583
|
-
declare function withdraw<T
|
|
584
|
-
declare function withdraw<T
|
|
585
|
-
declare function withdraw<T
|
|
586
|
-
declare function withdraw<T
|
|
587
|
-
declare function withdraw<T
|
|
588
|
-
declare function withdraw<T
|
|
589
|
-
declare function withdraw<T
|
|
590
|
-
declare function withdraw<T
|
|
591
|
-
declare function withdraw<T
|
|
592
|
-
declare function withdraw<T
|
|
593
|
-
declare function withdraw<T
|
|
594
|
-
declare function withdraw<T
|
|
595
|
-
declare function withdraw<T
|
|
596
|
-
declare function withdraw<T
|
|
597
|
-
declare function withdraw<T
|
|
598
|
-
declare function withdraw<T
|
|
599
|
-
declare function withdraw<T
|
|
600
|
-
declare function withdraw<T
|
|
601
|
-
declare function withdraw<T
|
|
602
|
-
declare function withdraw<T
|
|
603
|
-
declare function withdraw<T
|
|
604
|
-
declare function withdraw<T
|
|
605
|
-
declare function withdraw<T
|
|
606
|
-
declare function withdraw<T
|
|
607
|
-
declare function withdraw<T
|
|
608
|
-
declare function withdraw<T
|
|
609
|
-
declare function withdraw<T
|
|
610
|
-
declare function withdraw<T
|
|
611
|
-
declare function withdraw<T
|
|
612
|
-
declare function withdraw<T
|
|
581
|
+
declare function withdraw<T, E>(store: Store, token: RegularAtomToken<T, any, E>): RegularAtom<T, E>;
|
|
582
|
+
declare function withdraw<T extends Transceiver<any, any, any>>(store: Store, token: MutableAtomToken<T, any>): MutableAtom<T>;
|
|
583
|
+
declare function withdraw<T, E>(store: Store, token: AtomToken<T, any, E>): Atom<T, E>;
|
|
584
|
+
declare function withdraw<T>(store: Store, token: WritableHeldSelectorToken<T>): WritableHeldSelector<T>;
|
|
585
|
+
declare function withdraw<T>(store: Store, token: ReadonlyHeldSelectorToken<T>): ReadonlyHeldSelector<T>;
|
|
586
|
+
declare function withdraw<T, E>(store: Store, token: WritablePureSelectorToken<T, any, E>): WritablePureSelector<T, E>;
|
|
587
|
+
declare function withdraw<T, E>(store: Store, token: ReadonlyPureSelectorToken<T, any, E>): ReadonlyPureSelector<T, E>;
|
|
588
|
+
declare function withdraw<T, E>(store: Store, token: ReadonlySelectorToken<T, any, E>): ReadonlySelector<T, E>;
|
|
589
|
+
declare function withdraw<T, E>(store: Store, token: WritableSelectorToken<T, any, E>): WritableSelector<T, E>;
|
|
590
|
+
declare function withdraw<T>(store: Store, token: HeldSelectorToken<T>): HeldSelector<T>;
|
|
591
|
+
declare function withdraw<T, E>(store: Store, token: PureSelectorToken<T, any, E>): PureSelector<T, E>;
|
|
592
|
+
declare function withdraw<T, E>(store: Store, token: SelectorToken<T, any, E>): Selector<T, E>;
|
|
593
|
+
declare function withdraw<T, E>(store: Store, token: WritableToken<T, any, E>): WritableState<T, E>;
|
|
594
|
+
declare function withdraw<T, E>(store: Store, token: ReadableToken<T, any, E>): ReadableState<T, E>;
|
|
595
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: RegularAtomFamilyToken<T, K, E>): RegularAtomFamily<T, K, E>;
|
|
596
|
+
declare function withdraw<T extends Transceiver<any, any, any>, K extends Canonical>(store: Store, token: MutableAtomFamilyToken<T, K>): MutableAtomFamily<T, K>;
|
|
597
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: AtomFamilyToken<T, K, E>): AtomFamily<T, K, E>;
|
|
598
|
+
declare function withdraw<T, K extends Canonical>(store: Store, token: ReadonlyHeldSelectorFamilyToken<T, K>): ReadonlyHeldSelectorFamily<T, K>;
|
|
599
|
+
declare function withdraw<T, K extends Canonical>(store: Store, token: WritableHeldSelectorFamilyToken<T, K>): WritableHeldSelectorFamily<T, K>;
|
|
600
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: ReadonlyPureSelectorFamilyToken<T, K, E>): ReadonlyPureSelectorFamily<T, K, E>;
|
|
601
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: WritablePureSelectorFamilyToken<T, K, E>): WritablePureSelectorFamily<T, K, E>;
|
|
602
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: ReadonlySelectorFamilyToken<T, K, E>): ReadonlySelectorFamily<T, K, E>;
|
|
603
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: WritableSelectorFamilyToken<T, K, E>): WritableSelectorFamily<T, K, E>;
|
|
604
|
+
declare function withdraw<T, K extends Canonical>(store: Store, token: HeldSelectorFamilyToken<T, K>): HeldSelectorFamily<T, K>;
|
|
605
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: PureSelectorFamilyToken<T, K, E>): PureSelectorFamily<T, K, E>;
|
|
606
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: SelectorFamilyToken<T, K, E>): SelectorFamily<T, K, E>;
|
|
607
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: WritableFamilyToken<T, K, E>): WritableFamily<T, K, E>;
|
|
608
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: ReadableFamilyToken<T, K, E>): ReadableFamily<T, K, E>;
|
|
609
|
+
declare function withdraw<T extends Fn>(store: Store, token: TransactionToken<T>): Transaction<T extends Fn ? T : never>;
|
|
610
|
+
declare function withdraw<T>(store: Store, token: TimelineToken<T>): Timeline<T extends TimelineManageable ? T : never>;
|
|
611
|
+
declare function withdraw<T, E>(store: Store, token: WritableToken<T, any, E>): WritableState<T, E>;
|
|
612
|
+
declare function withdraw<T, E>(store: Store, token: ReadableToken<T, any, E>): ReadableState<T, E>;
|
|
613
613
|
declare function withdraw(store: Store, token: AtomIOToken): AtomIOInternalResource;
|
|
614
614
|
//#endregion
|
|
615
615
|
//#region src/internal/atom/has-role.d.ts
|
|
@@ -618,7 +618,7 @@ type InternalRole = (typeof INTERNAL_ROLES)[number];
|
|
|
618
618
|
declare function hasRole(atom: Atom<any, any>, role: InternalRole): boolean;
|
|
619
619
|
//#endregion
|
|
620
620
|
//#region src/internal/atom/create-regular-atom.d.ts
|
|
621
|
-
declare function createRegularAtom<T
|
|
621
|
+
declare function createRegularAtom<T, K extends Canonical, E>(store: Store, options: RegularAtomOptions<T, E>, family: FamilyMetadata<K> | undefined, internalRoles?: InternalRole[]): RegularAtomToken<T, K, E>;
|
|
622
622
|
//#endregion
|
|
623
623
|
//#region src/internal/atom/dispose-atom.d.ts
|
|
624
624
|
declare function disposeAtom(store: Store, atomToken: AtomToken<any, any, any>): void;
|
|
@@ -633,27 +633,27 @@ declare function disposeAtom(store: Store, atomToken: AtomToken<any, any, any>):
|
|
|
633
633
|
* @remarks
|
|
634
634
|
* Can be constructed like a Promise, or from an existing Promise.
|
|
635
635
|
*/
|
|
636
|
-
declare class Future<T
|
|
636
|
+
declare class Future<T> extends Promise<T> {
|
|
637
637
|
private fate;
|
|
638
638
|
private resolve;
|
|
639
639
|
private reject;
|
|
640
640
|
done: boolean;
|
|
641
|
-
constructor(executor: Promise<T
|
|
641
|
+
constructor(executor: Promise<T> | ((resolve: (value: T) => void, reject: (reason?: any) => void) => void));
|
|
642
642
|
private pass;
|
|
643
643
|
private fail;
|
|
644
|
-
use(value: Promise<T
|
|
644
|
+
use(value: Promise<T> | T): void;
|
|
645
645
|
}
|
|
646
646
|
//#endregion
|
|
647
647
|
//#region src/internal/caching.d.ts
|
|
648
|
-
declare function writeToCache<T
|
|
649
|
-
declare function writeToCache<T
|
|
648
|
+
declare function writeToCache<T, E>(target: Store, state: ReadableState<T, E>, value: E | T): E | T;
|
|
649
|
+
declare function writeToCache<T extends Promise<any>, E>(target: Store, state: ReadableState<T, E>, value: T): Future<Awaited<E | T>>;
|
|
650
650
|
/**
|
|
651
651
|
* @param target - the newest layer of the store
|
|
652
652
|
* @param state - the state to read from cache
|
|
653
653
|
* @param mut - whether the value is intended to be mutable
|
|
654
654
|
* @returns the state's current value
|
|
655
655
|
*/
|
|
656
|
-
declare function readFromCache<T
|
|
656
|
+
declare function readFromCache<T, E>(target: Store, state: ReadableState<T, E>, mut: `mut` | undefined): E | T;
|
|
657
657
|
declare function evictCachedValue(target: Store, key: string): void;
|
|
658
658
|
//#endregion
|
|
659
659
|
//#region src/internal/capitalize.d.ts
|
|
@@ -676,52 +676,52 @@ declare function ingestSelectorUpdateEvent(store: Store, selectorUpdate: Timelin
|
|
|
676
676
|
declare function ingestTransactionOutcomeEvent(store: Store, event: TransactionOutcomeEvent<any>, applying: `newValue` | `oldValue`): void;
|
|
677
677
|
//#endregion
|
|
678
678
|
//#region src/internal/families/create-readonly-pure-selector-family.d.ts
|
|
679
|
-
declare function createReadonlyPureSelectorFamily<T
|
|
679
|
+
declare function createReadonlyPureSelectorFamily<T, K extends Canonical, E>(store: RootStore, options: ReadonlyPureSelectorFamilyOptions<T, K, E>, internalRoles?: string[]): ReadonlyPureSelectorFamilyToken<T, K, E>;
|
|
680
680
|
//#endregion
|
|
681
681
|
//#region src/internal/families/create-regular-atom-family.d.ts
|
|
682
|
-
declare function createRegularAtomFamily<T
|
|
682
|
+
declare function createRegularAtomFamily<T, K extends Canonical, E>(store: RootStore, options: RegularAtomFamilyOptions<T, K, E>, internalRoles?: string[]): RegularAtomFamilyToken<T, K, E>;
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/internal/families/create-selector-family.d.ts
|
|
685
|
-
declare function createSelectorFamily<T
|
|
686
|
-
declare function createSelectorFamily<T
|
|
687
|
-
declare function createSelectorFamily<T
|
|
688
|
-
declare function createSelectorFamily<T
|
|
685
|
+
declare function createSelectorFamily<T extends object, K extends Canonical>(store: RootStore, options: WritableHeldSelectorFamilyOptions<T, K>): WritableHeldSelectorFamilyToken<T, K>;
|
|
686
|
+
declare function createSelectorFamily<T extends object, K extends Canonical>(store: RootStore, options: ReadonlyHeldSelectorFamilyOptions<T, K>): ReadonlyHeldSelectorFamilyToken<T, K>;
|
|
687
|
+
declare function createSelectorFamily<T, K extends Canonical, E>(store: RootStore, options: WritablePureSelectorFamilyOptions<T, K, E>): WritablePureSelectorFamilyToken<T, K, E>;
|
|
688
|
+
declare function createSelectorFamily<T, K extends Canonical, E>(store: RootStore, options: ReadonlyPureSelectorFamilyOptions<T, K, E>): ReadonlyPureSelectorFamilyToken<T, K, E>;
|
|
689
689
|
//#endregion
|
|
690
690
|
//#region src/internal/families/create-writable-pure-selector-family.d.ts
|
|
691
|
-
declare function createWritablePureSelectorFamily<T
|
|
691
|
+
declare function createWritablePureSelectorFamily<T, K extends Canonical, E>(store: Store, options: WritablePureSelectorFamilyOptions<T, K, E>, internalRoles?: string[]): WritablePureSelectorFamilyToken<T, K, E>;
|
|
692
692
|
//#endregion
|
|
693
693
|
//#region src/internal/families/dispose-from-store.d.ts
|
|
694
694
|
declare function disposeFromStore(store: Store, token: ReadableToken<any, any, any>): void;
|
|
695
|
-
declare function disposeFromStore<K
|
|
696
|
-
declare function disposeFromStore<K
|
|
695
|
+
declare function disposeFromStore<K extends Canonical>(store: Store, token: ReadableFamilyToken<any, K, any>, key: NoInfer<K>): void;
|
|
696
|
+
declare function disposeFromStore<K extends Canonical>(store: Store, ...params: [token: ReadableFamilyToken<any, K, any>, key: NoInfer<K>] | [token: ReadableToken<any, any, any>]): void;
|
|
697
697
|
//#endregion
|
|
698
698
|
//#region src/internal/families/find-in-store.d.ts
|
|
699
|
-
declare function findInStore<T
|
|
700
|
-
declare function findInStore<T
|
|
701
|
-
declare function findInStore<T
|
|
702
|
-
declare function findInStore<T
|
|
703
|
-
declare function findInStore<T
|
|
704
|
-
declare function findInStore<T
|
|
705
|
-
declare function findInStore<T
|
|
706
|
-
declare function findInStore<T
|
|
699
|
+
declare function findInStore<T extends Transceiver<any, any, any>, K extends Canonical, Key extends K>(store: Store, familyToken: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, Key>;
|
|
700
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: RegularAtomFamilyToken<T, K, E>, key: Key): RegularAtomToken<T, Key, E>;
|
|
701
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: AtomFamilyToken<T, K, E>, key: Key): AtomToken<T, Key, E>;
|
|
702
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: WritablePureSelectorFamilyToken<T, K, E>, key: Key): WritablePureSelectorToken<T, Key, E>;
|
|
703
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: ReadonlyPureSelectorFamilyToken<T, K, E>, key: Key): ReadonlyPureSelectorToken<T, Key, E>;
|
|
704
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: SelectorFamilyToken<T, K, E>, key: Key): SelectorToken<T, Key, E>;
|
|
705
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: WritableFamilyToken<T, K, E>, key: Key): WritableToken<T, Key, E>;
|
|
706
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: ReadableFamilyToken<T, K, E>, key: Key): ReadableToken<T, Key, E>;
|
|
707
707
|
//#endregion
|
|
708
708
|
//#region src/internal/families/get-family-of-token.d.ts
|
|
709
|
-
declare function getFamilyOfToken<T
|
|
710
|
-
declare function getFamilyOfToken<T
|
|
711
|
-
declare function getFamilyOfToken<T
|
|
712
|
-
declare function getFamilyOfToken<T
|
|
713
|
-
declare function getFamilyOfToken<T
|
|
714
|
-
declare function getFamilyOfToken<T
|
|
709
|
+
declare function getFamilyOfToken<T extends Transceiver<any, any, any>, K extends Canonical>(store: Store, token: MutableAtomToken<T, K>): MutableAtomFamily<T, K>;
|
|
710
|
+
declare function getFamilyOfToken<T, K extends Canonical, E>(store: Store, token: RegularAtomToken<T, K, E>): RegularAtomFamily<T, K, E>;
|
|
711
|
+
declare function getFamilyOfToken<T, K extends Canonical, E>(store: Store, token: WritablePureSelectorToken<T, K, E>): WritablePureSelectorFamily<T, K, E>;
|
|
712
|
+
declare function getFamilyOfToken<T, K extends Canonical, E>(store: Store, token: ReadonlyPureSelectorToken<T, K, E>): ReadonlyPureSelectorFamily<T, K, E>;
|
|
713
|
+
declare function getFamilyOfToken<T, K extends Canonical, E>(store: Store, token: WritableToken<T, K, E>): WritableFamily<T, K, E>;
|
|
714
|
+
declare function getFamilyOfToken<T, K extends Canonical, E>(store: Store, token: ReadableToken<T, K, E>): ReadableFamily<T, K, E>;
|
|
715
715
|
//#endregion
|
|
716
716
|
//#region src/internal/families/seek-in-store.d.ts
|
|
717
|
-
declare function seekInStore<T
|
|
718
|
-
declare function seekInStore<T
|
|
719
|
-
declare function seekInStore<T
|
|
720
|
-
declare function seekInStore<T
|
|
721
|
-
declare function seekInStore<T
|
|
722
|
-
declare function seekInStore<T
|
|
723
|
-
declare function seekInStore<T
|
|
724
|
-
declare function seekInStore<T
|
|
717
|
+
declare function seekInStore<T extends Transceiver<any, any, any>, K extends Canonical, Key extends K>(store: Store, token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, Key> | undefined;
|
|
718
|
+
declare function seekInStore<T, K extends Canonical, Key extends K, E>(store: Store, token: RegularAtomFamilyToken<T, K, E>, key: Key): RegularAtomToken<T, Key, E> | undefined;
|
|
719
|
+
declare function seekInStore<T, K extends Canonical, Key extends K, E>(store: Store, token: AtomFamilyToken<T, K, E>, key: Key): AtomToken<T, Key, E> | undefined;
|
|
720
|
+
declare function seekInStore<T, K extends Canonical, Key extends K, E>(store: Store, token: WritablePureSelectorFamilyToken<T, K, E>, key: Key): WritablePureSelectorToken<T, Key, E> | undefined;
|
|
721
|
+
declare function seekInStore<T, K extends Canonical, Key extends K, E>(store: Store, token: ReadonlyPureSelectorFamilyToken<T, K, E>, key: Key): ReadonlyPureSelectorToken<T, Key, E> | undefined;
|
|
722
|
+
declare function seekInStore<T, K extends Canonical, Key extends K, E>(store: Store, token: SelectorFamilyToken<T, K, E>, key: Key): SelectorToken<T, Key, E> | undefined;
|
|
723
|
+
declare function seekInStore<T, K extends Canonical, Key extends K, E>(store: Store, token: WritableFamilyToken<T, K, E>, key: Key): WritableToken<T, Key, E> | undefined;
|
|
724
|
+
declare function seekInStore<T, K extends Canonical, Key extends K, E>(store: Store, token: ReadableFamilyToken<T, K, E>, key: Key): ReadableToken<T, Key, E> | undefined;
|
|
725
725
|
//#endregion
|
|
726
726
|
//#region src/internal/get-environment-data.d.ts
|
|
727
727
|
type EnvironmentData = {
|
|
@@ -730,14 +730,14 @@ type EnvironmentData = {
|
|
|
730
730
|
declare function getEnvironmentData(store: Store): EnvironmentData;
|
|
731
731
|
//#endregion
|
|
732
732
|
//#region src/internal/get-state/get-from-store.d.ts
|
|
733
|
-
declare function getFromStore<T
|
|
734
|
-
declare function getFromStore<T
|
|
735
|
-
declare function getFromStore<T
|
|
736
|
-
declare function getFromStore<T
|
|
733
|
+
declare function getFromStore<T>(store: Store, token: ReadableToken<T>): T;
|
|
734
|
+
declare function getFromStore<T, E>(store: Store, token: ReadableToken<T, any, E>): E | T;
|
|
735
|
+
declare function getFromStore<T, K extends Canonical, E>(store: Store, token: ReadableFamilyToken<T, K, E>, key: NoInfer<K>): ViewOf<E | T>;
|
|
736
|
+
declare function getFromStore<T, K extends Canonical, E>(store: Store, ...params: [token: ReadableFamilyToken<T, K, E>, key: NoInfer<K>] | [token: ReadableToken<T, any, E>]): ViewOf<E | T>;
|
|
737
737
|
//#endregion
|
|
738
738
|
//#region src/internal/get-state/read-or-compute-value.d.ts
|
|
739
|
-
declare function readOrComputeValue<T
|
|
740
|
-
declare function readOrComputeValue<T
|
|
739
|
+
declare function readOrComputeValue<T, E>(target: Store, state: ReadableState<T, E>, mut?: undefined): ViewOf<E | T>;
|
|
740
|
+
declare function readOrComputeValue<T, E>(target: Store, state: ReadableState<T, E>, mut: `mut`): E | T;
|
|
741
741
|
//#endregion
|
|
742
742
|
//#region src/internal/get-trace.d.ts
|
|
743
743
|
declare function getTrace(error: Error): string;
|
|
@@ -757,22 +757,22 @@ declare function installIntoStore(tokens: AtomIOToken[], target: RootStore, sour
|
|
|
757
757
|
declare function isFn(input: unknown): input is Fn;
|
|
758
758
|
//#endregion
|
|
759
759
|
//#region src/internal/keys.d.ts
|
|
760
|
-
type AtomKey<T
|
|
760
|
+
type AtomKey<T> = string & {
|
|
761
761
|
__atomKey?: never;
|
|
762
|
-
__brand?: T
|
|
762
|
+
__brand?: T;
|
|
763
763
|
};
|
|
764
|
-
type SelectorKey<T
|
|
764
|
+
type SelectorKey<T> = string & {
|
|
765
765
|
__selectorKey?: never;
|
|
766
|
-
__brand?: T
|
|
766
|
+
__brand?: T;
|
|
767
767
|
};
|
|
768
|
-
type ReadonlySelectorKey<T
|
|
768
|
+
type ReadonlySelectorKey<T> = string & {
|
|
769
769
|
__readonlySelectorKey?: never;
|
|
770
|
-
__brand?: T
|
|
770
|
+
__brand?: T;
|
|
771
771
|
};
|
|
772
772
|
declare const isAtomKey: (store: Store, key: string) => key is AtomKey<unknown>;
|
|
773
773
|
declare const isSelectorKey: (store: Store, key: string) => key is SelectorKey<unknown>;
|
|
774
774
|
declare const isReadonlySelectorKey: (store: Store, key: string) => key is ReadonlySelectorKey<unknown>;
|
|
775
|
-
type StateKey<T
|
|
775
|
+
type StateKey<T> = AtomKey<T> | ReadonlySelectorKey<T> | SelectorKey<T>;
|
|
776
776
|
declare const isStateKey: (store: Store, key: string) => key is StateKey<unknown>;
|
|
777
777
|
//#endregion
|
|
778
778
|
//#region src/internal/not-found-error.d.ts
|
|
@@ -785,22 +785,22 @@ type ReservedIntrospectionKey = `🔍 ${string}`;
|
|
|
785
785
|
declare function isReservedIntrospectionKey(value: string): value is ReservedIntrospectionKey;
|
|
786
786
|
//#endregion
|
|
787
787
|
//#region src/internal/selector/create-readonly-held-selector.d.ts
|
|
788
|
-
declare function createReadonlyHeldSelector<T
|
|
788
|
+
declare function createReadonlyHeldSelector<T extends object>(store: Store, options: ReadonlyHeldSelectorOptions<T>, family: FamilyMetadata | undefined): ReadonlyHeldSelectorToken<T>;
|
|
789
789
|
//#endregion
|
|
790
790
|
//#region src/internal/selector/create-readonly-pure-selector.d.ts
|
|
791
|
-
declare function createReadonlyPureSelector<T
|
|
791
|
+
declare function createReadonlyPureSelector<T, K extends Canonical, E>(store: Store, options: ReadonlyPureSelectorOptions<T, E>, family: FamilyMetadata<K> | undefined): ReadonlyPureSelectorToken<T, K, E>;
|
|
792
792
|
//#endregion
|
|
793
793
|
//#region src/internal/selector/create-standalone-selector.d.ts
|
|
794
|
-
declare function createStandaloneSelector<T
|
|
795
|
-
declare function createStandaloneSelector<T
|
|
796
|
-
declare function createStandaloneSelector<T
|
|
797
|
-
declare function createStandaloneSelector<T
|
|
794
|
+
declare function createStandaloneSelector<T extends object>(store: Store, options: WritableHeldSelectorOptions<T>): WritableHeldSelectorToken<T>;
|
|
795
|
+
declare function createStandaloneSelector<T extends object>(store: Store, options: ReadonlyHeldSelectorOptions<T>): ReadonlyHeldSelectorToken<T>;
|
|
796
|
+
declare function createStandaloneSelector<T, E>(store: Store, options: WritablePureSelectorOptions<T, E>): WritablePureSelectorToken<T, any, E>;
|
|
797
|
+
declare function createStandaloneSelector<T, E>(store: Store, options: ReadonlyPureSelectorOptions<T, E>): ReadonlyPureSelectorToken<T, any, E>;
|
|
798
798
|
//#endregion
|
|
799
799
|
//#region src/internal/selector/create-writable-held-selector.d.ts
|
|
800
|
-
declare function createWritableHeldSelector<T
|
|
800
|
+
declare function createWritableHeldSelector<T extends object>(store: Store, options: WritableHeldSelectorOptions<T>, family: FamilyMetadata | undefined): WritableHeldSelectorToken<T>;
|
|
801
801
|
//#endregion
|
|
802
802
|
//#region src/internal/selector/create-writable-pure-selector.d.ts
|
|
803
|
-
declare function createWritablePureSelector<T
|
|
803
|
+
declare function createWritablePureSelector<T, K extends Canonical, E>(store: Store, options: WritablePureSelectorOptions<T, E>, family: FamilyMetadata<K> | undefined): WritablePureSelectorToken<T, K, E>;
|
|
804
804
|
//#endregion
|
|
805
805
|
//#region src/internal/selector/dispose-selector.d.ts
|
|
806
806
|
declare function disposeSelector(store: Store, selectorToken: SelectorToken<unknown, any, any>): void;
|
|
@@ -818,7 +818,7 @@ declare function traceRootSelectorAtoms(store: Store, selectorKey: string, cover
|
|
|
818
818
|
declare function updateSelectorAtoms(store: Store, selectorType: `readonly_held_selector` | `readonly_pure_selector` | `writable_held_selector` | `writable_pure_selector`, selectorKey: string, dependency: ReadableToken<unknown, any, unknown>, covered: Set<string>): void;
|
|
819
819
|
//#endregion
|
|
820
820
|
//#region src/internal/set-state/become.d.ts
|
|
821
|
-
declare function become<T
|
|
821
|
+
declare function become<T>(nextVersionOfThing: T | ((prev: T) => T), originalThing: T): T;
|
|
822
822
|
//#endregion
|
|
823
823
|
//#region src/internal/set-state/evict-downstream.d.ts
|
|
824
824
|
declare function evictDownstreamFromAtom(store: Store, atom: Atom<any, any>): void;
|
|
@@ -827,22 +827,22 @@ declare function evictDownstreamFromSelector(store: Store, selectorKey: string):
|
|
|
827
827
|
//#region src/internal/set-state/reset-in-store.d.ts
|
|
828
828
|
declare const RESET_STATE: unique symbol;
|
|
829
829
|
declare function resetInStore(store: Store, token: WritableToken<any, any, any>): void;
|
|
830
|
-
declare function resetInStore<K
|
|
831
|
-
declare function resetInStore<T
|
|
830
|
+
declare function resetInStore<K extends Canonical>(store: Store, token: WritableFamilyToken<any, K, any>, key: NoInfer<K>): void;
|
|
831
|
+
declare function resetInStore<T, K extends Canonical>(store: Store, ...params: [token: WritableFamilyToken<T, K, any>, key: NoInfer<K>] | [token: WritableToken<T, any, any>]): void;
|
|
832
832
|
//#endregion
|
|
833
833
|
//#region src/internal/set-state/operate-on-store.d.ts
|
|
834
|
-
type ProtoUpdate<T
|
|
835
|
-
oldValue: T
|
|
836
|
-
newValue: T
|
|
834
|
+
type ProtoUpdate<T> = {
|
|
835
|
+
oldValue: T;
|
|
836
|
+
newValue: T;
|
|
837
837
|
};
|
|
838
838
|
declare const OWN_OP: unique symbol;
|
|
839
839
|
declare const JOIN_OP: unique symbol;
|
|
840
|
-
declare function operateOnStore<T
|
|
840
|
+
declare function operateOnStore<T, TT extends T, K extends Canonical, E>(opMode: typeof JOIN_OP | typeof OWN_OP, store: Store, ...params: [token: WritableFamilyToken<T, K, E>, key: NoInfer<K>, value: Setter<TT> | TT | typeof RESET_STATE] | [token: WritableToken<T, any, E>, value: Setter<TT> | TT | typeof RESET_STATE]): void;
|
|
841
841
|
//#endregion
|
|
842
842
|
//#region src/internal/set-state/reset-atom-or-selector.d.ts
|
|
843
|
-
declare function resetAtomOrSelector<T
|
|
843
|
+
declare function resetAtomOrSelector<T, E>(target: Store & {
|
|
844
844
|
operation: OpenOperation;
|
|
845
|
-
}, state: WritableState<T
|
|
845
|
+
}, state: WritableState<T, E>): ProtoUpdate<E | T>;
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/internal/set-state/set-atom-or-selector.d.ts
|
|
848
848
|
declare const setAtomOrSelector: <T>(target: Store & {
|
|
@@ -850,16 +850,16 @@ declare const setAtomOrSelector: <T>(target: Store & {
|
|
|
850
850
|
}, state: WritableState<T, any>, value: NoInfer<T> | ((oldValue: T) => NoInfer<T>)) => ProtoUpdate<T>;
|
|
851
851
|
//#endregion
|
|
852
852
|
//#region src/internal/set-state/set-into-store.d.ts
|
|
853
|
-
declare function setIntoStore<T
|
|
854
|
-
declare function setIntoStore<T
|
|
855
|
-
declare function setIntoStore<T
|
|
853
|
+
declare function setIntoStore<T, TT extends T>(store: Store, token: WritableToken<T, any, any>, value: Setter<TT> | TT | typeof RESET_STATE): void;
|
|
854
|
+
declare function setIntoStore<T, TT extends T, K extends Canonical>(store: Store, token: WritableFamilyToken<T, K, any>, key: NoInfer<K>, value: Setter<TT> | TT | typeof RESET_STATE): void;
|
|
855
|
+
declare function setIntoStore<T, TT extends T, K extends Canonical>(store: Store, ...params: [token: WritableFamilyToken<T, K, any>, key: NoInfer<K>, value: Setter<TT> | TT | typeof RESET_STATE] | [token: WritableToken<T, any, any>, value: Setter<TT> | TT | typeof RESET_STATE]): void;
|
|
856
856
|
//#endregion
|
|
857
857
|
//#region src/internal/subscribe/recall-state.d.ts
|
|
858
858
|
declare const recallState: <T, E>(store: Store, state: ReadableState<T, E>) => T;
|
|
859
859
|
//#endregion
|
|
860
860
|
//#region src/internal/subscribe/subscribe-in-store.d.ts
|
|
861
|
-
declare function subscribeInStore<T
|
|
862
|
-
declare function subscribeInStore<F
|
|
861
|
+
declare function subscribeInStore<T>(store: Store, token: ReadableToken<T>, handleUpdate: UpdateHandler<T>, key?: string): () => void;
|
|
862
|
+
declare function subscribeInStore<F extends Fn>(store: Store, token: TransactionToken<F>, handleUpdate: TransactionUpdateHandler<F>, key?: string): () => void;
|
|
863
863
|
declare function subscribeInStore<M extends TimelineManageable>(store: Store, token: TimelineToken<M>, handleUpdate: (update: TimelineEvent<M> | `redo` | `undo`) => void, key?: string): () => void;
|
|
864
864
|
declare function subscribeInStore<M extends TimelineManageable>(store: Store, token: ReadableToken<any> | TimelineToken<M> | TransactionToken<any>, handleUpdate: TransactionUpdateHandler<any> | UpdateHandler<any> | ((update: TimelineEvent<M> | `redo` | `undo`) => void), key?: string): () => void;
|
|
865
865
|
//#endregion
|
|
@@ -867,7 +867,7 @@ declare function subscribeInStore<M extends TimelineManageable>(store: Store, to
|
|
|
867
867
|
declare const subscribeToRootDependency: (target: Store, selector: Selector<any, any>, atom: Atom<any, any>) => (() => void);
|
|
868
868
|
//#endregion
|
|
869
869
|
//#region src/internal/subscribe/subscribe-to-state.d.ts
|
|
870
|
-
declare function subscribeToState<T
|
|
870
|
+
declare function subscribeToState<T, E>(store: Store, token: ReadableToken<T, any, E>, key: string, handleUpdate: UpdateHandler<E | T>): () => void;
|
|
871
871
|
//#endregion
|
|
872
872
|
//#region src/internal/subscribe/subscribe-to-timeline.d.ts
|
|
873
873
|
declare const subscribeToTimeline: <ManagedAtom extends TimelineManageable>(store: Store, token: TimelineToken<ManagedAtom>, key: string, handleUpdate: (update: TimelineEvent<any> | `redo` | `undo`) => void) => (() => void);
|