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