atom.io 0.32.0 → 0.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/data/dist/index.d.ts +8 -925
  2. package/data/dist/index.js +2 -2
  3. package/dist/{chunk-5F2V7S3B.js → chunk-3PQTWLQQ.js} +1 -1
  4. package/dist/{chunk-Z2UJW4NQ.js → chunk-3ZFTRSNG.js} +3 -3
  5. package/dist/{chunk-354XQWHH.js → chunk-KVI5OBF2.js} +5 -5
  6. package/dist/{chunk-GY2XQYZY.js → chunk-UQEYZ3OI.js} +45 -40
  7. package/dist/{chunk-R3ZUK5EH.js → chunk-UYYKOGZQ.js} +16 -6
  8. package/dist/{chunk-ECOMOMUN.js → chunk-VRJP2PCU.js} +10 -10
  9. package/dist/{chunk-NF7FJKJD.js → chunk-X7SD2NXU.js} +2 -1
  10. package/dist/index.d.ts +43 -514
  11. package/dist/index.js +1 -1
  12. package/eslint-plugin/dist/index.js +3 -3
  13. package/eslint-plugin/src/rules/explicit-state-types.ts +1 -0
  14. package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +1 -0
  15. package/eslint-plugin/src/walk.ts +1 -0
  16. package/internal/dist/index.d.ts +8 -656
  17. package/internal/dist/index.js +1 -1
  18. package/internal/src/join/join-internal.ts +1 -1
  19. package/internal/src/junction.ts +7 -4
  20. package/internal/src/set-state/emit-update.ts +3 -1
  21. package/internal/src/timeline/create-timeline.ts +2 -1
  22. package/internal/src/timeline/time-travel.ts +2 -1
  23. package/introspection/dist/index.d.ts +6 -922
  24. package/introspection/dist/index.js +2 -2
  25. package/json/dist/index.d.ts +5 -899
  26. package/json/dist/index.js +1 -1
  27. package/package.json +8 -8
  28. package/react/dist/index.d.ts +3 -921
  29. package/react/dist/index.js +2 -2
  30. package/react-devtools/dist/index.d.ts +1 -26
  31. package/react-devtools/dist/index.js +28 -15
  32. package/react-devtools/src/Updates.tsx +12 -0
  33. package/react-devtools/src/json-editor/editors-by-type/utilities/cast-to-json.ts +2 -1
  34. package/realtime/dist/index.d.ts +7 -202
  35. package/realtime/dist/index.js +2 -2
  36. package/realtime/src/realtime-continuity.ts +1 -0
  37. package/realtime-client/dist/index.d.ts +21 -959
  38. package/realtime-client/dist/index.js +2 -2
  39. package/realtime-react/dist/index.d.ts +12 -166
  40. package/realtime-react/dist/index.js +4 -4
  41. package/realtime-server/dist/index.d.ts +26 -971
  42. package/realtime-server/dist/index.js +3 -3
  43. package/realtime-server/src/ipc-sockets/child-socket.ts +2 -0
  44. package/realtime-server/src/realtime-server-stores/server-sync-store.ts +10 -2
  45. package/realtime-testing/dist/index.d.ts +3 -1091
  46. package/realtime-testing/dist/index.js +7 -7
  47. package/transceivers/set-rtx/dist/index.d.ts +6 -40
  48. package/transceivers/set-rtx/dist/index.js +1 -1
  49. package/transceivers/set-rtx/src/set-rtx.ts +4 -7
  50. package/web/dist/index.d.ts +1 -30
  51. package/react-devtools/src/json-editor/assets/Untitled-1.ai +2 -1436
  52. package/react-devtools/src/json-editor/assets/data-vis.ai +1 -1548
  53. package/react-devtools/src/json-editor/comp/json-editor-sketches.ai +5 -1449
@@ -1,899 +1,5 @@
1
- type RegularAtomFamilyToken<T, K extends Canonical> = {
2
- key: string;
3
- type: `atom_family`;
4
- __T?: T;
5
- __K?: K;
6
- };
7
- type MutableAtomFamilyToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = {
8
- key: string;
9
- type: `mutable_atom_family`;
10
- __T?: T;
11
- __J?: J;
12
- __K?: K;
13
- };
14
- type AtomFamilyToken<T, K extends Canonical = Canonical> = MutableAtomFamilyToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamilyToken<T, K>;
15
-
16
- type TransactionToken<F extends Func> = {
17
- key: string;
18
- type: `transaction`;
19
- __F?: F;
20
- };
21
- type StateCreation<Token extends ReadableToken<any>> = {
22
- type: `state_creation`;
23
- token: Token;
24
- };
25
- type AtomDisposal<Token extends ReadableToken<any>> = {
26
- type: `state_disposal`;
27
- subType: `atom`;
28
- token: Token;
29
- value: TokenType<Token>;
30
- };
31
- type SelectorDisposal<Token extends ReadableToken<any>> = {
32
- type: `state_disposal`;
33
- subType: `selector`;
34
- token: Token;
35
- };
36
- type StateDisposal<Token extends ReadableToken<any>> = AtomDisposal<Token> | SelectorDisposal<Token>;
37
- type MoleculeCreation = {
38
- type: `molecule_creation`;
39
- key: Canonical;
40
- provenance: Canonical;
41
- };
42
- type MoleculeDisposal = {
43
- type: `molecule_disposal`;
44
- key: Canonical;
45
- provenance: stringified<Canonical>[];
46
- values: [key: string, value: any][];
47
- };
48
- type MoleculeTransfer = {
49
- type: `molecule_transfer`;
50
- key: Canonical;
51
- from: Canonical[];
52
- to: Canonical[];
53
- };
54
- type TransactionUpdateContent = KeyedStateUpdate<unknown> | MoleculeCreation | MoleculeDisposal | MoleculeTransfer | StateCreation<ReadableToken<unknown>> | StateDisposal<ReadableToken<unknown>> | TransactionUpdate<Func>;
55
- type TransactionUpdate<F extends Func> = {
56
- type: `transaction_update`;
57
- key: string;
58
- id: string;
59
- epoch: number;
60
- updates: TransactionUpdateContent[];
61
- params: Parameters<F>;
62
- output: ReturnType<F>;
63
- };
64
- type SetterToolkit = Readonly<{
65
- get: typeof getState;
66
- set: typeof setState;
67
- find: typeof findState;
68
- json: <T extends Transceiver<any>, J extends Json.Serializable>(state: MutableAtomToken<T, J>) => WritableSelectorToken<J>;
69
- }>;
70
- type ActorToolkit = Readonly<{
71
- get: typeof getState;
72
- set: typeof setState;
73
- find: typeof findState;
74
- json: <T extends Transceiver<any>, J extends Json.Serializable>(state: MutableAtomToken<T, J>) => WritableSelectorToken<J>;
75
- dispose: typeof disposeState;
76
- run: typeof runTransaction;
77
- env: () => EnvironmentData;
78
- }>;
79
- declare function runTransaction<F extends Func>(token: TransactionToken<F>, id?: string): (...parameters: Parameters<F>) => ReturnType<F>;
80
-
81
- type WritableSelectorFamilyToken<T, K extends Canonical> = {
82
- key: string;
83
- type: `selector_family`;
84
- __T?: T;
85
- __K?: K;
86
- };
87
- type ReadonlySelectorFamilyToken<T, K extends Canonical> = {
88
- key: string;
89
- type: `readonly_selector_family`;
90
- __T?: T;
91
- __K?: K;
92
- };
93
- type SelectorFamilyToken<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
94
-
95
- type TimelineManageable = AtomFamilyToken<any, any> | AtomToken<any>;
96
- type AtomOnly<M extends TimelineManageable> = M extends AtomFamilyToken<any, any> ? AtomToken<any> : M extends AtomToken<any> ? M : never;
97
- type TimelineToken<M> = {
98
- key: string;
99
- type: `timeline`;
100
- __M?: M;
101
- };
102
- type TimelineUpdate<ManagedAtom extends TimelineManageable> = TimelineAtomUpdate<ManagedAtom> | TimelineMoleculeCreation | TimelineMoleculeDisposal | TimelineSelectorUpdate<ManagedAtom> | TimelineStateCreation<AtomOnly<ManagedAtom>> | TimelineStateDisposal<AtomOnly<ManagedAtom>> | TimelineTransactionUpdate;
103
-
104
- /**
105
- * @public
106
- * Disposes of a state in the implicit store
107
- * @param token - The token of the state to dispose
108
- * @overload Default
109
- */
110
- declare function disposeState(token: ReadableToken<any>): void;
111
- /**
112
- * @public
113
- * Disposes of a state family in the implicit store
114
- * @param token - The token of the state family to dispose
115
- * @param key - The unique key of the state to dispose
116
- */
117
- declare function disposeState<K extends Canonical>(token: ReadableFamilyToken<any, K>, key: K): void;
118
-
119
- /**
120
- * @public
121
- * Finds a {@link MutableAtomToken} in the store
122
- * @param token - A {@link MutableAtomFamilyToken}
123
- * @param key - The key of the state
124
- * @returns
125
- * The current value of the state
126
- * @overload Mutable Atom
127
- */
128
- declare function findState<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical, Key extends K>(token: MutableAtomFamilyToken<T, J, K>, key: Key): MutableAtomToken<T, J, K>;
129
- /**
130
- * @public
131
- * Finds a state in the store
132
- * @param token - The token of the state family
133
- * @param key - The key of the state
134
- * @returns
135
- * The current value of the state
136
- * @overload Regular Atom
137
- */
138
- declare function findState<T, K extends Canonical, Key extends K>(token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T, K>;
139
- /**
140
- * @public
141
- * Finds a state in the store
142
- * @param token - The token of the state family
143
- * @param key - The key of the state
144
- * @returns
145
- * The current value of the state
146
- * @overload Writable Selector
147
- */
148
- declare function findState<T, K extends Canonical, Key extends K>(token: WritableSelectorFamilyToken<T, K>, key: Key): WritableSelectorToken<T, K>;
149
- /**
150
- * @public
151
- * Finds a state in the store
152
- * @param token - The token of the state family
153
- * @param key - The key of the state
154
- * @returns
155
- * The current value of the state
156
- * @overload Readonly Selector
157
- */
158
- declare function findState<T, K extends Canonical, Key extends K>(token: ReadonlySelectorFamilyToken<T, K>, key: Key): ReadonlySelectorToken<T, K>;
159
- /**
160
- * @public
161
- * Finds a state in the store
162
- * @param token - The token of the state family
163
- * @param key - The key of the state
164
- * @returns
165
- * The current value of the state
166
- * @overload Writable State
167
- */
168
- declare function findState<T, K extends Canonical, Key extends K>(token: WritableFamilyToken<T, K>, key: Key): WritableToken<T, K>;
169
- /**
170
- * @public
171
- * Finds a {@link ReadableToken} in the store
172
- * @param token - A {@link ReadableFamilyToken}
173
- * @param key - The key of the state
174
- * @returns
175
- * The current value of the state
176
- * @overload Unknown
177
- * @default
178
- */
179
- declare function findState<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K>;
180
-
181
- /**
182
- * @public
183
- * Get the current value of a state
184
- * @param token - The token of the state to get
185
- * @return The current value of the state
186
- * @overload Default
187
- * @default
188
- */
189
- declare function getState<T>(token: ReadableToken<T>): T;
190
- /**
191
- * @public
192
- * Get the current value of a state family
193
- * @param token - The token of a state family
194
- * @param key - The unique key of the state to get
195
- * @return The current value of the state
196
- * @overload Streamlined
197
- */
198
- declare function getState<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key): T;
199
-
200
- type SetUpdate = `add:${string}` | `clear:${string}` | `del:${string}` | `tx:${string}`;
201
- type NumberedSetUpdate = `${number}=${SetUpdate}`;
202
- interface SetRTXJson<P extends primitive> extends Json.Object {
203
- members: P[];
204
- cache: (NumberedSetUpdate | null)[];
205
- cacheLimit: number;
206
- cacheIdx: number;
207
- cacheUpdateNumber: number;
208
- }
209
- declare class SetRTX<P extends primitive> extends Set<P> implements Transceiver<NumberedSetUpdate>, Lineage {
210
- mode: TransceiverMode;
211
- readonly subject: Subject<SetUpdate>;
212
- cacheLimit: number;
213
- cache: (NumberedSetUpdate | null)[];
214
- cacheIdx: number;
215
- cacheUpdateNumber: number;
216
- constructor(values?: Iterable<P>, cacheLimit?: number);
217
- toJSON(): SetRTXJson<P>;
218
- static fromJSON<P extends primitive>(json: SetRTXJson<P>): SetRTX<P>;
219
- add(value: P): this;
220
- clear(): void;
221
- delete(value: P): boolean;
222
- readonly parent: SetRTX<P> | null;
223
- child: SetRTX<P> | null;
224
- transactionUpdates: SetUpdate[] | null;
225
- transaction(run: (child: SetRTX<P>) => boolean): void;
226
- protected _subscribe(key: string, fn: (update: SetUpdate) => void): () => void;
227
- subscribe(key: string, fn: (update: NumberedSetUpdate) => void): () => void;
228
- emit(update: SetUpdate): void;
229
- private doStep;
230
- getUpdateNumber(update: NumberedSetUpdate): number;
231
- do(update: NumberedSetUpdate): number | `OUT_OF_RANGE` | null;
232
- undoStep(update: SetUpdate): void;
233
- undo(update: NumberedSetUpdate): number | null;
234
- }
235
-
236
- interface JoinOptions<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> extends JunctionSchemaBase<ASide, BSide>, Partial<JunctionEntriesBase<AType, BType, Content>> {
237
- readonly key: string;
238
- readonly cardinality: Cardinality;
239
- readonly isAType: Refinement<string, AType>;
240
- readonly isBType: Refinement<string, BType>;
241
- }
242
-
243
- declare const LoggerIconDictionary: {
244
- readonly "\u231B": "Timeline event fully captured";
245
- readonly "\u23E9": "Timeline redo";
246
- readonly "\u23EA": "Timeline undo";
247
- readonly "\u23ED\uFE0F": "Transaction redo";
248
- readonly "\u23EE\uFE0F": "Transaction undo";
249
- readonly "\u23F3": "Timeline event partially captured";
250
- readonly "\u23F9\uFE0F": "Time-travel complete";
251
- readonly "\u2705": "Realtime transaction success";
252
- readonly "\u2728": "Computation complete";
253
- readonly "\u274C": "Conflict prevents attempted action";
254
- readonly "\u2B55": "Operation start";
255
- readonly "\uD83D\uDD34": "Operation complete";
256
- readonly "\u2757": "Operation blocked";
257
- readonly "\uD83D\uDFE2": "Operation unblocked";
258
- readonly "\uD83D\uDC1E": "Possible bug in AtomIO";
259
- readonly "\uD83D\uDC40": "Subscription added";
260
- readonly "\uD83D\uDC4B": "Greeting";
261
- readonly "\uD83D\uDC4D": "Realtime acknowledgment";
262
- readonly "\uD83D\uDC6A": "Family member added";
263
- readonly "\uD83D\uDC81": "Notice";
264
- readonly "\uD83D\uDCA5": "Caught";
265
- readonly "\uD83D\uDCC1": "Stow update";
266
- readonly "\uD83D\uDCC3": "Copy mutable";
267
- readonly "\uD83D\uDCD6": "Read state";
268
- readonly "\uD83D\uDCDD": "Write state";
269
- readonly "\uD83D\uDCE2": "Notify subscribers";
270
- readonly "\uD83D\uDD04": "Realtime transaction synchronized";
271
- readonly "\uD83D\uDD0C": "Register dependency";
272
- readonly "\uD83D\uDD0D": "Discover root";
273
- readonly "\uD83D\uDD25": "Delete state";
274
- readonly "\uD83D\uDD27": "Create mutable atom";
275
- readonly "\uD83D\uDD28": "Create immutable atom";
276
- readonly "\uD83D\uDDD1": "Evict cached value";
277
- readonly "\uD83D\uDE48": "Subscription canceled";
278
- readonly "\uD83D\uDE80": "Performance measure";
279
- readonly "\uD83D\uDEC4": "Apply transaction";
280
- readonly "\uD83D\uDEE0\uFE0F": "Install atom into store";
281
- readonly "\uD83D\uDEEB": "Begin transaction";
282
- readonly "\uD83D\uDEEC": "Complete transaction";
283
- readonly "\uD83E\uDDEE": "Computing selector";
284
- readonly "\uD83E\uDDF9": "Prepare to evict";
285
- readonly "\uD83E\uDE82": "Abort transaction";
286
- readonly "\uD83E\uDD1E": "Realtime optimistic update enqueued";
287
- readonly "\uD83D\uDC48": "Realtime confirmed update enqueued";
288
- readonly "\uD83E\uDDD1\u200D\u2696\uFE0F": "Realtime update beginning reconciliation";
289
- readonly "\uD83D\uDECE\uFE0F": "Realtime transaction received";
290
- readonly "\uD83D\uDD2D": "Determining realtime perspective";
291
- readonly "\uD83D\uDD8C": "Redacting realtime update";
292
- readonly "\uD83D\uDC41": "Determining perspective";
293
- };
294
- type LoggerIcon = keyof typeof LoggerIconDictionary;
295
- type TokenDenomination = `atom_family` | `atom` | `continuity` | `molecule_family` | `molecule` | `mutable_atom_family` | `mutable_atom` | `readonly_selector_family` | `readonly_selector` | `selector_family` | `selector` | `state` | `timeline` | `transaction` | `unknown`;
296
- declare const LOG_LEVELS: readonly ["info", "warn", "error"];
297
- type LogLevel = (typeof LOG_LEVELS)[number];
298
- type LogFn = (icon: LoggerIcon, denomination: TokenDenomination, tokenKey: string, message: string, ...rest: unknown[]) => void;
299
- type LogFilter = (...params: Parameters<LogFn>) => boolean;
300
- type Logger = Record<LogLevel, LogFn>;
301
- declare class AtomIOLogger implements Logger {
302
- logLevel: `error` | `info` | `warn` | null;
303
- private readonly filter?;
304
- private readonly logger;
305
- constructor(logLevel: `error` | `info` | `warn` | null, filter?: LogFilter | undefined, logger?: Logger);
306
- error: LogFn;
307
- info: LogFn;
308
- warn: LogFn;
309
- }
310
-
311
- declare const $claim: unique symbol;
312
- type Claim<K extends Canonical> = K & {
313
- [$claim]?: true;
314
- };
315
- declare class Realm<H extends Hierarchy> {
316
- store: Store;
317
- constructor(store?: Store);
318
- allocate<V extends Vassal<H>, A extends Above<V, H>>(provenance: A, key: V, attachmentStyle?: `all` | `any`): Claim<V>;
319
- fuse<C extends CompoundFrom<H>, T extends C extends CompoundTypedKey<infer t, any, any> ? t : never, A extends C extends CompoundTypedKey<any, infer v, any> ? v : never, B extends C extends CompoundTypedKey<any, any, infer m> ? m : never>(type: T, reagentA: SingularTypedKey<A>, reagentB: SingularTypedKey<B>): Claim<CompoundTypedKey<T, A, B>>;
320
- deallocate<V extends Vassal<H>>(claim: Claim<V>): void;
321
- claim<V extends Exclude<Vassal<H>, CompoundTypedKey>, A extends Above<V, H>>(newProvenance: A, claim: Claim<V>, exclusive?: `exclusive`): Claim<V>;
322
- }
323
- declare class Anarchy {
324
- store: Store;
325
- realm: Realm<any>;
326
- constructor(store?: Store);
327
- allocate(provenance: Canonical, key: Canonical, attachmentStyle?: `all` | `any`): void;
328
- deallocate(key: Canonical): void;
329
- claim(newProvenance: Canonical, key: Canonical, exclusive?: `exclusive`): void;
330
- }
331
- declare const T$ = "T$";
332
- type T$ = typeof T$;
333
- type TypeTag<T extends string> = `${T$}--${T}`;
334
- type SingularTypedKey<T extends string = string> = `${T}::${string}`;
335
- type CompoundTypedKey<A extends string = string, B extends string = string, C extends string = string> = `${TypeTag<A>}==${SingularTypedKey<B>}++${SingularTypedKey<C>}`;
336
- type TypedKey<A extends string = string, B extends string = string, C extends string = string> = CompoundTypedKey<A, B, C> | SingularTypedKey<A>;
337
- type Scope = SingularTypedKey[];
338
- type MutualFealty = {
339
- above: Scope;
340
- below: CompoundTypedKey;
341
- };
342
- type ExclusiveFealty = {
343
- above: TypedKey | `root`;
344
- below: Scope;
345
- };
346
- type Fealty = ExclusiveFealty | MutualFealty;
347
- type Hierarchy<F extends Fealty[] = Fealty[]> = Each<F>;
348
- type Vassal<H extends Hierarchy> = {
349
- [K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : H[K] extends {
350
- below: Array<infer V>;
351
- } ? V extends TypedKey ? V : never : never;
352
- }[keyof H];
353
- type Above<TK extends TypedKey, H extends Hierarchy> = {
354
- [K in keyof H]: H[K] extends MutualFealty ? TK extends H[K][`below`] ? H[K][`above`] : never : H[K] extends {
355
- below: Array<infer V>;
356
- } ? TK extends V ? H[K] extends ExclusiveFealty ? H[K][`above`] : never : never : never;
357
- }[keyof H];
358
- type CompoundFrom<H extends Hierarchy> = {
359
- [K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : never;
360
- }[keyof H];
361
-
362
- /**
363
- * @public
364
- * A function that sets the value of a state.
365
- * @param oldValue - The current value of the state.
366
- * @returns
367
- * The new value of the state.
368
- */
369
- type Setter<T, New extends T> = (oldValue: T) => New;
370
- /**
371
- * @public
372
- * Set the value of a state into the implicit store.
373
- * @param token - An atom or writable selector token.
374
- * @param value - The new value of the state.
375
- * @overload Default
376
- * @default
377
- */
378
- declare function setState<T, New extends T>(token: WritableToken<T>, value: New | Setter<T, New>): void;
379
- /**
380
- * @public
381
- * Set the value of a state into the implicit store.
382
- * @param token - An atom family or writable selector family token.
383
- * @param key - The unique key of the state to set.
384
- * @param value - The new value of the state.
385
- * @overload Streamlined
386
- */
387
- declare function setState<T, K extends Canonical, New extends T, Key extends K>(token: WritableFamilyToken<T, K>, key: Key, value: New | Setter<T, New>): void;
388
-
389
- type StateUpdate<T> = {
390
- newValue: T;
391
- oldValue: T;
392
- };
393
- type KeyedStateUpdate<T> = Flat<StateUpdate<T> & {
394
- key: string;
395
- type: `atom_update` | `selector_update`;
396
- family?: FamilyMetadata;
397
- }>;
398
-
399
- type TokenType<Comparison extends ReadableFamilyToken<any, any> | ReadableToken<any>> = Comparison extends ReadableToken<infer RepresentedValue> ? RepresentedValue : Comparison extends ReadableFamilyToken<infer RepresentedValue, any> ? RepresentedValue : never;
400
-
401
- /** @public */
402
- type RegularAtomToken<T, K extends Canonical = any> = {
403
- /** The unique identifier of the atom. */
404
- key: string;
405
- /** Discriminator. */
406
- type: `atom`;
407
- /** Present if the atom belongs to a family. */
408
- family?: FamilyMetadata<K>;
409
- /** Never present. This is a marker that preserves the type of the atom's value. */
410
- __T?: T;
411
- };
412
- /** @public */
413
- type MutableAtomToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical = any> = {
414
- /** The unique identifier of the atom. */
415
- key: string;
416
- /** Discriminator. */
417
- type: `mutable_atom`;
418
- /** Present if the atom belongs to a family. */
419
- family?: FamilyMetadata<K>;
420
- /** Never present. This is a marker that preserves the JSON form of the atom's transceiver value. */
421
- __J?: J;
422
- /** Never present. This is a marker that preserves the type of the atom's transceiver value. */
423
- __U?: T extends Transceiver<infer Update> ? Update : never;
424
- };
425
- /** @public */
426
- type AtomToken<T, K extends Canonical = any> = MutableAtomToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomToken<T, K>;
427
- /** @public */
428
- type WritableSelectorToken<T, K extends Canonical = any> = {
429
- /** The unique identifier of the selector. */
430
- key: string;
431
- /** Discriminator. */
432
- type: `selector`;
433
- /** Present if the selector belongs to a family. */
434
- family?: FamilyMetadata<K>;
435
- /** Never present. This is a marker that preserves the type of the selector's value. */
436
- __T?: T;
437
- };
438
- /** @public */
439
- type ReadonlySelectorToken<T, K extends Canonical = any> = {
440
- /** The unique identifier of the selector. */
441
- key: string;
442
- /** Discriminator. */
443
- type: `readonly_selector`;
444
- /** Present if the selector belongs to a family. */
445
- family?: FamilyMetadata<K>;
446
- /** Never present. This is a marker that preserves the type of the selector's value. */
447
- __T?: T;
448
- };
449
- /** @public */
450
- type SelectorToken<T, K extends Canonical = any> = ReadonlySelectorToken<T, K> | WritableSelectorToken<T, K>;
451
- /**
452
- * @public
453
- * These states can be set.
454
- */
455
- type WritableToken<T, K extends Canonical = any> = AtomToken<T, K> | WritableSelectorToken<T, K>;
456
- /**
457
- * @public
458
- * These states cannot be set.
459
- */
460
- type ReadableToken<T, K extends Canonical = any> = AtomToken<T, K> | SelectorToken<T, K>;
461
- /**
462
- * @public
463
- * States belonging to this family can be set.
464
- */
465
- type WritableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
466
- /**
467
- * @public
468
- * States belonging to this family cannot be set.
469
- */
470
- type ReadableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | SelectorFamilyToken<T, K>;
471
- /**
472
- * @public
473
- * Identifies a state's connection to its family.
474
- */
475
- type FamilyMetadata<K extends Canonical = any> = {
476
- /** The family's unique key. */
477
- key: string;
478
- /** The family member's unique identifier, in the form of a string. */
479
- subKey: stringified<K>;
480
- };
481
-
482
- declare class CircularBuffer<T> {
483
- protected _buffer: T[];
484
- protected _index: number;
485
- constructor(array: T[]);
486
- constructor(length: number);
487
- get buffer(): ReadonlyArray<T | undefined>;
488
- get index(): number;
489
- add(item: T): void;
490
- copy(): CircularBuffer<T>;
491
- }
492
-
493
- type Func = (...parameters: any[]) => any;
494
- type Flat<R extends {
495
- [K in PropertyKey]: any;
496
- }> = {
497
- [K in keyof R]: R[K];
498
- };
499
- type Count<N extends number, A extends any[] = []> = [
500
- ...A,
501
- any
502
- ][`length`] extends N ? A[`length`] : A[`length`] | Count<N, [...A, any]>;
503
- type Each<E extends any[]> = {
504
- [P in Count<E[`length`]>]: E[P];
505
- };
506
- type Refinement<A, B extends A> = (a: A) => a is B;
507
-
508
- type JunctionEntriesBase<AType extends string, BType extends string, Content extends Json.Object | null> = {
509
- readonly relations: ([AType, BType[]] | [BType, AType[]])[];
510
- readonly contents: [string, Content][];
511
- };
512
- interface JunctionEntries<AType extends string, BType extends string, Content extends Json.Object | null> extends Json.Object, JunctionEntriesBase<AType, BType, Content> {
513
- }
514
- type JunctionSchemaBase<ASide extends string, BSide extends string> = {
515
- readonly between: [a: ASide, b: BSide];
516
- readonly cardinality: `1:1` | `1:n` | `n:n`;
517
- };
518
- interface JunctionSchema<ASide extends string, BSide extends string> extends Json.Object, JunctionSchemaBase<ASide, BSide> {
519
- }
520
- type BaseExternalStoreConfiguration = {
521
- addRelation: (a: string, b: string) => void;
522
- deleteRelation: (a: string, b: string) => void;
523
- replaceRelationsSafely: (a: string, bs: string[]) => void;
524
- replaceRelationsUnsafely: (a: string, bs: string[]) => void;
525
- getRelatedKeys(key: string): Set<string> | undefined;
526
- has: (a: string, b?: string) => boolean;
527
- };
528
- type ExternalStoreWithContentConfiguration<Content extends Json.Object> = {
529
- getContent: (contentKey: string) => Content | undefined;
530
- setContent: (contentKey: string, content: Content) => void;
531
- deleteContent: (contentKey: string) => void;
532
- };
533
- type Empty<Obj extends object> = {
534
- [Key in keyof Obj]?: undefined;
535
- };
536
- type ExternalStoreConfiguration<Content extends Json.Object | null> = Content extends Json.Object ? BaseExternalStoreConfiguration & ExternalStoreWithContentConfiguration<Content> : BaseExternalStoreConfiguration & Empty<ExternalStoreWithContentConfiguration<Json.Object>>;
537
- type JunctionAdvancedConfiguration<AType extends string, BType extends string, Content extends Json.Object | null> = {
538
- warn?: (...args: any[]) => void;
539
- externalStore?: ExternalStoreConfiguration<Content>;
540
- isAType?: Refinement<string, AType>;
541
- isBType?: Refinement<string, BType>;
542
- isContent?: Refinement<unknown, Content>;
543
- makeContentKey?: (a: AType, b: BType) => string;
544
- };
545
- type JunctionJSON<ASide extends string, AType extends string, BSide extends string, BType extends string, Content extends Json.Object | null> = JunctionEntries<AType, BType, Content> & JunctionSchema<ASide, BSide>;
546
- declare class Junction<const ASide extends string, const AType extends string, const BSide extends string, const BType extends string, const Content extends Json.Object | null = null> {
547
- readonly a: ASide;
548
- readonly b: BSide;
549
- readonly cardinality: `1:1` | `1:n` | `n:n`;
550
- readonly relations: Map<AType | BType, Set<AType> | Set<BType>>;
551
- readonly contents: Map<string, Content>;
552
- isAType?: Refinement<string, AType> | null;
553
- isBType?: Refinement<string, BType> | null;
554
- isContent: Refinement<unknown, Content> | null;
555
- makeContentKey: (a: AType, b: BType) => string;
556
- warn?: (...args: any[]) => void;
557
- getRelatedKeys(key: AType): Set<BType> | undefined;
558
- getRelatedKeys(key: BType): Set<AType> | undefined;
559
- getRelatedKeys(key: AType | BType): Set<AType> | Set<BType> | undefined;
560
- protected addRelation(a: AType, b: BType): void;
561
- protected deleteRelation(a: AType, b: BType): void;
562
- protected replaceRelationsUnsafely(a: AType, bs: BType[]): void;
563
- protected replaceRelationsUnsafely(b: BType, as: AType[]): void;
564
- protected replaceRelationsSafely(a: AType, bs: BType[]): void;
565
- protected replaceRelationsSafely(b: BType, as: AType[]): void;
566
- protected getContentInternal(contentKey: string): Content | undefined;
567
- protected setContent(contentKey: string, content: Content): void;
568
- protected deleteContent(contentKey: string): void;
569
- constructor(data: JunctionSchema<ASide, BSide> & Partial<JunctionEntries<NoInfer<AType>, NoInfer<BType>, Content>>, config?: JunctionAdvancedConfiguration<AType, BType, Content>);
570
- toJSON(): JunctionJSON<ASide, AType, BSide, BType, Content>;
571
- set(a: AType, ...rest: Content extends null ? [b: BType] : [b: BType, content: Content]): this;
572
- set(relation: {
573
- [Key in ASide]: AType;
574
- } & {
575
- [Key in BSide]: BType;
576
- }, ...rest: Content extends null ? [] | [void?: undefined] : [content: Content]): this;
577
- delete(a: AType, b?: BType): this;
578
- delete(b: BType, a?: AType): this;
579
- delete(relation: {
580
- [Key in ASide]: AType;
581
- } | {
582
- [Key in BSide]: BType;
583
- } | ({
584
- [Key in ASide]: AType;
585
- } & {
586
- [Key in BSide]: BType;
587
- }), b?: undefined): this;
588
- getRelatedKey(key: AType): BType | undefined;
589
- getRelatedKey(key: BType): AType | undefined;
590
- replaceRelations(a: AType, relations: Content extends null ? BType[] : Record<BType, Content>, config?: {
591
- reckless: boolean;
592
- }): this;
593
- replaceRelations(b: BType, relations: Content extends null ? AType[] : Record<AType, Content>, config?: {
594
- reckless: boolean;
595
- }): this;
596
- getContent(a: AType, b: BType): Content | undefined;
597
- getRelationEntries(input: Record<ASide, AType>): [BType, Content][];
598
- getRelationEntries(input: Record<BSide, BType>): [AType, Content][];
599
- has(a: AType, b?: BType): boolean;
600
- has(b: BType, a?: AType): boolean;
601
- }
602
-
603
- declare class Subject<T> {
604
- Subscriber: (value: T) => void;
605
- subscribers: Map<string, this[`Subscriber`]>;
606
- subscribe(key: string, subscriber: this[`Subscriber`]): () => void;
607
- private unsubscribe;
608
- next(value: T): void;
609
- }
610
- declare class StatefulSubject<T> extends Subject<T> {
611
- state: T;
612
- constructor(initialState: T);
613
- next(value: T): void;
614
- }
615
-
616
- type Transaction<F extends Func> = {
617
- key: string;
618
- type: `transaction`;
619
- install: (store: Store) => void;
620
- subject: Subject<TransactionUpdate<F>>;
621
- run: (parameters: Parameters<F>, id?: string) => ReturnType<F>;
622
- };
623
-
624
- type TransactionProgress<F extends Func> = {
625
- phase: `applying` | `building`;
626
- update: TransactionUpdate<F>;
627
- toolkit: ActorToolkit;
628
- };
629
- type TransactionEpoch = {
630
- epoch: Map<string, number>;
631
- actionContinuities: Junction<`continuity`, string, `action`, string>;
632
- };
633
-
634
- type Molecule<K extends Canonical> = {
635
- readonly key: K;
636
- readonly stringKey: stringified<K>;
637
- readonly dependsOn: `all` | `any`;
638
- };
639
-
640
- 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 ? {
641
- readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<[
642
- AType,
643
- Content
644
- ] | null, BType>;
645
- } & {
646
- readonly [B in BSide as `${B}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
647
- BType,
648
- Content
649
- ] | null, AType>;
650
- } : {}) & {
651
- readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<AType | null, BType>;
652
- } & {
653
- readonly [B in BSide as `${B}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<BType | null, AType>;
654
- } : Cardinality extends `1:n` ? (Content extends Json.Object ? {
655
- readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<[
656
- AType,
657
- Content
658
- ] | null, BType>;
659
- } & {
660
- readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
661
- BType,
662
- Content
663
- ][], AType>;
664
- } : {}) & {
665
- readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<AType | null, BType>;
666
- } & {
667
- readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<BType[], AType>;
668
- } : Cardinality extends `n:n` ? (Content extends Json.Object ? {
669
- readonly [A in ASide as `${A}EntriesOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<[
670
- AType,
671
- Content
672
- ][], BType>;
673
- } & {
674
- readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
675
- BType,
676
- Content
677
- ][], AType>;
678
- } : {}) & {
679
- readonly [A in ASide as `${A}KeysOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<AType[], BType>;
680
- } & {
681
- readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<BType[], AType>;
682
- } : never;
683
- declare class Join<const ASide extends string, const AType extends string, const BSide extends string, const BType extends string, const Cardinality extends `1:1` | `1:n` | `n:n`, const Content extends Json.Object | null = null, const ContentKey extends CompoundTypedKey<`content`, ASide, BSide> = CompoundTypedKey<`content`, ASide, BSide>> {
684
- private toolkit;
685
- options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>;
686
- defaultContent: Content | undefined;
687
- molecules: Map<string, Molecule<any>>;
688
- relations: Junction<ASide, AType, BSide, BType, Content>;
689
- states: JoinStateFamilies<ASide, AType, BSide, BType, Cardinality, Content>;
690
- core: {
691
- relatedKeysAtoms: MutableAtomFamilyToken<SetRTX<string>, SetRTXJson<string>, string>;
692
- };
693
- transact(toolkit: SetterToolkit, run: (join: Join<ASide, AType, BSide, BType, Cardinality, Content>) => void): void;
694
- store: Store;
695
- realm: Anarchy;
696
- [Symbol.dispose](): void;
697
- constructor(options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>, defaultContent: Content | undefined, store?: Store);
698
- }
699
-
700
- interface Lineage {
701
- parent: typeof this | null;
702
- child: typeof this | null;
703
- }
704
-
705
- type OperationProgress = {
706
- open: false;
707
- } | {
708
- open: true;
709
- done: Set<string>;
710
- prev: Map<string, any>;
711
- time: number;
712
- token: WritableToken<any>;
713
- };
714
-
715
- type TimelineAtomUpdate<ManagedAtom extends TimelineManageable> = Flat<StateUpdate<TokenType<ManagedAtom>> & {
716
- key: string;
717
- type: `atom_update`;
718
- timestamp: number;
719
- family?: FamilyMetadata;
720
- }>;
721
- type TimelineSelectorUpdate<ManagedAtom extends TimelineManageable> = {
722
- key: string;
723
- type: `selector_update`;
724
- timestamp: number;
725
- atomUpdates: Omit<TimelineAtomUpdate<ManagedAtom>, `timestamp`>[];
726
- };
727
- type TimelineTransactionUpdate = Flat<TransactionUpdate<Func> & {
728
- key: string;
729
- type: `transaction_update`;
730
- timestamp: number;
731
- }>;
732
- type TimelineStateCreation<T extends ReadableToken<any>> = Flat<StateCreation<T> & {
733
- timestamp: number;
734
- }>;
735
- type TimelineStateDisposal<T extends ReadableToken<any>> = Flat<StateDisposal<T> & {
736
- timestamp: number;
737
- }>;
738
- type TimelineMoleculeCreation = Flat<MoleculeCreation & {
739
- timestamp: number;
740
- }>;
741
- type TimelineMoleculeDisposal = Flat<MoleculeDisposal & {
742
- timestamp: number;
743
- }>;
744
- type Timeline<ManagedAtom extends TimelineManageable> = {
745
- type: `timeline`;
746
- key: string;
747
- at: number;
748
- shouldCapture?: (update: TimelineUpdate<ManagedAtom>, timeline: Timeline<ManagedAtom>) => boolean;
749
- timeTraveling: `into_future` | `into_past` | null;
750
- history: TimelineUpdate<ManagedAtom>[];
751
- selectorTime: number | null;
752
- transactionKey: string | null;
753
- install: (store: Store) => void;
754
- subject: Subject<TimelineUpdate<ManagedAtom> | `redo` | `undo`>;
755
- subscriptions: Map<string, () => void>;
756
- };
757
-
758
- declare class Store implements Lineage {
759
- parent: Store | null;
760
- child: Store | null;
761
- valueMap: Map<string, any>;
762
- defaults: Map<string, any>;
763
- atoms: Map<string, Atom<any>>;
764
- selectors: Map<string, WritableSelector<any>>;
765
- readonlySelectors: Map<string, ReadonlySelector<any>>;
766
- atomsThatAreDefault: Set<string>;
767
- selectorAtoms: Junction<"selectorKey", string, "atomKey", string, null>;
768
- selectorGraph: Junction<"upstreamSelectorKey", string, "downstreamSelectorKey", string, {
769
- source: string;
770
- }>;
771
- trackers: Map<string, Tracker<Transceiver<any>>>;
772
- families: Map<string, MutableAtomFamily<any, any, any> | ReadonlySelectorFamily<any, any> | RegularAtomFamily<any, any> | WritableSelectorFamily<any, any>>;
773
- joins: Map<string, Join<any, any, any, any, any, any, `T$--content==${any}::${string}++${any}::${string}`>>;
774
- transactions: Map<string, Transaction<Func>>;
775
- transactionMeta: TransactionEpoch | TransactionProgress<Func>;
776
- timelines: Map<string, Timeline<any>>;
777
- timelineTopics: Junction<"timelineKey", string, "topicKey", string, {
778
- topicType: `atom_family` | `atom` | `molecule_family` | `molecule`;
779
- }>;
780
- disposalTraces: CircularBuffer<{
781
- key: string;
782
- trace: string;
783
- }>;
784
- molecules: Map<string, Molecule<Canonical>>;
785
- moleculeJoins: Junction<"moleculeKey", stringified<Canonical>, "joinKey", string, null>;
786
- moleculeGraph: Junction<"upstreamMoleculeKey", stringified<Canonical> | "root", "downstreamMoleculeKey", stringified<Canonical>, {
787
- source: stringified<Canonical>;
788
- }>;
789
- moleculeData: Junction<"moleculeKey", stringified<Canonical>, "stateFamilyKey", string, null>;
790
- miscResources: Map<string, Disposable>;
791
- on: {
792
- atomCreation: Subject<AtomToken<unknown>>;
793
- atomDisposal: Subject<AtomToken<unknown>>;
794
- selectorCreation: Subject<ReadonlySelectorToken<unknown> | WritableSelectorToken<unknown>>;
795
- selectorDisposal: Subject<ReadonlySelectorToken<unknown> | WritableSelectorToken<unknown>>;
796
- timelineCreation: Subject<TimelineToken<unknown>>;
797
- transactionCreation: Subject<TransactionToken<Func>>;
798
- transactionApplying: StatefulSubject<TransactionProgress<Func> | null>;
799
- operationClose: Subject<OperationProgress>;
800
- moleculeCreation: Subject<MoleculeCreation>;
801
- moleculeDisposal: Subject<MoleculeDisposal>;
802
- };
803
- operation: OperationProgress;
804
- config: {
805
- name: string;
806
- lifespan: `ephemeral` | `immortal`;
807
- };
808
- loggers: AtomIOLogger[];
809
- logger: Logger;
810
- constructor(config: Store[`config`], store?: Store | null);
811
- }
812
-
813
- interface Transceiver<S extends Json.Serializable> {
814
- do: (update: S) => number | `OUT_OF_RANGE` | null;
815
- undo: (update: S) => void;
816
- subscribe: (key: string, fn: (update: S) => void) => () => void;
817
- cacheUpdateNumber: number;
818
- getUpdateNumber: (update: S) => number;
819
- }
820
- type TransceiverMode = `playback` | `record` | `transaction`;
821
-
822
- /**
823
- * @internal Give the tracker a transceiver state and a store, and it will
824
- * subscribe to the transceiver's inner value. When the inner value changes,
825
- * the tracker will update its own state to reflect the change.
826
- */
827
- declare class Tracker<Mutable extends Transceiver<any>> {
828
- private Update;
829
- private initializeState;
830
- private unsubscribeFromInnerValue;
831
- private unsubscribeFromState;
832
- private observeCore;
833
- private updateCore;
834
- mutableState: MutableAtomToken<Mutable, Json.Serializable>;
835
- latestUpdateState: RegularAtomToken<typeof this.Update | null>;
836
- [Symbol.dispose]: () => void;
837
- constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store: Store);
838
- }
839
-
840
- type EnvironmentData = {
841
- store: Store;
842
- };
843
-
844
- type AtomIOState = {
845
- key: string;
846
- family?: FamilyMetadata;
847
- install: (store: Store) => void;
848
- subject: Subject<{
849
- newValue: any;
850
- oldValue: any;
851
- }>;
852
- };
853
- type RegularAtom<T> = AtomIOState & {
854
- type: `atom`;
855
- default: T | (() => T);
856
- cleanup?: () => void;
857
- };
858
- type MutableAtom<T extends Transceiver<any>, J extends Json.Serializable> = AtomIOState & JsonInterface<T, J> & {
859
- type: `mutable_atom`;
860
- default: T | (() => T);
861
- cleanup?: () => void;
862
- };
863
- type Atom<T> = RegularAtom<T> | (T extends Transceiver<any> ? MutableAtom<T, any> : never);
864
- type WritableSelector<T> = AtomIOState & {
865
- type: `selector`;
866
- get: () => T;
867
- set: (newValue: T | ((oldValue: T) => T)) => void;
868
- };
869
- type ReadonlySelector<T> = AtomIOState & {
870
- type: `readonly_selector`;
871
- get: () => T;
872
- };
873
- type RegularAtomFamily<T, K extends Canonical> = RegularAtomFamilyToken<T, K> & {
874
- (key: K): RegularAtomToken<T>;
875
- subject: Subject<StateCreation<AtomToken<T>> | StateDisposal<AtomToken<T>>>;
876
- install: (store: Store) => void;
877
- internalRoles: string[] | undefined;
878
- };
879
- type MutableAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = JsonInterface<T, J> & MutableAtomFamilyToken<T, J, K> & {
880
- (key: K): MutableAtomToken<T, J>;
881
- subject: Subject<StateCreation<MutableAtomToken<T, J>> | StateDisposal<MutableAtomToken<T, J>>>;
882
- install: (store: Store) => void;
883
- internalRoles: string[] | undefined;
884
- };
885
- type WritableSelectorFamily<T, K extends Canonical> = WritableSelectorFamilyToken<T, K> & ((key: K) => WritableSelectorToken<T>) & {
886
- default: (key: K) => T;
887
- subject: Subject<StateCreation<WritableSelectorToken<T>> | StateDisposal<WritableSelectorToken<T>>>;
888
- install: (store: Store) => void;
889
- internalRoles: string[] | undefined;
890
- };
891
- type ReadonlySelectorFamily<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> & ((key: K) => ReadonlySelectorToken<T>) & {
892
- default: (key: K) => T;
893
- subject: Subject<StateCreation<ReadonlySelectorToken<T>> | StateDisposal<ReadonlySelectorToken<T>>>;
894
- install: (store: Store) => void;
895
- internalRoles: string[] | undefined;
896
- };
1
+ import { Count, Flat, Store, Transceiver } from 'atom.io/internal';
2
+ import * as AtomIO from 'atom.io';
897
3
 
898
4
  type Entries<K extends PropertyKey = keyof any, V = any> = [K, V][];
899
5
  type KeyOfEntries<E extends Entries> = E extends [infer K, any][] ? K : never;
@@ -906,10 +12,10 @@ type FromEntries<E extends Entries> = Flat<{
906
12
  declare function fromEntries<E extends Entries>(entries: E): FromEntries<E>;
907
13
  declare function toEntries<T extends object>(obj: T): Entries<keyof T, T[keyof T]>;
908
14
 
909
- declare const selectJson: <T, J extends Json.Serializable>(atom: AtomToken<T>, transform: JsonInterface<T, J>, store?: Store) => WritableSelectorToken<J>;
15
+ declare const selectJson: <T, J extends Json.Serializable>(atom: AtomIO.AtomToken<T>, transform: JsonInterface<T, J>, store?: Store) => AtomIO.WritableSelectorToken<J>;
910
16
 
911
- declare function selectJsonFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(store: Store, atomFamilyToken: MutableAtomFamilyToken<T, J, K>, transform: JsonInterface<T, J>): WritableSelectorFamilyToken<J, K>;
912
- declare function selectJsonFamily<T, J extends Json.Serializable, K extends Canonical>(store: Store, atomFamilyToken: RegularAtomFamilyToken<T, K>, transform: JsonInterface<T, J>): WritableSelectorFamilyToken<J, K>;
17
+ declare function selectJsonFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(store: Store, atomFamilyToken: AtomIO.MutableAtomFamilyToken<T, J, K>, transform: JsonInterface<T, J>): AtomIO.WritableSelectorFamilyToken<J, K>;
18
+ declare function selectJsonFamily<T, J extends Json.Serializable, K extends Canonical>(store: Store, atomFamilyToken: AtomIO.RegularAtomFamilyToken<T, K>, transform: JsonInterface<T, J>): AtomIO.WritableSelectorFamilyToken<J, K>;
913
19
 
914
20
  type primitive = boolean | number | string | null;
915
21
  declare namespace Json {