atom.io 0.14.0 → 0.14.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 (133) hide show
  1. package/data/dist/index.cjs +1421 -52
  2. package/data/dist/index.cjs.map +1 -1
  3. package/data/dist/index.d.cts +317 -16
  4. package/data/dist/index.js +10 -267
  5. package/data/dist/index.js.map +1 -1
  6. package/data/package.json +5 -5
  7. package/data/src/join.ts +3 -3
  8. package/dist/chunk-C4YZZNRH.js +67 -0
  9. package/dist/chunk-C4YZZNRH.js.map +1 -0
  10. package/dist/chunk-CWKKQKVQ.js +68 -0
  11. package/dist/chunk-CWKKQKVQ.js.map +1 -0
  12. package/dist/chunk-GMN5KH6A.js +309 -0
  13. package/dist/chunk-GMN5KH6A.js.map +1 -0
  14. package/dist/chunk-N7ADBQJG.js +176 -0
  15. package/dist/chunk-N7ADBQJG.js.map +1 -0
  16. package/dist/chunk-NYCVSXQB.js +181 -0
  17. package/dist/chunk-NYCVSXQB.js.map +1 -0
  18. package/dist/chunk-PURABO5G.js +2581 -0
  19. package/dist/chunk-PURABO5G.js.map +1 -0
  20. package/dist/index.cjs +2330 -55
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +272 -22
  23. package/dist/index.js +1 -152
  24. package/dist/index.js.map +1 -1
  25. package/dist/metafile-cjs.json +1 -1
  26. package/internal/dist/index.cjs +299 -106
  27. package/internal/dist/index.cjs.map +1 -1
  28. package/internal/dist/index.d.cts +231 -30
  29. package/internal/dist/index.js +1 -2240
  30. package/internal/dist/index.js.map +1 -1
  31. package/internal/package.json +5 -5
  32. package/internal/src/atom/create-atom.ts +3 -1
  33. package/internal/src/families/create-atom-family.ts +3 -4
  34. package/internal/src/mutable/get-update-family.ts +23 -0
  35. package/internal/src/mutable/index.ts +1 -4
  36. package/internal/src/mutable/is-mutable.ts +44 -0
  37. package/internal/src/mutable/tracker.ts +9 -2
  38. package/internal/src/subject.ts +2 -1
  39. package/internal/src/timeline/add-atom-to-timeline.ts +10 -1
  40. package/internal/src/timeline/create-timeline.ts +44 -16
  41. package/introspection/dist/index.cjs +1566 -46
  42. package/introspection/dist/index.cjs.map +1 -1
  43. package/introspection/dist/index.d.cts +376 -4
  44. package/introspection/dist/index.js +2 -316
  45. package/introspection/dist/index.js.map +1 -1
  46. package/introspection/package.json +5 -5
  47. package/json/dist/index.cjs +1505 -8
  48. package/json/dist/index.cjs.map +1 -1
  49. package/json/dist/index.d.cts +373 -7
  50. package/json/dist/index.js +1 -76
  51. package/json/dist/index.js.map +1 -1
  52. package/json/package.json +5 -5
  53. package/package.json +5 -4
  54. package/react/dist/index.cjs +1549 -14
  55. package/react/dist/index.cjs.map +1 -1
  56. package/react/dist/index.d.cts +377 -4
  57. package/react/dist/index.js +2 -68
  58. package/react/dist/index.js.map +1 -1
  59. package/react/package.json +5 -5
  60. package/react-devtools/dist/index.cjs +2216 -198
  61. package/react-devtools/dist/index.cjs.map +1 -1
  62. package/react-devtools/dist/index.css +2 -2
  63. package/react-devtools/dist/index.d.cts +150 -24
  64. package/react-devtools/dist/index.js +57 -297
  65. package/react-devtools/dist/index.js.map +1 -1
  66. package/react-devtools/package.json +5 -5
  67. package/realtime-client/dist/index.cjs +1530 -35
  68. package/realtime-client/dist/index.cjs.map +1 -1
  69. package/realtime-client/dist/index.d.cts +384 -12
  70. package/realtime-client/dist/index.js +2 -165
  71. package/realtime-client/dist/index.js.map +1 -1
  72. package/realtime-client/package.json +5 -5
  73. package/realtime-react/dist/index.cjs +1727 -35
  74. package/realtime-react/dist/index.cjs.map +1 -1
  75. package/realtime-react/dist/index.d.cts +49 -9
  76. package/realtime-react/dist/index.js +4 -66
  77. package/realtime-react/dist/index.js.map +1 -1
  78. package/realtime-react/package.json +5 -5
  79. package/realtime-server/dist/index.cjs +1549 -58
  80. package/realtime-server/dist/index.cjs.map +1 -1
  81. package/realtime-server/dist/index.d.cts +394 -11
  82. package/realtime-server/dist/index.js +27 -21
  83. package/realtime-server/dist/index.js.map +1 -1
  84. package/realtime-server/package.json +6 -6
  85. package/realtime-testing/dist/index.cjs +2377 -16
  86. package/realtime-testing/dist/index.cjs.map +1 -1
  87. package/realtime-testing/dist/index.d.cts +489 -3
  88. package/realtime-testing/dist/index.js +10 -31
  89. package/realtime-testing/dist/index.js.map +1 -1
  90. package/realtime-testing/package.json +5 -5
  91. package/src/atom.ts +3 -1
  92. package/transceivers/set-rtx/dist/index.cjs +32 -10
  93. package/transceivers/set-rtx/dist/index.cjs.map +1 -1
  94. package/transceivers/set-rtx/dist/index.d.cts +29 -3
  95. package/transceivers/set-rtx/dist/index.js +2 -3
  96. package/transceivers/set-rtx/dist/index.js.map +1 -1
  97. package/transceivers/set-rtx/package.json +6 -6
  98. package/data/dist/index.d.ts +0 -158
  99. package/data/dist/metafile-cjs.json +0 -1
  100. package/data/dist/metafile-esm.json +0 -1
  101. package/dist/index.d.ts +0 -243
  102. package/dist/metafile-esm.json +0 -1
  103. package/internal/dist/index.d.ts +0 -421
  104. package/internal/dist/metafile-cjs.json +0 -1
  105. package/internal/dist/metafile-esm.json +0 -1
  106. package/internal/src/mutable/is-atom-token-mutable.ts +0 -7
  107. package/introspection/dist/index.d.ts +0 -24
  108. package/introspection/dist/metafile-cjs.json +0 -1
  109. package/introspection/dist/metafile-esm.json +0 -1
  110. package/json/dist/index.d.ts +0 -51
  111. package/json/dist/metafile-cjs.json +0 -1
  112. package/json/dist/metafile-esm.json +0 -1
  113. package/react/dist/index.d.ts +0 -23
  114. package/react/dist/metafile-cjs.json +0 -1
  115. package/react/dist/metafile-esm.json +0 -1
  116. package/react-devtools/dist/index.d.ts +0 -341
  117. package/react-devtools/dist/metafile-cjs.json +0 -1
  118. package/react-devtools/dist/metafile-esm.json +0 -1
  119. package/realtime-client/dist/index.d.ts +0 -22
  120. package/realtime-client/dist/metafile-cjs.json +0 -1
  121. package/realtime-client/dist/metafile-esm.json +0 -1
  122. package/realtime-react/dist/index.d.ts +0 -27
  123. package/realtime-react/dist/metafile-cjs.json +0 -1
  124. package/realtime-react/dist/metafile-esm.json +0 -1
  125. package/realtime-server/dist/index.d.ts +0 -25
  126. package/realtime-server/dist/metafile-cjs.json +0 -1
  127. package/realtime-server/dist/metafile-esm.json +0 -1
  128. package/realtime-testing/dist/index.d.ts +0 -49
  129. package/realtime-testing/dist/metafile-cjs.json +0 -1
  130. package/realtime-testing/dist/metafile-esm.json +0 -1
  131. package/transceivers/set-rtx/dist/index.d.ts +0 -40
  132. package/transceivers/set-rtx/dist/metafile-cjs.json +0 -1
  133. package/transceivers/set-rtx/dist/metafile-esm.json +0 -1
@@ -1,6 +1,214 @@
1
- import { FamilyMetadata, SelectorOptions, SelectorToken, ReadonlySelectorOptions, ReadonlySelectorToken, Transactors, StateToken, ƒn, TransactionUpdate, TransactionOptions, TransactionToken, AtomToken, MutableAtomOptions, MutableAtomToken, MutableAtomFamilyOptions, MutableAtomFamily, SelectorFamily, AtomFamily, StateUpdate, TimelineUpdate, TimelineOptions, TimelineToken, ReadonlySelectorFamily, AtomIOLogger, Logger, AtomOptions, AtomFamilyOptions, ReadonlySelectorFamilyOptions, SelectorFamilyOptions, UpdateHandler, TransactionUpdateHandler } from 'atom.io';
2
- import { Json } from 'atom.io/json';
3
- import { Store as Store$1 } from 'atom.io/internal';
1
+ type JsonInterface<T, J extends Serializable = Serializable> = {
2
+ toJson: (t: T) => J;
3
+ fromJson: (json: J) => T;
4
+ };
5
+
6
+ type primitive = boolean | number | string | null;
7
+
8
+ type Serializable = primitive | Readonly<{
9
+ [key: string]: Serializable;
10
+ }> | ReadonlyArray<Serializable>;
11
+ type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
12
+
13
+ type Effectors<T> = {
14
+ setSelf: <V extends T>(next: V | ((oldValue: T) => V)) => void;
15
+ onSet: (callback: (options: {
16
+ newValue: T;
17
+ oldValue: T;
18
+ }) => void) => void;
19
+ };
20
+ type AtomEffect<T> = (tools: Effectors<T>) => (() => void) | void;
21
+ type AtomOptions<T> = {
22
+ key: string;
23
+ default: T | (() => T);
24
+ effects?: AtomEffect<T>[];
25
+ };
26
+ type MutableAtomOptions<T extends Transceiver<any>, J extends Serializable> = JsonInterface<T, J> & Omit<AtomOptions<T>, `default`> & {
27
+ default: () => T;
28
+ mutable: true;
29
+ };
30
+ type AtomFamilyOptions<T, K extends Serializable> = {
31
+ key: string;
32
+ default: T | ((key: K) => T);
33
+ effects?: (key: K) => AtomEffect<T>[];
34
+ };
35
+ type AtomFamily<T, K extends Serializable = Serializable> = ((key: K) => AtomToken<T>) & {
36
+ key: string;
37
+ type: `atom_family`;
38
+ subject: Subject<AtomToken<T>>;
39
+ mutable?: boolean;
40
+ };
41
+ type MutableAtomFamilyOptions<T extends Transceiver<any>, J extends Serializable, K extends Serializable> = AtomFamilyOptions<T, K> & JsonInterface<T, J> & {
42
+ mutable: true;
43
+ };
44
+ type MutableAtomFamily<Core extends Transceiver<any>, SerializableCore extends Serializable, Key extends Serializable> = JsonInterface<Core, SerializableCore> & ((key: Key) => MutableAtomToken<Core, SerializableCore>) & {
45
+ key: `${string}`;
46
+ type: `atom_family`;
47
+ subject: Subject<MutableAtomToken<Core, SerializableCore>>;
48
+ mutable: true;
49
+ };
50
+
51
+ declare const LoggerIconDictionary: {
52
+ readonly "\u231B": "Timeline event fully captured";
53
+ readonly "\u23E9": "Timeline redo";
54
+ readonly "\u23EA": "Timeline undo";
55
+ readonly "\u23ED\uFE0F": "Transaction redo";
56
+ readonly "\u23EE\uFE0F": "Transaction undo";
57
+ readonly "\u23F3": "Timeline event partially captured";
58
+ readonly "\u23F9\uFE0F": "Time-travel complete";
59
+ readonly "\uD83D\uDC81": "Notice";
60
+ readonly "\uD83D\uDD04": "Realtime transaction synchronized";
61
+ readonly "\u2705": "Realtime transaction success";
62
+ readonly "\u2728": "Computation complete";
63
+ readonly "\u274C": "Conflict prevents attempted action";
64
+ readonly "\u2B55": "Operation start";
65
+ readonly "\uD83D\uDC1E": "Possible bug in AtomIO";
66
+ readonly "\uD83D\uDC40": "Subscription added";
67
+ readonly "\uD83D\uDC6A": "Family member added";
68
+ readonly "\uD83D\uDCC1": "Stow update";
69
+ readonly "\uD83D\uDCC3": "Copy mutable";
70
+ readonly "\uD83D\uDCD6": "Read state";
71
+ readonly "\uD83D\uDCDD": "Write state";
72
+ readonly "\uD83D\uDCE2": "Notify subscribers";
73
+ readonly "\uD83D\uDD0C": "Register dependency";
74
+ readonly "\uD83D\uDD0D": "Discover root";
75
+ readonly "\uD83D\uDD25": "Delete state";
76
+ readonly "\uD83D\uDD27": "Create mutable atom";
77
+ readonly "\uD83D\uDD28": "Create immutable atom";
78
+ readonly "\uD83D\uDD34": "Operation complete";
79
+ readonly "\uD83D\uDDD1": "Evict cached value";
80
+ readonly "\uD83D\uDCA5": "Caught";
81
+ readonly "\uD83D\uDE48": "Subscription canceled";
82
+ readonly "\uD83D\uDEC4": "Apply transaction";
83
+ readonly "\uD83D\uDEE0\uFE0F": "Install atom into store";
84
+ readonly "\uD83D\uDEEB": "Begin transaction";
85
+ readonly "\uD83D\uDEEC": "Complete transaction";
86
+ readonly "\uD83E\uDDEE": "Computing selector";
87
+ readonly "\uD83E\uDDF9": "Prepare to evict";
88
+ readonly "\uD83E\uDE82": "Abort transaction";
89
+ };
90
+ type LoggerIcon = keyof typeof LoggerIconDictionary;
91
+ declare const LOG_LEVELS: readonly ["info", "warn", "error"];
92
+ type LogLevel = (typeof LOG_LEVELS)[number];
93
+ type LogFn = (icon: LoggerIcon, tokenType: `atom` | `readonly_selector` | `selector` | `state` | `timeline` | `transaction` | `unknown`, tokenKey: string, message: string, ...rest: unknown[]) => void;
94
+ type LogFilter = (...params: Parameters<LogFn>) => boolean;
95
+ type Logger = Record<LogLevel, LogFn>;
96
+ declare class AtomIOLogger implements Logger {
97
+ logLevel: `error` | `info` | `warn` | null;
98
+ private readonly filter?;
99
+ private readonly logger;
100
+ constructor(logLevel: `error` | `info` | `warn` | null, filter?: LogFilter | undefined, logger?: Logger);
101
+ error: LogFn;
102
+ info: LogFn;
103
+ warn: LogFn;
104
+ }
105
+
106
+ type TransactionToken<_> = {
107
+ key: string;
108
+ type: `transaction`;
109
+ __brand?: _;
110
+ };
111
+ type TransactionUpdate<ƒ extends ƒn> = {
112
+ key: string;
113
+ updates: (KeyedStateUpdate<unknown> | TransactionUpdate<ƒn>)[];
114
+ params: Parameters<ƒ>;
115
+ output: ReturnType<ƒ>;
116
+ };
117
+ type Transactors = {
118
+ get: <S>(state: ReadonlySelectorToken<S> | StateToken<S>) => S;
119
+ set: <S>(state: StateToken<S>, newValue: S | ((oldValue: S) => S)) => void;
120
+ };
121
+ type ReadonlyTransactors = Pick<Transactors, `get`>;
122
+ type Read<ƒ extends ƒn> = (transactors: ReadonlyTransactors, ...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
123
+ type Write<ƒ extends ƒn> = (transactors: Transactors, ...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
124
+ type Act<ƒ extends ƒn> = (transactors: Transactors & {
125
+ run: typeof runTransaction;
126
+ }, ...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
127
+ type TransactionOptions<ƒ extends ƒn> = {
128
+ key: string;
129
+ do: Act<ƒ>;
130
+ };
131
+ declare const runTransaction: <ƒ extends ƒn>(token: TransactionToken<ƒ>, store?: Store) => (...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
132
+
133
+ type SelectorOptions<T> = {
134
+ key: string;
135
+ get: Read<() => T>;
136
+ set: Write<(newValue: T) => void>;
137
+ };
138
+ type ReadonlySelectorOptions<T> = {
139
+ key: string;
140
+ get: Read<() => T>;
141
+ };
142
+ type SelectorFamilyOptions<T, K extends Serializable> = {
143
+ key: string;
144
+ get: (key: K) => Read<() => T>;
145
+ set: (key: K) => Write<(newValue: T) => void>;
146
+ };
147
+ type ReadonlySelectorFamilyOptions<T, K extends Serializable> = {
148
+ key: string;
149
+ get: (key: K) => Read<() => T>;
150
+ };
151
+ type SelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => SelectorToken<T>) & {
152
+ key: string;
153
+ type: `selector_family`;
154
+ subject: Subject<SelectorToken<T>>;
155
+ };
156
+ type ReadonlySelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => ReadonlySelectorToken<T>) & {
157
+ key: string;
158
+ type: `readonly_selector_family`;
159
+ subject: Subject<ReadonlySelectorToken<T>>;
160
+ };
161
+
162
+ type StateUpdate<T> = {
163
+ newValue: T;
164
+ oldValue: T;
165
+ };
166
+ type KeyedStateUpdate<T> = StateUpdate<T> & {
167
+ key: string;
168
+ family?: FamilyMetadata;
169
+ };
170
+ type UpdateHandler<T> = (update: StateUpdate<T>) => void;
171
+ type TransactionUpdateHandler<ƒ extends ƒn> = (data: TransactionUpdate<ƒ>) => void;
172
+
173
+ type TimelineToken = {
174
+ key: string;
175
+ type: `timeline`;
176
+ };
177
+ type TimelineOptions = {
178
+ key: string;
179
+ atoms: (AtomFamily<any, any> | AtomToken<any>)[];
180
+ shouldCapture?: (update: TimelineUpdate, timeline: Timeline) => boolean;
181
+ };
182
+ type TimelineUpdate = TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate;
183
+
184
+ type ƒn = (...parameters: any[]) => any;
185
+ type AtomToken<_> = {
186
+ key: string;
187
+ type: `atom`;
188
+ family?: FamilyMetadata;
189
+ __brand?: _;
190
+ };
191
+ interface MutableAtomToken<T extends Transceiver<any>, J extends Serializable> extends AtomToken<T> {
192
+ __asJSON?: J;
193
+ __update?: T extends Transceiver<infer Update> ? Update : never;
194
+ }
195
+ type SelectorToken<_> = {
196
+ key: string;
197
+ type: `selector`;
198
+ family?: FamilyMetadata;
199
+ __brand?: _;
200
+ };
201
+ type StateToken<T> = AtomToken<T> | SelectorToken<T>;
202
+ type ReadonlySelectorToken<_> = {
203
+ key: string;
204
+ type: `readonly_selector`;
205
+ family?: FamilyMetadata;
206
+ __brand?: _;
207
+ };
208
+ type FamilyMetadata = {
209
+ key: string;
210
+ subKey: string;
211
+ };
4
212
 
5
213
  declare class Subject<T> {
6
214
  Subscriber: (value: T) => void;
@@ -104,13 +312,6 @@ declare function deposit<T>(state: ReadonlySelector<T>): ReadonlySelectorToken<T
104
312
  declare function deposit<T>(state: Transaction<T extends ƒn ? T : never>): TransactionToken<T>;
105
313
  declare function deposit<T>(state: Atom<T> | ReadonlySelector<T> | Selector<T>): ReadonlySelectorToken<T> | StateToken<T>;
106
314
 
107
- type primitive = boolean | number | string | null;
108
-
109
- type Serializable = primitive | Readonly<{
110
- [key: string]: Serializable;
111
- }> | ReadonlyArray<Serializable>;
112
- type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
113
-
114
315
  type Refinement<Unrefined, Refined extends Unrefined> = (value: Unrefined) => value is Refined;
115
316
  type Cardinality = `1:1` | `1:n` | `n:n`;
116
317
 
@@ -185,28 +386,28 @@ interface Lineage {
185
386
  declare function newest<T extends Lineage>(scion: T): T;
186
387
  declare function eldest<T extends Lineage>(scion: T): T;
187
388
 
188
- interface Transceiver<Signal extends Json.Serializable> {
389
+ interface Transceiver<Signal extends Serializable> {
189
390
  do: (update: Signal) => void;
190
391
  undo: (update: Signal) => void;
191
392
  subscribe: (key: string, fn: (update: Signal) => void) => () => void;
192
393
  cacheUpdateNumber: number;
193
394
  getUpdateNumber: (update: Signal) => number;
194
395
  }
195
- declare function isTransceiver(value: unknown): value is Transceiver<Json.Serializable>;
396
+ declare function isTransceiver(value: unknown): value is Transceiver<Serializable>;
196
397
  type TransceiverMode = `playback` | `record` | `transaction`;
197
398
  type Signal<TVR extends Transceiver<any>> = TVR extends Transceiver<infer Signal> ? Signal : never;
198
399
 
199
- declare function createMutableAtom<Core extends Transceiver<any>, SerializableCore extends Json.Serializable>(options: MutableAtomOptions<Core, SerializableCore>, store: Store): MutableAtomToken<Core, SerializableCore>;
400
+ declare function createMutableAtom<Core extends Transceiver<any>, SerializableCore extends Serializable>(options: MutableAtomOptions<Core, SerializableCore>, store: Store): MutableAtomToken<Core, SerializableCore>;
200
401
 
201
- declare function createMutableAtomFamily<Core extends Transceiver<any>, SerializableCore extends Json.Serializable, Key extends string>(options: MutableAtomFamilyOptions<Core, SerializableCore, Key>, store: Store): MutableAtomFamily<Core, SerializableCore, Key>;
402
+ declare function createMutableAtomFamily<Core extends Transceiver<any>, SerializableCore extends Serializable, Key extends string>(options: MutableAtomFamilyOptions<Core, SerializableCore, Key>, store: Store): MutableAtomFamily<Core, SerializableCore, Key>;
202
403
 
203
- declare const getJsonFamily: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable, Key extends string>(mutableAtomFamily: MutableAtomFamily<Core, SerializableCore, Key>, store: Store) => SelectorFamily<SerializableCore, Key>;
404
+ declare const getJsonFamily: <Core extends Transceiver<Serializable>, SerializableCore extends Serializable, Key extends string>(mutableAtomFamily: MutableAtomFamily<Core, SerializableCore, Key>, store: Store) => SelectorFamily<SerializableCore, Key>;
204
405
 
205
- declare const getJsonToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => SelectorToken<SerializableCore>;
406
+ declare const getJsonToken: <Core extends Transceiver<Serializable>, SerializableCore extends Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => SelectorToken<SerializableCore>;
206
407
 
207
- declare const getUpdateToken: <Core extends Transceiver<Json.Serializable>, SerializableCore extends Json.Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => AtomToken<Signal<Core>>;
408
+ declare const getUpdateToken: <Core extends Transceiver<Serializable>, SerializableCore extends Serializable>(mutableAtomToken: MutableAtomToken<Core, SerializableCore>) => AtomToken<Signal<Core>>;
208
409
 
209
- declare function isAtomTokenMutable(token: AtomToken<any>): token is MutableAtomToken<any, any>;
410
+ declare const getUpdateFamily: <Core extends Transceiver<Serializable>, SerializableCore extends Serializable, Key extends string>(mutableAtomFamily: MutableAtomFamily<Core, SerializableCore, Key>, store: Store) => AtomFamily<Signal<Core> | null, Key>;
210
411
 
211
412
  /**
212
413
  * @internal Give the tracker a transceiver state and a store, and it will
@@ -219,12 +420,12 @@ declare class Tracker<Mutable extends Transceiver<any>> {
219
420
  private unsubscribeFromInnerValue;
220
421
  private observeCore;
221
422
  private updateCore;
222
- mutableState: MutableAtomToken<Mutable, Json.Serializable>;
423
+ mutableState: MutableAtomToken<Mutable, Serializable>;
223
424
  latestUpdateState: AtomToken<typeof this.Update | null>;
224
- constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store: Store);
425
+ constructor(mutableState: MutableAtomToken<Mutable, Serializable>, store: Store);
225
426
  }
226
427
 
227
- declare class FamilyTracker<Core extends Transceiver<any>, FamilyMemberKey extends Json.Serializable> {
428
+ declare class FamilyTracker<Core extends Transceiver<any>, FamilyMemberKey extends Serializable> {
228
429
  private readonly Update;
229
430
  readonly findLatestUpdateState: AtomFamily<typeof this.Update | null, FamilyMemberKey>;
230
431
  readonly findMutableState: AtomFamily<Core, FamilyMemberKey>;
@@ -234,7 +435,6 @@ declare class FamilyTracker<Core extends Transceiver<any>, FamilyMemberKey exten
234
435
  interface MutableAtom<T> extends Atom<T> {
235
436
  mutable: true;
236
437
  }
237
- declare const isAtomMutable: <T>(atom: Atom<T>) => atom is MutableAtom<T>;
238
438
 
239
439
  type OperationProgress = {
240
440
  open: false;
@@ -342,6 +542,7 @@ declare function withdrawNewFamilyMember<T>(token: ReadonlySelectorToken<T> | St
342
542
  type Atom<T> = {
343
543
  key: string;
344
544
  type: `atom`;
545
+ mutable?: boolean;
345
546
  family?: FamilyMetadata;
346
547
  install: (store: Store) => void;
347
548
  subject: Subject<{
@@ -381,12 +582,12 @@ declare const readCachedValue: <T>(key: string, store: Store) => T;
381
582
  declare const isValueCached: (key: string, store: Store) => boolean;
382
583
  declare const evictCachedValue: (key: string, store: Store) => void;
383
584
 
384
- declare function createAtomFamily<T, K extends Json.Serializable>(options: AtomFamilyOptions<T, K>, store: Store): AtomFamily<T, K>;
585
+ declare function createAtomFamily<T, K extends Serializable>(options: AtomFamilyOptions<T, K>, store: Store): AtomFamily<T, K>;
385
586
 
386
- declare function createReadonlySelectorFamily<T, K extends Json.Serializable>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamily<T, K>;
587
+ declare function createReadonlySelectorFamily<T, K extends Serializable>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamily<T, K>;
387
588
 
388
- declare function createSelectorFamily<T, K extends Json.Serializable>(options: SelectorFamilyOptions<T, K>, store: Store): SelectorFamily<T, K>;
389
- declare function createSelectorFamily<T, K extends Json.Serializable>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamily<T, K>;
589
+ declare function createSelectorFamily<T, K extends Serializable>(options: SelectorFamilyOptions<T, K>, store: Store): SelectorFamily<T, K>;
590
+ declare function createSelectorFamily<T, K extends Serializable>(options: ReadonlySelectorFamilyOptions<T, K>, store: Store): ReadonlySelectorFamily<T, K>;
390
591
 
391
592
  declare class LazyMap<K, V> extends Map<K, V> {
392
593
  protected readonly source: Map<K, V>;
@@ -412,10 +613,10 @@ declare const setAtomOrSelector: <T>(state: Atom<T> | Selector<T>, value: T | ((
412
613
 
413
614
  declare const subscribeToRootAtoms: <T>(state: ReadonlySelector<T> | Selector<T>, store: Store) => (() => void)[] | null;
414
615
 
415
- declare function subscribeToState<T>(token: ReadonlySelectorToken<T> | StateToken<T>, handleUpdate: UpdateHandler<T>, key: string, store: Store$1): () => void;
616
+ declare function subscribeToState<T>(token: ReadonlySelectorToken<T> | StateToken<T>, handleUpdate: UpdateHandler<T>, key: string, store: Store): () => void;
416
617
 
417
- declare const subscribeToTimeline: (token: TimelineToken, handleUpdate: (update: TimelineUpdate | `redo` | `undo`) => void, key: string, store: Store$1) => (() => void);
618
+ declare const subscribeToTimeline: (token: TimelineToken, handleUpdate: (update: TimelineUpdate | `redo` | `undo`) => void, key: string, store: Store) => (() => void);
418
619
 
419
- declare const subscribeToTransaction: <ƒ extends ƒn>(token: TransactionToken<ƒ>, handleUpdate: TransactionUpdateHandler<ƒ>, key: string, store: Store$1) => (() => void);
620
+ declare const subscribeToTransaction: <ƒ extends ƒn>(token: TransactionToken<ƒ>, handleUpdate: TransactionUpdateHandler<ƒ>, key: string, store: Store) => (() => void);
420
621
 
421
- export { type Atom, type AtomKey, FamilyTracker, Future, IMPLICIT, LazyMap, type Lineage, type Modify, type MutableAtom, NotFoundError, type OperationProgress, type ReadonlySelector, type ReadonlySelectorKey, type Selector, type SelectorKey, type Signal, type StateKey, StatefulSubject, Store, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineSelectorUpdate, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionMeta, type TransactionPhase, type Transceiver, type TransceiverMode, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, createTimeline, createTransaction, deleteAtom, deleteSelector, deposit, eldest, evictCachedValue, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateToken, isAtomDefault, isAtomKey, isAtomMutable, isAtomTokenMutable, isDone, isReadonlySelectorKey, isSelectorDefault, isSelectorKey, isStateKey, isTransceiver, isValueCached, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, readCachedValue, readOrComputeValue, redoTransactionUpdate, registerSelector, setAtomOrSelector, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, undoTransactionUpdate, updateSelectorAtoms, withdraw, withdrawNewFamilyMember };
622
+ export { type Atom, type AtomKey, FamilyTracker, Future, IMPLICIT, LazyMap, type Lineage, type Modify, type MutableAtom, NotFoundError, type OperationProgress, type ReadonlySelector, type ReadonlySelectorKey, type Selector, type SelectorKey, type Signal, type StateKey, StatefulSubject, Store, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineSelectorUpdate, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionMeta, type TransactionPhase, type Transceiver, type TransceiverMode, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, createTimeline, createTransaction, deleteAtom, deleteSelector, deposit, eldest, evictCachedValue, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, isAtomDefault, isAtomKey, isDone, isReadonlySelectorKey, isSelectorDefault, isSelectorKey, isStateKey, isTransceiver, isValueCached, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, readCachedValue, readOrComputeValue, redoTransactionUpdate, registerSelector, setAtomOrSelector, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, undoTransactionUpdate, updateSelectorAtoms, withdraw, withdrawNewFamilyMember };