atom.io 0.18.1 → 0.18.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 (84) hide show
  1. package/data/dist/index.cjs +0 -2
  2. package/data/dist/index.js +2 -4
  3. package/dist/{chunk-JDUNWJFB.js → chunk-BWWVY5O5.js} +1 -3
  4. package/dist/{chunk-NYCVSXQB.js → chunk-CVBEVTM5.js} +0 -2
  5. package/dist/chunk-O47EQUM6.js +29 -0
  6. package/dist/{chunk-PZLG2HP3.js → chunk-U2IICNHQ.js} +0 -2
  7. package/dist/{chunk-XACXFU3B.js → chunk-VAE5OCKN.js} +0 -2
  8. package/dist/{chunk-NYTGCPHB.js → chunk-WX2NCOZR.js} +0 -2
  9. package/dist/{chunk-IZHOMSXA.js → chunk-YDOGCZ53.js} +0 -2
  10. package/dist/index.cjs +0 -2
  11. package/dist/index.js +1 -3
  12. package/internal/dist/index.cjs +46 -102
  13. package/internal/dist/index.d.ts +23 -23
  14. package/internal/dist/index.js +48 -104
  15. package/internal/src/families/create-regular-atom-family.ts +4 -4
  16. package/internal/src/get-state/get-from-store.ts +2 -5
  17. package/internal/src/mutable/create-mutable-atom-family.ts +4 -4
  18. package/internal/src/selector/register-selector.ts +3 -14
  19. package/internal/src/set-state/set-into-store.ts +2 -5
  20. package/internal/src/store/withdraw-new-family-member.ts +38 -28
  21. package/internal/src/store/withdraw.ts +20 -23
  22. package/internal/src/subscribe/subscribe-to-state.ts +2 -3
  23. package/internal/src/subscribe/subscribe-to-timeline.ts +0 -5
  24. package/internal/src/subscribe/subscribe-to-transaction.ts +0 -5
  25. package/internal/src/timeline/add-atom-to-timeline.ts +6 -15
  26. package/internal/src/timeline/create-timeline.ts +0 -27
  27. package/introspection/dist/index.cjs +0 -2
  28. package/introspection/dist/index.js +1 -3
  29. package/json/dist/index.cjs +0 -2
  30. package/json/dist/index.js +3 -5
  31. package/package.json +6 -5
  32. package/react/dist/index.cjs +2 -5
  33. package/react/dist/index.js +3 -6
  34. package/react/src/use-tl.ts +2 -2
  35. package/react-devtools/dist/index.cjs +1 -3
  36. package/react-devtools/dist/index.css +0 -1
  37. package/react-devtools/dist/index.js +4 -6
  38. package/realtime/dist/index.cjs +0 -2
  39. package/realtime/dist/index.js +1 -3
  40. package/realtime-client/dist/index.cjs +1 -3
  41. package/realtime-client/dist/index.js +15 -41
  42. package/realtime-react/dist/index.cjs +0 -2
  43. package/realtime-react/dist/index.js +2 -4
  44. package/realtime-server/dist/index.cjs +3 -5
  45. package/realtime-server/dist/index.js +4 -6
  46. package/realtime-server/src/ipc-sockets/parent-socket.ts +4 -3
  47. package/realtime-testing/dist/index.cjs +43 -7
  48. package/realtime-testing/dist/index.js +6 -9
  49. package/realtime-testing/src/setup-realtime-test.tsx +3 -5
  50. package/transceivers/set-rtx/dist/index.cjs +0 -2
  51. package/transceivers/set-rtx/dist/index.js +1 -3
  52. package/data/dist/index.cjs.map +0 -1
  53. package/data/dist/index.js.map +0 -1
  54. package/dist/chunk-IZHOMSXA.js.map +0 -1
  55. package/dist/chunk-JDUNWJFB.js.map +0 -1
  56. package/dist/chunk-NYCVSXQB.js.map +0 -1
  57. package/dist/chunk-NYTGCPHB.js.map +0 -1
  58. package/dist/chunk-PZLG2HP3.js.map +0 -1
  59. package/dist/chunk-XACXFU3B.js.map +0 -1
  60. package/dist/index.cjs.map +0 -1
  61. package/dist/index.js.map +0 -1
  62. package/internal/dist/index.cjs.map +0 -1
  63. package/internal/dist/index.js.map +0 -1
  64. package/introspection/dist/index.cjs.map +0 -1
  65. package/introspection/dist/index.js.map +0 -1
  66. package/json/dist/index.cjs.map +0 -1
  67. package/json/dist/index.js.map +0 -1
  68. package/react/dist/index.cjs.map +0 -1
  69. package/react/dist/index.js.map +0 -1
  70. package/react-devtools/dist/index.cjs.map +0 -1
  71. package/react-devtools/dist/index.css.map +0 -1
  72. package/react-devtools/dist/index.js.map +0 -1
  73. package/realtime/dist/index.cjs.map +0 -1
  74. package/realtime/dist/index.js.map +0 -1
  75. package/realtime-client/dist/index.cjs.map +0 -1
  76. package/realtime-client/dist/index.js.map +0 -1
  77. package/realtime-react/dist/index.cjs.map +0 -1
  78. package/realtime-react/dist/index.js.map +0 -1
  79. package/realtime-server/dist/index.cjs.map +0 -1
  80. package/realtime-server/dist/index.js.map +0 -1
  81. package/realtime-testing/dist/index.cjs.map +0 -1
  82. package/realtime-testing/dist/index.js.map +0 -1
  83. package/transceivers/set-rtx/dist/index.cjs.map +0 -1
  84. package/transceivers/set-rtx/dist/index.js.map +0 -1
@@ -671,5 +671,3 @@ exports.join = join;
671
671
  exports.struct = struct;
672
672
  exports.structFamily = structFamily;
673
673
  exports.until = until;
674
- //# sourceMappingURL=out.js.map
675
- //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
- import { Junction } from '../../dist/chunk-NYTGCPHB.js';
2
- import '../../dist/chunk-PZLG2HP3.js';
1
+ import { Junction } from '../../dist/chunk-WX2NCOZR.js';
2
+ import '../../dist/chunk-U2IICNHQ.js';
3
3
  import { createStandaloneSelector, findInStore, IMPLICIT, getFromStore, setIntoStore, createMutableAtomFamily, createRegularAtomFamily, createRegularAtom, createSelectorFamily, getJsonFamily } from 'atom.io/internal';
4
4
  import { dispose } from 'atom.io';
5
5
  import { SetRTX } from 'atom.io/transceivers/set-rtx';
@@ -405,5 +405,3 @@ function until(loadable, fallback) {
405
405
  }
406
406
 
407
407
  export { Join, dict, join, struct, structFamily, until };
408
- //# sourceMappingURL=out.js.map
409
- //# sourceMappingURL=index.js.map
@@ -11,8 +11,6 @@ var persistAtom = (storage) => ({ stringify, parse }) => (key) => ({ setSelf, on
11
11
  storage.setItem(key, stringify(newValue));
12
12
  });
13
13
  };
14
- var lazyLocalStorageEffect = persistAtom(localStorage)(JSON);
14
+ var lazyLocalStorageEffect = persistAtom(window.localStorage)(JSON);
15
15
 
16
16
  export { lazyLocalStorageEffect };
17
- //# sourceMappingURL=out.js.map
18
- //# sourceMappingURL=chunk-JDUNWJFB.js.map
@@ -177,5 +177,3 @@ var delve = (obj, path) => {
177
177
  };
178
178
 
179
179
  export { addTo, become, comprises, delve, doNothing, doesExtend, entriesToRecord, fallback, hasExactProperties, ifDefined, isArray, isEmptyArray, isEmptyObject, isModifier, isOneOf, isPlainObject, isRecord, map, mapObject, pipe, raiseError, recordToEntries, sprawl, treeShake };
180
- //# sourceMappingURL=out.js.map
181
- //# sourceMappingURL=chunk-NYCVSXQB.js.map
@@ -0,0 +1,29 @@
1
+ import { lazyLocalStorageEffect } from './chunk-BWWVY5O5.js';
2
+ import * as AtomIO from 'atom.io';
3
+
4
+ var myIdState__INTERNAL = AtomIO.atom({
5
+ key: `mySocketId__INTERNAL`,
6
+ default: void 0
7
+ });
8
+ var myIdState = AtomIO.selector({
9
+ key: `mySocketId`,
10
+ get: ({ get }) => get(myIdState__INTERNAL)
11
+ });
12
+ var usernameEffects = typeof window === `undefined` ? [] : [lazyLocalStorageEffect(`myUsername`)];
13
+ var myUsernameState = AtomIO.atom({
14
+ key: `myUsername`,
15
+ default: null,
16
+ effects: usernameEffects
17
+ });
18
+ var optimisticUpdateQueue = AtomIO.atom({
19
+ key: `updateQueue`,
20
+ default: []
21
+ });
22
+ var confirmedUpdateQueue = AtomIO.atom(
23
+ {
24
+ key: `serverConfirmedUpdateQueue`,
25
+ default: []
26
+ }
27
+ );
28
+
29
+ export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue };
@@ -32,5 +32,3 @@ var __objRest = (source, exclude) => {
32
32
  };
33
33
 
34
34
  export { __objRest, __restKey, __spreadProps, __spreadValues };
35
- //# sourceMappingURL=out.js.map
36
- //# sourceMappingURL=chunk-PZLG2HP3.js.map
@@ -42,5 +42,3 @@ var isPrimitive = (input) => {
42
42
  };
43
43
 
44
44
  export { JSON_DEFAULTS, JSON_TYPE_NAMES, isBoolean, isNull, isNumber, isPrimitive, isString, parseJson, stringSetJsonInterface, stringifyJson };
45
- //# sourceMappingURL=out.js.map
46
- //# sourceMappingURL=chunk-XACXFU3B.js.map
@@ -257,5 +257,3 @@ var Junction = class {
257
257
  };
258
258
 
259
259
  export { Junction };
260
- //# sourceMappingURL=out.js.map
261
- //# sourceMappingURL=chunk-NYTGCPHB.js.map
@@ -327,5 +327,3 @@ function syncContinuity(continuity, socket, store) {
327
327
  }
328
328
 
329
329
  export { syncContinuity };
330
- //# sourceMappingURL=out.js.map
331
- //# sourceMappingURL=chunk-IZHOMSXA.js.map
package/dist/index.cjs CHANGED
@@ -177,5 +177,3 @@ exports.subscribe = subscribe;
177
177
  exports.timeline = timeline;
178
178
  exports.transaction = transaction;
179
179
  exports.undo = undo;
180
- //# sourceMappingURL=out.js.map
181
- //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-PZLG2HP3.js';
1
+ import './chunk-U2IICNHQ.js';
2
2
  import * as Internal from 'atom.io/internal';
3
3
  import { createStandaloneAtom, IMPLICIT, createAtomFamily, findInStore, createStandaloneSelector, createSelectorFamily, Store, createTransaction, createTimeline, getFromStore, setIntoStore, timeTravel, subscribeToTimeline, subscribeToTransaction, subscribeToState, arbitrary, actUponStore } from 'atom.io/internal';
4
4
 
@@ -136,5 +136,3 @@ function belongsTo(family, unknownToken) {
136
136
  }
137
137
 
138
138
  export { AtomIOLogger, LOG_LEVELS, Silo, atom, atomFamily, belongsTo, dispose, findState, getState, isToken, redo, runTransaction, selector, selectorFamily, setState, simpleLog, simpleLogger, subscribe, timeline, transaction, undo };
139
- //# sourceMappingURL=out.js.map
140
- //# sourceMappingURL=index.js.map
@@ -504,27 +504,37 @@ function withdraw(token, store) {
504
504
  }
505
505
  target = target.child;
506
506
  }
507
+ throw new NotFoundError(token, store);
507
508
  }
508
509
 
509
510
  // internal/src/store/withdraw-new-family-member.ts
510
- function withdrawNewFamilyMember(token, store) {
511
- if (token.family) {
512
- store.logger.info(
513
- `\u{1F46A}`,
514
- token.type,
515
- token.key,
516
- `creating new family member in store "${store.config.name}"`
517
- );
518
- const target = newest(store);
519
- const family = target.families.get(token.family.key);
520
- if (family) {
521
- const jsonSubKey = JSON.parse(token.family.subKey);
522
- family(jsonSubKey);
523
- const state = withdraw(token, store);
524
- return state;
511
+ function withdrawOrCreate(token, store) {
512
+ try {
513
+ const state = withdraw(token, store);
514
+ return state;
515
+ } catch (notFoundError) {
516
+ if (token.family) {
517
+ store.logger.info(
518
+ `\u{1F46A}`,
519
+ token.type,
520
+ token.key,
521
+ `creating new family member in store "${store.config.name}"`
522
+ );
523
+ const target = newest(store);
524
+ const family = target.families.get(token.family.key);
525
+ if (family) {
526
+ const jsonSubKey = JSON.parse(token.family.subKey);
527
+ family(jsonSubKey);
528
+ const state = withdraw(token, store);
529
+ return state;
530
+ }
531
+ throw new NotFoundError(
532
+ { key: token.family.key, type: `${token.type}_family` },
533
+ store
534
+ );
525
535
  }
536
+ throw notFoundError;
526
537
  }
527
- return void 0;
528
538
  }
529
539
 
530
540
  // internal/src/future.ts
@@ -637,10 +647,11 @@ function createRegularAtomFamily(options, store) {
637
647
  const subKey = json.stringifyJson(key);
638
648
  const family = { key: options.key, subKey };
639
649
  const fullKey = `${options.key}(${subKey})`;
640
- const existing = withdraw({ key: fullKey, type: `atom` }, store);
650
+ const target2 = newest(store);
651
+ const atomAlreadyCreated = target2.atoms.has(fullKey);
641
652
  let token;
642
- if (existing) {
643
- token = deposit(existing);
653
+ if (atomAlreadyCreated) {
654
+ token = { type: `atom`, key: fullKey, family };
644
655
  } else {
645
656
  const individualOptions = {
646
657
  key: fullKey,
@@ -998,15 +1009,11 @@ var setAtomOrSelector = (state, value, store) => {
998
1009
 
999
1010
  // internal/src/set-state/set-into-store.ts
1000
1011
  function setIntoStore(token, value, store) {
1001
- var _a;
1002
1012
  const rejection = openOperation(token, store);
1003
1013
  if (rejection) {
1004
1014
  return;
1005
1015
  }
1006
- const state = (_a = withdraw(token, store)) != null ? _a : withdrawNewFamilyMember(token, store);
1007
- if (state === void 0) {
1008
- throw new NotFoundError(token, store);
1009
- }
1016
+ const state = withdrawOrCreate(token, store);
1010
1017
  setAtomOrSelector(state, value, store);
1011
1018
  closeOperation(store);
1012
1019
  }
@@ -1091,14 +1098,8 @@ var updateSelectorAtoms = (selectorKey, dependency, store) => {
1091
1098
  // internal/src/selector/register-selector.ts
1092
1099
  var registerSelector = (selectorKey, store) => ({
1093
1100
  get: (dependency) => {
1094
- var _a;
1095
1101
  const target = newest(store);
1096
- const dependencyState = (_a = withdraw(dependency, store)) != null ? _a : withdrawNewFamilyMember(dependency, store);
1097
- if (dependencyState === void 0) {
1098
- throw new Error(
1099
- `State "${dependency.key}" not found in store "${store.config.name}".`
1100
- );
1101
- }
1102
+ const dependencyState = withdrawOrCreate(dependency, store);
1102
1103
  const dependencyValue = readOrComputeValue(dependencyState, store);
1103
1104
  store.logger.info(
1104
1105
  `\u{1F50C}`,
@@ -1121,12 +1122,7 @@ var registerSelector = (selectorKey, store) => ({
1121
1122
  return dependencyValue;
1122
1123
  },
1123
1124
  set: (WritableToken, newValue) => {
1124
- const state = withdraw(WritableToken, store);
1125
- if (state === void 0) {
1126
- throw new Error(
1127
- `State "${WritableToken.key}" not found in this store. Did you forget to initialize with the "atom" or "selector" function?`
1128
- );
1129
- }
1125
+ const state = withdrawOrCreate(WritableToken, store);
1130
1126
  setAtomOrSelector(state, newValue, store);
1131
1127
  },
1132
1128
  find: (token, key) => findInStore(token, key, store)
@@ -1314,8 +1310,7 @@ var subscribeToRootAtoms = (selector, store) => {
1314
1310
 
1315
1311
  // internal/src/subscribe/subscribe-to-state.ts
1316
1312
  function subscribeToState(token, handleUpdate, key, store) {
1317
- var _a;
1318
- const state = (_a = withdraw(token, store)) != null ? _a : withdrawNewFamilyMember(token, store);
1313
+ const state = withdrawOrCreate(token, store);
1319
1314
  if (state === void 0) {
1320
1315
  throw new Error(
1321
1316
  `State "${token.key}" not found in this store. Did you forget to initialize with the "atom" or "selector" function?`
@@ -1350,11 +1345,6 @@ function subscribeToState(token, handleUpdate, key, store) {
1350
1345
  // internal/src/subscribe/subscribe-to-timeline.ts
1351
1346
  var subscribeToTimeline = (token, handleUpdate, key, store) => {
1352
1347
  const tl = withdraw(token, store);
1353
- if (tl === void 0) {
1354
- throw new Error(
1355
- `Cannot subscribe to timeline "${token.key}": timeline not found in store "${store.config.name}".`
1356
- );
1357
- }
1358
1348
  store.logger.info(`\u{1F440}`, `timeline`, token.key, `Adding subscription "${key}"`);
1359
1349
  const unsubscribe = tl.subject.subscribe(key, handleUpdate);
1360
1350
  return () => {
@@ -1371,11 +1361,6 @@ var subscribeToTimeline = (token, handleUpdate, key, store) => {
1371
1361
  // internal/src/subscribe/subscribe-to-transaction.ts
1372
1362
  var subscribeToTransaction = (token, handleUpdate, key, store) => {
1373
1363
  const tx = withdraw(token, store);
1374
- if (tx === void 0) {
1375
- throw new Error(
1376
- `Cannot subscribe to transaction "${token.key}": transaction not found in store "${store.config.name}".`
1377
- );
1378
- }
1379
1364
  store.logger.info(
1380
1365
  `\u{1F440}`,
1381
1366
  `transaction`,
@@ -1650,10 +1635,11 @@ function createMutableAtomFamily(options, store) {
1650
1635
  const subKey = json.stringifyJson(key);
1651
1636
  const family = { key: options.key, subKey };
1652
1637
  const fullKey = `${options.key}(${subKey})`;
1653
- const existing = withdraw({ key: fullKey, type: `mutable_atom` }, store);
1638
+ const target2 = newest(store);
1639
+ const atomAlreadyCreated = target2.atoms.has(fullKey);
1654
1640
  let token;
1655
- if (existing) {
1656
- token = deposit(existing);
1641
+ if (atomAlreadyCreated) {
1642
+ token = { type: `mutable_atom`, key: fullKey, family };
1657
1643
  } else {
1658
1644
  const individualOptions = {
1659
1645
  key: fullKey,
@@ -1876,11 +1862,7 @@ function getEnvironmentData(store) {
1876
1862
 
1877
1863
  // internal/src/get-state/get-from-store.ts
1878
1864
  function getFromStore(token, store) {
1879
- var _a;
1880
- const state = (_a = withdraw(token, store)) != null ? _a : withdrawNewFamilyMember(token, store);
1881
- if (state === void 0) {
1882
- throw new NotFoundError(token, store);
1883
- }
1865
+ const state = withdrawOrCreate(token, store);
1884
1866
  return readOrComputeValue(state, store);
1885
1867
  }
1886
1868
 
@@ -1952,16 +1934,11 @@ var LazyMap = class extends Map {
1952
1934
  // internal/src/timeline/add-atom-to-timeline.ts
1953
1935
  var addAtomToTimeline = (atomToken, tl, store) => {
1954
1936
  let maybeAtom = withdraw(atomToken, store);
1955
- if ((maybeAtom == null ? void 0 : maybeAtom.type) === `mutable_atom`) {
1937
+ if (maybeAtom.type === `mutable_atom`) {
1956
1938
  const updateToken = getUpdateToken(maybeAtom);
1957
1939
  maybeAtom = withdraw(updateToken, store);
1958
1940
  }
1959
1941
  const atom = maybeAtom;
1960
- if (atom === void 0) {
1961
- throw new Error(
1962
- `Cannot subscribe to atom "${atomToken.key}" because it has not been initialized in store "${store.config.name}"`
1963
- );
1964
- }
1965
1942
  store.timelineAtoms.set({ atomKey: atom.key, timelineKey: tl.key });
1966
1943
  atom.subject.subscribe(`timeline`, (update) => {
1967
1944
  var _a, _b, _c, _d, _e, _f;
@@ -1993,15 +1970,11 @@ var addAtomToTimeline = (atomToken, tl, store) => {
1993
1970
  }
1994
1971
  }
1995
1972
  if (currentTransactionKey) {
1996
- const currentTransaction = withdraw(
1997
- { key: currentTransactionKey, type: `transaction` },
1998
- store
1999
- );
2000
- if (currentTransaction === void 0) {
2001
- throw new Error(
2002
- `Transaction "${currentTransactionKey}" not found in store "${store.config.name}". This is surprising, because we are in the application phase of "${currentTransactionKey}".`
2003
- );
2004
- }
1973
+ const txToken = {
1974
+ key: currentTransactionKey,
1975
+ type: `transaction`
1976
+ };
1977
+ const currentTransaction = withdraw(txToken, store);
2005
1978
  if (tl.transactionKey !== currentTransactionKey) {
2006
1979
  if (tl.transactionKey) {
2007
1980
  store.logger.error(
@@ -2173,15 +2146,6 @@ function createTimeline(options, store, data) {
2173
2146
  if (tokenOrFamily.type === `atom_family` || tokenOrFamily.type === `mutable_atom_family`) {
2174
2147
  const familyToken = tokenOrFamily;
2175
2148
  const family = withdraw(familyToken, store);
2176
- if (family === void 0) {
2177
- store.logger.error(
2178
- `\u274C`,
2179
- `timeline`,
2180
- options.key,
2181
- `Failed to add family "${familyToken.key}" because it does not exist in the store`
2182
- );
2183
- continue;
2184
- }
2185
2149
  const familyKey = family.key;
2186
2150
  target.timelineAtoms.set({ atomKey: familyKey, timelineKey });
2187
2151
  family.subject.subscribe(`timeline:${options.key}`, (token2) => {
@@ -2194,26 +2158,8 @@ function createTimeline(options, store, data) {
2194
2158
  }
2195
2159
  } else {
2196
2160
  let atom = withdraw(tokenOrFamily, store);
2197
- if (atom === void 0) {
2198
- store.logger.error(
2199
- `\u274C`,
2200
- `timeline`,
2201
- options.key,
2202
- `Failed to add atom "${atomKey}" because it does not exist in the store`
2203
- );
2204
- continue;
2205
- }
2206
2161
  if (isMutable(atom)) {
2207
2162
  const updateAtom = withdraw(getUpdateToken(atom), store);
2208
- if (updateAtom === void 0) {
2209
- store.logger.error(
2210
- `\u274C`,
2211
- `timeline`,
2212
- options.key,
2213
- `Failed to add update atom "${atomKey}" because it does not exist in the store`
2214
- );
2215
- continue;
2216
- }
2217
2163
  atom = updateAtom;
2218
2164
  atomKey = atom.key;
2219
2165
  }
@@ -2637,6 +2583,4 @@ exports.traceAllSelectorAtoms = traceAllSelectorAtoms;
2637
2583
  exports.traceSelectorAtoms = traceSelectorAtoms;
2638
2584
  exports.updateSelectorAtoms = updateSelectorAtoms;
2639
2585
  exports.withdraw = withdraw;
2640
- exports.withdrawNewFamilyMember = withdrawNewFamilyMember;
2641
- //# sourceMappingURL=out.js.map
2642
- //# sourceMappingURL=index.cjs.map
2586
+ exports.withdrawOrCreate = withdrawOrCreate;
@@ -243,28 +243,28 @@ declare const IMPLICIT: {
243
243
  declare const clearStore: (store: Store) => void;
244
244
 
245
245
  type Withdrawable = Atom<any> | AtomFamily<any, any> | MutableAtom<any, any> | MutableAtomFamily<any, any, any> | ReadableState<any> | ReadableState<any> | ReadonlySelector<any> | ReadonlySelectorFamily<any, any> | RegularAtom<any> | RegularAtomFamily<any, any> | Selector<any> | SelectorFamily<any, any> | Timeline<any> | Transaction<any> | WritableSelector<any> | WritableSelectorFamily<any, any> | WritableState<any>;
246
- declare function withdraw<T>(token: RegularAtomToken<T>, store: Store): RegularAtom<T> | undefined;
247
- declare function withdraw<T extends Transceiver<any>>(token: MutableAtomToken<T, any>, store: Store): MutableAtom<T, any> | undefined;
248
- declare function withdraw<T>(token: AtomToken<T>, store: Store): Atom<T> | undefined;
249
- declare function withdraw<T>(token: WritableSelectorToken<T>, store: Store): WritableSelector<T> | undefined;
250
- declare function withdraw<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T> | undefined;
251
- declare function withdraw<T>(token: SelectorToken<T>, store: Store): Selector<T> | undefined;
252
- declare function withdraw<T>(token: WritableToken<T>, store: Store): WritableState<T> | undefined;
253
- declare function withdraw<T>(token: ReadableToken<T>, store: Store): ReadableState<T> | undefined;
254
- declare function withdraw<T, K extends Json.Serializable>(token: RegularAtomFamilyToken<T, K>, store: Store): RegularAtomFamily<T, K> | undefined;
255
- declare function withdraw<T extends Transceiver<any>, J extends Json.Serializable, K extends Json.Serializable>(token: MutableAtomFamilyToken<T, J, K>, store: Store): MutableAtomFamily<T, J, K> | undefined;
256
- declare function withdraw<T, K extends Json.Serializable>(token: AtomFamilyToken<T>, store: Store): AtomFamily<T, any> | undefined;
257
- declare function withdraw<T, K extends Json.Serializable>(token: ReadonlySelectorFamilyToken<T, K>, store: Store): ReadonlySelectorFamily<T, any> | undefined;
258
- declare function withdraw<T, K extends Json.Serializable>(token: WritableSelectorFamilyToken<T, K>, store: Store): WritableSelectorFamily<T, any> | undefined;
259
- declare function withdraw<T, K extends Json.Serializable>(token: SelectorFamilyToken<T, K>, store: Store): SelectorFamily<T, any> | undefined;
260
- declare function withdraw<T>(token: TransactionToken<T>, store: Store): Transaction<T extends _n ? T : never> | undefined;
261
- declare function withdraw<T>(token: TimelineToken<T>, store: Store): Timeline<T extends TimelineManageable ? T : never> | undefined;
262
-
263
- declare function withdrawNewFamilyMember<T>(token: RegularAtomToken<T>, store: Store): Atom<T> | undefined;
264
- declare function withdrawNewFamilyMember<T>(token: WritableSelectorToken<T>, store: Store): WritableSelector<T> | undefined;
265
- declare function withdrawNewFamilyMember<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T> | undefined;
266
- declare function withdrawNewFamilyMember<T>(token: WritableToken<T>, store: Store): WritableState<T> | undefined;
267
- declare function withdrawNewFamilyMember<T>(token: ReadableToken<T>, store: Store): ReadableState<T> | undefined;
246
+ declare function withdraw<T>(token: RegularAtomToken<T>, store: Store): RegularAtom<T>;
247
+ declare function withdraw<T extends Transceiver<any>>(token: MutableAtomToken<T, any>, store: Store): MutableAtom<T, any>;
248
+ declare function withdraw<T>(token: AtomToken<T>, store: Store): Atom<T>;
249
+ declare function withdraw<T>(token: WritableSelectorToken<T>, store: Store): WritableSelector<T>;
250
+ declare function withdraw<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T>;
251
+ declare function withdraw<T>(token: SelectorToken<T>, store: Store): Selector<T>;
252
+ declare function withdraw<T>(token: WritableToken<T>, store: Store): WritableState<T>;
253
+ declare function withdraw<T>(token: ReadableToken<T>, store: Store): ReadableState<T>;
254
+ declare function withdraw<T, K extends Json.Serializable>(token: RegularAtomFamilyToken<T, K>, store: Store): RegularAtomFamily<T, K>;
255
+ declare function withdraw<T extends Transceiver<any>, J extends Json.Serializable, K extends Json.Serializable>(token: MutableAtomFamilyToken<T, J, K>, store: Store): MutableAtomFamily<T, J, K>;
256
+ declare function withdraw<T, K extends Json.Serializable>(token: AtomFamilyToken<T>, store: Store): AtomFamily<T, any>;
257
+ declare function withdraw<T, K extends Json.Serializable>(token: ReadonlySelectorFamilyToken<T, K>, store: Store): ReadonlySelectorFamily<T, any>;
258
+ declare function withdraw<T, K extends Json.Serializable>(token: WritableSelectorFamilyToken<T, K>, store: Store): WritableSelectorFamily<T, any>;
259
+ declare function withdraw<T, K extends Json.Serializable>(token: SelectorFamilyToken<T, K>, store: Store): SelectorFamily<T, any>;
260
+ declare function withdraw<T>(token: TransactionToken<T>, store: Store): Transaction<T extends _n ? T : never>;
261
+ declare function withdraw<T>(token: TimelineToken<T>, store: Store): Timeline<T extends TimelineManageable ? T : never>;
262
+
263
+ declare function withdrawOrCreate<T>(token: RegularAtomToken<T>, store: Store): Atom<T>;
264
+ declare function withdrawOrCreate<T>(token: WritableSelectorToken<T>, store: Store): WritableSelector<T>;
265
+ declare function withdrawOrCreate<T>(token: ReadonlySelectorToken<T>, store: Store): ReadonlySelector<T>;
266
+ declare function withdrawOrCreate<T>(token: WritableToken<T>, store: Store): WritableState<T>;
267
+ declare function withdrawOrCreate<T>(token: ReadableToken<T>, store: Store): ReadableState<T>;
268
268
 
269
269
  interface Transceiver<Signal extends Json.Serializable> {
270
270
  do: (update: Signal) => number | `OUT_OF_RANGE` | null;
@@ -484,4 +484,4 @@ type Selector<T> = ReadonlySelector<T> | WritableSelector<T>;
484
484
  type WritableState<T> = Atom<T> | WritableSelector<T>;
485
485
  type ReadableState<T> = Atom<T> | Selector<T>;
486
486
 
487
- export { type Atom, type AtomIOState, type AtomKey, type ChildStore, type EnvironmentData, FamilyTracker, Future, IMPLICIT, LazyMap, type Lineage, type Modify, type MutableAtom, NotFoundError, type OperationProgress, 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 TimelineSelectorUpdate, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionEpoch, type TransactionPhase, type TransactionProgress, type Transceiver, type TransceiverMode, type Withdrawable, type WritableSelector, type WritableState, abortTransaction, actUponStore, addAtomToTimeline, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deleteAtom, deleteSelector, deposit, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateToken, ingestAtomUpdate, ingestSelectorUpdate, ingestTransactionUpdate, isAtomDefault, isAtomKey, isChildStore, isDone, isMutable, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, readCachedValue, readOrComputeValue, registerSelector, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw, withdrawNewFamilyMember };
487
+ export { type Atom, type AtomIOState, type AtomKey, type ChildStore, type EnvironmentData, FamilyTracker, Future, IMPLICIT, LazyMap, type Lineage, type Modify, type MutableAtom, NotFoundError, type OperationProgress, 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 TimelineSelectorUpdate, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionEpoch, type TransactionPhase, type TransactionProgress, type Transceiver, type TransceiverMode, type Withdrawable, type WritableSelector, type WritableState, abortTransaction, actUponStore, addAtomToTimeline, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deleteAtom, deleteSelector, deposit, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateToken, ingestAtomUpdate, ingestSelectorUpdate, ingestTransactionUpdate, isAtomDefault, isAtomKey, isChildStore, isDone, isMutable, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, readCachedValue, readOrComputeValue, registerSelector, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw, withdrawOrCreate };