atom.io 0.36.0 → 0.36.2
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/internal/index.d.ts +93 -73
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +233 -248
- package/dist/internal/index.js.map +1 -1
- package/dist/introspection/index.d.ts +5 -6
- package/dist/introspection/index.d.ts.map +1 -1
- package/dist/introspection/index.js +2 -3
- package/dist/introspection/index.js.map +1 -1
- package/dist/main/index.d.ts +29 -37
- package/dist/main/index.d.ts.map +1 -1
- package/dist/main/index.js +8 -9
- package/dist/main/index.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-devtools/index.d.ts.map +1 -1
- package/dist/react-devtools/index.js.map +1 -1
- package/dist/realtime-client/index.d.ts +7 -8
- package/dist/realtime-client/index.d.ts.map +1 -1
- package/dist/realtime-client/index.js +3 -4
- package/dist/realtime-client/index.js.map +1 -1
- package/dist/realtime-react/index.d.ts +4 -4
- package/dist/realtime-react/index.d.ts.map +1 -1
- package/dist/realtime-react/index.js.map +1 -1
- package/dist/realtime-server/index.d.ts +2 -2
- package/dist/realtime-server/index.d.ts.map +1 -1
- package/dist/realtime-server/index.js.map +1 -1
- package/dist/transceivers/set-rtx/index.d.ts +9 -2
- package/dist/transceivers/set-rtx/index.d.ts.map +1 -1
- package/dist/transceivers/set-rtx/index.js +3 -0
- package/dist/transceivers/set-rtx/index.js.map +1 -1
- package/package.json +3 -3
- package/src/internal/atom/create-regular-atom.ts +5 -5
- package/src/internal/atom/has-role.ts +12 -0
- package/src/internal/atom/index.ts +1 -0
- package/src/internal/caching.ts +60 -41
- package/src/internal/families/find-in-store.ts +1 -1
- package/src/internal/families/get-family-of-token.ts +1 -1
- package/src/internal/families/init-family-member.ts +1 -1
- package/src/internal/families/seek-in-store.ts +1 -1
- package/src/internal/get-state/read-or-compute-value.ts +26 -21
- package/src/internal/index.ts +8 -8
- package/src/internal/join/create-join.ts +3 -2
- package/src/internal/join/join-internal.ts +7 -4
- package/src/internal/mutable/create-mutable-atom-family.ts +6 -5
- package/src/internal/mutable/create-mutable-atom.ts +1 -1
- package/src/internal/mutable/get-json-family.ts +1 -1
- package/src/internal/mutable/get-json-token.ts +1 -1
- package/src/internal/mutable/get-update-family.ts +1 -1
- package/src/internal/mutable/get-update-token.ts +1 -1
- package/src/internal/mutable/tracker-family.ts +27 -31
- package/src/internal/mutable/tracker.ts +29 -23
- package/src/internal/mutable/transceiver.ts +11 -10
- package/src/internal/selector/create-readonly-held-selector.ts +2 -2
- package/src/internal/selector/create-readonly-pure-selector.ts +2 -2
- package/src/internal/selector/create-writable-held-selector.ts +3 -4
- package/src/internal/selector/create-writable-pure-selector.ts +3 -3
- package/src/internal/set-state/evict-downstream.ts +17 -15
- package/src/internal/set-state/index.ts +1 -0
- package/src/internal/set-state/reset-in-store.ts +6 -50
- package/src/internal/set-state/set-atom.ts +17 -24
- package/src/internal/set-state/set-into-store.ts +29 -13
- package/src/internal/store/counterfeit.ts +1 -1
- package/src/internal/store/deposit.ts +7 -8
- package/src/internal/store/store.ts +6 -6
- package/src/internal/store/withdraw.ts +8 -8
- package/src/internal/subscribe/subscribe-in-store.ts +8 -8
- package/src/internal/subscribe/subscribe-to-timeline.ts +2 -2
- package/src/internal/subscribe/subscribe-to-transaction.ts +2 -2
- package/src/internal/timeline/create-timeline.ts +3 -3
- package/src/internal/transaction/act-upon-store.ts +2 -2
- package/src/internal/transaction/apply-transaction.ts +2 -2
- package/src/internal/transaction/build-transaction.ts +2 -2
- package/src/internal/transaction/create-transaction.ts +3 -3
- package/src/internal/transaction/index.ts +2 -2
- package/src/internal/transaction/is-root-store.ts +4 -2
- package/src/internal/utility-types.ts +1 -1
- package/src/introspection/attach-introspection-states.ts +3 -3
- package/src/introspection/attach-transaction-index.ts +4 -4
- package/src/introspection/attach-transaction-logs.ts +4 -4
- package/src/introspection/auditor.ts +3 -3
- package/src/main/atom.ts +4 -4
- package/src/main/dispose-state.ts +4 -3
- package/src/main/find-state.ts +1 -1
- package/src/main/get-state.ts +6 -5
- package/src/main/reset-state.ts +3 -3
- package/src/main/set-state.ts +3 -3
- package/src/main/subscribe.ts +3 -3
- package/src/main/tokens.ts +9 -18
- package/src/main/transaction.ts +13 -15
- package/src/react/use-json.ts +5 -5
- package/src/react-devtools/TransactionIndex.tsx +3 -3
- package/src/react-devtools/Updates.tsx +2 -2
- package/src/realtime-client/continuity/register-and-attempt-confirmed-update.ts +2 -2
- package/src/realtime-client/pull-mutable-atom-family-member.ts +8 -13
- package/src/realtime-client/pull-mutable-atom.ts +5 -8
- package/src/realtime-client/push-state.ts +6 -5
- package/src/realtime-client/server-action.ts +5 -4
- package/src/realtime-react/use-pull-mutable-atom.ts +1 -1
- package/src/realtime-react/use-pull-mutable-family-member.ts +1 -1
- package/src/realtime-react/use-server-action.ts +2 -2
- package/src/realtime-server/realtime-mutable-family-provider.ts +1 -1
- package/src/realtime-server/realtime-mutable-provider.ts +1 -1
- package/src/transceivers/set-rtx/set-rtx.ts +14 -1
- package/src/internal/set-state/copy-mutable-if-needed.ts +0 -29
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { Func as Func$1, Store as Store$1 } from "atom.io/internal";
|
|
2
1
|
import { Canonical, Json, stringified } from "atom.io/json";
|
|
3
|
-
import { Above, ActorToolkit, Anarchy, AtomFamilyToken, AtomIOLogger, AtomIOToken, AtomToken, Claim, CompoundFrom, CompoundTypedKey, FamilyMetadata, HeldSelectorFamilyToken, HeldSelectorToken, Hierarchy, JoinOptions, JoinStates, JoinToken, KeyedStateUpdate, Logger, MoleculeCreation, MoleculeDisposal, MoleculeTransfer, MutableAtomFamilyOptions, MutableAtomFamilyToken, MutableAtomOptions, MutableAtomToken, PureSelectorFamilyToken, PureSelectorToken, ReadableFamilyToken, ReadableToken, ReadonlyHeldSelectorFamilyOptions, ReadonlyHeldSelectorFamilyToken, ReadonlyHeldSelectorOptions, ReadonlyHeldSelectorToken, ReadonlyPureSelectorFamilyOptions, ReadonlyPureSelectorFamilyToken, ReadonlyPureSelectorOptions, ReadonlyPureSelectorToken, ReadonlySelectorFamilyToken, ReadonlySelectorToken, RegularAtomFamilyOptions, RegularAtomFamilyToken, RegularAtomOptions, RegularAtomToken, SelectorFamilyToken, SelectorToken, SingularTypedKey, StateCreation, StateDisposal, StateUpdate, TimelineManageable, TimelineOptions, TimelineToken, TimelineUpdate, TokenType, TransactionOptions, TransactionToken, TransactionUpdate, TransactionUpdateHandler, UpdateHandler, Vassal, WritableFamilyToken, WritableHeldSelectorFamilyOptions, WritableHeldSelectorFamilyToken, WritableHeldSelectorOptions, WritableHeldSelectorToken, WritablePureSelectorFamilyOptions, WritablePureSelectorFamilyToken, WritablePureSelectorOptions, WritablePureSelectorToken, WritableSelectorFamilyToken, WritableSelectorToken, WritableToken, WriterToolkit } from "atom.io";
|
|
2
|
+
import { Above, ActorToolkit, Anarchy, AtomFamilyToken, AtomIOLogger, AtomIOToken, AtomToken, Claim, CompoundFrom, CompoundTypedKey, FamilyMetadata, HeldSelectorFamilyToken, HeldSelectorToken, Hierarchy, JoinOptions, JoinStates, JoinToken, KeyedStateUpdate, Logger, MoleculeCreation, MoleculeDisposal, MoleculeTransfer, MutableAtomFamilyOptions, MutableAtomFamilyToken, MutableAtomOptions, MutableAtomToken, PureSelectorFamilyToken, PureSelectorToken, ReadableFamilyToken, ReadableToken, ReadonlyHeldSelectorFamilyOptions, ReadonlyHeldSelectorFamilyToken, ReadonlyHeldSelectorOptions, ReadonlyHeldSelectorToken, ReadonlyPureSelectorFamilyOptions, ReadonlyPureSelectorFamilyToken, ReadonlyPureSelectorOptions, ReadonlyPureSelectorToken, ReadonlySelectorFamilyToken, ReadonlySelectorToken, RegularAtomFamilyOptions, RegularAtomFamilyToken, RegularAtomOptions, RegularAtomToken, SelectorFamilyToken, SelectorToken, SingularTypedKey, StateCreation, StateDisposal, StateLifecycleEvent, StateUpdate, TimelineManageable, TimelineOptions, TimelineToken, TimelineUpdate, TokenType, TransactionOptions, TransactionToken, TransactionUpdate, TransactionUpdateHandler, UpdateHandler, Vassal, WritableFamilyToken, WritableHeldSelectorFamilyOptions, WritableHeldSelectorFamilyToken, WritableHeldSelectorOptions, WritableHeldSelectorToken, WritablePureSelectorFamilyOptions, WritablePureSelectorFamilyToken, WritablePureSelectorOptions, WritablePureSelectorToken, WritableSelectorFamilyToken, WritableSelectorToken, WritableToken, WriterToolkit } from "atom.io";
|
|
4
3
|
import { SetRTX } from "atom.io/transceivers/set-rtx";
|
|
5
4
|
|
|
5
|
+
//#region src/internal/atom/has-role.d.ts
|
|
6
|
+
declare const INTERNAL_ROLES: readonly ["tracker:signal"];
|
|
7
|
+
type internalRole = (typeof INTERNAL_ROLES)[number];
|
|
8
|
+
declare function hasRole(atom: Atom<any>, role: internalRole): boolean;
|
|
9
|
+
//#endregion
|
|
6
10
|
//#region src/internal/store/circular-buffer.d.ts
|
|
7
11
|
declare class CircularBuffer<T> {
|
|
8
12
|
protected _buffer: T[];
|
|
@@ -25,7 +29,7 @@ declare const FAMILY_MEMBER_TOKEN_TYPES: {
|
|
|
25
29
|
readonly writable_held_selector_family: "writable_held_selector";
|
|
26
30
|
readonly writable_pure_selector_family: "writable_pure_selector";
|
|
27
31
|
};
|
|
28
|
-
declare function counterfeit<T extends Transceiver<any, any>, K extends Canonical, Key extends K>(token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T>;
|
|
32
|
+
declare function counterfeit<T extends Transceiver<any, any, any>, K extends Canonical, Key extends K>(token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T>;
|
|
29
33
|
declare function counterfeit<T, K extends Canonical, Key extends K>(token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T>;
|
|
30
34
|
declare function counterfeit<T, K extends Canonical, Key extends K>(token: AtomFamilyToken<T, K>, key: Key): AtomToken<T>;
|
|
31
35
|
declare function counterfeit<T, K extends Canonical, Key extends K>(token: WritablePureSelectorFamilyToken<T, K>, key: Key): WritablePureSelectorToken<T>;
|
|
@@ -35,7 +39,7 @@ declare function counterfeit<T, K extends Canonical, Key extends K>(token: Writa
|
|
|
35
39
|
declare function counterfeit<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T>;
|
|
36
40
|
//#endregion
|
|
37
41
|
//#region src/internal/utility-types.d.ts
|
|
38
|
-
type
|
|
42
|
+
type Fn = (...parameters: any[]) => any;
|
|
39
43
|
type Flat<R extends { [K in PropertyKey]: any }> = { [K in keyof R]: R[K] };
|
|
40
44
|
type Count<N extends number, A extends any[] = []> = [...A, any][`length`] extends N ? A[`length`] : A[`length`] | Count<N, [...A, any]>;
|
|
41
45
|
type Each<E extends any[]> = { [P in Count<E[`length`]>]: E[P] };
|
|
@@ -127,14 +131,26 @@ declare class Junction<const ASide extends string, const AType extends string, c
|
|
|
127
131
|
declare const abortTransaction: (store: Store) => void;
|
|
128
132
|
//#endregion
|
|
129
133
|
//#region src/internal/transaction/act-upon-store.d.ts
|
|
130
|
-
declare function actUponStore<F extends
|
|
134
|
+
declare function actUponStore<F extends Fn>(store: Store, token: TransactionToken<F>, id: string): (...parameters: Parameters<F>) => ReturnType<F>;
|
|
131
135
|
//#endregion
|
|
132
136
|
//#region src/internal/transaction/apply-transaction.d.ts
|
|
133
|
-
declare const applyTransaction: <F extends
|
|
137
|
+
declare const applyTransaction: <F extends Fn>(output: ReturnType<F>, store: Store) => void;
|
|
134
138
|
//#endregion
|
|
135
139
|
//#region src/internal/transaction/assign-transaction-to-continuity.d.ts
|
|
136
140
|
declare function assignTransactionToContinuity(store: Store, continuityKey: string, transactionKey: string): void;
|
|
137
141
|
//#endregion
|
|
142
|
+
//#region src/internal/lazy-map.d.ts
|
|
143
|
+
declare class LazyMap<K, V> extends Map<K, V> {
|
|
144
|
+
deleted: Set<K>;
|
|
145
|
+
protected readonly source: Map<K, V>;
|
|
146
|
+
constructor(source: Map<K, V>);
|
|
147
|
+
get(key: K): V | undefined;
|
|
148
|
+
set(key: K, value: V): this;
|
|
149
|
+
hasOwn(key: K): boolean;
|
|
150
|
+
has(key: K): boolean;
|
|
151
|
+
delete(key: K): boolean;
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
138
154
|
//#region src/internal/transaction/is-root-store.d.ts
|
|
139
155
|
interface RootStore extends Store {
|
|
140
156
|
transactionMeta: TransactionEpoch;
|
|
@@ -142,9 +158,10 @@ interface RootStore extends Store {
|
|
|
142
158
|
child: ChildStore | null;
|
|
143
159
|
}
|
|
144
160
|
interface ChildStore extends Store {
|
|
145
|
-
transactionMeta: TransactionProgress<
|
|
161
|
+
transactionMeta: TransactionProgress<Fn>;
|
|
146
162
|
parent: ChildStore | RootStore;
|
|
147
163
|
child: ChildStore | null;
|
|
164
|
+
valueMap: LazyMap<string, any>;
|
|
148
165
|
}
|
|
149
166
|
declare function isRootStore(store: Store): store is RootStore;
|
|
150
167
|
declare function isChildStore(store: Store): store is ChildStore;
|
|
@@ -167,14 +184,14 @@ declare class StatefulSubject<T> extends Subject<T> {
|
|
|
167
184
|
}
|
|
168
185
|
//#endregion
|
|
169
186
|
//#region src/internal/transaction/create-transaction.d.ts
|
|
170
|
-
type Transaction<F extends
|
|
187
|
+
type Transaction<F extends Fn> = {
|
|
171
188
|
key: string;
|
|
172
189
|
type: `transaction`;
|
|
173
190
|
install: (store: Store) => void;
|
|
174
191
|
subject: Subject<TransactionUpdate<F>>;
|
|
175
192
|
run: (parameters: Parameters<F>, id?: string) => ReturnType<F>;
|
|
176
193
|
};
|
|
177
|
-
declare function createTransaction<F extends
|
|
194
|
+
declare function createTransaction<F extends Fn>(store: Store, options: TransactionOptions<F>): TransactionToken<F>;
|
|
178
195
|
//#endregion
|
|
179
196
|
//#region src/internal/transaction/get-epoch-number.d.ts
|
|
180
197
|
declare function getContinuityKey(store: RootStore, transactionKey: string): string | undefined;
|
|
@@ -188,7 +205,7 @@ declare function setEpochNumberOfAction(store: Store, transactionKey: string, ne
|
|
|
188
205
|
//#region src/internal/transaction/index.d.ts
|
|
189
206
|
declare const TRANSACTION_PHASES: readonly ["idle", "building", "applying"];
|
|
190
207
|
type TransactionPhase = (typeof TRANSACTION_PHASES)[number];
|
|
191
|
-
type TransactionProgress<F extends
|
|
208
|
+
type TransactionProgress<F extends Fn> = {
|
|
192
209
|
phase: `applying` | `building`;
|
|
193
210
|
update: TransactionUpdate<F>;
|
|
194
211
|
toolkit: ActorToolkit;
|
|
@@ -200,7 +217,7 @@ type TransactionEpoch = {
|
|
|
200
217
|
//#endregion
|
|
201
218
|
//#region src/internal/store/deposit.d.ts
|
|
202
219
|
declare function deposit<T>(state: RegularAtom<T>): RegularAtomToken<T>;
|
|
203
|
-
declare function deposit<T extends Transceiver<any, any>>(state: MutableAtom<T>): MutableAtomToken<T>;
|
|
220
|
+
declare function deposit<T extends Transceiver<any, any, any>>(state: MutableAtom<T>): MutableAtomToken<T>;
|
|
204
221
|
declare function deposit<T>(state: Atom<T>): AtomToken<T>;
|
|
205
222
|
declare function deposit<T>(state: WritablePureSelector<T>): WritablePureSelectorToken<T>;
|
|
206
223
|
declare function deposit<T>(state: ReadonlyPureSelector<T>): ReadonlyPureSelectorToken<T>;
|
|
@@ -208,19 +225,19 @@ declare function deposit<T>(state: Selector<T>): SelectorToken<T>;
|
|
|
208
225
|
declare function deposit<T>(state: WritableState<T>): WritableToken<T>;
|
|
209
226
|
declare function deposit<T>(state: ReadableState<T>): ReadableToken<T>;
|
|
210
227
|
declare function deposit<T, K extends Canonical>(state: RegularAtomFamily<T, K>): RegularAtomFamilyToken<T, K>;
|
|
211
|
-
declare function deposit<T extends Transceiver<any, any>, K extends Canonical>(state: MutableAtomFamily<T, K>): MutableAtomFamilyToken<T, K>;
|
|
228
|
+
declare function deposit<T extends Transceiver<any, any, any>, K extends Canonical>(state: MutableAtomFamily<T, K>): MutableAtomFamilyToken<T, K>;
|
|
212
229
|
declare function deposit<T>(state: AtomFamily<T, any>): AtomFamilyToken<T, any>;
|
|
213
230
|
declare function deposit<T>(state: WritablePureSelectorFamily<T, any>): WritablePureSelectorFamilyToken<T, any>;
|
|
214
231
|
declare function deposit<T>(state: ReadonlyPureSelectorFamily<T, any>): ReadonlyPureSelectorFamilyToken<T, any>;
|
|
215
232
|
declare function deposit<T>(state: SelectorFamily<T, any>): SelectorFamilyToken<T, any>;
|
|
216
233
|
declare function deposit<T>(state: WritableFamily<T, any>): WritableFamilyToken<T, any>;
|
|
217
234
|
declare function deposit<T>(state: ReadableFamily<T, any>): ReadableFamilyToken<T, any>;
|
|
218
|
-
declare function deposit<T extends
|
|
235
|
+
declare function deposit<T extends Fn>(state: Transaction<T>): TransactionToken<T>;
|
|
219
236
|
declare function deposit<M extends TimelineManageable>(state: Timeline<M>): TimelineToken<M>;
|
|
220
237
|
declare function deposit(resource: AtomIOInternalResource): AtomIOToken;
|
|
221
238
|
//#endregion
|
|
222
239
|
//#region src/internal/join/create-join.d.ts
|
|
223
|
-
declare function createJoin<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object>(store: Store
|
|
240
|
+
declare function createJoin<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object>(store: Store, options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>, defaultContent: Content | undefined): JoinToken<ASide, AType, BSide, BType, Cardinality, Content>;
|
|
224
241
|
//#endregion
|
|
225
242
|
//#region src/internal/join/edit-relations-in-store.d.ts
|
|
226
243
|
declare function editRelationsInStore<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>, change: (relations: Junction<ASide, AType, BSide, BType, Content>) => void, store: Store): void;
|
|
@@ -300,7 +317,7 @@ type TimelineSelectorUpdate<ManagedAtom extends TimelineManageable> = {
|
|
|
300
317
|
timestamp: number;
|
|
301
318
|
atomUpdates: Omit<TimelineAtomUpdate<ManagedAtom>, `timestamp`>[];
|
|
302
319
|
};
|
|
303
|
-
type TimelineTransactionUpdate = Flat<TransactionUpdate<
|
|
320
|
+
type TimelineTransactionUpdate = Flat<TransactionUpdate<Fn> & {
|
|
304
321
|
key: string;
|
|
305
322
|
type: `transaction_update`;
|
|
306
323
|
timestamp: number;
|
|
@@ -349,11 +366,11 @@ declare class Store implements Lineage {
|
|
|
349
366
|
selectorGraph: Junction<`upstreamSelectorKey`, string, `downstreamSelectorKey`, string, {
|
|
350
367
|
source: string;
|
|
351
368
|
}>;
|
|
352
|
-
trackers: Map<string, Tracker<Transceiver<any, any>>>;
|
|
369
|
+
trackers: Map<string, Tracker<Transceiver<any, any, any>>>;
|
|
353
370
|
families: Map<string, HeldSelectorFamily<any, any> | MutableAtomFamily<any, any> | PureSelectorFamily<any, any> | RegularAtomFamily<any, any>>;
|
|
354
371
|
joins: Map<string, Join<any, any, any, any, any, any>>;
|
|
355
|
-
transactions: Map<string, Transaction<
|
|
356
|
-
transactionMeta: TransactionEpoch | TransactionProgress<
|
|
372
|
+
transactions: Map<string, Transaction<Fn>>;
|
|
373
|
+
transactionMeta: TransactionEpoch | TransactionProgress<Fn>;
|
|
357
374
|
timelines: Map<string, Timeline<any>>;
|
|
358
375
|
timelineTopics: Junction<`timelineKey`, string, `topicKey`, string, {
|
|
359
376
|
topicType: `atom_family` | `atom` | `molecule_family` | `molecule`;
|
|
@@ -385,8 +402,8 @@ type StoreEventCarrier = {
|
|
|
385
402
|
selectorCreation: Subject<SelectorToken<unknown>>;
|
|
386
403
|
selectorDisposal: Subject<SelectorToken<unknown>>;
|
|
387
404
|
timelineCreation: Subject<TimelineToken<unknown>>;
|
|
388
|
-
transactionCreation: Subject<TransactionToken<
|
|
389
|
-
transactionApplying: StatefulSubject<TransactionProgress<
|
|
405
|
+
transactionCreation: Subject<TransactionToken<Fn>>;
|
|
406
|
+
transactionApplying: StatefulSubject<TransactionProgress<Fn> | null>;
|
|
390
407
|
operationClose: Subject<OperationProgress>;
|
|
391
408
|
moleculeCreation: Subject<MoleculeCreation>;
|
|
392
409
|
moleculeDisposal: Subject<MoleculeDisposal>;
|
|
@@ -401,7 +418,7 @@ declare const clearStore: (store: Store) => void;
|
|
|
401
418
|
//#endregion
|
|
402
419
|
//#region src/internal/store/withdraw.d.ts
|
|
403
420
|
declare function withdraw<T>(store: Store, token: RegularAtomToken<T>): RegularAtom<T>;
|
|
404
|
-
declare function withdraw<T extends Transceiver<any, any>>(store: Store, token: MutableAtomToken<T, any>): MutableAtom<T>;
|
|
421
|
+
declare function withdraw<T extends Transceiver<any, any, any>>(store: Store, token: MutableAtomToken<T, any>): MutableAtom<T>;
|
|
405
422
|
declare function withdraw<T>(store: Store, token: AtomToken<T>): Atom<T>;
|
|
406
423
|
declare function withdraw<T>(store: Store, token: WritableHeldSelectorToken<T>): WritableHeldSelector<T>;
|
|
407
424
|
declare function withdraw<T>(store: Store, token: ReadonlyHeldSelectorToken<T>): ReadonlyHeldSelector<T>;
|
|
@@ -415,7 +432,7 @@ declare function withdraw<T>(store: Store, token: SelectorToken<T>): Selector<T>
|
|
|
415
432
|
declare function withdraw<T>(store: Store, token: WritableToken<T>): WritableState<T>;
|
|
416
433
|
declare function withdraw<T>(store: Store, token: ReadableToken<T>): ReadableState<T>;
|
|
417
434
|
declare function withdraw<T, K extends Canonical>(store: Store, token: RegularAtomFamilyToken<T, K>): RegularAtomFamily<T, K>;
|
|
418
|
-
declare function withdraw<T extends Transceiver<any, any>, K extends Canonical>(store: Store, token: MutableAtomFamilyToken<T, K>): MutableAtomFamily<T, K>;
|
|
435
|
+
declare function withdraw<T extends Transceiver<any, any, any>, K extends Canonical>(store: Store, token: MutableAtomFamilyToken<T, K>): MutableAtomFamily<T, K>;
|
|
419
436
|
declare function withdraw<T, K extends Canonical>(store: Store, token: AtomFamilyToken<T, K>): AtomFamily<T, K>;
|
|
420
437
|
declare function withdraw<T, K extends Canonical>(store: Store, token: ReadonlyHeldSelectorFamilyToken<T, K>): ReadonlyHeldSelectorFamily<T, K>;
|
|
421
438
|
declare function withdraw<T, K extends Canonical>(store: Store, token: WritableHeldSelectorFamilyToken<T, K>): WritableHeldSelectorFamily<T, K>;
|
|
@@ -428,47 +445,49 @@ declare function withdraw<T, K extends Canonical>(store: Store, token: PureSelec
|
|
|
428
445
|
declare function withdraw<T, K extends Canonical>(store: Store, token: SelectorFamilyToken<T, K>): SelectorFamily<T, K>;
|
|
429
446
|
declare function withdraw<T, K extends Canonical>(store: Store, token: ReadableFamilyToken<T, K>): ReadableFamily<T, K>;
|
|
430
447
|
declare function withdraw<T, K extends Canonical>(store: Store, token: WritableFamilyToken<T, K>): WritableFamily<T, K>;
|
|
431
|
-
declare function withdraw<T extends
|
|
448
|
+
declare function withdraw<T extends Fn>(store: Store, token: TransactionToken<T>): Transaction<T extends Fn ? T : never>;
|
|
432
449
|
declare function withdraw<T>(store: Store, token: TimelineToken<T>): Timeline<T extends TimelineManageable ? T : never>;
|
|
433
450
|
declare function withdraw<T>(store: Store, token: WritableToken<T>): WritableState<T>;
|
|
434
451
|
declare function withdraw<T>(store: Store, token: ReadableToken<T>): ReadableState<T>;
|
|
435
452
|
declare function withdraw(store: Store, token: AtomIOToken): AtomIOInternalResource;
|
|
436
453
|
//#endregion
|
|
437
454
|
//#region src/internal/mutable/transceiver.d.ts
|
|
438
|
-
interface Transceiver<S extends Json.Serializable, J extends Json.Serializable> {
|
|
455
|
+
interface Transceiver<V, S extends Json.Serializable, J extends Json.Serializable> {
|
|
439
456
|
do: (update: S) => number | `OUT_OF_RANGE` | null;
|
|
440
457
|
undo: (update: S) => void;
|
|
441
458
|
subscribe: (key: string, fn: (update: S) => void) => () => void;
|
|
442
459
|
cacheUpdateNumber: number;
|
|
443
460
|
getUpdateNumber: (update: S) => number;
|
|
461
|
+
view: () => V;
|
|
444
462
|
toJSON: () => J;
|
|
445
463
|
}
|
|
446
|
-
type TransceiverConstructor<J extends Json.Serializable, T extends Transceiver<any, J>> = (new () => T) & {
|
|
464
|
+
type TransceiverConstructor<J extends Json.Serializable, T extends Transceiver<any, any, J>> = (new () => T) & {
|
|
447
465
|
fromJSON: (json: J) => T;
|
|
448
466
|
};
|
|
449
|
-
declare function isTransceiver(value: unknown): value is Transceiver<Json.Serializable, Json.Serializable>;
|
|
467
|
+
declare function isTransceiver(value: unknown): value is Transceiver<any, Json.Serializable, Json.Serializable>;
|
|
450
468
|
type TransceiverMode = `playback` | `record` | `transaction`;
|
|
451
|
-
type
|
|
452
|
-
type
|
|
453
|
-
type
|
|
469
|
+
type ViewOf<T> = T extends Transceiver<infer V, any, any> ? V : T;
|
|
470
|
+
type SignalFrom<T extends Transceiver<any, any, any>> = T extends Transceiver<any, infer S, any> ? S : never;
|
|
471
|
+
type AsJSON<T extends Transceiver<any, any, any>> = T extends Transceiver<any, any, infer J> ? J : never;
|
|
472
|
+
type ConstructorOf<T extends Transceiver<any, any, any>> = TransceiverConstructor<AsJSON<T>, T>;
|
|
454
473
|
//#endregion
|
|
455
474
|
//#region src/internal/mutable/create-mutable-atom.d.ts
|
|
456
|
-
declare function createMutableAtom<T extends Transceiver<any, any>>(store: Store, options: MutableAtomOptions<T>, family: FamilyMetadata | undefined): MutableAtomToken<T>;
|
|
475
|
+
declare function createMutableAtom<T extends Transceiver<any, any, any>>(store: Store, options: MutableAtomOptions<T>, family: FamilyMetadata | undefined): MutableAtomToken<T>;
|
|
457
476
|
//#endregion
|
|
458
477
|
//#region src/internal/mutable/create-mutable-atom-family.d.ts
|
|
459
|
-
declare function createMutableAtomFamily<T extends Transceiver<any, any>, K extends Canonical>(store: Store, options: MutableAtomFamilyOptions<T, K>, internalRoles?: string[]): MutableAtomFamilyToken<T, K>;
|
|
478
|
+
declare function createMutableAtomFamily<T extends Transceiver<any, any, any>, K extends Canonical>(store: Store, options: MutableAtomFamilyOptions<T, K>, internalRoles?: string[]): MutableAtomFamilyToken<T, K>;
|
|
460
479
|
//#endregion
|
|
461
480
|
//#region src/internal/mutable/get-json-family.d.ts
|
|
462
|
-
declare const getJsonFamily: <Core extends Transceiver<Json.Serializable, Json.Serializable>, Key extends Canonical>(mutableAtomFamily: MutableAtomFamilyToken<Core, Key>, store: Store) => WritablePureSelectorFamily<ReturnType<Core[`toJSON`]>, Key>;
|
|
481
|
+
declare const getJsonFamily: <Core extends Transceiver<any, Json.Serializable, Json.Serializable>, Key extends Canonical>(mutableAtomFamily: MutableAtomFamilyToken<Core, Key>, store: Store) => WritablePureSelectorFamily<ReturnType<Core[`toJSON`]>, Key>;
|
|
463
482
|
//#endregion
|
|
464
483
|
//#region src/internal/mutable/get-json-token.d.ts
|
|
465
|
-
declare const getJsonToken: <T extends Transceiver<any, any>>(store: Store, mutableAtomToken: MutableAtomToken<T>) => WritablePureSelectorToken<AsJSON<T>>;
|
|
484
|
+
declare const getJsonToken: <T extends Transceiver<any, any, any>>(store: Store, mutableAtomToken: MutableAtomToken<T>) => WritablePureSelectorToken<AsJSON<T>>;
|
|
466
485
|
//#endregion
|
|
467
486
|
//#region src/internal/mutable/get-update-family.d.ts
|
|
468
|
-
declare const getUpdateFamily: <T extends Transceiver<Json.Serializable, Json.Serializable>, K extends string>(mutableAtomFamily: MutableAtomFamilyToken<T, K>, store: Store) => AtomFamily<SignalFrom<T>, K>;
|
|
487
|
+
declare const getUpdateFamily: <T extends Transceiver<any, Json.Serializable, Json.Serializable>, K extends string>(mutableAtomFamily: MutableAtomFamilyToken<T, K>, store: Store) => AtomFamily<SignalFrom<T>, K>;
|
|
469
488
|
//#endregion
|
|
470
489
|
//#region src/internal/mutable/get-update-token.d.ts
|
|
471
|
-
declare const getUpdateToken: <T extends Transceiver<any, any>>(mutableAtomToken: MutableAtomToken<T>) => RegularAtomToken<SignalFrom<T>>;
|
|
490
|
+
declare const getUpdateToken: <T extends Transceiver<any, any, any>>(mutableAtomToken: MutableAtomToken<T>) => RegularAtomToken<SignalFrom<T>>;
|
|
472
491
|
//#endregion
|
|
473
492
|
//#region src/internal/mutable/tracker.d.ts
|
|
474
493
|
/**
|
|
@@ -476,8 +495,8 @@ declare const getUpdateToken: <T extends Transceiver<any, any>>(mutableAtomToken
|
|
|
476
495
|
* subscribe to the transceiver's inner value. When the inner value changes,
|
|
477
496
|
* the tracker will update its own state to reflect the change.
|
|
478
497
|
*/
|
|
479
|
-
declare class Tracker<T extends Transceiver<any, any>> {
|
|
480
|
-
private
|
|
498
|
+
declare class Tracker<T extends Transceiver<any, any, any>> {
|
|
499
|
+
private initializeSignalAtom;
|
|
481
500
|
private unsubscribeFromInnerValue;
|
|
482
501
|
private unsubscribeFromState;
|
|
483
502
|
private captureSignalsFromCore;
|
|
@@ -489,9 +508,9 @@ declare class Tracker<T extends Transceiver<any, any>> {
|
|
|
489
508
|
}
|
|
490
509
|
//#endregion
|
|
491
510
|
//#region src/internal/mutable/tracker-family.d.ts
|
|
492
|
-
declare class FamilyTracker<T extends Transceiver<any, any>, K extends Canonical> {
|
|
511
|
+
declare class FamilyTracker<T extends Transceiver<any, any, any>, K extends Canonical> {
|
|
493
512
|
private trackers;
|
|
494
|
-
readonly
|
|
513
|
+
readonly latestSignalAtoms: RegularAtomFamily<SignalFrom<T> | null, K>;
|
|
495
514
|
readonly mutableAtoms: MutableAtomFamily<T, K>;
|
|
496
515
|
constructor(mutableAtoms: MutableAtomFamily<T, K>, store: Store);
|
|
497
516
|
}
|
|
@@ -500,7 +519,7 @@ declare class FamilyTracker<T extends Transceiver<any, any>, K extends Canonical
|
|
|
500
519
|
declare function arbitrary(random?: () => number): string;
|
|
501
520
|
//#endregion
|
|
502
521
|
//#region src/internal/atom/create-regular-atom.d.ts
|
|
503
|
-
declare function createRegularAtom<T>(store: Store, options: RegularAtomOptions<T>, family: FamilyMetadata | undefined): RegularAtomToken<T>;
|
|
522
|
+
declare function createRegularAtom<T>(store: Store, options: RegularAtomOptions<T>, family: FamilyMetadata | undefined, internalRoles?: internalRole[]): RegularAtomToken<T>;
|
|
504
523
|
//#endregion
|
|
505
524
|
//#region src/internal/atom/dispose-atom.d.ts
|
|
506
525
|
declare function disposeAtom(store: Store, atomToken: AtomToken<unknown>): void;
|
|
@@ -527,10 +546,16 @@ declare class Future<T> extends Promise<T> {
|
|
|
527
546
|
}
|
|
528
547
|
//#endregion
|
|
529
548
|
//#region src/internal/caching.d.ts
|
|
530
|
-
declare function
|
|
531
|
-
declare function
|
|
532
|
-
|
|
533
|
-
|
|
549
|
+
declare function writeToCache<T>(target: Store, state: ReadableState<T>, value: T): T;
|
|
550
|
+
declare function writeToCache<T extends Promise<any>>(target: Store, state: ReadableState<T>, value: T): Future<Awaited<T>>;
|
|
551
|
+
/**
|
|
552
|
+
* @param target - the newest layer of the store
|
|
553
|
+
* @param state - the state to read from cache
|
|
554
|
+
* @param mut - whether the value is intended to be mutable
|
|
555
|
+
* @returns the state's current value
|
|
556
|
+
*/
|
|
557
|
+
declare function readFromCache<T>(target: Store, state: ReadableState<T>, mut: `mut` | undefined): T;
|
|
558
|
+
declare function evictCachedValue(target: Store, key: string): void;
|
|
534
559
|
//#endregion
|
|
535
560
|
//#region src/internal/capitalize.d.ts
|
|
536
561
|
declare function capitalize<S extends string>(string: S): Capitalize<S>;
|
|
@@ -555,7 +580,7 @@ declare function disposeFromStore(store: Store, token: ReadableToken<any>): void
|
|
|
555
580
|
declare function disposeFromStore<K extends Canonical>(store: Store, token: ReadableFamilyToken<any, K>, key: K): void;
|
|
556
581
|
//#endregion
|
|
557
582
|
//#region src/internal/families/find-in-store.d.ts
|
|
558
|
-
declare function findInStore<T extends Transceiver<any, any>, K extends Canonical, Key extends K>(store: Store, token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K>;
|
|
583
|
+
declare function findInStore<T extends Transceiver<any, any, any>, K extends Canonical, Key extends K>(store: Store, token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K>;
|
|
559
584
|
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T, K>;
|
|
560
585
|
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, token: AtomFamilyToken<T, K>, key: Key): AtomToken<T, K>;
|
|
561
586
|
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, token: WritablePureSelectorFamilyToken<T, K>, key: Key): WritablePureSelectorToken<T, K>;
|
|
@@ -565,7 +590,7 @@ declare function findInStore<T, K extends Canonical, Key extends K>(store: Store
|
|
|
565
590
|
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K>;
|
|
566
591
|
//#endregion
|
|
567
592
|
//#region src/internal/families/init-family-member.d.ts
|
|
568
|
-
declare function initFamilyMemberInStore<T extends Transceiver<any, any>, K extends Canonical, Key extends K>(store: Store, token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K>;
|
|
593
|
+
declare function initFamilyMemberInStore<T extends Transceiver<any, any, any>, K extends Canonical, Key extends K>(store: Store, token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K>;
|
|
569
594
|
declare function initFamilyMemberInStore<T, K extends Canonical, Key extends K>(store: Store, token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T, K>;
|
|
570
595
|
declare function initFamilyMemberInStore<T, K extends Canonical, Key extends K>(store: Store, token: AtomFamilyToken<T, K>, key: Key): AtomToken<T, K>;
|
|
571
596
|
declare function initFamilyMemberInStore<T, K extends Canonical, Key extends K>(store: Store, token: WritablePureSelectorFamilyToken<T, K>, key: Key): WritablePureSelectorToken<T, K>;
|
|
@@ -575,7 +600,7 @@ declare function initFamilyMemberInStore<T, K extends Canonical, Key extends K>(
|
|
|
575
600
|
declare function initFamilyMemberInStore<T, K extends Canonical, Key extends K>(store: Store, token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K>;
|
|
576
601
|
//#endregion
|
|
577
602
|
//#region src/internal/families/seek-in-store.d.ts
|
|
578
|
-
declare function seekInStore<T extends Transceiver<any, any>, K extends Canonical, Key extends K>(store: Store, token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K> | undefined;
|
|
603
|
+
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, K> | undefined;
|
|
579
604
|
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T, K> | undefined;
|
|
580
605
|
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: AtomFamilyToken<T, K>, key: Key): AtomToken<T, K> | undefined;
|
|
581
606
|
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: WritablePureSelectorFamilyToken<T, K>, key: Key): WritablePureSelectorToken<T, K> | undefined;
|
|
@@ -595,7 +620,8 @@ declare function getFromStore<T>(store: Store, token: ReadableToken<T>): T;
|
|
|
595
620
|
declare function getFromStore<T, K extends Canonical>(store: Store, token: ReadableFamilyToken<T, K>, key: K): T;
|
|
596
621
|
//#endregion
|
|
597
622
|
//#region src/internal/get-state/read-or-compute-value.d.ts
|
|
598
|
-
declare
|
|
623
|
+
declare function readOrComputeValue<T>(target: Store, state: ReadableState<T>, mut?: undefined): ViewOf<T>;
|
|
624
|
+
declare function readOrComputeValue<T>(target: Store, state: ReadableState<T>, mut: `mut`): T;
|
|
599
625
|
//#endregion
|
|
600
626
|
//#region src/internal/get-trace.d.ts
|
|
601
627
|
declare function getTrace(error: Error): string;
|
|
@@ -646,18 +672,6 @@ declare const isReadonlySelectorKey: (store: Store, key: string) => key is Reado
|
|
|
646
672
|
type StateKey<T> = AtomKey<T> | ReadonlySelectorKey<T> | SelectorKey<T>;
|
|
647
673
|
declare const isStateKey: (store: Store, key: string) => key is StateKey<unknown>;
|
|
648
674
|
//#endregion
|
|
649
|
-
//#region src/internal/lazy-map.d.ts
|
|
650
|
-
declare class LazyMap<K, V> extends Map<K, V> {
|
|
651
|
-
deleted: Set<K>;
|
|
652
|
-
protected readonly source: Map<K, V>;
|
|
653
|
-
constructor(source: Map<K, V>);
|
|
654
|
-
get(key: K): V | undefined;
|
|
655
|
-
set(key: K, value: V): this;
|
|
656
|
-
hasOwn(key: K): boolean;
|
|
657
|
-
has(key: K): boolean;
|
|
658
|
-
delete(key: K): boolean;
|
|
659
|
-
}
|
|
660
|
-
//#endregion
|
|
661
675
|
//#region src/internal/not-found-error.d.ts
|
|
662
676
|
declare class NotFoundError extends Error {
|
|
663
677
|
constructor(token: AtomIOToken, store: Store);
|
|
@@ -707,10 +721,15 @@ declare const updateSelectorAtoms: (store: Store, selectorType: `readonly_held_s
|
|
|
707
721
|
type Modify<T> = (thing: T) => T;
|
|
708
722
|
declare const become: <T>(nextVersionOfThing: Modify<T> | T) => (originalThing: T) => T;
|
|
709
723
|
//#endregion
|
|
724
|
+
//#region src/internal/set-state/evict-downstream.d.ts
|
|
725
|
+
declare function evictDownstreamFromAtom(store: Store, atom: Atom<any>): void;
|
|
726
|
+
declare function evictDownstreamFromSelector(store: Store, selectorKey: string): void;
|
|
727
|
+
//#endregion
|
|
710
728
|
//#region src/internal/set-state/reset-atom-or-selector.d.ts
|
|
711
729
|
declare function resetAtomOrSelector(store: Store, state: WritableState<any>): void;
|
|
712
730
|
//#endregion
|
|
713
731
|
//#region src/internal/set-state/reset-in-store.d.ts
|
|
732
|
+
declare const RESET_STATE: unique symbol;
|
|
714
733
|
declare function resetInStore(store: Store, token: WritableToken<any>): void;
|
|
715
734
|
declare function resetInStore<K extends Canonical>(store: Store, token: WritableFamilyToken<any, K>, key: K): void;
|
|
716
735
|
//#endregion
|
|
@@ -718,17 +737,17 @@ declare function resetInStore<K extends Canonical>(store: Store, token: Writable
|
|
|
718
737
|
declare const setAtomOrSelector: <T>(store: Store, state: WritableState<T>, value: T | ((oldValue: T) => T)) => void;
|
|
719
738
|
//#endregion
|
|
720
739
|
//#region src/internal/set-state/set-into-store.d.ts
|
|
721
|
-
declare function setIntoStore<T, New extends T>(store: Store, token: WritableToken<T>, value: New | ((oldValue: T) => New)): void;
|
|
722
|
-
declare function setIntoStore<T, K extends Canonical, New extends T>(store: Store, token: WritableFamilyToken<T, K>, key: K, value: New | ((oldValue: T) => New)): void;
|
|
740
|
+
declare function setIntoStore<T, New extends T>(store: Store, token: WritableToken<T>, value: New | typeof RESET_STATE | ((oldValue: T) => New)): void;
|
|
741
|
+
declare function setIntoStore<T, K extends Canonical, New extends T>(store: Store, token: WritableFamilyToken<T, K>, key: K, value: New | typeof RESET_STATE | ((oldValue: T) => New)): void;
|
|
723
742
|
//#endregion
|
|
724
743
|
//#region src/internal/subscribe/recall-state.d.ts
|
|
725
744
|
declare const recallState: <T>(store: Store, state: ReadableState<T>) => T;
|
|
726
745
|
//#endregion
|
|
727
746
|
//#region src/internal/subscribe/subscribe-in-store.d.ts
|
|
728
|
-
declare function subscribeInStore<T>(store: Store
|
|
729
|
-
declare function subscribeInStore<F extends
|
|
730
|
-
declare function subscribeInStore<M extends TimelineManageable>(store: Store
|
|
731
|
-
declare function subscribeInStore<M extends TimelineManageable>(store: Store
|
|
747
|
+
declare function subscribeInStore<T>(store: Store, token: ReadableToken<T>, handleUpdate: UpdateHandler<T>, key?: string): () => void;
|
|
748
|
+
declare function subscribeInStore<F extends Fn>(store: Store, token: TransactionToken<F>, handleUpdate: TransactionUpdateHandler<F>, key?: string): () => void;
|
|
749
|
+
declare function subscribeInStore<M extends TimelineManageable>(store: Store, token: TimelineToken<M>, handleUpdate: (update: TimelineUpdate<M> | `redo` | `undo`) => void, key?: string): () => void;
|
|
750
|
+
declare function subscribeInStore<M extends TimelineManageable>(store: Store, token: ReadableToken<any> | TimelineToken<M> | TransactionToken<any>, handleUpdate: TransactionUpdateHandler<any> | UpdateHandler<any> | ((update: TimelineUpdate<M> | `redo` | `undo`) => void), key?: string): () => void;
|
|
732
751
|
//#endregion
|
|
733
752
|
//#region src/internal/subscribe/subscribe-to-root-atoms.d.ts
|
|
734
753
|
declare const subscribeToRootDependency: (target: Store, selector: Selector<any>, atom: Atom<any>) => (() => void);
|
|
@@ -740,7 +759,7 @@ declare function subscribeToState<T>(store: Store, token: ReadableToken<T>, key:
|
|
|
740
759
|
declare const subscribeToTimeline: <ManagedAtom extends TimelineManageable>(store: Store, token: TimelineToken<ManagedAtom>, key: string, handleUpdate: (update: TimelineUpdate<any> | `redo` | `undo`) => void) => (() => void);
|
|
741
760
|
//#endregion
|
|
742
761
|
//#region src/internal/subscribe/subscribe-to-transaction.d.ts
|
|
743
|
-
declare const subscribeToTransaction: <F extends
|
|
762
|
+
declare const subscribeToTransaction: <F extends Fn>(store: Store, token: TransactionToken<F>, key: string, handleUpdate: TransactionUpdateHandler<F>) => (() => void);
|
|
744
763
|
//#endregion
|
|
745
764
|
//#region src/internal/index.d.ts
|
|
746
765
|
type AtomIOState = {
|
|
@@ -756,13 +775,14 @@ type RegularAtom<T> = Flat<AtomIOState & {
|
|
|
756
775
|
type: `atom`;
|
|
757
776
|
default: T | (() => T);
|
|
758
777
|
cleanup?: () => void;
|
|
778
|
+
internalRoles?: internalRole[];
|
|
759
779
|
}>;
|
|
760
|
-
type MutableAtom<T extends Transceiver<any, any>> = Flat<AtomIOState & {
|
|
780
|
+
type MutableAtom<T extends Transceiver<any, any, any>> = Flat<AtomIOState & {
|
|
761
781
|
type: `mutable_atom`;
|
|
762
782
|
class: ConstructorOf<T>;
|
|
763
783
|
cleanup?: () => void;
|
|
764
784
|
}>;
|
|
765
|
-
type Atom<T> = RegularAtom<T> | (T extends Transceiver<any, any> ? MutableAtom<T> : never);
|
|
785
|
+
type Atom<T> = RegularAtom<T> | (T extends Transceiver<any, any, any> ? MutableAtom<T> : never);
|
|
766
786
|
type WritableHeldSelector<T> = Flat<AtomIOState & {
|
|
767
787
|
type: `writable_held_selector`;
|
|
768
788
|
const: T;
|
|
@@ -796,12 +816,12 @@ type RegularAtomFamily<T, K extends Canonical> = RegularAtomFamilyToken<T, K> &
|
|
|
796
816
|
internalRoles: string[] | undefined;
|
|
797
817
|
subject: Subject<StateCreation<AtomToken<T>> | StateDisposal<AtomToken<T>>>;
|
|
798
818
|
};
|
|
799
|
-
type MutableAtomFamily<T extends Transceiver<any, any>, K extends Canonical> = Flat<MutableAtomFamilyToken<T, K> & {
|
|
819
|
+
type MutableAtomFamily<T extends Transceiver<any, any, any>, K extends Canonical> = Flat<MutableAtomFamilyToken<T, K> & {
|
|
800
820
|
install: (store: Store) => void;
|
|
801
821
|
internalRoles: string[] | undefined;
|
|
802
|
-
subject: Subject<
|
|
822
|
+
subject: Subject<StateLifecycleEvent<MutableAtomToken<T>>>;
|
|
803
823
|
}> & ((key: K) => MutableAtomToken<T>);
|
|
804
|
-
type AtomFamily<T, K extends Canonical = Canonical> = MutableAtomFamily<T extends Transceiver<any, any> ? T : never, K> | RegularAtomFamily<T, K>;
|
|
824
|
+
type AtomFamily<T, K extends Canonical = Canonical> = MutableAtomFamily<T extends Transceiver<any, any, any> ? T : never, K> | RegularAtomFamily<T, K>;
|
|
805
825
|
type WritablePureSelectorFamily<T, K extends Canonical> = Flat<WritablePureSelectorFamilyToken<T, K> & {
|
|
806
826
|
default: (key: K) => T;
|
|
807
827
|
install: (store: Store) => void;
|
|
@@ -835,5 +855,5 @@ type WritableFamily<T, K extends Canonical> = AtomFamily<T, K> | WritablePureSel
|
|
|
835
855
|
type ReadableFamily<T, K extends Canonical> = AtomFamily<T, K> | SelectorFamily<T, K>;
|
|
836
856
|
type AtomIOInternalResource = ReadableFamily<any, any> | ReadableState<any> | Timeline<any> | Transaction<any>;
|
|
837
857
|
//#endregion
|
|
838
|
-
export { AsJSON, Atom, AtomFamily, AtomIOInternalResource, AtomIOState, AtomKey, BaseExternalStoreConfiguration, ChildStore, CircularBuffer, ConstructorOf, Count, Each, Empty, EnvironmentData, ExternalStoreConfiguration, ExternalStoreWithContentConfiguration, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Flat,
|
|
858
|
+
export { AsJSON, Atom, AtomFamily, AtomIOInternalResource, AtomIOState, AtomKey, BaseExternalStoreConfiguration, ChildStore, CircularBuffer, ConstructorOf, Count, Each, Empty, EnvironmentData, ExternalStoreConfiguration, ExternalStoreWithContentConfiguration, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Flat, Fn, Future, HeldSelector, HeldSelectorFamily, IMPLICIT, INTERNAL_ROLES, Join, JoinStateFamilies, Junction, JunctionAdvancedConfiguration, JunctionEntries, JunctionEntriesBase, JunctionJSON, JunctionSchema, JunctionSchemaBase, LazyMap, Lineage, Modify, Molecule, MutableAtom, MutableAtomFamily, NotFoundError, OperationProgress, PureSelector, PureSelectorFamily, RESET_STATE, ReadableFamily, ReadableState, ReadonlyHeldSelector, ReadonlyHeldSelectorFamily, ReadonlyPureSelector, ReadonlyPureSelectorFamily, ReadonlySelector, ReadonlySelectorFamily, ReadonlySelectorKey, Refinement, RegularAtom, RegularAtomFamily, ReservedIntrospectionKey, RootStore, Selector, SelectorFamily, SelectorKey, SignalFrom, StateKey, StatefulSubject, Store, StoreEventCarrier, Subject, TRANSACTION_PHASES, Timeline, TimelineAtomUpdate, TimelineMoleculeCreation, TimelineMoleculeDisposal, TimelineSelectorUpdate, TimelineStateCreation, TimelineStateDisposal, TimelineTransactionUpdate, Tracker, Transaction, TransactionEpoch, TransactionPhase, TransactionProgress, Transceiver, TransceiverConstructor, TransceiverMode, ViewOf, WritableFamily, WritableHeldSelector, WritableHeldSelectorFamily, WritablePureSelector, WritablePureSelectorFamily, WritableSelector, WritableSelectorFamily, WritableState, abortTransaction, actUponStore, allocateIntoStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, capitalize, claimWithinStore, clearStore, closeOperation, counterfeit, createJoin, createMutableAtom, createMutableAtomFamily, createReadonlyHeldSelector, createReadonlyPureSelector, createReadonlyPureSelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneSelector, createTimeline, createTransaction, createWritableHeldSelector, createWritablePureSelector, createWritablePureSelectorFamily, deallocateFromStore, deposit, disposeAtom, disposeFromStore, disposeSelector, editRelationsInStore, evictCachedValue, evictDownstreamFromAtom, evictDownstreamFromSelector, findInStore, findRelationsInStore, fuseWithinStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getInternalRelationsFromStore, getJoin, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getTrace, getUpdateFamily, getUpdateToken, hasRole, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestMoleculeTransferEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, installIntoStore, internalRole, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isReservedIntrospectionKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeRootMoleculeInStore, markDone, newest, openOperation, prettyPrintTokenType, readFromCache, readOrComputeValue, recallState, registerSelector, resetAtomOrSelector, resetInStore, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootDependency, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceRootSelectorAtoms, updateSelectorAtoms, withdraw, writeToCache };
|
|
839
859
|
//# sourceMappingURL=index.d.ts.map
|