atom.io 0.27.1 → 0.27.3

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 (45) 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-ETCFHO7J.js +3087 -0
  7. package/dist/index.d.ts +4 -31
  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 +52 -19
  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 +38 -29
  14. package/internal/src/families/create-regular-atom-family.ts +40 -31
  15. package/internal/src/families/create-selector-family.ts +6 -5
  16. package/internal/src/families/create-writable-selector-family.ts +39 -30
  17. package/internal/src/families/throw-in-case-of-conflicting-family.ts +18 -0
  18. package/internal/src/index.ts +76 -2
  19. package/internal/src/ingest-updates/ingest-creation-disposal.ts +0 -1
  20. package/internal/src/ingest-updates/ingest-selector-update.ts +1 -1
  21. package/internal/src/molecule/dispose-molecule.ts +0 -1
  22. package/internal/src/molecule/grow-molecule-in-store.ts +27 -17
  23. package/internal/src/mutable/create-mutable-atom-family.ts +41 -32
  24. package/internal/src/mutable/get-json-family.ts +2 -1
  25. package/internal/src/mutable/get-update-family.ts +23 -0
  26. package/internal/src/mutable/index.ts +1 -0
  27. package/internal/src/mutable/tracker-family.ts +5 -3
  28. package/internal/src/not-found-error.ts +2 -35
  29. package/internal/src/pretty-print.ts +37 -0
  30. package/internal/src/store/store.ts +10 -4
  31. package/internal/src/store/withdraw.ts +8 -8
  32. package/introspection/dist/index.js +3 -3
  33. package/introspection/src/attach-timeline-family.ts +1 -1
  34. package/introspection/src/attach-transaction-logs.ts +2 -2
  35. package/json/dist/index.d.ts +2 -2
  36. package/json/dist/index.js +16 -12
  37. package/json/src/select-json-family.ts +21 -18
  38. package/package.json +4 -4
  39. package/realtime-server/dist/index.d.ts +1 -1
  40. package/src/atom.ts +2 -32
  41. package/src/get-state.ts +2 -2
  42. package/src/index.ts +1 -10
  43. package/src/selector.ts +1 -26
  44. package/src/set-state.ts +2 -2
  45. 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>;
@@ -257,7 +232,7 @@ declare function disposeState<M extends MoleculeConstructor>(token: MoleculeFami
257
232
 
258
233
  declare function getState<T>(token: ReadableToken<T>): T;
259
234
  declare function getState<M extends MoleculeConstructor>(token: MoleculeToken<M>): InstanceType<M>;
260
- declare function getState<T, K extends Canonical>(token: ReadableFamilyToken<T, K>, key: K): T;
235
+ declare function getState<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key): T;
261
236
  declare function getState<M extends MoleculeConstructor>(token: MoleculeFamilyToken<M>, key: Canonical): InstanceType<M>;
262
237
 
263
238
  declare const LoggerIconDictionary: {
@@ -347,7 +322,7 @@ declare function setState<T, New extends T>(token: WritableToken<T>, value: New
347
322
  * @param value - The new value of the state.
348
323
  * @overload Streamlined
349
324
  */
350
- declare function setState<T, K extends Canonical, New extends T>(token: WritableFamilyToken<T, K>, key: K, value: New | ((oldValue: T) => New)): void;
325
+ declare function setState<T, K extends Canonical, New extends T, Key extends K>(token: WritableFamilyToken<T, K>, key: Key, value: New | ((oldValue: T) => New)): void;
351
326
 
352
327
  declare class Silo {
353
328
  store: Store;
@@ -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, MoleculeToken, MoleculeFamily, MoleculeFamilyToken, ReadableToken, TimelineManageable, StateUpdate, TokenType, FamilyMetadata, StateCreation, StateDisposal, MoleculeConstructor, 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
 
@@ -245,7 +245,7 @@ declare class Store implements Lineage {
245
245
  source: string;
246
246
  }>;
247
247
  trackers: Map<string, Tracker<Transceiver<any>>>;
248
- families: Map<string, WritableSelectorFamily<any, any> | MutableAtomFamily<any, any, any> | RegularAtomFamily<any, any> | ReadonlySelectorFamily<any, any>>;
248
+ families: Map<string, MutableAtomFamily<any, any, any> | ReadonlySelectorFamily<any, any> | RegularAtomFamily<any, any> | WritableSelectorFamily<any, any>>;
249
249
  transactions: Map<string, Transaction<Func>>;
250
250
  transactionMeta: TransactionEpoch | TransactionProgress<Func>;
251
251
  timelines: Map<string, Timeline<any>>;
@@ -254,7 +254,7 @@ declare class Store implements Lineage {
254
254
  }>;
255
255
  molecules: Map<string, Molecule<any>>;
256
256
  moleculeFamilies: Map<string, Flat<atom_io.MoleculeFamilyToken<any> & {
257
- subject: Subject<atom_io.MoleculeDisposal | atom_io.MoleculeCreation<any>>;
257
+ subject: Subject<atom_io.MoleculeCreation<any> | atom_io.MoleculeDisposal>;
258
258
  dependsOn: `all` | `any`;
259
259
  new: any;
260
260
  }>>;
@@ -322,12 +322,14 @@ type Signal<TVR extends Transceiver<any>> = TVR extends Transceiver<infer S> ? S
322
322
 
323
323
  declare function createMutableAtom<T extends Transceiver<any>, J extends Json.Serializable>(options: MutableAtomOptions<T, J>, family: FamilyMetadata | undefined, store: Store): MutableAtomToken<T, J>;
324
324
 
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>;
325
+ 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
326
 
327
327
  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
328
 
329
329
  declare const getJsonToken: <Core extends Transceiver<any>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>, store: Store) => WritableSelectorToken<SerializableCore>;
330
330
 
331
+ 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>;
332
+
331
333
  declare const getUpdateToken: <Core extends Transceiver<any>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => RegularAtomToken<Signal<Core>>;
332
334
 
333
335
  /**
@@ -392,15 +394,15 @@ declare function cacheValue<T extends Promise<any>>(key: string, value: T, subje
392
394
  declare const readCachedValue: <T>(token: ReadableState<any>, target: Store) => T;
393
395
  declare const evictCachedValue: (key: string, target: Store) => void;
394
396
 
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>;
397
+ 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>;
398
+ declare function createAtomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>, store: Store): RegularAtomFamilyToken<T, K>;
397
399
 
398
- declare function createReadonlySelectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamily<T, K>;
400
+ declare function createReadonlySelectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store, internalRoles?: string[]): ReadonlySelectorFamilyToken<T, K>;
399
401
 
400
- declare function createRegularAtomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>, store: Store): RegularAtomFamily<T, K>;
402
+ declare function createRegularAtomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>, store: Store, internalRoles?: string[]): RegularAtomFamilyToken<T, K>;
401
403
 
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>;
404
+ declare function createSelectorFamily<T, K extends Canonical>(options: WritableSelectorFamilyOptions<T, K>, store: Store): WritableSelectorFamilyToken<T, K>;
405
+ declare function createSelectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamilyToken<T, K>;
404
406
 
405
407
  declare function disposeFromStore(token: MoleculeToken<any> | ReadableToken<any>, store: Store): void;
406
408
  declare function disposeFromStore<K extends Canonical>(token: ReadableFamilyToken<any, K>, key: K, store: Store): void;
@@ -504,18 +506,20 @@ declare class Molecule<M extends MoleculeConstructor> implements MoleculeToken<M
504
506
  constructor(ctx: Molecule<any> | Molecule<any>[] | undefined, key: MoleculeKey<M>, family?: MoleculeFamilyToken<M>);
505
507
  }
506
508
 
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>;
509
+ 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>;
510
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: RegularAtomFamilyToken<T, K>, store: Store): RegularAtomToken<T>;
511
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: AtomFamilyToken<T, K>, store: Store): AtomToken<T>;
512
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: WritableSelectorFamilyToken<T, K>, store: Store): WritableSelectorToken<T>;
513
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: ReadonlySelectorFamilyToken<T, K>, store: Store): ReadonlySelectorToken<T>;
514
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: SelectorFamilyToken<T, K>, store: Store): SelectorToken<T>;
515
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: WritableFamilyToken<T, K>, store: Store): WritableToken<T>;
516
+ declare function growMoleculeInStore<T, K extends Canonical>(molecule: Molecule<any>, family: ReadableFamilyToken<T, K>, store: Store): ReadableToken<T>;
515
517
 
516
518
  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
519
 
518
520
  type AtomIOToken = MoleculeFamilyToken<any> | MoleculeToken<any> | ReadableFamilyToken<any, any> | ReadableToken<any> | TimelineToken<any> | TransactionToken<any>;
521
+ declare function prettyPrintTokenType(token: AtomIOToken): string;
522
+
519
523
  declare class NotFoundError extends Error {
520
524
  constructor(token: AtomIOToken, store: Store);
521
525
  constructor(familyToken: AtomIOToken, key: Json.Serializable, store: Store);
@@ -587,5 +591,34 @@ type ReadonlySelector<T> = AtomIOState & {
587
591
  type Selector<T> = ReadonlySelector<T> | WritableSelector<T>;
588
592
  type WritableState<T> = Atom<T> | WritableSelector<T>;
589
593
  type ReadableState<T> = Atom<T> | Selector<T>;
594
+ type RegularAtomFamily<T, K extends Canonical> = RegularAtomFamilyToken<T, K> & {
595
+ (key: K): RegularAtomToken<T>;
596
+ subject: Subject<StateCreation<AtomToken<T>> | StateDisposal<AtomToken<T>>>;
597
+ install: (store: Store) => void;
598
+ internalRoles: string[] | undefined;
599
+ };
600
+ type MutableAtomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = JsonInterface<T, J> & MutableAtomFamilyToken<T, J, K> & {
601
+ (key: K): MutableAtomToken<T, J>;
602
+ subject: Subject<StateCreation<MutableAtomToken<T, J>> | StateDisposal<MutableAtomToken<T, J>>>;
603
+ install: (store: Store) => void;
604
+ internalRoles: string[] | undefined;
605
+ };
606
+ type AtomFamily<T, K extends Canonical = Canonical> = MutableAtomFamily<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamily<T, K>;
607
+ type WritableSelectorFamily<T, K extends Canonical> = WritableSelectorFamilyToken<T, K> & {
608
+ (key: K): WritableSelectorToken<T>;
609
+ subject: Subject<StateCreation<WritableSelectorToken<T>> | StateDisposal<WritableSelectorToken<T>>>;
610
+ install: (store: Store) => void;
611
+ internalRoles: string[] | undefined;
612
+ };
613
+ type ReadonlySelectorFamily<T, K extends Canonical> = ((key: K) => ReadonlySelectorToken<T>) & {
614
+ key: string;
615
+ type: `readonly_selector_family`;
616
+ subject: Subject<StateCreation<ReadonlySelectorToken<T>> | StateDisposal<ReadonlySelectorToken<T>>>;
617
+ install: (store: Store) => void;
618
+ internalRoles: string[] | undefined;
619
+ };
620
+ type SelectorFamily<T, K extends Canonical> = ReadonlySelectorFamily<T, K> | WritableSelectorFamily<T, K>;
621
+ type WritableFamily<T, K extends Canonical> = AtomFamily<T, K> | WritableSelectorFamily<T, K>;
622
+ type ReadableFamily<T, K extends Canonical> = AtomFamily<T, K> | SelectorFamily<T, K>;
590
623
 
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 };
624
+ 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 };