atom.io 0.40.0 → 0.40.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/data/index.d.ts +1 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/internal/index.d.ts +205 -196
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +145 -107
- package/dist/internal/index.js.map +1 -1
- package/dist/introspection/index.d.ts +6 -6
- package/dist/introspection/index.d.ts.map +1 -1
- package/dist/introspection/index.js.map +1 -1
- package/dist/main/index.d.ts +93 -66
- package/dist/main/index.d.ts.map +1 -1
- package/dist/main/index.js +16 -13
- package/dist/main/index.js.map +1 -1
- package/dist/react/index.d.ts +14 -14
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-devtools/index.js +1 -1
- package/dist/react-devtools/index.js.map +1 -1
- package/dist/realtime-client/index.d.ts +3 -3
- 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-server/index.d.ts +2 -2
- package/dist/realtime-server/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/data/struct.ts +2 -2
- package/src/internal/atom/create-regular-atom.ts +11 -9
- package/src/internal/atom/dispose-atom.ts +11 -8
- package/src/internal/atom/has-role.ts +1 -1
- package/src/internal/caching.ts +15 -15
- package/src/internal/events/ingest-creation-disposal.ts +1 -1
- package/src/internal/families/create-readonly-held-selector-family.ts +3 -4
- package/src/internal/families/create-readonly-pure-selector-family.ts +25 -23
- package/src/internal/families/create-regular-atom-family.ts +21 -15
- package/src/internal/families/create-selector-family.ts +15 -15
- package/src/internal/families/create-writable-held-selector-family.ts +2 -2
- package/src/internal/families/create-writable-pure-selector-family.ts +25 -21
- package/src/internal/families/dispose-from-store.ts +17 -7
- package/src/internal/families/find-in-store.ts +23 -23
- package/src/internal/families/get-family-of-token.ts +17 -17
- package/src/internal/families/mint-in-store.ts +10 -10
- package/src/internal/families/seek-in-store.ts +26 -26
- package/src/internal/get-state/get-fallback.ts +8 -8
- package/src/internal/get-state/get-from-store.ts +20 -8
- package/src/internal/get-state/read-or-compute-value.ts +78 -14
- package/src/internal/get-state/reduce-reference.ts +10 -10
- package/src/internal/index.ts +65 -60
- package/src/internal/install-into-store.ts +2 -1
- package/src/internal/join/create-join.ts +2 -2
- package/src/internal/join/find-relations-in-store.ts +2 -2
- package/src/internal/join/get-internal-relations-from-store.ts +2 -2
- package/src/internal/join/get-join.ts +5 -2
- package/src/internal/join/join-internal.ts +30 -26
- package/src/internal/lineage.ts +12 -1
- package/src/internal/molecule.ts +64 -36
- package/src/internal/mutable/create-mutable-atom-family.ts +5 -5
- package/src/internal/mutable/create-mutable-atom.ts +2 -2
- package/src/internal/mutable/get-json-family.ts +3 -2
- package/src/internal/mutable/get-update-family.ts +7 -5
- package/src/internal/mutable/tracker-family.ts +8 -4
- package/src/internal/mutable/tracker.ts +5 -1
- package/src/internal/operation.ts +4 -2
- package/src/internal/selector/create-readonly-held-selector.ts +2 -2
- package/src/internal/selector/create-readonly-pure-selector.ts +10 -8
- package/src/internal/selector/create-standalone-selector.ts +10 -10
- package/src/internal/selector/create-writable-held-selector.ts +2 -2
- package/src/internal/selector/create-writable-pure-selector.ts +11 -9
- package/src/internal/selector/dispose-selector.ts +2 -2
- package/src/internal/selector/register-selector.ts +2 -2
- package/src/internal/selector/trace-selector-atoms.ts +3 -3
- package/src/internal/selector/update-selector-atoms.ts +1 -1
- package/src/internal/set-state/become.ts +1 -3
- package/src/internal/set-state/dispatch-state-update.ts +10 -6
- package/src/internal/set-state/evict-downstream.ts +4 -1
- package/src/internal/set-state/operate-on-store.ts +16 -10
- package/src/internal/set-state/reset-atom-or-selector.ts +7 -7
- package/src/internal/set-state/reset-in-store.ts +17 -16
- package/src/internal/set-state/set-atom-or-selector.ts +1 -1
- package/src/internal/set-state/set-atom.ts +1 -1
- package/src/internal/set-state/set-into-store.ts +34 -7
- package/src/internal/set-state/set-selector.ts +1 -1
- package/src/internal/store/deposit.ts +38 -30
- package/src/internal/store/mint-or-counterfeit.ts +23 -23
- package/src/internal/store/store.ts +23 -21
- package/src/internal/store/withdraw.ts +68 -62
- package/src/internal/subscribe/recall-state.ts +4 -1
- package/src/internal/subscribe/subscribe-to-root-atoms.ts +2 -2
- package/src/internal/subscribe/subscribe-to-state.ts +4 -4
- package/src/internal/timeline/create-timeline.ts +11 -10
- package/src/internal/timeline/time-travel.ts +4 -3
- package/src/internal/transaction/abort-transaction.ts +3 -15
- package/src/internal/transaction/act-upon-store.ts +1 -5
- package/src/internal/transaction/apply-transaction.ts +3 -15
- package/src/internal/transaction/assign-transaction-to-continuity.ts +2 -7
- package/src/internal/transaction/build-transaction.ts +2 -3
- package/src/internal/transaction/create-transaction.ts +5 -6
- package/src/internal/transaction/get-epoch-number.ts +1 -7
- package/src/internal/transaction/set-epoch-number.ts +4 -12
- package/src/introspection/attach-atom-index.ts +2 -2
- package/src/introspection/attach-introspection-states.ts +4 -2
- package/src/introspection/attach-selector-index.ts +4 -2
- package/src/introspection/attach-timeline-family.ts +15 -13
- package/src/introspection/attach-timeline-index.ts +1 -1
- package/src/introspection/attach-transaction-index.ts +1 -1
- package/src/introspection/attach-transaction-logs.ts +6 -4
- package/src/introspection/attach-type-selectors.ts +4 -3
- package/src/introspection/index.ts +3 -5
- package/src/main/atom.ts +14 -8
- package/src/main/dispose-state.ts +1 -5
- package/src/main/events.ts +26 -26
- package/src/main/get-state.ts +10 -11
- package/src/main/realm.ts +36 -12
- package/src/main/reset-state.ts +5 -9
- package/src/main/selector.ts +40 -24
- package/src/main/set-state.ts +8 -11
- package/src/main/silo.ts +4 -3
- package/src/main/timeline.ts +5 -3
- package/src/main/tokens.ts +72 -44
- package/src/main/validators.ts +4 -4
- package/src/react/parse-state-overloads.ts +10 -10
- package/src/react/store-context.tsx +3 -3
- package/src/react/use-i.ts +6 -6
- package/src/react/use-loadable.ts +15 -15
- package/src/react/use-o.ts +9 -9
- package/src/react-devtools/Button.tsx +3 -2
- package/src/react-devtools/StateEditor.tsx +5 -3
- package/src/react-devtools/StateIndex.tsx +6 -4
- package/src/react-devtools/TimelineIndex.tsx +0 -2
- package/src/react-devtools/Updates.tsx +1 -1
- package/src/react-devtools/store.ts +18 -9
- package/src/realtime-client/continuity/register-and-attempt-confirmed-update.ts +4 -8
- package/src/realtime-client/sync-continuity.ts +2 -2
- package/src/realtime-server/index.ts +2 -2
package/dist/internal/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { SetRTX } from "atom.io/transceivers/set-rtx";
|
|
|
5
5
|
//#region src/internal/atom/has-role.d.ts
|
|
6
6
|
declare const INTERNAL_ROLES: readonly ["tracker:signal"];
|
|
7
7
|
type internalRole = (typeof INTERNAL_ROLES)[number];
|
|
8
|
-
declare function hasRole(atom: Atom<any>, role: internalRole): boolean;
|
|
8
|
+
declare function hasRole(atom: Atom<any, any>, role: internalRole): boolean;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/internal/store/circular-buffer.d.ts
|
|
11
11
|
declare class CircularBuffer<T> {
|
|
@@ -161,18 +161,6 @@ type JunctionOverlay<AName extends string, A extends string, BName extends strin
|
|
|
161
161
|
contents: MapOverlay<string, Content>;
|
|
162
162
|
};
|
|
163
163
|
//#endregion
|
|
164
|
-
//#region src/internal/transaction/abort-transaction.d.ts
|
|
165
|
-
declare const abortTransaction: (store: Store) => void;
|
|
166
|
-
//#endregion
|
|
167
|
-
//#region src/internal/transaction/act-upon-store.d.ts
|
|
168
|
-
declare function actUponStore<F extends Fn>(store: Store, token: TransactionToken<F>, id: string): (...parameters: Parameters<F>) => ReturnType<F>;
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region src/internal/transaction/apply-transaction.d.ts
|
|
171
|
-
declare function applyTransaction<F extends Fn>(store: Store, output: ReturnType<F>): void;
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/internal/transaction/assign-transaction-to-continuity.d.ts
|
|
174
|
-
declare function assignTransactionToContinuity(store: Store, continuityKey: string, transactionKey: string): void;
|
|
175
|
-
//#endregion
|
|
176
164
|
//#region src/internal/transaction/is-root-store.d.ts
|
|
177
165
|
interface RootStore extends Store {
|
|
178
166
|
transactionMeta: TransactionEpoch;
|
|
@@ -188,8 +176,20 @@ interface ChildStore extends Store {
|
|
|
188
176
|
declare function isRootStore(store: Store): store is RootStore;
|
|
189
177
|
declare function isChildStore(store: Store): store is ChildStore;
|
|
190
178
|
//#endregion
|
|
179
|
+
//#region src/internal/transaction/abort-transaction.d.ts
|
|
180
|
+
declare const abortTransaction: (target: ChildStore) => void;
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/internal/transaction/act-upon-store.d.ts
|
|
183
|
+
declare function actUponStore<F extends Fn>(store: Store, token: TransactionToken<F>, id: string): (...parameters: Parameters<F>) => ReturnType<F>;
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/internal/transaction/apply-transaction.d.ts
|
|
186
|
+
declare function applyTransaction<F extends Fn>(store: ChildStore, output: ReturnType<F>): void;
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/internal/transaction/assign-transaction-to-continuity.d.ts
|
|
189
|
+
declare function assignTransactionToContinuity(store: RootStore, continuityKey: string, transactionKey: string): void;
|
|
190
|
+
//#endregion
|
|
191
191
|
//#region src/internal/transaction/build-transaction.d.ts
|
|
192
|
-
declare const buildTransaction: (store:
|
|
192
|
+
declare const buildTransaction: (store: RootStore, token: TransactionToken<any>, params: any[], id: string) => ChildStore;
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/internal/subject.d.ts
|
|
195
195
|
declare class Subject<T> {
|
|
@@ -209,20 +209,20 @@ declare class StatefulSubject<T> extends Subject<T> {
|
|
|
209
209
|
type Transaction<F extends Fn> = {
|
|
210
210
|
key: string;
|
|
211
211
|
type: `transaction`;
|
|
212
|
-
install: (store:
|
|
212
|
+
install: (store: RootStore) => void;
|
|
213
213
|
subject: Subject<TransactionOutcomeEvent<TransactionToken<F>>>;
|
|
214
214
|
run: (parameters: Parameters<F>, id?: string) => ReturnType<F>;
|
|
215
215
|
};
|
|
216
|
-
declare function createTransaction<F extends Fn>(store:
|
|
216
|
+
declare function createTransaction<F extends Fn>(store: RootStore, options: TransactionOptions<F>): TransactionToken<F>;
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region src/internal/transaction/get-epoch-number.d.ts
|
|
219
219
|
declare function getContinuityKey(store: RootStore, transactionKey: string): string | undefined;
|
|
220
220
|
declare function getEpochNumberOfContinuity(store: RootStore, continuityKey: string): number | undefined;
|
|
221
|
-
declare function getEpochNumberOfAction(store:
|
|
221
|
+
declare function getEpochNumberOfAction(store: RootStore, transactionKey: string): number | undefined;
|
|
222
222
|
//#endregion
|
|
223
223
|
//#region src/internal/transaction/set-epoch-number.d.ts
|
|
224
|
-
declare function setEpochNumberOfContinuity(store:
|
|
225
|
-
declare function setEpochNumberOfAction(store:
|
|
224
|
+
declare function setEpochNumberOfContinuity(store: RootStore, continuityKey: string, newEpoch: number): void;
|
|
225
|
+
declare function setEpochNumberOfAction(store: RootStore, transactionKey: string, newEpoch: number): void;
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region src/internal/transaction/index.d.ts
|
|
228
228
|
declare const TRANSACTION_PHASES: readonly ["idle", "building", "applying"];
|
|
@@ -238,22 +238,22 @@ type TransactionEpoch = {
|
|
|
238
238
|
};
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/internal/store/deposit.d.ts
|
|
241
|
-
declare function deposit<T>(state: RegularAtom<T>): RegularAtomToken<T>;
|
|
241
|
+
declare function deposit<T, E>(state: RegularAtom<T, E>): RegularAtomToken<T, Canonical, E>;
|
|
242
242
|
declare function deposit<T extends Transceiver<any, any, any>>(state: MutableAtom<T>): MutableAtomToken<T>;
|
|
243
|
-
declare function deposit<T>(state: Atom<T>): AtomToken<T>;
|
|
244
|
-
declare function deposit<T>(state: WritablePureSelector<T>): WritablePureSelectorToken<T>;
|
|
245
|
-
declare function deposit<T>(state: ReadonlyPureSelector<T>): ReadonlyPureSelectorToken<T>;
|
|
246
|
-
declare function deposit<T>(state: Selector<T>): SelectorToken<T>;
|
|
247
|
-
declare function deposit<T>(state: WritableState<T>): WritableToken<T>;
|
|
248
|
-
declare function deposit<T>(state: ReadableState<T>): ReadableToken<T>;
|
|
249
|
-
declare function deposit<T, K extends Canonical>(state: RegularAtomFamily<T, K>): RegularAtomFamilyToken<T, K>;
|
|
243
|
+
declare function deposit<T, E>(state: Atom<T, E>): AtomToken<T, Canonical, E>;
|
|
244
|
+
declare function deposit<T, E>(state: WritablePureSelector<T, E>): WritablePureSelectorToken<T, any, E>;
|
|
245
|
+
declare function deposit<T, E>(state: ReadonlyPureSelector<T, E>): ReadonlyPureSelectorToken<T, any, E>;
|
|
246
|
+
declare function deposit<T, E>(state: Selector<T, E>): SelectorToken<T, any, E>;
|
|
247
|
+
declare function deposit<T, E>(state: WritableState<T, E>): WritableToken<T, any, E>;
|
|
248
|
+
declare function deposit<T, E>(state: ReadableState<T, E>): ReadableToken<T, any, E>;
|
|
249
|
+
declare function deposit<T, K extends Canonical, E>(state: RegularAtomFamily<T, K, E>): RegularAtomFamilyToken<T, K, E>;
|
|
250
250
|
declare function deposit<T extends Transceiver<any, any, any>, K extends Canonical>(state: MutableAtomFamily<T, K>): MutableAtomFamilyToken<T, K>;
|
|
251
|
-
declare function deposit<T>(state: AtomFamily<T, any>): AtomFamilyToken<T, any>;
|
|
252
|
-
declare function deposit<T>(state: WritablePureSelectorFamily<T, any>): WritablePureSelectorFamilyToken<T, any>;
|
|
253
|
-
declare function deposit<T>(state: ReadonlyPureSelectorFamily<T, any>): ReadonlyPureSelectorFamilyToken<T, any>;
|
|
254
|
-
declare function deposit<T>(state: SelectorFamily<T, any>): SelectorFamilyToken<T, any>;
|
|
255
|
-
declare function deposit<T>(state: WritableFamily<T, any>): WritableFamilyToken<T, any>;
|
|
256
|
-
declare function deposit<T>(state: ReadableFamily<T, any>): ReadableFamilyToken<T, any>;
|
|
251
|
+
declare function deposit<T, E>(state: AtomFamily<T, any, E>): AtomFamilyToken<T, any, E>;
|
|
252
|
+
declare function deposit<T, E>(state: WritablePureSelectorFamily<T, any, E>): WritablePureSelectorFamilyToken<T, any, E>;
|
|
253
|
+
declare function deposit<T, E>(state: ReadonlyPureSelectorFamily<T, any, E>): ReadonlyPureSelectorFamilyToken<T, any, E>;
|
|
254
|
+
declare function deposit<T, E>(state: SelectorFamily<T, any, E>): SelectorFamilyToken<T, any, E>;
|
|
255
|
+
declare function deposit<T, E>(state: WritableFamily<T, any, E>): WritableFamilyToken<T, any, E>;
|
|
256
|
+
declare function deposit<T, E>(state: ReadableFamily<T, any, E>): ReadableFamilyToken<T, any, E>;
|
|
257
257
|
declare function deposit<T extends Fn>(state: Transaction<T>): TransactionToken<T>;
|
|
258
258
|
declare function deposit<M extends TimelineManageable>(state: Timeline<M>): TimelineToken<M>;
|
|
259
259
|
declare function deposit(resource: AtomIOInternalResource): AtomIOToken;
|
|
@@ -270,37 +270,25 @@ declare const FAMILY_MEMBER_TOKEN_TYPES: {
|
|
|
270
270
|
readonly writable_pure_selector_family: "writable_pure_selector";
|
|
271
271
|
};
|
|
272
272
|
declare function mint<T extends Transceiver<any, any, any>, K extends Canonical, Key extends K>(token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T>;
|
|
273
|
-
declare function mint<T, K extends Canonical, Key extends K>(token: RegularAtomFamilyToken<T, K>, key: Key, counterfeit?: typeof COUNTERFEIT): RegularAtomToken<T>;
|
|
274
|
-
declare function mint<T, K extends Canonical, Key extends K>(token: AtomFamilyToken<T, K>, key: Key, counterfeit?: typeof COUNTERFEIT): AtomToken<T>;
|
|
275
|
-
declare function mint<T, K extends Canonical, Key extends K>(token: WritablePureSelectorFamilyToken<T, K>, key: Key, counterfeit?: typeof COUNTERFEIT): WritablePureSelectorToken<T>;
|
|
276
|
-
declare function mint<T, K extends Canonical, Key extends K>(token: ReadonlyPureSelectorFamilyToken<T, K>, key: Key, counterfeit?: typeof COUNTERFEIT): ReadonlyPureSelectorToken<T>;
|
|
277
|
-
declare function mint<T, K extends Canonical, Key extends K>(token: SelectorFamilyToken<T, K>, key: Key, counterfeit?: typeof COUNTERFEIT): SelectorToken<T>;
|
|
278
|
-
declare function mint<T, K extends Canonical, Key extends K>(token: WritableFamilyToken<T, K>, key: Key, counterfeit?: typeof COUNTERFEIT): WritableToken<T>;
|
|
279
|
-
declare function mint<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key, counterfeit?: typeof COUNTERFEIT): ReadableToken<T>;
|
|
273
|
+
declare function mint<T, K extends Canonical, Key extends K, E>(token: RegularAtomFamilyToken<T, K, E>, key: Key, counterfeit?: typeof COUNTERFEIT): RegularAtomToken<T, Key, E>;
|
|
274
|
+
declare function mint<T, K extends Canonical, Key extends K, E>(token: AtomFamilyToken<T, K, E>, key: Key, counterfeit?: typeof COUNTERFEIT): AtomToken<T, Key, E>;
|
|
275
|
+
declare function mint<T, K extends Canonical, Key extends K, E>(token: WritablePureSelectorFamilyToken<T, K, E>, key: Key, counterfeit?: typeof COUNTERFEIT): WritablePureSelectorToken<T, Key, E>;
|
|
276
|
+
declare function mint<T, K extends Canonical, Key extends K, E>(token: ReadonlyPureSelectorFamilyToken<T, K, E>, key: Key, counterfeit?: typeof COUNTERFEIT): ReadonlyPureSelectorToken<T, Key, E>;
|
|
277
|
+
declare function mint<T, K extends Canonical, Key extends K, E>(token: SelectorFamilyToken<T, K, E>, key: Key, counterfeit?: typeof COUNTERFEIT): SelectorToken<T, Key, E>;
|
|
278
|
+
declare function mint<T, K extends Canonical, Key extends K, E>(token: WritableFamilyToken<T, K, E>, key: Key, counterfeit?: typeof COUNTERFEIT): WritableToken<T, Key, E>;
|
|
279
|
+
declare function mint<T, K extends Canonical, Key extends K, E>(token: ReadableFamilyToken<T, K, E>, key: Key, counterfeit?: typeof COUNTERFEIT): ReadableToken<T, Key, E>;
|
|
280
280
|
//#endregion
|
|
281
281
|
//#region src/internal/join/create-join.d.ts
|
|
282
|
-
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:
|
|
282
|
+
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: RootStore, options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>, defaultContent: Content | undefined): JoinToken<ASide, AType, BSide, BType, Cardinality, Content>;
|
|
283
283
|
//#endregion
|
|
284
284
|
//#region src/internal/join/edit-relations-in-store.d.ts
|
|
285
285
|
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;
|
|
286
286
|
//#endregion
|
|
287
287
|
//#region src/internal/join/find-relations-in-store.d.ts
|
|
288
|
-
declare function findRelationsInStore<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>, key: AType | BType, store:
|
|
288
|
+
declare function findRelationsInStore<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>, key: AType | BType, store: RootStore): JoinStates<ASide, AType, BSide, BType, Cardinality, Content>;
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/internal/join/get-internal-relations-from-store.d.ts
|
|
291
|
-
declare function getInternalRelationsFromStore(token: JoinToken<any, any, any, any, any, any>, store:
|
|
292
|
-
//#endregion
|
|
293
|
-
//#region src/internal/molecule.d.ts
|
|
294
|
-
type Molecule<K extends Canonical> = {
|
|
295
|
-
readonly key: K;
|
|
296
|
-
readonly stringKey: stringified<K>;
|
|
297
|
-
readonly dependsOn: `all` | `any`;
|
|
298
|
-
};
|
|
299
|
-
declare function makeRootMoleculeInStore<S extends string>(key: S, store?: Store): S;
|
|
300
|
-
declare function allocateIntoStore<H extends Hierarchy, V extends Vassal<H>, A extends Above<V, H>>(store: Store, provenance: A, key: V, dependsOn?: `all` | `any`): Claim<V>;
|
|
301
|
-
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>): Claim<CompoundTypedKey<T, A, B>>;
|
|
302
|
-
declare function deallocateFromStore<H extends Hierarchy, V extends Vassal<H>>(store: Store, claim: Claim<V>): void;
|
|
303
|
-
declare function claimWithinStore<H extends Hierarchy, V extends Exclude<Vassal<H>, CompoundTypedKey>, A extends Above<V, H>>(store: Store, newProvenance: A, claim: Claim<V>, exclusive?: `exclusive`): Claim<V>;
|
|
291
|
+
declare function getInternalRelationsFromStore(token: JoinToken<any, any, any, any, any, any>, store: RootStore): MutableAtomFamilyToken<SetRTX<string>, string>;
|
|
304
292
|
//#endregion
|
|
305
293
|
//#region src/internal/join/join-internal.d.ts
|
|
306
294
|
type JoinStateFamilies<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> = Cardinality extends `1:1` ? (Content extends Json.Object ? { readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlyPureSelectorFamilyToken<[AType, Content] | null, BType> } & { readonly [B in BSide as `${B}EntryOf${Capitalize<ASide>}`]: ReadonlyPureSelectorFamilyToken<[BType, Content] | null, AType> } : {}) & { readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlyPureSelectorFamilyToken<AType | null, BType> } & { readonly [B in BSide as `${B}KeyOf${Capitalize<ASide>}`]: ReadonlyPureSelectorFamilyToken<BType | null, AType> } : Cardinality extends `1:n` ? (Content extends Json.Object ? { readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlyPureSelectorFamilyToken<[AType, Content] | null, BType> } & { readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlyPureSelectorFamilyToken<[BType, Content][], AType> } : {}) & { readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlyPureSelectorFamilyToken<AType | null, BType> } & { readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlyPureSelectorFamilyToken<BType[], AType> } : Cardinality extends `n:n` ? (Content extends Json.Object ? { readonly [A in ASide as `${A}EntriesOf${Capitalize<BSide>}`]: ReadonlyPureSelectorFamilyToken<[AType, Content][], BType> } & { readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlyPureSelectorFamilyToken<[BType, Content][], AType> } : {}) & { readonly [A in ASide as `${A}KeysOf${Capitalize<BSide>}`]: ReadonlyPureSelectorFamilyToken<AType[], BType> } & { readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlyPureSelectorFamilyToken<BType[], AType> } : never;
|
|
@@ -308,7 +296,6 @@ declare class Join<const ASide extends string, const AType extends string, const
|
|
|
308
296
|
private toolkit;
|
|
309
297
|
options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>;
|
|
310
298
|
defaultContent: Content | undefined;
|
|
311
|
-
molecules: Map<string, Molecule<any>>;
|
|
312
299
|
relations: Junction<ASide, AType, BSide, BType, Content>;
|
|
313
300
|
states: JoinStateFamilies<ASide, AType, BSide, BType, Cardinality, Content>;
|
|
314
301
|
core: {
|
|
@@ -318,7 +305,7 @@ declare class Join<const ASide extends string, const AType extends string, const
|
|
|
318
305
|
store: Store;
|
|
319
306
|
realm: Anarchy;
|
|
320
307
|
[Symbol.dispose](): void;
|
|
321
|
-
constructor(options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>, defaultContent: Content | undefined, store?:
|
|
308
|
+
constructor(options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>, defaultContent: Content | undefined, store?: RootStore);
|
|
322
309
|
}
|
|
323
310
|
//#endregion
|
|
324
311
|
//#region src/internal/join/get-join.d.ts
|
|
@@ -329,13 +316,28 @@ interface Lineage {
|
|
|
329
316
|
parent: typeof this | null;
|
|
330
317
|
child: typeof this | null;
|
|
331
318
|
}
|
|
332
|
-
declare function newest<T extends Lineage>(scion: T): T;
|
|
319
|
+
declare function newest<T extends Lineage>(scion: T): Exclude<T[`child`], null> | T;
|
|
320
|
+
declare function eldest<T extends Lineage>(scion: T): Exclude<T[`parent`], T[`child`] | null>;
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/internal/molecule.d.ts
|
|
323
|
+
type Molecule<K extends Canonical> = {
|
|
324
|
+
readonly key: K;
|
|
325
|
+
readonly stringKey: stringified<K>;
|
|
326
|
+
readonly dependsOn: `all` | `any`;
|
|
327
|
+
};
|
|
328
|
+
declare function makeRootMoleculeInStore<S extends string>(key: S, store?: Store): S;
|
|
329
|
+
declare function allocateIntoStore<H extends Hierarchy, V extends Vassal<H>, A extends Above<V, H>>(store: Store, provenance: A, key: V, dependsOn?: `all` | `any`): Claim<V>;
|
|
330
|
+
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>): Claim<CompoundTypedKey<T, A, B>>;
|
|
331
|
+
declare function createDeallocateTX<H extends Hierarchy, V extends Exclude<Vassal<H>, CompoundTypedKey>>(store: RootStore): TransactionToken<(claim: Claim<V>) => void>;
|
|
332
|
+
declare function deallocateFromStore<H extends Hierarchy, V extends Vassal<H>>(target: Store, claim: Claim<V>): void;
|
|
333
|
+
declare function createClaimTX<H extends Hierarchy, V extends Exclude<Vassal<H>, CompoundTypedKey>, A extends Above<V, H>>(store: RootStore): TransactionToken<(newProvenance: A, claim: Claim<V>, exclusive?: `exclusive`) => void>;
|
|
334
|
+
declare function claimWithinStore<H extends Hierarchy, V extends Exclude<Vassal<H>, CompoundTypedKey>, A extends Above<V, H>>(store: Store, newProvenance: A, claim: Claim<V>, exclusive?: `exclusive`): Claim<V>;
|
|
333
335
|
//#endregion
|
|
334
336
|
//#region src/internal/operation.d.ts
|
|
335
337
|
type OperationProgress = OpenOperation<any> | {
|
|
336
338
|
open: false;
|
|
337
339
|
};
|
|
338
|
-
type OpenOperation<R extends ReadableToken<any> = ReadableToken<any>> = {
|
|
340
|
+
type OpenOperation<R extends ReadableToken<any, any> = ReadableToken<any, any>> = {
|
|
339
341
|
open: true;
|
|
340
342
|
token: R;
|
|
341
343
|
done: Set<string>;
|
|
@@ -343,7 +345,7 @@ type OpenOperation<R extends ReadableToken<any> = ReadableToken<any>> = {
|
|
|
343
345
|
timestamp: number;
|
|
344
346
|
subEvents: (AtomUpdateEvent<any> | StateCreationEvent<any>)[];
|
|
345
347
|
};
|
|
346
|
-
declare function openOperation(store: Store, token: ReadableToken<any>): number | (Store & {
|
|
348
|
+
declare function openOperation(store: Store, token: ReadableToken<any, any, any>): number | (Store & {
|
|
347
349
|
operation: OpenOperation;
|
|
348
350
|
});
|
|
349
351
|
declare function closeOperation(store: Store): void;
|
|
@@ -359,31 +361,31 @@ type Timeline<ManagedAtom extends TimelineManageable> = {
|
|
|
359
361
|
history: TimelineEvent<ManagedAtom>[];
|
|
360
362
|
selectorTime: number | null;
|
|
361
363
|
transactionKey: string | null;
|
|
362
|
-
install: (store:
|
|
364
|
+
install: (store: RootStore) => void;
|
|
363
365
|
subject: Subject<TimelineEvent<ManagedAtom> | `redo` | `undo`>;
|
|
364
366
|
subscriptions: Map<string, () => void>;
|
|
365
367
|
};
|
|
366
|
-
declare function createTimeline<ManagedAtom extends TimelineManageable>(store:
|
|
368
|
+
declare function createTimeline<ManagedAtom extends TimelineManageable>(store: RootStore, options: TimelineOptions<ManagedAtom>, data?: Timeline<ManagedAtom>): TimelineToken<ManagedAtom>;
|
|
367
369
|
//#endregion
|
|
368
370
|
//#region src/internal/timeline/time-travel.d.ts
|
|
369
371
|
declare const timeTravel: (store: Store, action: `redo` | `undo`, token: TimelineToken<any>) => void;
|
|
370
372
|
//#endregion
|
|
371
373
|
//#region src/internal/store/store.d.ts
|
|
372
374
|
declare class Store implements Lineage {
|
|
373
|
-
parent:
|
|
374
|
-
child:
|
|
375
|
+
parent: ChildStore | RootStore | null;
|
|
376
|
+
child: ChildStore | null;
|
|
375
377
|
valueMap: Map<string, any>;
|
|
376
378
|
defaults: Map<string, any>;
|
|
377
|
-
atoms: Map<string, Atom<any>>;
|
|
378
|
-
writableSelectors: Map<string, WritableSelector<any>>;
|
|
379
|
-
readonlySelectors: Map<string, ReadonlySelector<any>>;
|
|
379
|
+
atoms: Map<string, Atom<any, any>>;
|
|
380
|
+
writableSelectors: Map<string, WritableSelector<any, any>>;
|
|
381
|
+
readonlySelectors: Map<string, ReadonlySelector<any, any>>;
|
|
380
382
|
atomsThatAreDefault: Set<string>;
|
|
381
383
|
selectorAtoms: Junction<`selectorKey`, string, `atomKey`, string>;
|
|
382
384
|
selectorGraph: Junction<`upstreamSelectorKey`, string, `downstreamSelectorKey`, string, {
|
|
383
385
|
source: string;
|
|
384
386
|
}>;
|
|
385
387
|
trackers: Map<string, Tracker<Transceiver<any, any, any>>>;
|
|
386
|
-
families: Map<string, HeldSelectorFamily<any, any> | MutableAtomFamily<any, any> | PureSelectorFamily<any, any> | RegularAtomFamily<any, any>>;
|
|
388
|
+
families: Map<string, HeldSelectorFamily<any, any> | MutableAtomFamily<any, any> | PureSelectorFamily<any, any, any> | RegularAtomFamily<any, any, any>>;
|
|
387
389
|
joins: Map<string, Join<any, any, any, any, any, any>>;
|
|
388
390
|
transactions: Map<string, Transaction<Fn>>;
|
|
389
391
|
transactionMeta: TransactionEpoch | TransactionProgress<Fn>;
|
|
@@ -413,10 +415,10 @@ declare class Store implements Lineage {
|
|
|
413
415
|
constructor(config: Store[`config`], store?: Store | null);
|
|
414
416
|
}
|
|
415
417
|
type StoreEventCarrier = {
|
|
416
|
-
atomCreation: Subject<AtomToken<unknown>>;
|
|
417
|
-
atomDisposal: Subject<AtomToken<unknown>>;
|
|
418
|
-
selectorCreation: Subject<SelectorToken<unknown>>;
|
|
419
|
-
selectorDisposal: Subject<SelectorToken<unknown>>;
|
|
418
|
+
atomCreation: Subject<AtomToken<unknown, any, any>>;
|
|
419
|
+
atomDisposal: Subject<AtomToken<unknown, any, any>>;
|
|
420
|
+
selectorCreation: Subject<SelectorToken<unknown, any, any>>;
|
|
421
|
+
selectorDisposal: Subject<SelectorToken<unknown, any, any>>;
|
|
420
422
|
timelineCreation: Subject<TimelineToken<unknown>>;
|
|
421
423
|
transactionCreation: Subject<TransactionToken<Fn>>;
|
|
422
424
|
transactionApplying: StatefulSubject<TransactionProgress<Fn> | null>;
|
|
@@ -425,46 +427,46 @@ type StoreEventCarrier = {
|
|
|
425
427
|
moleculeDisposal: Subject<MoleculeDisposalEvent>;
|
|
426
428
|
};
|
|
427
429
|
declare global {
|
|
428
|
-
var ATOM_IO_IMPLICIT_STORE:
|
|
430
|
+
var ATOM_IO_IMPLICIT_STORE: RootStore | undefined;
|
|
429
431
|
}
|
|
430
432
|
declare const IMPLICIT: {
|
|
431
|
-
readonly STORE:
|
|
433
|
+
readonly STORE: RootStore;
|
|
432
434
|
};
|
|
433
435
|
declare const clearStore: (store: Store) => void;
|
|
434
436
|
//#endregion
|
|
435
437
|
//#region src/internal/store/withdraw.d.ts
|
|
436
|
-
declare function withdraw<T>(store: Store, token: RegularAtomToken<T>): RegularAtom<T>;
|
|
438
|
+
declare function withdraw<T, E>(store: Store, token: RegularAtomToken<T, any, E>): RegularAtom<T, E>;
|
|
437
439
|
declare function withdraw<T extends Transceiver<any, any, any>>(store: Store, token: MutableAtomToken<T, any>): MutableAtom<T>;
|
|
438
|
-
declare function withdraw<T>(store: Store, token: AtomToken<T>): Atom<T>;
|
|
440
|
+
declare function withdraw<T, E>(store: Store, token: AtomToken<T, any, E>): Atom<T, E>;
|
|
439
441
|
declare function withdraw<T>(store: Store, token: WritableHeldSelectorToken<T>): WritableHeldSelector<T>;
|
|
440
442
|
declare function withdraw<T>(store: Store, token: ReadonlyHeldSelectorToken<T>): ReadonlyHeldSelector<T>;
|
|
441
|
-
declare function withdraw<T>(store: Store, token: WritablePureSelectorToken<T>): WritablePureSelector<T>;
|
|
442
|
-
declare function withdraw<T>(store: Store, token: ReadonlyPureSelectorToken<T>): ReadonlyPureSelector<T>;
|
|
443
|
-
declare function withdraw<T>(store: Store, token: ReadonlySelectorToken<T>): ReadonlySelector<T>;
|
|
444
|
-
declare function withdraw<T>(store: Store, token: WritableSelectorToken<T>): WritableSelector<T>;
|
|
443
|
+
declare function withdraw<T, E>(store: Store, token: WritablePureSelectorToken<T, any, E>): WritablePureSelector<T, E>;
|
|
444
|
+
declare function withdraw<T, E>(store: Store, token: ReadonlyPureSelectorToken<T, any, E>): ReadonlyPureSelector<T, E>;
|
|
445
|
+
declare function withdraw<T, E>(store: Store, token: ReadonlySelectorToken<T, any, E>): ReadonlySelector<T, E>;
|
|
446
|
+
declare function withdraw<T, E>(store: Store, token: WritableSelectorToken<T, any, E>): WritableSelector<T, E>;
|
|
445
447
|
declare function withdraw<T>(store: Store, token: HeldSelectorToken<T>): HeldSelector<T>;
|
|
446
|
-
declare function withdraw<T>(store: Store, token: PureSelectorToken<T>): PureSelector<T>;
|
|
447
|
-
declare function withdraw<T>(store: Store, token: SelectorToken<T>): Selector<T>;
|
|
448
|
-
declare function withdraw<T>(store: Store, token: WritableToken<T>): WritableState<T>;
|
|
449
|
-
declare function withdraw<T>(store: Store, token: ReadableToken<T>): ReadableState<T>;
|
|
450
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: RegularAtomFamilyToken<T, K>): RegularAtomFamily<T, K>;
|
|
448
|
+
declare function withdraw<T, E>(store: Store, token: PureSelectorToken<T, any, E>): PureSelector<T, E>;
|
|
449
|
+
declare function withdraw<T, E>(store: Store, token: SelectorToken<T, any, E>): Selector<T, E>;
|
|
450
|
+
declare function withdraw<T, E>(store: Store, token: WritableToken<T, any, E>): WritableState<T, E>;
|
|
451
|
+
declare function withdraw<T, E>(store: Store, token: ReadableToken<T, any, E>): ReadableState<T, E>;
|
|
452
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: RegularAtomFamilyToken<T, K, E>): RegularAtomFamily<T, K, E>;
|
|
451
453
|
declare function withdraw<T extends Transceiver<any, any, any>, K extends Canonical>(store: Store, token: MutableAtomFamilyToken<T, K>): MutableAtomFamily<T, K>;
|
|
452
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: AtomFamilyToken<T, K>): AtomFamily<T, K>;
|
|
454
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: AtomFamilyToken<T, K, E>): AtomFamily<T, K, E>;
|
|
453
455
|
declare function withdraw<T, K extends Canonical>(store: Store, token: ReadonlyHeldSelectorFamilyToken<T, K>): ReadonlyHeldSelectorFamily<T, K>;
|
|
454
456
|
declare function withdraw<T, K extends Canonical>(store: Store, token: WritableHeldSelectorFamilyToken<T, K>): WritableHeldSelectorFamily<T, K>;
|
|
455
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: ReadonlyPureSelectorFamilyToken<T, K>): ReadonlyPureSelectorFamily<T, K>;
|
|
456
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: WritablePureSelectorFamilyToken<T, K>): WritablePureSelectorFamily<T, K>;
|
|
457
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: ReadonlySelectorFamilyToken<T, K>): ReadonlySelectorFamily<T, K>;
|
|
458
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: WritableSelectorFamilyToken<T, K>): WritableSelectorFamily<T, K>;
|
|
457
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: ReadonlyPureSelectorFamilyToken<T, K, E>): ReadonlyPureSelectorFamily<T, K, E>;
|
|
458
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: WritablePureSelectorFamilyToken<T, K, E>): WritablePureSelectorFamily<T, K, E>;
|
|
459
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: ReadonlySelectorFamilyToken<T, K, E>): ReadonlySelectorFamily<T, K, E>;
|
|
460
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: WritableSelectorFamilyToken<T, K, E>): WritableSelectorFamily<T, K, E>;
|
|
459
461
|
declare function withdraw<T, K extends Canonical>(store: Store, token: HeldSelectorFamilyToken<T, K>): HeldSelectorFamily<T, K>;
|
|
460
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: PureSelectorFamilyToken<T, K>): PureSelectorFamily<T, K>;
|
|
461
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: SelectorFamilyToken<T, K>): SelectorFamily<T, K>;
|
|
462
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: WritableFamilyToken<T, K>): WritableFamily<T, K>;
|
|
463
|
-
declare function withdraw<T, K extends Canonical>(store: Store, token: ReadableFamilyToken<T, K>): ReadableFamily<T, K>;
|
|
462
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: PureSelectorFamilyToken<T, K, E>): PureSelectorFamily<T, K, E>;
|
|
463
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: SelectorFamilyToken<T, K, E>): SelectorFamily<T, K, E>;
|
|
464
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: WritableFamilyToken<T, K, E>): WritableFamily<T, K, E>;
|
|
465
|
+
declare function withdraw<T, K extends Canonical, E>(store: Store, token: ReadableFamilyToken<T, K, E>): ReadableFamily<T, K, E>;
|
|
464
466
|
declare function withdraw<T extends Fn>(store: Store, token: TransactionToken<T>): Transaction<T extends Fn ? T : never>;
|
|
465
467
|
declare function withdraw<T>(store: Store, token: TimelineToken<T>): Timeline<T extends TimelineManageable ? T : never>;
|
|
466
|
-
declare function withdraw<T>(store: Store, token: WritableToken<T>): WritableState<T>;
|
|
467
|
-
declare function withdraw<T>(store: Store, token: ReadableToken<T>): ReadableState<T>;
|
|
468
|
+
declare function withdraw<T, E>(store: Store, token: WritableToken<T, any, E>): WritableState<T, E>;
|
|
469
|
+
declare function withdraw<T, E>(store: Store, token: ReadableToken<T, any, E>): ReadableState<T, E>;
|
|
468
470
|
declare function withdraw(store: Store, token: AtomIOToken): AtomIOInternalResource;
|
|
469
471
|
//#endregion
|
|
470
472
|
//#region src/internal/mutable/transceiver.d.ts
|
|
@@ -490,16 +492,16 @@ type ConstructorOf<T extends Transceiver<any, any, any>> = TransceiverConstructo
|
|
|
490
492
|
declare function createMutableAtom<T extends Transceiver<any, any, any>>(store: Store, options: MutableAtomOptions<T>, family: FamilyMetadata | undefined): MutableAtomToken<T>;
|
|
491
493
|
//#endregion
|
|
492
494
|
//#region src/internal/mutable/create-mutable-atom-family.d.ts
|
|
493
|
-
declare function createMutableAtomFamily<T extends Transceiver<any, any, any>, K extends Canonical>(store:
|
|
495
|
+
declare function createMutableAtomFamily<T extends Transceiver<any, any, any>, K extends Canonical>(store: RootStore, options: MutableAtomFamilyOptions<T, K>, internalRoles?: string[]): MutableAtomFamilyToken<T, K>;
|
|
494
496
|
//#endregion
|
|
495
497
|
//#region src/internal/mutable/get-json-family.d.ts
|
|
496
|
-
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>;
|
|
498
|
+
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, never>;
|
|
497
499
|
//#endregion
|
|
498
500
|
//#region src/internal/mutable/get-json-token.d.ts
|
|
499
501
|
declare const getJsonToken: <T extends Transceiver<any, any, any>>(store: Store, mutableAtomToken: MutableAtomToken<T>) => WritablePureSelectorToken<AsJSON<T>>;
|
|
500
502
|
//#endregion
|
|
501
503
|
//#region src/internal/mutable/get-update-family.d.ts
|
|
502
|
-
declare const getUpdateFamily: <T extends Transceiver<any, Json.Serializable, Json.Serializable>, K extends string>(mutableAtomFamily: MutableAtomFamilyToken<T, K>, store: Store) =>
|
|
504
|
+
declare const getUpdateFamily: <T extends Transceiver<any, Json.Serializable, Json.Serializable>, K extends string>(mutableAtomFamily: MutableAtomFamilyToken<T, K>, store: Store) => RegularAtomFamily<SignalFrom<T>, K, never>;
|
|
503
505
|
//#endregion
|
|
504
506
|
//#region src/internal/mutable/get-update-token.d.ts
|
|
505
507
|
declare const getUpdateToken: <T extends Transceiver<any, any, any>>(mutableAtomToken: MutableAtomToken<T>) => RegularAtomToken<SignalFrom<T>>;
|
|
@@ -527,17 +529,17 @@ declare class FamilyTracker<T extends Transceiver<any, any, any>, K extends Cano
|
|
|
527
529
|
private trackers;
|
|
528
530
|
readonly latestSignalAtoms: RegularAtomFamily<SignalFrom<T> | null, K>;
|
|
529
531
|
readonly mutableAtoms: MutableAtomFamily<T, K>;
|
|
530
|
-
constructor(mutableAtoms: MutableAtomFamily<T, K>, store:
|
|
532
|
+
constructor(mutableAtoms: MutableAtomFamily<T, K>, store: RootStore);
|
|
531
533
|
}
|
|
532
534
|
//#endregion
|
|
533
535
|
//#region src/internal/arbitrary.d.ts
|
|
534
536
|
declare function arbitrary(random?: () => number): string;
|
|
535
537
|
//#endregion
|
|
536
538
|
//#region src/internal/atom/create-regular-atom.d.ts
|
|
537
|
-
declare function createRegularAtom<T>(store: Store, options: RegularAtomOptions<T>, family: FamilyMetadata | undefined, internalRoles?: internalRole[]): RegularAtomToken<T>;
|
|
539
|
+
declare function createRegularAtom<T, K extends Canonical, E>(store: Store, options: RegularAtomOptions<T, E>, family: FamilyMetadata<K> | undefined, internalRoles?: internalRole[]): RegularAtomToken<T, K, E>;
|
|
538
540
|
//#endregion
|
|
539
541
|
//#region src/internal/atom/dispose-atom.d.ts
|
|
540
|
-
declare function disposeAtom(store: Store, atomToken: AtomToken<any>): void;
|
|
542
|
+
declare function disposeAtom(store: Store, atomToken: AtomToken<any, any, any>): void;
|
|
541
543
|
//#endregion
|
|
542
544
|
//#region src/internal/future.d.ts
|
|
543
545
|
/**
|
|
@@ -561,15 +563,15 @@ declare class Future<T> extends Promise<T> {
|
|
|
561
563
|
}
|
|
562
564
|
//#endregion
|
|
563
565
|
//#region src/internal/caching.d.ts
|
|
564
|
-
declare function writeToCache<T>(target: Store, state: ReadableState<T>, value: T): T;
|
|
565
|
-
declare function writeToCache<T extends Promise<any
|
|
566
|
+
declare function writeToCache<T, E>(target: Store, state: ReadableState<T, E>, value: E | T): E | T;
|
|
567
|
+
declare function writeToCache<T extends Promise<any>, E>(target: Store, state: ReadableState<T, E>, value: T): Future<Awaited<E | T>>;
|
|
566
568
|
/**
|
|
567
569
|
* @param target - the newest layer of the store
|
|
568
570
|
* @param state - the state to read from cache
|
|
569
571
|
* @param mut - whether the value is intended to be mutable
|
|
570
572
|
* @returns the state's current value
|
|
571
573
|
*/
|
|
572
|
-
declare function readFromCache<T>(target: Store, state: ReadableState<T>, mut: `mut` | undefined): T;
|
|
574
|
+
declare function readFromCache<T, E>(target: Store, state: ReadableState<T, E>, mut: `mut` | undefined): E | T;
|
|
573
575
|
declare function evictCachedValue(target: Store, key: string): void;
|
|
574
576
|
//#endregion
|
|
575
577
|
//#region src/internal/capitalize.d.ts
|
|
@@ -580,7 +582,7 @@ declare function ingestAtomUpdateEvent(store: Store, event: AtomUpdateEvent<any>
|
|
|
580
582
|
//#endregion
|
|
581
583
|
//#region src/internal/events/ingest-creation-disposal.d.ts
|
|
582
584
|
declare function ingestCreationEvent(store: Store, event: StateCreationEvent<any>, applying: `newValue` | `oldValue`): void;
|
|
583
|
-
declare function ingestDisposalEvent(store: Store, event: StateDisposalEvent<ReadableToken<any>>, applying: `newValue` | `oldValue`): void;
|
|
585
|
+
declare function ingestDisposalEvent(store: Store, event: StateDisposalEvent<ReadableToken<any, any, any>>, applying: `newValue` | `oldValue`): void;
|
|
584
586
|
declare function ingestMoleculeCreationEvent(store: Store, event: MoleculeCreationEvent, applying: `newValue` | `oldValue`): void;
|
|
585
587
|
declare function ingestMoleculeDisposalEvent(store: Store, event: MoleculeDisposalEvent, applying: `newValue` | `oldValue`): void;
|
|
586
588
|
declare function ingestMoleculeTransferEvent(store: Store, event: MoleculeTransferEvent, applying: `newValue` | `oldValue`): void;
|
|
@@ -592,43 +594,44 @@ declare function ingestSelectorUpdateEvent(store: Store, selectorUpdate: Timelin
|
|
|
592
594
|
declare function ingestTransactionOutcomeEvent(store: Store, event: TransactionOutcomeEvent<any>, applying: `newValue` | `oldValue`): void;
|
|
593
595
|
//#endregion
|
|
594
596
|
//#region src/internal/families/create-readonly-pure-selector-family.d.ts
|
|
595
|
-
declare function createReadonlyPureSelectorFamily<T, K extends Canonical>(store:
|
|
597
|
+
declare function createReadonlyPureSelectorFamily<T, K extends Canonical, E>(store: RootStore, options: ReadonlyPureSelectorFamilyOptions<T, K, E>, internalRoles?: string[]): ReadonlyPureSelectorFamilyToken<T, K, E>;
|
|
596
598
|
//#endregion
|
|
597
599
|
//#region src/internal/families/create-regular-atom-family.d.ts
|
|
598
|
-
declare function createRegularAtomFamily<T, K extends Canonical>(store:
|
|
600
|
+
declare function createRegularAtomFamily<T, K extends Canonical, E>(store: RootStore, options: RegularAtomFamilyOptions<T, K, E>, internalRoles?: string[]): RegularAtomFamilyToken<T, K, E>;
|
|
599
601
|
//#endregion
|
|
600
602
|
//#region src/internal/families/create-selector-family.d.ts
|
|
601
|
-
declare function createSelectorFamily<T extends object, K extends Canonical>(store:
|
|
602
|
-
declare function createSelectorFamily<T extends object, K extends Canonical>(store:
|
|
603
|
-
declare function createSelectorFamily<T, K extends Canonical>(store:
|
|
604
|
-
declare function createSelectorFamily<T, K extends Canonical>(store:
|
|
603
|
+
declare function createSelectorFamily<T extends object, K extends Canonical>(store: RootStore, options: WritableHeldSelectorFamilyOptions<T, K>): WritableHeldSelectorFamilyToken<T, K>;
|
|
604
|
+
declare function createSelectorFamily<T extends object, K extends Canonical>(store: RootStore, options: ReadonlyHeldSelectorFamilyOptions<T, K>): ReadonlyHeldSelectorFamilyToken<T, K>;
|
|
605
|
+
declare function createSelectorFamily<T, K extends Canonical, E>(store: RootStore, options: WritablePureSelectorFamilyOptions<T, K, E>): WritablePureSelectorFamilyToken<T, K, E>;
|
|
606
|
+
declare function createSelectorFamily<T, K extends Canonical, E>(store: RootStore, options: ReadonlyPureSelectorFamilyOptions<T, K, E>): ReadonlyPureSelectorFamilyToken<T, K, E>;
|
|
605
607
|
//#endregion
|
|
606
608
|
//#region src/internal/families/create-writable-pure-selector-family.d.ts
|
|
607
|
-
declare function createWritablePureSelectorFamily<T, K extends Canonical>(store: Store, options: WritablePureSelectorFamilyOptions<T, K>, internalRoles?: string[]): WritablePureSelectorFamilyToken<T, K>;
|
|
609
|
+
declare function createWritablePureSelectorFamily<T, K extends Canonical, E>(store: Store, options: WritablePureSelectorFamilyOptions<T, K, E>, internalRoles?: string[]): WritablePureSelectorFamilyToken<T, K, E>;
|
|
608
610
|
//#endregion
|
|
609
611
|
//#region src/internal/families/dispose-from-store.d.ts
|
|
610
|
-
declare function disposeFromStore(store: Store, token: ReadableToken<any>): void;
|
|
611
|
-
declare function disposeFromStore<K extends Canonical>(store: Store, token: ReadableFamilyToken<any, K>, key:
|
|
612
|
+
declare function disposeFromStore(store: Store, token: ReadableToken<any, any, any>): void;
|
|
613
|
+
declare function disposeFromStore<K extends Canonical, Key extends K>(store: Store, token: ReadableFamilyToken<any, K, any>, key: Key): void;
|
|
614
|
+
declare function disposeFromStore<K extends Canonical, Key extends K>(store: Store, ...params: [token: ReadableFamilyToken<any, K, any>, key: Key] | [token: ReadableToken<any, any, any>]): void;
|
|
612
615
|
//#endregion
|
|
613
616
|
//#region src/internal/families/find-in-store.d.ts
|
|
614
617
|
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, K>;
|
|
615
|
-
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T, K>;
|
|
616
|
-
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: AtomFamilyToken<T, K>, key: Key): AtomToken<T, K>;
|
|
617
|
-
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: WritablePureSelectorFamilyToken<T, K>, key: Key): WritablePureSelectorToken<T, K>;
|
|
618
|
-
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: ReadonlyPureSelectorFamilyToken<T, K>, key: Key): ReadonlyPureSelectorToken<T, K>;
|
|
619
|
-
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: SelectorFamilyToken<T, K>, key: Key): SelectorToken<T, K>;
|
|
620
|
-
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: WritableFamilyToken<T, K>, key: Key): WritableToken<T, K>;
|
|
621
|
-
declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K>;
|
|
618
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: RegularAtomFamilyToken<T, K, E>, key: Key): RegularAtomToken<T, K, E>;
|
|
619
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: AtomFamilyToken<T, K, E>, key: Key): AtomToken<T, K, E>;
|
|
620
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: WritablePureSelectorFamilyToken<T, K, E>, key: Key): WritablePureSelectorToken<T, K, E>;
|
|
621
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: ReadonlyPureSelectorFamilyToken<T, K, E>, key: Key): ReadonlyPureSelectorToken<T, K, E>;
|
|
622
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: SelectorFamilyToken<T, K, E>, key: Key): SelectorToken<T, K, E>;
|
|
623
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: WritableFamilyToken<T, K, E>, key: Key): WritableToken<T, K, E>;
|
|
624
|
+
declare function findInStore<T, K extends Canonical, Key extends K, E>(store: Store, familyToken: ReadableFamilyToken<T, K, E>, key: Key): ReadableToken<T, K, E>;
|
|
622
625
|
//#endregion
|
|
623
626
|
//#region src/internal/families/seek-in-store.d.ts
|
|
624
|
-
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,
|
|
625
|
-
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T,
|
|
626
|
-
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: AtomFamilyToken<T, K>, key: Key): AtomToken<T,
|
|
627
|
-
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: WritablePureSelectorFamilyToken<T, K>, key: Key): WritablePureSelectorToken<T,
|
|
628
|
-
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: ReadonlyPureSelectorFamilyToken<T, K>, key: Key): ReadonlyPureSelectorToken<T,
|
|
629
|
-
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: SelectorFamilyToken<T, K>, key: Key): SelectorToken<T,
|
|
630
|
-
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: WritableFamilyToken<T, K>, key: Key): WritableToken<T,
|
|
631
|
-
declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T,
|
|
627
|
+
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;
|
|
628
|
+
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;
|
|
629
|
+
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;
|
|
630
|
+
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;
|
|
631
|
+
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;
|
|
632
|
+
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;
|
|
633
|
+
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;
|
|
634
|
+
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;
|
|
632
635
|
//#endregion
|
|
633
636
|
//#region src/internal/get-environment-data.d.ts
|
|
634
637
|
type EnvironmentData = {
|
|
@@ -638,11 +641,13 @@ declare function getEnvironmentData(store: Store): EnvironmentData;
|
|
|
638
641
|
//#endregion
|
|
639
642
|
//#region src/internal/get-state/get-from-store.d.ts
|
|
640
643
|
declare function getFromStore<T>(store: Store, token: ReadableToken<T>): T;
|
|
641
|
-
declare function getFromStore<T,
|
|
644
|
+
declare function getFromStore<T, E>(store: Store, token: ReadableToken<T, any, E>): E | T;
|
|
645
|
+
declare function getFromStore<T, K extends Canonical, E>(store: Store, token: ReadableFamilyToken<T, K, E>, key: K): ViewOf<E | T>;
|
|
646
|
+
declare function getFromStore<T, K extends Canonical, Key extends K, E>(store: Store, ...params: [token: ReadableFamilyToken<T, K, E>, key: Key] | [token: ReadableToken<T, any, E>]): ViewOf<E | T>;
|
|
642
647
|
//#endregion
|
|
643
648
|
//#region src/internal/get-state/read-or-compute-value.d.ts
|
|
644
|
-
declare function readOrComputeValue<T>(target: Store, state: ReadableState<T>, mut?: undefined): ViewOf<T>;
|
|
645
|
-
declare function readOrComputeValue<T>(target: Store, state: ReadableState<T>, mut: `mut`): T;
|
|
649
|
+
declare function readOrComputeValue<T, E>(target: Store, state: ReadableState<T, E>, mut?: undefined): ViewOf<E | T>;
|
|
650
|
+
declare function readOrComputeValue<T, E>(target: Store, state: ReadableState<T, E>, mut: `mut`): E | T;
|
|
646
651
|
//#endregion
|
|
647
652
|
//#region src/internal/get-trace.d.ts
|
|
648
653
|
declare function getTrace(error: Error): string;
|
|
@@ -656,7 +661,7 @@ declare function getTrace(error: Error): string;
|
|
|
656
661
|
* @param source - The store to install the tokens from
|
|
657
662
|
*
|
|
658
663
|
*/
|
|
659
|
-
declare function installIntoStore(tokens: AtomIOToken[], target:
|
|
664
|
+
declare function installIntoStore(tokens: AtomIOToken[], target: RootStore, source: Store): void;
|
|
660
665
|
//#endregion
|
|
661
666
|
//#region src/internal/keys.d.ts
|
|
662
667
|
type AtomKey<T> = string & {
|
|
@@ -690,22 +695,22 @@ declare function isReservedIntrospectionKey(value: string): value is ReservedInt
|
|
|
690
695
|
declare function createReadonlyHeldSelector<T extends object>(store: Store, options: ReadonlyHeldSelectorOptions<T>, family: FamilyMetadata | undefined): ReadonlyHeldSelectorToken<T>;
|
|
691
696
|
//#endregion
|
|
692
697
|
//#region src/internal/selector/create-readonly-pure-selector.d.ts
|
|
693
|
-
declare function createReadonlyPureSelector<T>(store: Store, options: ReadonlyPureSelectorOptions<T>, family: FamilyMetadata | undefined): ReadonlyPureSelectorToken<T>;
|
|
698
|
+
declare function createReadonlyPureSelector<T, K extends Canonical, E>(store: Store, options: ReadonlyPureSelectorOptions<T, E>, family: FamilyMetadata<K> | undefined): ReadonlyPureSelectorToken<T, K, E>;
|
|
694
699
|
//#endregion
|
|
695
700
|
//#region src/internal/selector/create-standalone-selector.d.ts
|
|
696
701
|
declare function createStandaloneSelector<T extends object>(store: Store, options: WritableHeldSelectorOptions<T>): WritableHeldSelectorToken<T>;
|
|
697
702
|
declare function createStandaloneSelector<T extends object>(store: Store, options: ReadonlyHeldSelectorOptions<T>): ReadonlyHeldSelectorToken<T>;
|
|
698
|
-
declare function createStandaloneSelector<T>(store: Store, options: WritablePureSelectorOptions<T>): WritablePureSelectorToken<T>;
|
|
699
|
-
declare function createStandaloneSelector<T>(store: Store, options: ReadonlyPureSelectorOptions<T>): ReadonlyPureSelectorToken<T>;
|
|
703
|
+
declare function createStandaloneSelector<T, E>(store: Store, options: WritablePureSelectorOptions<T, E>): WritablePureSelectorToken<T, any, E>;
|
|
704
|
+
declare function createStandaloneSelector<T, E>(store: Store, options: ReadonlyPureSelectorOptions<T, E>): ReadonlyPureSelectorToken<T, any, E>;
|
|
700
705
|
//#endregion
|
|
701
706
|
//#region src/internal/selector/create-writable-held-selector.d.ts
|
|
702
707
|
declare function createWritableHeldSelector<T extends object>(store: Store, options: WritableHeldSelectorOptions<T>, family: FamilyMetadata | undefined): WritableHeldSelectorToken<T>;
|
|
703
708
|
//#endregion
|
|
704
709
|
//#region src/internal/selector/create-writable-pure-selector.d.ts
|
|
705
|
-
declare function createWritablePureSelector<T>(store: Store, options: WritablePureSelectorOptions<T>, family: FamilyMetadata | undefined): WritablePureSelectorToken<T>;
|
|
710
|
+
declare function createWritablePureSelector<T, K extends Canonical, E>(store: Store, options: WritablePureSelectorOptions<T, E>, family: FamilyMetadata<K> | undefined): WritablePureSelectorToken<T, K, E>;
|
|
706
711
|
//#endregion
|
|
707
712
|
//#region src/internal/selector/dispose-selector.d.ts
|
|
708
|
-
declare function disposeSelector(store: Store, selectorToken: SelectorToken<unknown>): void;
|
|
713
|
+
declare function disposeSelector(store: Store, selectorToken: SelectorToken<unknown, any, any>): void;
|
|
709
714
|
//#endregion
|
|
710
715
|
//#region src/internal/selector/get-selector-dependency-keys.d.ts
|
|
711
716
|
declare function getSelectorDependencyKeys(store: Store, key: string): (AtomKey<unknown> | ReadonlySelectorKey<unknown> | SelectorKey<unknown>)[];
|
|
@@ -714,23 +719,23 @@ declare function getSelectorDependencyKeys(store: Store, key: string): (AtomKey<
|
|
|
714
719
|
declare function registerSelector(store: Store, selectorType: `readonly_held_selector` | `readonly_pure_selector` | `writable_held_selector` | `writable_pure_selector`, selectorKey: string, covered: Set<string>): WriterToolkit;
|
|
715
720
|
//#endregion
|
|
716
721
|
//#region src/internal/selector/trace-selector-atoms.d.ts
|
|
717
|
-
declare function traceRootSelectorAtoms(store: Store, selectorKey: string, covered?: Set<string>): Map<string, Atom<
|
|
722
|
+
declare function traceRootSelectorAtoms(store: Store, selectorKey: string, covered?: Set<string>): Map<string, Atom<any, any>>;
|
|
718
723
|
//#endregion
|
|
719
724
|
//#region src/internal/selector/update-selector-atoms.d.ts
|
|
720
|
-
declare function updateSelectorAtoms(store: Store, selectorType: `readonly_held_selector` | `readonly_pure_selector` | `writable_held_selector` | `writable_pure_selector`, selectorKey: string, dependency: ReadableToken<unknown>, covered: Set<string>): void;
|
|
725
|
+
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;
|
|
721
726
|
//#endregion
|
|
722
727
|
//#region src/internal/set-state/become.d.ts
|
|
723
|
-
|
|
724
|
-
declare function become<T>(nextVersionOfThing: Modify<T> | T, originalThing: T): T;
|
|
728
|
+
declare function become<T>(nextVersionOfThing: T | ((prev: T) => T), originalThing: T): T;
|
|
725
729
|
//#endregion
|
|
726
730
|
//#region src/internal/set-state/evict-downstream.d.ts
|
|
727
|
-
declare function evictDownstreamFromAtom(store: Store, atom: Atom<any>): void;
|
|
731
|
+
declare function evictDownstreamFromAtom(store: Store, atom: Atom<any, any>): void;
|
|
728
732
|
declare function evictDownstreamFromSelector(store: Store, selectorKey: string): void;
|
|
729
733
|
//#endregion
|
|
730
734
|
//#region src/internal/set-state/reset-in-store.d.ts
|
|
731
735
|
declare const RESET_STATE: unique symbol;
|
|
732
|
-
declare function resetInStore(store: Store, token: WritableToken<any>): void;
|
|
733
|
-
declare function resetInStore<K extends Canonical>(store: Store, token: WritableFamilyToken<any, K>, key: K): void;
|
|
736
|
+
declare function resetInStore(store: Store, token: WritableToken<any, any, any>): void;
|
|
737
|
+
declare function resetInStore<K extends Canonical>(store: Store, token: WritableFamilyToken<any, K, any>, key: K): void;
|
|
738
|
+
declare function resetInStore<T, K extends Canonical, Key extends K>(store: Store, ...params: [token: WritableFamilyToken<T, K, any>, key: Key] | [token: WritableToken<T, any, any>]): void;
|
|
734
739
|
//#endregion
|
|
735
740
|
//#region src/internal/set-state/operate-on-store.d.ts
|
|
736
741
|
type ProtoUpdate<T> = {
|
|
@@ -739,21 +744,22 @@ type ProtoUpdate<T> = {
|
|
|
739
744
|
};
|
|
740
745
|
//#endregion
|
|
741
746
|
//#region src/internal/set-state/reset-atom-or-selector.d.ts
|
|
742
|
-
declare function resetAtomOrSelector<T>(target: Store & {
|
|
747
|
+
declare function resetAtomOrSelector<T, E>(target: Store & {
|
|
743
748
|
operation: OpenOperation;
|
|
744
|
-
}, state: WritableState<T>): ProtoUpdate<T>;
|
|
749
|
+
}, state: WritableState<T, E>): ProtoUpdate<E | T>;
|
|
745
750
|
//#endregion
|
|
746
751
|
//#region src/internal/set-state/set-atom-or-selector.d.ts
|
|
747
752
|
declare const setAtomOrSelector: <T>(target: Store & {
|
|
748
753
|
operation: OpenOperation;
|
|
749
|
-
}, state: WritableState<T>, value: T | ((oldValue: T) => T)) => ProtoUpdate<T>;
|
|
754
|
+
}, state: WritableState<T, any>, value: T | ((oldValue: T) => T)) => ProtoUpdate<T>;
|
|
750
755
|
//#endregion
|
|
751
756
|
//#region src/internal/set-state/set-into-store.d.ts
|
|
752
|
-
declare function setIntoStore<T, New extends T>(store: Store, token: WritableToken<T>, value: New | typeof RESET_STATE | ((oldValue: T) => New)): void;
|
|
753
|
-
declare function setIntoStore<T, K extends Canonical, New extends T, Key extends K>(store: Store, token: WritableFamilyToken<T, K>, key: Key, value: New | typeof RESET_STATE | ((oldValue: T) => New)): void;
|
|
757
|
+
declare function setIntoStore<T, New extends T, E>(store: Store, token: WritableToken<T, any, E>, value: New | typeof RESET_STATE | ((oldValue: T) => New)): void;
|
|
758
|
+
declare function setIntoStore<T, K extends Canonical, New extends T, Key extends K, E>(store: Store, token: WritableFamilyToken<T, K, E>, key: Key, value: New | typeof RESET_STATE | ((oldValue: T) => New)): void;
|
|
759
|
+
declare function setIntoStore<T, K extends Canonical, New extends T, Key extends K, E>(store: Store, ...params: [token: WritableFamilyToken<T, K, E>, key: Key, value: New | typeof RESET_STATE | ((oldValue: T) => New)] | [token: WritableToken<T, any, E>, value: New | typeof RESET_STATE | ((oldValue: T) => New)]): void;
|
|
754
760
|
//#endregion
|
|
755
761
|
//#region src/internal/subscribe/recall-state.d.ts
|
|
756
|
-
declare const recallState: <T>(store: Store, state: ReadableState<T>) => T;
|
|
762
|
+
declare const recallState: <T, E>(store: Store, state: ReadableState<T, E>) => T;
|
|
757
763
|
//#endregion
|
|
758
764
|
//#region src/internal/subscribe/subscribe-in-store.d.ts
|
|
759
765
|
declare function subscribeInStore<T>(store: Store, token: ReadableToken<T>, handleUpdate: UpdateHandler<T>, key?: string): () => void;
|
|
@@ -762,10 +768,10 @@ declare function subscribeInStore<M extends TimelineManageable>(store: Store, to
|
|
|
762
768
|
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;
|
|
763
769
|
//#endregion
|
|
764
770
|
//#region src/internal/subscribe/subscribe-to-root-atoms.d.ts
|
|
765
|
-
declare const subscribeToRootDependency: (target: Store, selector: Selector<any>, atom: Atom<any>) => (() => void);
|
|
771
|
+
declare const subscribeToRootDependency: (target: Store, selector: Selector<any, any>, atom: Atom<any, any>) => (() => void);
|
|
766
772
|
//#endregion
|
|
767
773
|
//#region src/internal/subscribe/subscribe-to-state.d.ts
|
|
768
|
-
declare function subscribeToState<T>(store: Store, token: ReadableToken<T>, key: string, handleUpdate: UpdateHandler<T>): () => void;
|
|
774
|
+
declare function subscribeToState<T, E>(store: Store, token: ReadableToken<T, any, E>, key: string, handleUpdate: UpdateHandler<E | T>): () => void;
|
|
769
775
|
//#endregion
|
|
770
776
|
//#region src/internal/subscribe/subscribe-to-timeline.d.ts
|
|
771
777
|
declare const subscribeToTimeline: <ManagedAtom extends TimelineManageable>(store: Store, token: TimelineToken<ManagedAtom>, key: string, handleUpdate: (update: TimelineEvent<any> | `redo` | `undo`) => void) => (() => void);
|
|
@@ -777,21 +783,22 @@ declare const subscribeToTransaction: <F extends Fn>(store: Store, token: Transa
|
|
|
777
783
|
type AtomIOState = {
|
|
778
784
|
key: string;
|
|
779
785
|
family?: FamilyMetadata;
|
|
780
|
-
install: (store:
|
|
786
|
+
install: (store: RootStore) => void;
|
|
781
787
|
subject: Subject<StateUpdate<any>>;
|
|
782
788
|
};
|
|
783
|
-
type RegularAtom<T> = Flat<AtomIOState & {
|
|
789
|
+
type RegularAtom<T, E> = Flat<AtomIOState & {
|
|
784
790
|
type: `atom`;
|
|
785
791
|
default: T | (() => T);
|
|
786
792
|
cleanup?: () => void;
|
|
787
793
|
internalRoles?: internalRole[];
|
|
794
|
+
catch?: readonly (new () => E)[];
|
|
788
795
|
}>;
|
|
789
796
|
type MutableAtom<T extends Transceiver<any, any, any>> = Flat<AtomIOState & {
|
|
790
797
|
type: `mutable_atom`;
|
|
791
798
|
class: ConstructorOf<T>;
|
|
792
799
|
cleanup?: () => void;
|
|
793
800
|
}>;
|
|
794
|
-
type Atom<T> = RegularAtom<T> | (T extends Transceiver<any, any, any> ? MutableAtom<T> : never);
|
|
801
|
+
type Atom<T, E> = RegularAtom<T, E> | (T extends Transceiver<any, any, any> ? MutableAtom<T> : never);
|
|
795
802
|
type WritableHeldSelector<T> = Flat<AtomIOState & {
|
|
796
803
|
type: `writable_held_selector`;
|
|
797
804
|
const: T;
|
|
@@ -803,67 +810,69 @@ type ReadonlyHeldSelector<T> = Flat<AtomIOState & {
|
|
|
803
810
|
const: T;
|
|
804
811
|
getFrom: (target: Store) => T;
|
|
805
812
|
}>;
|
|
806
|
-
type WritablePureSelector<T> = Flat<AtomIOState & {
|
|
813
|
+
type WritablePureSelector<T, E> = Flat<AtomIOState & {
|
|
807
814
|
type: `writable_pure_selector`;
|
|
808
|
-
getFrom: (target: Store) => T;
|
|
815
|
+
getFrom: (target: Store) => E | T;
|
|
809
816
|
setSelf: (newValue: T) => void;
|
|
817
|
+
catch?: readonly (new () => E)[];
|
|
810
818
|
}>;
|
|
811
|
-
type ReadonlyPureSelector<T> = Flat<AtomIOState & {
|
|
819
|
+
type ReadonlyPureSelector<T, E> = Flat<AtomIOState & {
|
|
812
820
|
type: `readonly_pure_selector`;
|
|
813
|
-
getFrom: (target: Store) => T;
|
|
821
|
+
getFrom: (target: Store) => E | T;
|
|
822
|
+
catch?: readonly (new () => E)[];
|
|
814
823
|
}>;
|
|
815
|
-
type ReadonlySelector<T> = ReadonlyHeldSelector<T> | ReadonlyPureSelector<T>;
|
|
816
|
-
type WritableSelector<T> = WritableHeldSelector<T> | WritablePureSelector<T>;
|
|
824
|
+
type ReadonlySelector<T, E> = ReadonlyHeldSelector<T> | ReadonlyPureSelector<T, E>;
|
|
825
|
+
type WritableSelector<T, E> = WritableHeldSelector<T> | WritablePureSelector<T, E>;
|
|
817
826
|
type HeldSelector<T> = ReadonlyHeldSelector<T> | WritableHeldSelector<T>;
|
|
818
|
-
type PureSelector<T> = ReadonlyPureSelector<T> | WritablePureSelector<T>;
|
|
819
|
-
type Selector<T> = ReadonlyHeldSelector<T> | ReadonlyPureSelector<T> | WritableHeldSelector<T> | WritablePureSelector<T>;
|
|
820
|
-
type WritableState<T> = Atom<T> | WritableSelector<T>;
|
|
821
|
-
type ReadableState<T> = Atom<T> | Selector<T>;
|
|
822
|
-
type RegularAtomFamily<T, K extends Canonical> = Flat<RegularAtomFamilyToken<T, K> & {
|
|
827
|
+
type PureSelector<T, E> = ReadonlyPureSelector<T, E> | WritablePureSelector<T, E>;
|
|
828
|
+
type Selector<T, E> = ReadonlyHeldSelector<T> | ReadonlyPureSelector<T, E> | WritableHeldSelector<T> | WritablePureSelector<T, E>;
|
|
829
|
+
type WritableState<T, E> = Atom<T, E> | WritableSelector<T, E>;
|
|
830
|
+
type ReadableState<T, E> = Atom<T, E> | Selector<T, E>;
|
|
831
|
+
type RegularAtomFamily<T, K extends Canonical, E = never> = Flat<RegularAtomFamilyToken<T, K, E> & {
|
|
823
832
|
default: T | ((key: K) => T);
|
|
824
|
-
install: (store:
|
|
833
|
+
install: (store: RootStore) => void;
|
|
825
834
|
internalRoles: string[] | undefined;
|
|
826
|
-
subject: Subject<StateLifecycleEvent<RegularAtomToken<T>>>;
|
|
827
|
-
}> & ((key:
|
|
835
|
+
subject: Subject<StateLifecycleEvent<RegularAtomToken<T, K, E>>>;
|
|
836
|
+
}> & (<Key extends K>(key: Key) => RegularAtomToken<T, Key, E>);
|
|
828
837
|
type MutableAtomFamily<T extends Transceiver<any, any, any>, K extends Canonical> = Flat<MutableAtomFamilyToken<T, K> & {
|
|
829
838
|
class: ConstructorOf<T>;
|
|
830
|
-
install: (store:
|
|
839
|
+
install: (store: RootStore) => void;
|
|
831
840
|
internalRoles: string[] | undefined;
|
|
832
841
|
subject: Subject<StateLifecycleEvent<MutableAtomToken<T>>>;
|
|
833
|
-
}> & ((key:
|
|
834
|
-
type AtomFamily<T, K extends Canonical
|
|
835
|
-
type WritablePureSelectorFamily<T, K extends Canonical> = Flat<WritablePureSelectorFamilyToken<T, K> & {
|
|
842
|
+
}> & (<Key extends K>(key: Key) => MutableAtomToken<T, Key>);
|
|
843
|
+
type AtomFamily<T, K extends Canonical, E> = MutableAtomFamily<T extends Transceiver<any, any, any> ? T : never, K> | RegularAtomFamily<T, K, E>;
|
|
844
|
+
type WritablePureSelectorFamily<T, K extends Canonical, E> = Flat<WritablePureSelectorFamilyToken<T, K, E> & {
|
|
836
845
|
default: (key: K) => T;
|
|
837
|
-
install: (store:
|
|
846
|
+
install: (store: RootStore) => void;
|
|
838
847
|
internalRoles: string[] | undefined;
|
|
839
|
-
subject: Subject<StateLifecycleEvent<WritablePureSelectorToken<T>>>;
|
|
840
|
-
}> & ((key:
|
|
848
|
+
subject: Subject<StateLifecycleEvent<WritablePureSelectorToken<T, K, E>>>;
|
|
849
|
+
}> & (<Key extends K>(key: Key) => WritablePureSelectorToken<T, Key, E>);
|
|
841
850
|
type WritableHeldSelectorFamily<T, K extends Canonical> = Flat<WritableHeldSelectorFamilyToken<T, K> & {
|
|
842
851
|
default: (key: K) => T;
|
|
843
|
-
install: (store:
|
|
852
|
+
install: (store: RootStore) => void;
|
|
844
853
|
internalRoles: string[] | undefined;
|
|
845
|
-
subject: Subject<StateLifecycleEvent<WritableHeldSelectorToken<T>>>;
|
|
846
|
-
}> & ((key:
|
|
847
|
-
type ReadonlyPureSelectorFamily<T, K extends Canonical> = Flat<ReadonlyPureSelectorFamilyToken<T, K> & {
|
|
854
|
+
subject: Subject<StateLifecycleEvent<WritableHeldSelectorToken<T, K>>>;
|
|
855
|
+
}> & (<Key extends K>(key: Key) => WritableHeldSelectorToken<T, Key>);
|
|
856
|
+
type ReadonlyPureSelectorFamily<T, K extends Canonical, E> = Flat<ReadonlyPureSelectorFamilyToken<T, K, E> & {
|
|
848
857
|
default: (key: K) => T;
|
|
849
|
-
install: (store:
|
|
858
|
+
install: (store: RootStore) => void;
|
|
850
859
|
internalRoles: string[] | undefined;
|
|
851
|
-
subject: Subject<StateLifecycleEvent<ReadonlyPureSelectorToken<T>>>;
|
|
852
|
-
}> & ((key:
|
|
860
|
+
subject: Subject<StateLifecycleEvent<ReadonlyPureSelectorToken<T, K, E>>>;
|
|
861
|
+
}> & (<Key extends K>(key: Key) => ReadonlyPureSelectorToken<T, Key, E>);
|
|
853
862
|
type ReadonlyHeldSelectorFamily<T, K extends Canonical> = Flat<ReadonlyHeldSelectorFamilyToken<T, K> & {
|
|
854
863
|
default: (key: K) => T;
|
|
855
|
-
install: (store:
|
|
864
|
+
install: (store: RootStore) => void;
|
|
856
865
|
internalRoles: string[] | undefined;
|
|
857
866
|
subject: Subject<StateLifecycleEvent<ReadonlyHeldSelectorToken<T>>>;
|
|
858
|
-
}> & ((key:
|
|
859
|
-
type PureSelectorFamily<T, K extends Canonical> = ReadonlyPureSelectorFamily<T, K> | WritablePureSelectorFamily<T, K>;
|
|
867
|
+
}> & (<Key extends K>(key: Key) => ReadonlyHeldSelectorToken<T, Key>);
|
|
868
|
+
type PureSelectorFamily<T, K extends Canonical, E> = ReadonlyPureSelectorFamily<T, K, E> | WritablePureSelectorFamily<T, K, E>;
|
|
860
869
|
type HeldSelectorFamily<T, K extends Canonical> = ReadonlyHeldSelectorFamily<T, K> | WritableHeldSelectorFamily<T, K>;
|
|
861
|
-
type ReadonlySelectorFamily<T, K extends Canonical> = ReadonlyHeldSelectorFamily<T, K> | ReadonlyPureSelectorFamily<T, K>;
|
|
862
|
-
type WritableSelectorFamily<T, K extends Canonical> = WritableHeldSelectorFamily<T, K> | WritablePureSelectorFamily<T, K>;
|
|
863
|
-
type SelectorFamily<T, K extends Canonical> = HeldSelectorFamily<T, K> | PureSelectorFamily<T, K>;
|
|
864
|
-
type WritableFamily<T, K extends Canonical> = AtomFamily<T, K> |
|
|
865
|
-
type ReadableFamily<T, K extends Canonical> = AtomFamily<T, K> | SelectorFamily<T, K>;
|
|
866
|
-
type AtomIOInternalResource = ReadableFamily<any, any> | ReadableState<any> | Timeline<any> | Transaction<any>;
|
|
867
|
-
//#endregion
|
|
868
|
-
export { AsJSON, Atom, AtomFamily, AtomIOInternalResource, AtomIOState, AtomKey, BaseExternalStoreConfiguration, COUNTERFEIT, 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, JunctionOverlay, JunctionSchema, JunctionSchemaBase, Lineage, MapOverlay,
|
|
870
|
+
type ReadonlySelectorFamily<T, K extends Canonical, E> = ReadonlyHeldSelectorFamily<T, K> | ReadonlyPureSelectorFamily<T, K, E>;
|
|
871
|
+
type WritableSelectorFamily<T, K extends Canonical, E> = WritableHeldSelectorFamily<T, K> | WritablePureSelectorFamily<T, K, E>;
|
|
872
|
+
type SelectorFamily<T, K extends Canonical, E> = HeldSelectorFamily<T, K> | PureSelectorFamily<T, K, E>;
|
|
873
|
+
type WritableFamily<T, K extends Canonical, E> = AtomFamily<T, K, E> | WritableSelectorFamily<T, K, E>;
|
|
874
|
+
type ReadableFamily<T, K extends Canonical, E> = AtomFamily<T, K, E> | SelectorFamily<T, K, E>;
|
|
875
|
+
type AtomIOInternalResource = ReadableFamily<any, any, any> | ReadableState<any, any> | Timeline<any> | Transaction<any>;
|
|
876
|
+
//#endregion
|
|
877
|
+
export { AsJSON, Atom, AtomFamily, AtomIOInternalResource, AtomIOState, AtomKey, BaseExternalStoreConfiguration, COUNTERFEIT, 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, JunctionOverlay, JunctionSchema, JunctionSchemaBase, Lineage, MapOverlay, Molecule, MutableAtom, MutableAtomFamily, NotFoundError, OpenOperation, OperationProgress, PureSelector, PureSelectorFamily, RESET_STATE, ReadableFamily, ReadableState, ReadonlyHeldSelector, ReadonlyHeldSelectorFamily, ReadonlyPureSelector, ReadonlyPureSelectorFamily, ReadonlySelector, ReadonlySelectorFamily, ReadonlySelectorKey, Refinement, RegularAtom, RegularAtomFamily, RelationsOverlay, ReservedIntrospectionKey, RootStore, Selector, SelectorFamily, SelectorKey, SetOverlay, SignalFrom, StateKey, StatefulSubject, Store, StoreEventCarrier, Subject, TRANSACTION_PHASES, Timeline, Tracker, Transaction, TransactionEpoch, TransactionPhase, TransactionProgress, Transceiver, TransceiverConstructor, TransceiverMode, WritableFamily, WritableHeldSelector, WritableHeldSelectorFamily, WritablePureSelector, WritablePureSelectorFamily, WritableSelector, WritableSelectorFamily, WritableState, abortTransaction, actUponStore, allocateIntoStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, capitalize, claimWithinStore, clearStore, closeOperation, createClaimTX, createDeallocateTX, createJoin, createMutableAtom, createMutableAtomFamily, createReadonlyHeldSelector, createReadonlyPureSelector, createReadonlyPureSelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneSelector, createTimeline, createTransaction, createWritableHeldSelector, createWritablePureSelector, createWritablePureSelectorFamily, deallocateFromStore, deposit, disposeAtom, disposeFromStore, disposeSelector, editRelationsInStore, eldest, evictCachedValue, evictDownstreamFromAtom, evictDownstreamFromSelector, findInStore, findRelationsInStore, fuseWithinStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getInternalRelationsFromStore, getJoin, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getTrace, getUpdateFamily, getUpdateToken, hasRole, ingestAtomUpdateEvent, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestMoleculeTransferEvent, ingestSelectorUpdateEvent, ingestTransactionOutcomeEvent, installIntoStore, internalRole, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isReservedIntrospectionKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeRootMoleculeInStore, markDone, mint, newest, openOperation, readFromCache, readOrComputeValue, recallState, registerSelector, resetAtomOrSelector, resetInStore, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootDependency, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceRootSelectorAtoms, updateSelectorAtoms, withdraw, writeToCache };
|
|
869
878
|
//# sourceMappingURL=index.d.ts.map
|