atom.io 0.27.2 → 0.27.4

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 (52) hide show
  1. package/data/dist/index.d.ts +12 -12
  2. package/data/dist/index.js +20 -14
  3. package/data/src/dict.ts +4 -4
  4. package/data/src/join.ts +23 -18
  5. package/data/src/struct-family.ts +2 -2
  6. package/dist/chunk-JRENM6KL.js +3148 -0
  7. package/dist/index.d.ts +3 -30
  8. package/eslint-plugin/dist/index.js +8 -0
  9. package/eslint-plugin/src/walk.ts +8 -0
  10. package/internal/dist/index.d.ts +55 -25
  11. package/internal/dist/index.js +2 -3044
  12. package/internal/src/families/create-atom-family.ts +6 -5
  13. package/internal/src/families/create-readonly-selector-family.ts +54 -28
  14. package/internal/src/families/create-regular-atom-family.ts +41 -31
  15. package/internal/src/families/create-selector-family.ts +6 -5
  16. package/internal/src/families/create-writable-selector-family.ts +55 -29
  17. package/internal/src/families/dispose-from-store.ts +11 -2
  18. package/internal/src/families/seek-in-store.ts +0 -3
  19. package/internal/src/families/throw-in-case-of-conflicting-family.ts +18 -0
  20. package/internal/src/get-state/get-from-store.ts +26 -2
  21. package/internal/src/get-state/read-or-compute-value.ts +1 -1
  22. package/internal/src/index.ts +78 -2
  23. package/internal/src/ingest-updates/ingest-creation-disposal.ts +0 -1
  24. package/internal/src/ingest-updates/ingest-selector-update.ts +1 -1
  25. package/internal/src/molecule/dispose-molecule.ts +0 -1
  26. package/internal/src/molecule/grow-molecule-in-store.ts +27 -17
  27. package/internal/src/mutable/create-mutable-atom-family.ts +41 -32
  28. package/internal/src/mutable/get-json-family.ts +2 -1
  29. package/internal/src/mutable/get-update-family.ts +23 -0
  30. package/internal/src/mutable/index.ts +1 -0
  31. package/internal/src/mutable/tracker-family.ts +5 -3
  32. package/internal/src/not-found-error.ts +2 -35
  33. package/internal/src/pretty-print.ts +37 -0
  34. package/internal/src/selector/create-writable-selector.ts +6 -6
  35. package/internal/src/set-state/set-into-store.ts +13 -2
  36. package/internal/src/store/deposit.ts +11 -10
  37. package/internal/src/store/store.ts +11 -4
  38. package/internal/src/store/withdraw.ts +8 -8
  39. package/internal/src/transaction/build-transaction.ts +1 -0
  40. package/introspection/dist/index.js +3 -3
  41. package/introspection/src/attach-timeline-family.ts +1 -1
  42. package/introspection/src/attach-transaction-logs.ts +2 -2
  43. package/json/dist/index.d.ts +2 -2
  44. package/json/dist/index.js +16 -12
  45. package/json/src/select-json-family.ts +21 -18
  46. package/package.json +7 -7
  47. package/realtime-server/dist/index.d.ts +1 -1
  48. package/src/atom.ts +2 -32
  49. package/src/index.ts +1 -10
  50. package/src/logger.ts +4 -0
  51. package/src/selector.ts +1 -26
  52. package/src/silo.ts +7 -5
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Transceiver, Subject, Store, Func, EnvironmentData, Flat, Timeline, TimelineAtomUpdate, TimelineMoleculeCreation, TimelineMoleculeDisposal, TimelineSelectorUpdate, TimelineStateCreation, TimelineStateDisposal, TimelineTransactionUpdate } from 'atom.io/internal';
1
+ import { Transceiver, Func, EnvironmentData, Flat, Subject, Store, Timeline, TimelineAtomUpdate, TimelineMoleculeCreation, TimelineMoleculeDisposal, TimelineSelectorUpdate, TimelineStateCreation, TimelineStateDisposal, TimelineTransactionUpdate } from 'atom.io/internal';
2
2
  import { Json, JsonInterface, Canonical } from 'atom.io/json';
3
3
  import { MoleculeConstructor as MoleculeConstructor$1, MoleculeToken as MoleculeToken$1, MoleculeFamilyToken as MoleculeFamilyToken$1, MoleculeParams as MoleculeParams$1, getState as getState$1, setState as setState$1, makeMolecule as makeMolecule$1, ActorToolkit as ActorToolkit$1, MutableAtomFamilyToken as MutableAtomFamilyToken$1, MutableAtomToken as MutableAtomToken$1, RegularAtomFamilyToken as RegularAtomFamilyToken$1, RegularAtomToken as RegularAtomToken$1, WritableSelectorFamilyToken as WritableSelectorFamilyToken$1, WritableSelectorToken as WritableSelectorToken$1, ReadonlySelectorFamilyToken as ReadonlySelectorFamilyToken$1, ReadonlySelectorToken as ReadonlySelectorToken$1, WritableFamilyToken as WritableFamilyToken$1, WritableToken as WritableToken$1, ReadableFamilyToken as ReadableFamilyToken$1, ReadableToken as ReadableToken$1, MoleculeCreation as MoleculeCreation$1, MoleculeDisposal as MoleculeDisposal$1 } from 'atom.io';
4
4
  import { findState } from 'atom.io/ephemeral';
@@ -51,11 +51,6 @@ type RegularAtomFamilyToken<T, K extends Canonical> = {
51
51
  __T?: T;
52
52
  __K?: K;
53
53
  };
54
- type RegularAtomFamily<T, K extends Canonical> = RegularAtomFamilyToken<T, K> & {
55
- (key: K): RegularAtomToken<T>;
56
- subject: Subject<StateCreation<AtomToken<T>> | StateDisposal<AtomToken<T>>>;
57
- install: (store: Store) => void;
58
- };
59
54
  type MutableAtomFamilyOptions<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = JsonInterface<T, J> & {
60
55
  key: string;
61
56
  default: (key: K) => T;
@@ -69,12 +64,6 @@ type MutableAtomFamilyToken<T extends Transceiver<any>, J extends Json.Serializa
69
64
  __J?: J;
70
65
  __K?: K;
71
66
  };
72
- type MutableAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = JsonInterface<T, J> & MutableAtomFamilyToken<T, J, K> & {
73
- (key: K): MutableAtomToken<T, J>;
74
- subject: Subject<StateCreation<MutableAtomToken<T, J>> | StateDisposal<MutableAtomToken<T, J>>>;
75
- install: (store: Store) => void;
76
- };
77
- type AtomFamily<T, K extends Canonical = Canonical> = MutableAtomFamily<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamily<T, K>;
78
67
  type AtomFamilyToken<T, K extends Canonical = Canonical> = MutableAtomFamilyToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamilyToken<T, K>;
79
68
  declare function atomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(options: MutableAtomFamilyOptions<T, J, K>): MutableAtomFamilyToken<T, J, K>;
80
69
  declare function atomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>): RegularAtomFamilyToken<T, K>;
@@ -173,26 +162,12 @@ type WritableSelectorFamilyToken<T, K extends Canonical> = {
173
162
  __T?: T;
174
163
  __K?: K;
175
164
  };
176
- type WritableSelectorFamily<T, K extends Canonical> = WritableSelectorFamilyToken<T, K> & {
177
- (key: K): WritableSelectorToken<T>;
178
- subject: Subject<StateCreation<WritableSelectorToken<T>> | StateDisposal<WritableSelectorToken<T>>>;
179
- install: (store: Store) => void;
180
- };
181
165
  type ReadonlySelectorFamilyToken<T, K extends Canonical> = {
182
166
  key: string;
183
167
  type: `readonly_selector_family`;
184
168
  __T?: T;
185
169
  __K?: K;
186
170
  };
187
- type ReadonlySelectorFamily<T, K extends Canonical> = ((key: K) => ReadonlySelectorToken<T>) & {
188
- key: string;
189
- type: `readonly_selector_family`;
190
- subject: Subject<StateCreation<ReadonlySelectorToken<T>> | StateDisposal<ReadonlySelectorToken<T>>>;
191
- install: (store: Store) => void;
192
- __T?: T;
193
- __K?: K;
194
- };
195
- type SelectorFamily<T, K extends Canonical> = ReadonlySelectorFamily<T, K> | WritableSelectorFamily<T, K>;
196
171
  type SelectorFamilyToken<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
197
172
  declare function selectorFamily<T, K extends Canonical>(options: WritableSelectorFamilyOptions<T, K>): WritableSelectorFamilyToken<T, K>;
198
173
  declare function selectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>): ReadonlySelectorFamilyToken<T, K>;
@@ -312,7 +287,7 @@ declare const LoggerIconDictionary: {
312
287
  readonly "\uD83D\uDC41": "Determining perspective";
313
288
  };
314
289
  type LoggerIcon = keyof typeof LoggerIconDictionary;
315
- type TokenDenomination = `atom` | `continuity` | `molecule_family` | `molecule` | `mutable_atom` | `readonly_selector` | `selector` | `state` | `timeline` | `transaction` | `unknown`;
290
+ 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`;
316
291
  declare const LOG_LEVELS: readonly ["info", "warn", "error"];
317
292
  type LogLevel = (typeof LOG_LEVELS)[number];
318
293
  type LogFn = (icon: LoggerIcon, denomination: TokenDenomination, tokenKey: string, message: string, ...rest: unknown[]) => void;
@@ -444,8 +419,6 @@ type ReadonlySelectorToken<T> = {
444
419
  type SelectorToken<T> = ReadonlySelectorToken<T> | WritableSelectorToken<T>;
445
420
  type WritableToken<T> = AtomToken<T> | WritableSelectorToken<T>;
446
421
  type ReadableToken<T> = AtomToken<T> | SelectorToken<T>;
447
- type WritableFamily<T, K extends Canonical> = AtomFamily<T, K> | WritableSelectorFamily<T, K>;
448
- type ReadableFamily<T, K extends Canonical> = AtomFamily<T, K> | SelectorFamily<T, K>;
449
422
  type WritableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
450
423
  type ReadableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | SelectorFamilyToken<T, K>;
451
424
  type FamilyMetadata = {
@@ -453,4 +426,4 @@ type FamilyMetadata = {
453
426
  subKey: string;
454
427
  };
455
428
 
456
- export { type ActorToolkit, type AtomEffect, type AtomFamily, type AtomFamilyToken, AtomIOLogger, type AtomOnly, type AtomToken, type CtorToolkit, type Effectors, type FamilyMetadata, type GetterToolkit, type KeyedStateUpdate, LOG_LEVELS, type LogFilter, type LogFn, type LogLevel, type Logger, type LoggerIcon, type MoleculeConstructor, type MoleculeCreation, type MoleculeDisposal, type MoleculeFamily, type MoleculeFamilyOptions, type MoleculeFamilyToken, type MoleculeKey, type MoleculeParams, type MoleculeToken, type MoleculeType, type MutableAtomFamily, type MutableAtomFamilyOptions, type MutableAtomFamilyToken, type MutableAtomOptions, type MutableAtomToken, type Read, type ReadableFamily, type ReadableFamilyToken, type ReadableToken, type ReadonlySelectorFamily, type ReadonlySelectorFamilyOptions, type ReadonlySelectorFamilyToken, type ReadonlySelectorOptions, type ReadonlySelectorToken, type RegularAtomFamily, type RegularAtomFamilyOptions, type RegularAtomFamilyToken, type RegularAtomOptions, type RegularAtomToken, type SelectorFamily, type SelectorFamilyToken, type SelectorToken, type SetterToolkit, Silo, type StateCreation, type StateDisposal, type StateUpdate, type TimelineManageable, type TimelineOptions, type TimelineToken, type TimelineUpdate, type TokenDenomination, type TokenType, type Transact, type TransactionIO, type TransactionOptions, type TransactionToken, type TransactionUpdate, type TransactionUpdateContent, type TransactionUpdateHandler, type UpdateHandler, type WritableFamily, type WritableFamilyToken, type WritableSelectorFamily, type WritableSelectorFamilyOptions, type WritableSelectorFamilyToken, type WritableSelectorOptions, type WritableSelectorToken, type WritableToken, type Write, atom, atomFamily, belongsTo, disposeState, getState, isToken, makeMolecule, makeRootMolecule, moleculeFamily, redo, runTransaction, selector, selectorFamily, setState, simpleLog, simpleLogger, subscribe, timeline, transaction, undo };
429
+ export { type ActorToolkit, type AtomEffect, type AtomFamilyToken, AtomIOLogger, type AtomOnly, type AtomToken, type CtorToolkit, type Effectors, type FamilyMetadata, type GetterToolkit, type KeyedStateUpdate, LOG_LEVELS, type LogFilter, type LogFn, type LogLevel, type Logger, type LoggerIcon, type MoleculeConstructor, type MoleculeCreation, type MoleculeDisposal, type MoleculeFamily, type MoleculeFamilyOptions, type MoleculeFamilyToken, type MoleculeKey, type MoleculeParams, type MoleculeToken, type MoleculeType, type MutableAtomFamilyOptions, type MutableAtomFamilyToken, type MutableAtomOptions, type MutableAtomToken, type Read, type ReadableFamilyToken, type ReadableToken, type ReadonlySelectorFamilyOptions, type ReadonlySelectorFamilyToken, type ReadonlySelectorOptions, type ReadonlySelectorToken, type RegularAtomFamilyOptions, type RegularAtomFamilyToken, type RegularAtomOptions, type RegularAtomToken, type SelectorFamilyToken, type SelectorToken, type SetterToolkit, Silo, type StateCreation, type StateDisposal, type StateUpdate, type TimelineManageable, type TimelineOptions, type TimelineToken, type TimelineUpdate, type TokenDenomination, type TokenType, type Transact, type TransactionIO, type TransactionOptions, type TransactionToken, type TransactionUpdate, type TransactionUpdateContent, type TransactionUpdateHandler, type UpdateHandler, type WritableFamilyToken, type WritableSelectorFamilyOptions, type WritableSelectorFamilyToken, type WritableSelectorOptions, type WritableSelectorToken, type WritableToken, type Write, atom, atomFamily, belongsTo, disposeState, getState, isToken, makeMolecule, makeRootMolecule, moleculeFamily, redo, runTransaction, selector, selectorFamily, setState, simpleLog, simpleLogger, subscribe, timeline, transaction, undo };
@@ -62,6 +62,9 @@ var explicitStateTypes = createRule({
62
62
  function walk(node, callback, depth = 0) {
63
63
  callback(node, depth);
64
64
  switch (node.type) {
65
+ case `AwaitExpression`:
66
+ walk(node.argument, callback, depth + 1);
67
+ break;
65
68
  case `FunctionDeclaration`:
66
69
  case `FunctionExpression`:
67
70
  case `ArrowFunctionExpression`:
@@ -113,6 +116,11 @@ function walk(node, callback, depth = 0) {
113
116
  walk(node.left, callback, depth);
114
117
  walk(node.right, callback, depth);
115
118
  break;
119
+ case `ConditionalExpression`:
120
+ walk(node.test, callback, depth + 1);
121
+ walk(node.consequent, callback, depth + 1);
122
+ walk(node.alternate, callback, depth + 1);
123
+ break;
116
124
  case `MemberExpression`:
117
125
  walk(node.object, callback, depth);
118
126
  walk(node.property, callback, depth);
@@ -8,6 +8,9 @@ export function walk(
8
8
  callback(node, depth)
9
9
 
10
10
  switch (node.type) {
11
+ case `AwaitExpression`:
12
+ walk(node.argument, callback, depth + 1)
13
+ break
11
14
  case `FunctionDeclaration`:
12
15
  case `FunctionExpression`:
13
16
  case `ArrowFunctionExpression`:
@@ -59,6 +62,11 @@ export function walk(
59
62
  walk(node.left, callback, depth)
60
63
  walk(node.right, callback, depth)
61
64
  break
65
+ case `ConditionalExpression`:
66
+ walk(node.test, callback, depth + 1)
67
+ walk(node.consequent, callback, depth + 1)
68
+ walk(node.alternate, callback, depth + 1)
69
+ break
62
70
  case `MemberExpression`:
63
71
  walk(node.object, callback, depth)
64
72
  walk(node.property, callback, depth)
@@ -1,5 +1,5 @@
1
1
  import * as atom_io from 'atom.io';
2
- import { TransactionToken, TransactionUpdate, TransactionOptions, ActorToolkit, RegularAtomToken, MutableAtomToken, AtomToken, WritableSelectorToken, ReadonlySelectorToken, SelectorToken, WritableToken, MoleculeToken, MoleculeFamily, MoleculeFamilyToken, ReadableToken, TimelineManageable, StateUpdate, TokenType, FamilyMetadata, StateCreation, StateDisposal, MoleculeConstructor, MoleculeCreation, MoleculeDisposal, TimelineUpdate, TimelineOptions, TimelineToken, WritableSelectorFamily, MutableAtomFamily, RegularAtomFamily, ReadonlySelectorFamily, AtomIOLogger, Logger, AtomFamily, ReadableFamily, SelectorFamily, WritableFamily, RegularAtomFamilyToken, MutableAtomFamilyToken, AtomFamilyToken, ReadonlySelectorFamilyToken, WritableSelectorFamilyToken, SelectorFamilyToken, ReadableFamilyToken, WritableFamilyToken, MutableAtomOptions, MutableAtomFamilyOptions, RegularAtomOptions, RegularAtomFamilyOptions, ReadonlySelectorFamilyOptions, WritableSelectorFamilyOptions, MoleculeKey, KeyedStateUpdate, MoleculeFamilyOptions, MoleculeParams, ReadonlySelectorOptions, WritableSelectorOptions, SetterToolkit, UpdateHandler, TransactionUpdateHandler } from 'atom.io';
2
+ import { TransactionToken, TransactionUpdate, TransactionOptions, ActorToolkit, RegularAtomToken, MutableAtomToken, AtomToken, WritableSelectorToken, ReadonlySelectorToken, SelectorToken, WritableToken, MoleculeConstructor, MoleculeFamily, MoleculeFamilyToken, MoleculeToken, ReadableToken, TimelineManageable, StateUpdate, TokenType, FamilyMetadata, StateCreation, StateDisposal, MoleculeCreation, MoleculeDisposal, TimelineUpdate, TimelineOptions, TimelineToken, AtomIOLogger, Logger, RegularAtomFamilyToken, MutableAtomFamilyToken, AtomFamilyToken, ReadonlySelectorFamilyToken, WritableSelectorFamilyToken, SelectorFamilyToken, ReadableFamilyToken, WritableFamilyToken, MutableAtomOptions, MutableAtomFamilyOptions, RegularAtomOptions, RegularAtomFamilyOptions, ReadonlySelectorFamilyOptions, WritableSelectorFamilyOptions, MoleculeKey, KeyedStateUpdate, MoleculeFamilyOptions, MoleculeParams, ReadonlySelectorOptions, WritableSelectorOptions, SetterToolkit, UpdateHandler, TransactionUpdateHandler } from 'atom.io';
3
3
  import { Canonical, Json, JsonInterface } from 'atom.io/json';
4
4
  import { Join } from 'atom.io/data';
5
5
 
@@ -156,14 +156,11 @@ declare function deposit<T>(state: WritableSelector<T>): WritableSelectorToken<T
156
156
  declare function deposit<T>(state: ReadonlySelector<T>): ReadonlySelectorToken<T>;
157
157
  declare function deposit<T>(state: Selector<T>): SelectorToken<T>;
158
158
  declare function deposit<T>(state: WritableState<T>): WritableToken<T>;
159
- declare function deposit<K extends Canonical, S extends {
160
- [key: string]: any;
161
- }, P extends any[]>(state: Molecule<any>): MoleculeToken<any>;
162
- declare function deposit<K extends Canonical, S extends {
163
- [key: string]: any;
164
- }, P extends any[]>(state: MoleculeFamily<any>): MoleculeFamilyToken<any>;
159
+ declare function deposit<M extends MoleculeConstructor>(state: MoleculeFamily<M>): MoleculeFamilyToken<M>;
160
+ declare function deposit<M extends MoleculeConstructor>(state: Molecule<M>): MoleculeToken<M>;
165
161
  declare function deposit<T extends Func>(state: Transaction<T>): TransactionToken<T>;
166
162
  declare function deposit<T>(state: ReadableState<T>): ReadableToken<T>;
163
+ declare function deposit(state: Molecule<any> | ReadableState<any>): MoleculeToken<any> | ReadableToken<any>;
167
164
 
168
165
  interface Lineage {
169
166
  parent: typeof this | null;
@@ -236,6 +233,7 @@ declare class Store implements Lineage {
236
233
  parent: Store | null;
237
234
  child: Store | null;
238
235
  valueMap: Map<string, any>;
236
+ defaults: Map<string, any>;
239
237
  atoms: Map<string, Atom<any>>;
240
238
  selectors: Map<string, WritableSelector<any>>;
241
239
  readonlySelectors: Map<string, ReadonlySelector<any>>;
@@ -245,7 +243,7 @@ declare class Store implements Lineage {
245
243
  source: string;
246
244
  }>;
247
245
  trackers: Map<string, Tracker<Transceiver<any>>>;
248
- families: Map<string, WritableSelectorFamily<any, any> | MutableAtomFamily<any, any, any> | RegularAtomFamily<any, any> | ReadonlySelectorFamily<any, any>>;
246
+ families: Map<string, MutableAtomFamily<any, any, any> | ReadonlySelectorFamily<any, any> | RegularAtomFamily<any, any> | WritableSelectorFamily<any, any>>;
249
247
  transactions: Map<string, Transaction<Func>>;
250
248
  transactionMeta: TransactionEpoch | TransactionProgress<Func>;
251
249
  timelines: Map<string, Timeline<any>>;
@@ -254,7 +252,7 @@ declare class Store implements Lineage {
254
252
  }>;
255
253
  molecules: Map<string, Molecule<any>>;
256
254
  moleculeFamilies: Map<string, Flat<atom_io.MoleculeFamilyToken<any> & {
257
- subject: Subject<atom_io.MoleculeDisposal | atom_io.MoleculeCreation<any>>;
255
+ subject: Subject<atom_io.MoleculeCreation<any> | atom_io.MoleculeDisposal>;
258
256
  dependsOn: `all` | `any`;
259
257
  new: any;
260
258
  }>>;
@@ -322,12 +320,14 @@ type Signal<TVR extends Transceiver<any>> = TVR extends Transceiver<infer S> ? S
322
320
 
323
321
  declare function createMutableAtom<T extends Transceiver<any>, J extends Json.Serializable>(options: MutableAtomOptions<T, J>, family: FamilyMetadata | undefined, store: Store): MutableAtomToken<T, J>;
324
322
 
325
- declare function createMutableAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends string>(options: MutableAtomFamilyOptions<T, J, K>, store: Store): MutableAtomFamily<T, J, K>;
323
+ declare function createMutableAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends string>(options: MutableAtomFamilyOptions<T, J, K>, store: Store, internalRoles?: string[]): MutableAtomFamilyToken<T, J, K>;
326
324
 
327
325
  declare const getJsonFamily: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable, Key extends string>(mutableAtomFamily: MutableAtomFamilyToken<Core, SerializableCore, Key>, store: Store) => WritableSelectorFamily<SerializableCore, Key>;
328
326
 
329
327
  declare const getJsonToken: <Core extends Transceiver<any>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>, store: Store) => WritableSelectorToken<SerializableCore>;
330
328
 
329
+ declare const getUpdateFamily: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable, Key extends string>(mutableAtomFamily: MutableAtomFamilyToken<Core, SerializableCore, Key>, store: Store) => AtomFamily<Signal<Core>, Key>;
330
+
331
331
  declare const getUpdateToken: <Core extends Transceiver<any>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => RegularAtomToken<Signal<Core>>;
332
332
 
333
333
  /**
@@ -392,15 +392,15 @@ declare function cacheValue<T extends Promise<any>>(key: string, value: T, subje
392
392
  declare const readCachedValue: <T>(token: ReadableState<any>, target: Store) => T;
393
393
  declare const evictCachedValue: (key: string, target: Store) => void;
394
394
 
395
- declare function createAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(options: MutableAtomFamilyOptions<T, J, K>, store: Store): MutableAtomFamily<T, J, K>;
396
- declare function createAtomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>, store: Store): RegularAtomFamily<T, K>;
395
+ declare function createAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(options: MutableAtomFamilyOptions<T, J, K>, store: Store): MutableAtomFamilyToken<T, J, K>;
396
+ declare function createAtomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>, store: Store): RegularAtomFamilyToken<T, K>;
397
397
 
398
- declare function createReadonlySelectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamily<T, K>;
398
+ declare function createReadonlySelectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store, internalRoles?: string[]): ReadonlySelectorFamilyToken<T, K>;
399
399
 
400
- declare function createRegularAtomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>, store: Store): RegularAtomFamily<T, K>;
400
+ declare function createRegularAtomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>, store: Store, internalRoles?: string[]): RegularAtomFamilyToken<T, K>;
401
401
 
402
- declare function createSelectorFamily<T, K extends Canonical>(options: WritableSelectorFamilyOptions<T, K>, store: Store): WritableSelectorFamily<T, K>;
403
- declare function createSelectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamily<T, K>;
402
+ declare function createSelectorFamily<T, K extends Canonical>(options: WritableSelectorFamilyOptions<T, K>, store: Store): WritableSelectorFamilyToken<T, K>;
403
+ declare function createSelectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamilyToken<T, K>;
404
404
 
405
405
  declare function disposeFromStore(token: MoleculeToken<any> | ReadableToken<any>, store: Store): void;
406
406
  declare function disposeFromStore<K extends Canonical>(token: ReadableFamilyToken<any, K>, key: K, store: Store): void;
@@ -504,18 +504,20 @@ declare class Molecule<M extends MoleculeConstructor> implements MoleculeToken<M
504
504
  constructor(ctx: Molecule<any> | Molecule<any>[] | undefined, key: MoleculeKey<M>, family?: MoleculeFamilyToken<M>);
505
505
  }
506
506
 
507
- declare function growMoleculeInStore<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(molecule: Molecule<any>, family: MutableAtomFamily<T, J, K>, store: Store): MutableAtomToken<T, J>;
508
- declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: RegularAtomFamily<T, K>, store: Store): RegularAtomToken<T>;
509
- declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: AtomFamily<T, K>, store: Store): AtomToken<T>;
510
- declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: WritableSelectorFamily<T, K>, store: Store): WritableSelectorToken<T>;
511
- declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: ReadonlySelectorFamily<T, K>, store: Store): ReadonlySelectorToken<T>;
512
- declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: SelectorFamily<T, K>, store: Store): SelectorToken<T>;
513
- declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: WritableFamily<T, K>, store: Store): WritableToken<T>;
514
- declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: ReadableFamily<T, K>, store: Store): ReadableToken<T>;
507
+ declare function growMoleculeInStore<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(molecule: Molecule<any>, family: MutableAtomFamilyToken<T, J, K>, store: Store): MutableAtomToken<T, J>;
508
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: RegularAtomFamilyToken<T, K>, store: Store): RegularAtomToken<T>;
509
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: AtomFamilyToken<T, K>, store: Store): AtomToken<T>;
510
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: WritableSelectorFamilyToken<T, K>, store: Store): WritableSelectorToken<T>;
511
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: ReadonlySelectorFamilyToken<T, K>, store: Store): ReadonlySelectorToken<T>;
512
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: SelectorFamilyToken<T, K>, store: Store): SelectorToken<T>;
513
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: WritableFamilyToken<T, K>, store: Store): WritableToken<T>;
514
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: ReadableFamilyToken<T, K>, store: Store): ReadableToken<T>;
515
515
 
516
516
  declare function makeMoleculeInStore<M extends MoleculeConstructor>(store: Store, context: MoleculeToken<M> | MoleculeToken<M>[], familyToken: MoleculeFamilyToken<M>, key: MoleculeKey<M>, ...params: MoleculeParams<M>): MoleculeToken<M>;
517
517
 
518
518
  type AtomIOToken = MoleculeFamilyToken<any> | MoleculeToken<any> | ReadableFamilyToken<any, any> | ReadableToken<any> | TimelineToken<any> | TransactionToken<any>;
519
+ declare function prettyPrintTokenType(token: AtomIOToken): string;
520
+
519
521
  declare class NotFoundError extends Error {
520
522
  constructor(token: AtomIOToken, store: Store);
521
523
  constructor(familyToken: AtomIOToken, key: Json.Serializable, store: Store);
@@ -587,5 +589,33 @@ type ReadonlySelector<T> = AtomIOState & {
587
589
  type Selector<T> = ReadonlySelector<T> | WritableSelector<T>;
588
590
  type WritableState<T> = Atom<T> | WritableSelector<T>;
589
591
  type ReadableState<T> = Atom<T> | Selector<T>;
592
+ type RegularAtomFamily<T, K extends Canonical> = RegularAtomFamilyToken<T, K> & {
593
+ (key: K): RegularAtomToken<T>;
594
+ subject: Subject<StateCreation<AtomToken<T>> | StateDisposal<AtomToken<T>>>;
595
+ install: (store: Store) => void;
596
+ internalRoles: string[] | undefined;
597
+ };
598
+ type MutableAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = JsonInterface<T, J> & MutableAtomFamilyToken<T, J, K> & {
599
+ (key: K): MutableAtomToken<T, J>;
600
+ subject: Subject<StateCreation<MutableAtomToken<T, J>> | StateDisposal<MutableAtomToken<T, J>>>;
601
+ install: (store: Store) => void;
602
+ internalRoles: string[] | undefined;
603
+ };
604
+ type AtomFamily<T, K extends Canonical = Canonical> = MutableAtomFamily<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamily<T, K>;
605
+ type WritableSelectorFamily<T, K extends Canonical> = WritableSelectorFamilyToken<T, K> & ((key: K) => WritableSelectorToken<T>) & {
606
+ default: (key: K) => T;
607
+ subject: Subject<StateCreation<WritableSelectorToken<T>> | StateDisposal<WritableSelectorToken<T>>>;
608
+ install: (store: Store) => void;
609
+ internalRoles: string[] | undefined;
610
+ };
611
+ type ReadonlySelectorFamily<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> & ((key: K) => ReadonlySelectorToken<T>) & {
612
+ default: (key: K) => T;
613
+ subject: Subject<StateCreation<ReadonlySelectorToken<T>> | StateDisposal<ReadonlySelectorToken<T>>>;
614
+ install: (store: Store) => void;
615
+ internalRoles: string[] | undefined;
616
+ };
617
+ type SelectorFamily<T, K extends Canonical> = ReadonlySelectorFamily<T, K> | WritableSelectorFamily<T, K>;
618
+ type WritableFamily<T, K extends Canonical> = AtomFamily<T, K> | WritableSelectorFamily<T, K>;
619
+ type ReadableFamily<T, K extends Canonical> = AtomFamily<T, K> | SelectorFamily<T, K>;
590
620
 
591
- export { type Atom, type AtomIOState, type AtomKey, type ChildStore, type EnvironmentData, FamilyTracker, type Flat, type Func, Future, IMPLICIT, LazyMap, type Lineage, type Modify, Molecule, type MutableAtom, NotFoundError, type OperationProgress, type Range, type ReadableState, type ReadonlySelector, type ReadonlySelectorKey, type RegularAtom, type RootStore, type Selector, type SelectorKey, type Signal, type StateKey, StatefulSubject, Store, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineMoleculeCreation, type TimelineMoleculeDisposal, type TimelineSelectorUpdate, type TimelineStateCreation, type TimelineStateDisposal, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionEpoch, type TransactionPhase, type TransactionProgress, type Transceiver, type TransceiverMode, type Withdrawable, type WritableSelector, type WritableState, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, readCachedValue, readOrComputeValue, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw };
621
+ export { type Atom, type AtomFamily, type AtomIOState, type AtomIOToken, type AtomKey, type ChildStore, type EnvironmentData, FamilyTracker, type Flat, type Func, Future, IMPLICIT, LazyMap, type Lineage, type Modify, Molecule, type MutableAtom, type MutableAtomFamily, NotFoundError, type OperationProgress, type Range, type ReadableFamily, type ReadableState, type ReadonlySelector, type ReadonlySelectorFamily, type ReadonlySelectorKey, type RegularAtom, type RegularAtomFamily, type RootStore, type Selector, type SelectorFamily, type SelectorKey, type Signal, type StateKey, StatefulSubject, Store, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineMoleculeCreation, type TimelineMoleculeDisposal, type TimelineSelectorUpdate, type TimelineStateCreation, type TimelineStateDisposal, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionEpoch, type TransactionPhase, type TransactionProgress, type Transceiver, type TransceiverMode, type Withdrawable, type WritableFamily, type WritableSelector, type WritableSelectorFamily, type WritableState, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, prettyPrintTokenType, readCachedValue, readOrComputeValue, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw };