atom.io 0.32.3 → 0.33.0

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 (362) hide show
  1. package/dist/chunk-Cl8Af3a2.js +11 -0
  2. package/dist/data/index.d.ts +28 -0
  3. package/dist/data/index.d.ts.map +1 -0
  4. package/dist/data/index.js +66 -0
  5. package/dist/data/index.js.map +1 -0
  6. package/dist/devtools-CAg2k57t.js +0 -0
  7. package/dist/devtools-Jyn42mZm.css +311 -0
  8. package/dist/devtools-Jyn42mZm.css.map +1 -0
  9. package/dist/eslint-plugin/index.d.ts +36 -0
  10. package/dist/eslint-plugin/index.d.ts.map +1 -0
  11. package/dist/eslint-plugin/index.js +196 -0
  12. package/dist/eslint-plugin/index.js.map +1 -0
  13. package/{internal/dist → dist/internal}/index.d.ts +497 -377
  14. package/dist/internal/index.d.ts.map +1 -0
  15. package/dist/internal/index.js +3213 -0
  16. package/dist/internal/index.js.map +1 -0
  17. package/dist/introspection/index.d.ts +153 -0
  18. package/dist/introspection/index.d.ts.map +1 -0
  19. package/dist/introspection/index.js +520 -0
  20. package/dist/introspection/index.js.map +1 -0
  21. package/{json/dist → dist/json}/index.d.ts +38 -32
  22. package/dist/json/index.d.ts.map +1 -0
  23. package/dist/json/index.js +75 -0
  24. package/dist/json/index.js.map +1 -0
  25. package/dist/main/index.d.ts +691 -0
  26. package/dist/main/index.d.ts.map +1 -0
  27. package/dist/main/index.js +237 -0
  28. package/dist/main/index.js.map +1 -0
  29. package/{react/dist → dist/react}/index.d.ts +22 -11
  30. package/dist/react/index.d.ts.map +1 -0
  31. package/dist/react/index.js +91 -0
  32. package/dist/react/index.js.map +1 -0
  33. package/dist/react-devtools/index.d.ts +194 -0
  34. package/dist/react-devtools/index.d.ts.map +1 -0
  35. package/dist/react-devtools/index.js +1274 -0
  36. package/dist/react-devtools/index.js.map +1 -0
  37. package/dist/realtime/index.d.ts +55 -0
  38. package/dist/realtime/index.d.ts.map +1 -0
  39. package/dist/realtime/index.js +113 -0
  40. package/dist/realtime/index.js.map +1 -0
  41. package/dist/realtime-client/index.d.ts +81 -0
  42. package/dist/realtime-client/index.d.ts.map +1 -0
  43. package/dist/realtime-client/index.js +376 -0
  44. package/dist/realtime-client/index.js.map +1 -0
  45. package/dist/realtime-react/index.d.ts +68 -0
  46. package/dist/realtime-react/index.d.ts.map +1 -0
  47. package/dist/realtime-react/index.js +182 -0
  48. package/dist/realtime-react/index.js.map +1 -0
  49. package/dist/realtime-server/index.d.ts +190 -0
  50. package/dist/realtime-server/index.d.ts.map +1 -0
  51. package/dist/realtime-server/index.js +795 -0
  52. package/dist/realtime-server/index.js.map +1 -0
  53. package/dist/realtime-testing/index.d.ts +60 -0
  54. package/dist/realtime-testing/index.d.ts.map +1 -0
  55. package/dist/realtime-testing/index.js +181 -0
  56. package/dist/realtime-testing/index.js.map +1 -0
  57. package/dist/transceivers/set-rtx/index.d.ts +44 -0
  58. package/dist/transceivers/set-rtx/index.d.ts.map +1 -0
  59. package/dist/transceivers/set-rtx/index.js +204 -0
  60. package/dist/transceivers/set-rtx/index.js.map +1 -0
  61. package/dist/web/index.d.ts +15 -0
  62. package/dist/web/index.d.ts.map +1 -0
  63. package/dist/web/index.js +16 -0
  64. package/dist/web/index.js.map +1 -0
  65. package/package.json +70 -122
  66. package/{data/src → src/data}/struct.ts +1 -0
  67. package/{eslint-plugin/src → src/eslint-plugin}/index.ts +3 -1
  68. package/{eslint-plugin/src → src/eslint-plugin}/rules/explicit-state-types.ts +6 -1
  69. package/{eslint-plugin/src → src/eslint-plugin}/rules/synchronous-selector-dependencies.ts +14 -1
  70. package/{internal/src → src/internal}/families/create-writable-selector-family.ts +4 -2
  71. package/{internal/src → src/internal}/families/index.ts +2 -0
  72. package/{internal/src → src/internal}/index.ts +1 -0
  73. package/{internal/src → src/internal}/join/find-relations-in-store.ts +12 -0
  74. package/{internal/src → src/internal}/junction.ts +3 -2
  75. package/{internal/src → src/internal}/lazy-map.ts +1 -1
  76. package/{internal/src → src/internal}/mutable/tracker-family.ts +2 -5
  77. package/{internal/src → src/internal}/mutable/tracker.ts +15 -9
  78. package/{internal/src → src/internal}/selector/register-selector.ts +2 -1
  79. package/{internal/src → src/internal}/store/store.ts +68 -53
  80. package/{internal/src → src/internal}/subject.ts +1 -1
  81. package/{internal/src → src/internal}/transaction/build-transaction.ts +2 -1
  82. package/{introspection/src → src/introspection}/auditor.ts +1 -1
  83. package/{introspection/src → src/introspection}/differ.ts +12 -1
  84. package/{introspection/src → src/introspection}/refinery.ts +18 -3
  85. package/{json/src → src/json}/entries.ts +1 -1
  86. package/{json/src → src/json}/select-json-family.ts +1 -1
  87. package/src/{realm.ts → main/realm.ts} +1 -1
  88. package/src/{silo.ts → main/silo.ts} +1 -1
  89. package/src/{transaction.ts → main/transaction.ts} +1 -1
  90. package/{react/src → src/react}/store-context.tsx +3 -1
  91. package/{react/src → src/react}/use-i.ts +3 -5
  92. package/{react-devtools/src → src/react-devtools}/AtomIODevtools.tsx +1 -1
  93. package/{react-devtools/src → src/react-devtools}/Button.tsx +3 -1
  94. package/{react-devtools/src → src/react-devtools}/Updates.tsx +5 -1
  95. package/src/react-devtools/devtools.css +308 -0
  96. package/{react-devtools/src → src/react-devtools}/json-editor/developer-interface.tsx +2 -2
  97. package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/cast-json.ts +2 -2
  98. package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/object-properties.ts +3 -3
  99. package/{react-devtools/src → src/react-devtools}/json-editor/json-editor-internal.tsx +4 -2
  100. package/{react-devtools/src → src/react-devtools}/store.ts +3 -2
  101. package/{realtime/src → src/realtime}/shared-room-store.ts +28 -5
  102. package/src/realtime-client/realtime-client-stores/client-main-store.ts +23 -0
  103. package/src/realtime-client/realtime-client-stores/client-sync-store.ts +15 -0
  104. package/{realtime-react/src → src/realtime-react}/index.ts +1 -0
  105. package/{realtime-react/src → src/realtime-react}/on-mount.ts +1 -1
  106. package/{realtime-react/src → src/realtime-react}/realtime-context.tsx +5 -4
  107. package/{realtime-react/src → src/realtime-react}/use-single-effect.ts +3 -2
  108. package/{realtime-server/src → src/realtime-server}/ipc-sockets/child-socket.ts +1 -1
  109. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-room-external-actions.ts +20 -19
  110. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-room-external-store.ts +12 -7
  111. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-sync-store.ts +13 -4
  112. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-user-store.ts +26 -8
  113. package/{transceivers/set-rtx/src → src/transceivers/set-rtx}/set-rtx.ts +2 -2
  114. package/data/dist/index.d.ts +0 -31
  115. package/data/dist/index.js +0 -69
  116. package/data/package.json +0 -13
  117. package/dist/chunk-2XDFCXGB.js +0 -109
  118. package/dist/chunk-35NB2XZU.js +0 -4501
  119. package/dist/chunk-4LWKCEW3.js +0 -14
  120. package/dist/chunk-EF4S7H42.js +0 -526
  121. package/dist/chunk-LTLDKXDN.js +0 -153
  122. package/dist/chunk-MENOYVPP.js +0 -83
  123. package/dist/chunk-RGUNRT72.js +0 -634
  124. package/dist/chunk-TS76LQVD.js +0 -1035
  125. package/dist/chunk-XWL6SNVU.js +0 -7
  126. package/dist/index.d.ts +0 -701
  127. package/dist/index.js +0 -2
  128. package/eslint-plugin/dist/index.d.ts +0 -64
  129. package/eslint-plugin/dist/index.js +0 -238
  130. package/eslint-plugin/package.json +0 -13
  131. package/internal/dist/index.js +0 -2
  132. package/internal/package.json +0 -13
  133. package/introspection/dist/index.d.ts +0 -149
  134. package/introspection/dist/index.js +0 -3
  135. package/introspection/package.json +0 -13
  136. package/json/dist/index.js +0 -2
  137. package/json/package.json +0 -13
  138. package/react/dist/index.js +0 -3
  139. package/react/package.json +0 -13
  140. package/react-devtools/dist/index.css +0 -309
  141. package/react-devtools/dist/index.d.ts +0 -160
  142. package/react-devtools/dist/index.js +0 -1481
  143. package/react-devtools/package.json +0 -13
  144. package/react-devtools/src/devtools.scss +0 -309
  145. package/realtime/dist/index.d.ts +0 -51
  146. package/realtime/dist/index.js +0 -3
  147. package/realtime/package.json +0 -13
  148. package/realtime-client/dist/index.d.ts +0 -41
  149. package/realtime-client/dist/index.js +0 -4
  150. package/realtime-client/package.json +0 -13
  151. package/realtime-client/src/realtime-client-stores/client-main-store.ts +0 -20
  152. package/realtime-client/src/realtime-client-stores/client-sync-store.ts +0 -15
  153. package/realtime-react/dist/index.d.ts +0 -39
  154. package/realtime-react/dist/index.js +0 -6
  155. package/realtime-react/package.json +0 -13
  156. package/realtime-server/dist/index.d.ts +0 -139
  157. package/realtime-server/dist/index.js +0 -4
  158. package/realtime-server/package.json +0 -13
  159. package/realtime-testing/dist/index.d.ts +0 -59
  160. package/realtime-testing/dist/index.js +0 -198
  161. package/realtime-testing/package.json +0 -13
  162. package/transceivers/set-rtx/dist/index.d.ts +0 -41
  163. package/transceivers/set-rtx/dist/index.js +0 -2
  164. package/transceivers/set-rtx/package.json +0 -13
  165. package/web/dist/index.d.ts +0 -9
  166. package/web/dist/index.js +0 -2
  167. package/web/package.json +0 -13
  168. /package/{data/src → src/data}/dict.ts +0 -0
  169. /package/{data/src → src/data}/index.ts +0 -0
  170. /package/{data/src → src/data}/struct-family.ts +0 -0
  171. /package/{eslint-plugin/src → src/eslint-plugin}/rules/index.ts +0 -0
  172. /package/{eslint-plugin/src → src/eslint-plugin}/walk.ts +0 -0
  173. /package/{internal/src → src/internal}/arbitrary.ts +0 -0
  174. /package/{internal/src → src/internal}/atom/create-regular-atom.ts +0 -0
  175. /package/{internal/src → src/internal}/atom/create-standalone-atom.ts +0 -0
  176. /package/{internal/src → src/internal}/atom/dispose-atom.ts +0 -0
  177. /package/{internal/src → src/internal}/atom/index.ts +0 -0
  178. /package/{internal/src → src/internal}/atom/is-default.ts +0 -0
  179. /package/{internal/src → src/internal}/caching.ts +0 -0
  180. /package/{internal/src → src/internal}/capitalize.ts +0 -0
  181. /package/{internal/src → src/internal}/families/create-atom-family.ts +0 -0
  182. /package/{internal/src → src/internal}/families/create-readonly-selector-family.ts +0 -0
  183. /package/{internal/src → src/internal}/families/create-regular-atom-family.ts +0 -0
  184. /package/{internal/src → src/internal}/families/create-selector-family.ts +0 -0
  185. /package/{internal/src → src/internal}/families/dispose-from-store.ts +0 -0
  186. /package/{internal/src → src/internal}/families/find-in-store.ts +0 -0
  187. /package/{internal/src → src/internal}/families/get-family-of-token.ts +0 -0
  188. /package/{internal/src → src/internal}/families/init-family-member.ts +0 -0
  189. /package/{internal/src → src/internal}/families/seek-in-store.ts +0 -0
  190. /package/{internal/src → src/internal}/future.ts +0 -0
  191. /package/{internal/src → src/internal}/get-environment-data.ts +0 -0
  192. /package/{internal/src → src/internal}/get-state/get-from-store.ts +0 -0
  193. /package/{internal/src → src/internal}/get-state/index.ts +0 -0
  194. /package/{internal/src → src/internal}/get-state/read-or-compute-value.ts +0 -0
  195. /package/{internal/src → src/internal}/get-trace.ts +0 -0
  196. /package/{internal/src → src/internal}/ingest-updates/index.ts +0 -0
  197. /package/{internal/src → src/internal}/ingest-updates/ingest-atom-update.ts +0 -0
  198. /package/{internal/src → src/internal}/ingest-updates/ingest-creation-disposal.ts +0 -0
  199. /package/{internal/src → src/internal}/ingest-updates/ingest-selector-update.ts +0 -0
  200. /package/{internal/src → src/internal}/ingest-updates/ingest-transaction-update.ts +0 -0
  201. /package/{internal/src → src/internal}/install-into-store.ts +0 -0
  202. /package/{internal/src → src/internal}/join/edit-relations-in-store.ts +0 -0
  203. /package/{internal/src → src/internal}/join/get-internal-relations-from-store.ts +0 -0
  204. /package/{internal/src → src/internal}/join/get-join.ts +0 -0
  205. /package/{internal/src → src/internal}/join/index.ts +0 -0
  206. /package/{internal/src → src/internal}/join/join-internal.ts +0 -0
  207. /package/{internal/src → src/internal}/keys.ts +0 -0
  208. /package/{internal/src → src/internal}/lineage.ts +0 -0
  209. /package/{internal/src → src/internal}/molecule.ts +0 -0
  210. /package/{internal/src → src/internal}/mutable/create-mutable-atom-family.ts +0 -0
  211. /package/{internal/src → src/internal}/mutable/create-mutable-atom.ts +0 -0
  212. /package/{internal/src → src/internal}/mutable/get-json-family.ts +0 -0
  213. /package/{internal/src → src/internal}/mutable/get-json-token.ts +0 -0
  214. /package/{internal/src → src/internal}/mutable/get-update-family.ts +0 -0
  215. /package/{internal/src → src/internal}/mutable/get-update-token.ts +0 -0
  216. /package/{internal/src → src/internal}/mutable/index.ts +0 -0
  217. /package/{internal/src → src/internal}/mutable/transceiver.ts +0 -0
  218. /package/{internal/src → src/internal}/not-found-error.ts +0 -0
  219. /package/{internal/src → src/internal}/operation.ts +0 -0
  220. /package/{internal/src → src/internal}/pretty-print.ts +0 -0
  221. /package/{internal/src → src/internal}/reserved-keys.ts +0 -0
  222. /package/{internal/src → src/internal}/selector/create-readonly-selector.ts +0 -0
  223. /package/{internal/src → src/internal}/selector/create-standalone-selector.ts +0 -0
  224. /package/{internal/src → src/internal}/selector/create-writable-selector.ts +0 -0
  225. /package/{internal/src → src/internal}/selector/dispose-selector.ts +0 -0
  226. /package/{internal/src → src/internal}/selector/get-selector-dependency-keys.ts +0 -0
  227. /package/{internal/src → src/internal}/selector/index.ts +0 -0
  228. /package/{internal/src → src/internal}/selector/trace-selector-atoms.ts +0 -0
  229. /package/{internal/src → src/internal}/selector/update-selector-atoms.ts +0 -0
  230. /package/{internal/src → src/internal}/set-state/become.ts +0 -0
  231. /package/{internal/src → src/internal}/set-state/copy-mutable-if-needed.ts +0 -0
  232. /package/{internal/src → src/internal}/set-state/emit-update.ts +0 -0
  233. /package/{internal/src → src/internal}/set-state/evict-downstream.ts +0 -0
  234. /package/{internal/src → src/internal}/set-state/index.ts +0 -0
  235. /package/{internal/src → src/internal}/set-state/set-atom-or-selector.ts +0 -0
  236. /package/{internal/src → src/internal}/set-state/set-atom.ts +0 -0
  237. /package/{internal/src → src/internal}/set-state/set-into-store.ts +0 -0
  238. /package/{internal/src → src/internal}/store/circular-buffer.ts +0 -0
  239. /package/{internal/src → src/internal}/store/counterfeit.ts +0 -0
  240. /package/{internal/src → src/internal}/store/deposit.ts +0 -0
  241. /package/{internal/src → src/internal}/store/index.ts +0 -0
  242. /package/{internal/src → src/internal}/store/withdraw.ts +0 -0
  243. /package/{internal/src → src/internal}/subscribe/index.ts +0 -0
  244. /package/{internal/src → src/internal}/subscribe/recall-state.ts +0 -0
  245. /package/{internal/src → src/internal}/subscribe/subscribe-in-store.ts +0 -0
  246. /package/{internal/src → src/internal}/subscribe/subscribe-to-root-atoms.ts +0 -0
  247. /package/{internal/src → src/internal}/subscribe/subscribe-to-state.ts +0 -0
  248. /package/{internal/src → src/internal}/subscribe/subscribe-to-timeline.ts +0 -0
  249. /package/{internal/src → src/internal}/subscribe/subscribe-to-transaction.ts +0 -0
  250. /package/{internal/src → src/internal}/timeline/create-timeline.ts +0 -0
  251. /package/{internal/src → src/internal}/timeline/index.ts +0 -0
  252. /package/{internal/src → src/internal}/timeline/time-travel.ts +0 -0
  253. /package/{internal/src → src/internal}/transaction/abort-transaction.ts +0 -0
  254. /package/{internal/src → src/internal}/transaction/act-upon-store.ts +0 -0
  255. /package/{internal/src → src/internal}/transaction/apply-transaction.ts +0 -0
  256. /package/{internal/src → src/internal}/transaction/assign-transaction-to-continuity.ts +0 -0
  257. /package/{internal/src → src/internal}/transaction/create-transaction.ts +0 -0
  258. /package/{internal/src → src/internal}/transaction/get-epoch-number.ts +0 -0
  259. /package/{internal/src → src/internal}/transaction/index.ts +0 -0
  260. /package/{internal/src → src/internal}/transaction/is-root-store.ts +0 -0
  261. /package/{internal/src → src/internal}/transaction/set-epoch-number.ts +0 -0
  262. /package/{internal/src → src/internal}/utility-types.ts +0 -0
  263. /package/{introspection/src → src/introspection}/attach-atom-index.ts +0 -0
  264. /package/{introspection/src → src/introspection}/attach-introspection-states.ts +0 -0
  265. /package/{introspection/src → src/introspection}/attach-selector-index.ts +0 -0
  266. /package/{introspection/src → src/introspection}/attach-timeline-family.ts +0 -0
  267. /package/{introspection/src → src/introspection}/attach-timeline-index.ts +0 -0
  268. /package/{introspection/src → src/introspection}/attach-transaction-index.ts +0 -0
  269. /package/{introspection/src → src/introspection}/attach-transaction-logs.ts +0 -0
  270. /package/{introspection/src → src/introspection}/attach-type-selectors.ts +0 -0
  271. /package/{introspection/src → src/introspection}/index.ts +0 -0
  272. /package/{introspection/src → src/introspection}/sprawl.ts +0 -0
  273. /package/{json/src → src/json}/index.ts +0 -0
  274. /package/{json/src → src/json}/select-json.ts +0 -0
  275. /package/src/{atom.ts → main/atom.ts} +0 -0
  276. /package/src/{dispose-state.ts → main/dispose-state.ts} +0 -0
  277. /package/src/{find-state.ts → main/find-state.ts} +0 -0
  278. /package/src/{get-state.ts → main/get-state.ts} +0 -0
  279. /package/src/{index.ts → main/index.ts} +0 -0
  280. /package/src/{join.ts → main/join.ts} +0 -0
  281. /package/src/{logger.ts → main/logger.ts} +0 -0
  282. /package/src/{selector.ts → main/selector.ts} +0 -0
  283. /package/src/{set-state.ts → main/set-state.ts} +0 -0
  284. /package/src/{subscribe.ts → main/subscribe.ts} +0 -0
  285. /package/src/{timeline.ts → main/timeline.ts} +0 -0
  286. /package/src/{validators.ts → main/validators.ts} +0 -0
  287. /package/{react/src → src/react}/index.ts +0 -0
  288. /package/{react/src → src/react}/parse-state-overloads.ts +0 -0
  289. /package/{react/src → src/react}/use-json.ts +0 -0
  290. /package/{react/src → src/react}/use-o.ts +0 -0
  291. /package/{react/src → src/react}/use-tl.ts +0 -0
  292. /package/{react-devtools/src → src/react-devtools}/StateEditor.tsx +0 -0
  293. /package/{react-devtools/src → src/react-devtools}/StateIndex.tsx +0 -0
  294. /package/{react-devtools/src → src/react-devtools}/TimelineIndex.tsx +0 -0
  295. /package/{react-devtools/src → src/react-devtools}/TransactionIndex.tsx +0 -0
  296. /package/{react-devtools/src → src/react-devtools}/elastic-input/ElasticInput.tsx +0 -0
  297. /package/{react-devtools/src → src/react-devtools}/elastic-input/NumberInput.tsx +0 -0
  298. /package/{react-devtools/src → src/react-devtools}/elastic-input/TextInput.tsx +0 -0
  299. /package/{react-devtools/src → src/react-devtools}/elastic-input/index.ts +0 -0
  300. /package/{react-devtools/src → src/react-devtools}/error-boundary/DefaultFallback.tsx +0 -0
  301. /package/{react-devtools/src → src/react-devtools}/error-boundary/ReactErrorBoundary.tsx +0 -0
  302. /package/{react-devtools/src → src/react-devtools}/error-boundary/index.ts +0 -0
  303. /package/{react-devtools/src → src/react-devtools}/index.ts +0 -0
  304. /package/{react-devtools/src → src/react-devtools}/json-editor/default-components.tsx +0 -0
  305. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/array-editor.tsx +0 -0
  306. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/non-json.tsx +0 -0
  307. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/object-editor.tsx +0 -0
  308. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/primitive-editors.tsx +0 -0
  309. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/array-elements.ts +0 -0
  310. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/cast-to-json.ts +0 -0
  311. /package/{react-devtools/src → src/react-devtools}/json-editor/index.ts +0 -0
  312. /package/{react-devtools/src → src/react-devtools}/json-editor/todo.md +0 -0
  313. /package/{realtime/src → src/realtime}/index.ts +0 -0
  314. /package/{realtime/src → src/realtime}/realtime-continuity.ts +0 -0
  315. /package/{realtime-client/src → src/realtime-client}/continuity/index.ts +0 -0
  316. /package/{realtime-client/src → src/realtime-client}/continuity/register-and-attempt-confirmed-update.ts +0 -0
  317. /package/{realtime-client/src → src/realtime-client}/continuity/use-conceal-state.ts +0 -0
  318. /package/{realtime-client/src → src/realtime-client}/continuity/use-reveal-state.ts +0 -0
  319. /package/{realtime-client/src → src/realtime-client}/index.ts +0 -0
  320. /package/{realtime-client/src → src/realtime-client}/pull-atom-family-member.ts +0 -0
  321. /package/{realtime-client/src → src/realtime-client}/pull-atom.ts +0 -0
  322. /package/{realtime-client/src → src/realtime-client}/pull-mutable-atom-family-member.ts +0 -0
  323. /package/{realtime-client/src → src/realtime-client}/pull-mutable-atom.ts +0 -0
  324. /package/{realtime-client/src → src/realtime-client}/pull-selector-family-member.ts +0 -0
  325. /package/{realtime-client/src → src/realtime-client}/pull-selector.ts +0 -0
  326. /package/{realtime-client/src → src/realtime-client}/push-state.ts +0 -0
  327. /package/{realtime-client/src → src/realtime-client}/realtime-client-stores/index.ts +0 -0
  328. /package/{realtime-client/src → src/realtime-client}/server-action.ts +0 -0
  329. /package/{realtime-client/src → src/realtime-client}/sync-continuity.ts +0 -0
  330. /package/{realtime-react/src → src/realtime-react}/use-pull-atom-family-member.ts +0 -0
  331. /package/{realtime-react/src → src/realtime-react}/use-pull-atom.ts +0 -0
  332. /package/{realtime-react/src → src/realtime-react}/use-pull-mutable-atom.ts +0 -0
  333. /package/{realtime-react/src → src/realtime-react}/use-pull-mutable-family-member.ts +0 -0
  334. /package/{realtime-react/src → src/realtime-react}/use-pull-selector-family-member.ts +0 -0
  335. /package/{realtime-react/src → src/realtime-react}/use-pull-selector.ts +0 -0
  336. /package/{realtime-react/src → src/realtime-react}/use-push.ts +0 -0
  337. /package/{realtime-react/src → src/realtime-react}/use-realtime-service.ts +0 -0
  338. /package/{realtime-react/src → src/realtime-react}/use-server-action.ts +0 -0
  339. /package/{realtime-react/src → src/realtime-react}/use-sync-continuity.ts +0 -0
  340. /package/{realtime-server/src → src/realtime-server}/README.md +0 -0
  341. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-send-initial-payload.ts +0 -0
  342. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-serve-transaction-request.ts +0 -0
  343. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-sync-realtime-continuity.ts +0 -0
  344. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-track-client-acknowledgement.ts +0 -0
  345. /package/{realtime-server/src → src/realtime-server}/continuity/subscribe-to-continuity-actions.ts +0 -0
  346. /package/{realtime-server/src → src/realtime-server}/continuity/subscribe-to-continuity-perpectives.ts +0 -0
  347. /package/{realtime-server/src → src/realtime-server}/index.ts +0 -0
  348. /package/{realtime-server/src → src/realtime-server}/ipc-sockets/custom-socket.ts +0 -0
  349. /package/{realtime-server/src → src/realtime-server}/ipc-sockets/index.ts +0 -0
  350. /package/{realtime-server/src → src/realtime-server}/ipc-sockets/parent-socket.ts +0 -0
  351. /package/{realtime-server/src → src/realtime-server}/realtime-action-receiver.ts +0 -0
  352. /package/{realtime-server/src → src/realtime-server}/realtime-family-provider.ts +0 -0
  353. /package/{realtime-server/src → src/realtime-server}/realtime-mutable-family-provider.ts +0 -0
  354. /package/{realtime-server/src → src/realtime-server}/realtime-mutable-provider.ts +0 -0
  355. /package/{realtime-server/src → src/realtime-server}/realtime-server-stores/index.ts +0 -0
  356. /package/{realtime-server/src → src/realtime-server}/realtime-state-provider.ts +0 -0
  357. /package/{realtime-server/src → src/realtime-server}/realtime-state-receiver.ts +0 -0
  358. /package/{realtime-testing/src → src/realtime-testing}/index.ts +0 -0
  359. /package/{realtime-testing/src → src/realtime-testing}/setup-realtime-test.tsx +0 -0
  360. /package/{transceivers/set-rtx/src → src/transceivers/set-rtx}/index.ts +0 -0
  361. /package/{web/src → src/web}/index.ts +0 -0
  362. /package/{web/src → src/web}/persist-sync.ts +0 -0
package/dist/index.d.ts DELETED
@@ -1,701 +0,0 @@
1
- import { Transceiver, Func, EnvironmentData, TimelineAtomUpdate, TimelineMoleculeCreation, TimelineMoleculeDisposal, TimelineSelectorUpdate, TimelineStateCreation, TimelineStateDisposal, TimelineTransactionUpdate, Timeline, JunctionSchemaBase, JunctionEntriesBase, Refinement, Store, Junction, Each, Flat } from 'atom.io/internal';
2
- import { Canonical, Json, JsonInterface, stringified } from 'atom.io/json';
3
- import { getState as getState$1, setState as setState$1, findState as findState$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 } from 'atom.io';
4
- import { SetRTX, SetRTXJson } from 'atom.io/transceivers/set-rtx';
5
-
6
- /**
7
- * @public
8
- * Create a mutable atom, a global reactive variable in the implicit store
9
- *
10
- * The value of a mutable atom must be some kind of {@link Transceiver}.
11
- *
12
- * @param options - {@link MutableAtomOptions}.
13
- * @returns
14
- * A reference to the atom created: a {@link MutableAtomToken}
15
- * @overload Mutable
16
- */
17
- declare function atom<T extends Transceiver<any>, J extends Json.Serializable>(options: MutableAtomOptions<T, J>): MutableAtomToken<T, J>;
18
- /**
19
- * @public
20
- * Create a regular atom, a global reactive variable in the implicit store
21
- * @param options - {@link RegularAtomOptions}.
22
- * @returns
23
- * A reference to the atom created: a {@link RegularAtomToken}
24
- * @overload Regular
25
- */
26
- declare function atom<T>(options: RegularAtomOptions<T>): RegularAtomToken<T>;
27
- /** @public */
28
- type Effectors<T> = {
29
- /**
30
- * Set the value of the atom
31
- * @param next - The new value of the atom, or a setter function
32
- */
33
- setSelf: <New extends T>(next: New | Setter<T, New>) => void;
34
- /** Subscribe to changes to the atom */
35
- onSet: (callback: (options: {
36
- newValue: T;
37
- oldValue: T;
38
- }) => void) => void;
39
- };
40
- /**
41
- * @public
42
- * A function that runs side effects when the atom is set
43
- * @param tools - {@link Effectors} that can be used to run side effects
44
- * @returns
45
- * Optionally, a cleanup function that will be called when the atom is disposed
46
- */
47
- type AtomEffect<T> = (tools: Effectors<T>) => (() => void) | void;
48
- /** @public */
49
- type RegularAtomOptions<T> = {
50
- /** The unique identifier of the atom */
51
- key: string;
52
- /** The starting value of the atom */
53
- default: T | (() => T);
54
- /** Hooks used to run side effects when the atom is set */
55
- effects?: AtomEffect<T>[];
56
- };
57
- type MutableAtomOptions<T extends Transceiver<any>, J extends Json.Serializable> = JsonInterface<T, J> & Omit<RegularAtomOptions<T>, `default`> & {
58
- default: () => T;
59
- mutable: true;
60
- };
61
- /** @public */
62
- type RegularAtomFamilyOptions<T, K extends Canonical> = {
63
- /** The unique identifier of the atom family */
64
- key: string;
65
- /** The starting value of the atom family */
66
- default: T | ((key: K) => T);
67
- /** Hooks used to run side effects when an atom in the family is set */
68
- effects?: (key: K) => AtomEffect<T>[];
69
- };
70
- type RegularAtomFamilyToken<T, K extends Canonical> = {
71
- key: string;
72
- type: `atom_family`;
73
- __T?: T;
74
- __K?: K;
75
- };
76
- type MutableAtomFamilyOptions<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = JsonInterface<T, J> & {
77
- key: string;
78
- default: (key: K) => T;
79
- effects?: (key: K) => AtomEffect<T>[];
80
- mutable: true;
81
- };
82
- type MutableAtomFamilyToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = {
83
- key: string;
84
- type: `mutable_atom_family`;
85
- __T?: T;
86
- __J?: J;
87
- __K?: K;
88
- };
89
- type AtomFamilyToken<T, K extends Canonical = Canonical> = MutableAtomFamilyToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamilyToken<T, K>;
90
- declare function atomFamily<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical>(options: MutableAtomFamilyOptions<T, J, K>): MutableAtomFamilyToken<T, J, K>;
91
- declare function atomFamily<T, K extends Canonical>(options: RegularAtomFamilyOptions<T, K>): RegularAtomFamilyToken<T, K>;
92
-
93
- type TransactionToken<F extends Func> = {
94
- key: string;
95
- type: `transaction`;
96
- __F?: F;
97
- };
98
- type StateCreation<Token extends ReadableToken<any>> = {
99
- type: `state_creation`;
100
- token: Token;
101
- };
102
- type AtomDisposal<Token extends ReadableToken<any>> = {
103
- type: `state_disposal`;
104
- subType: `atom`;
105
- token: Token;
106
- value: TokenType<Token>;
107
- };
108
- type SelectorDisposal<Token extends ReadableToken<any>> = {
109
- type: `state_disposal`;
110
- subType: `selector`;
111
- token: Token;
112
- };
113
- type StateDisposal<Token extends ReadableToken<any>> = AtomDisposal<Token> | SelectorDisposal<Token>;
114
- type MoleculeCreation = {
115
- type: `molecule_creation`;
116
- key: Canonical;
117
- provenance: Canonical;
118
- };
119
- type MoleculeDisposal = {
120
- type: `molecule_disposal`;
121
- key: Canonical;
122
- provenance: stringified<Canonical>[];
123
- values: [key: string, value: any][];
124
- };
125
- type MoleculeTransfer = {
126
- type: `molecule_transfer`;
127
- key: Canonical;
128
- from: Canonical[];
129
- to: Canonical[];
130
- };
131
- type TransactionUpdateContent = KeyedStateUpdate<unknown> | MoleculeCreation | MoleculeDisposal | MoleculeTransfer | StateCreation<ReadableToken<unknown>> | StateDisposal<ReadableToken<unknown>> | TransactionUpdate<Func>;
132
- type TransactionUpdate<F extends Func> = {
133
- type: `transaction_update`;
134
- key: string;
135
- id: string;
136
- epoch: number;
137
- updates: TransactionUpdateContent[];
138
- params: Parameters<F>;
139
- output: ReturnType<F>;
140
- };
141
- type GetterToolkit = Pick<SetterToolkit, `find` | `get` | `json`>;
142
- type SetterToolkit = Readonly<{
143
- get: typeof getState$1;
144
- set: typeof setState$1;
145
- find: typeof findState$1;
146
- json: <T extends Transceiver<any>, J extends Json.Serializable>(state: MutableAtomToken<T, J>) => WritableSelectorToken<J>;
147
- }>;
148
- type ActorToolkit = Readonly<{
149
- get: typeof getState$1;
150
- set: typeof setState$1;
151
- find: typeof findState$1;
152
- json: <T extends Transceiver<any>, J extends Json.Serializable>(state: MutableAtomToken<T, J>) => WritableSelectorToken<J>;
153
- dispose: typeof disposeState;
154
- run: typeof runTransaction;
155
- env: () => EnvironmentData;
156
- }>;
157
- type Read<F extends Func> = (toolkit: GetterToolkit, ...parameters: Parameters<F>) => ReturnType<F>;
158
- type Write<F extends Func> = (toolkit: SetterToolkit, ...parameters: Parameters<F>) => ReturnType<F>;
159
- type Transact<F extends Func> = (toolkit: ActorToolkit, ...parameters: Parameters<F>) => ReturnType<F>;
160
- type TransactionOptions<F extends Func> = {
161
- key: string;
162
- do: Transact<F>;
163
- };
164
- type TransactionIO<Token extends TransactionToken<any>> = Token extends TransactionToken<infer F> ? F : never;
165
- declare function transaction<F extends Func>(options: TransactionOptions<F>): TransactionToken<F>;
166
- declare function runTransaction<F extends Func>(token: TransactionToken<F>, id?: string): (...parameters: Parameters<F>) => ReturnType<F>;
167
-
168
- type WritableSelectorOptions<T> = {
169
- key: string;
170
- get: Read<() => T>;
171
- set: Write<(newValue: T) => void>;
172
- };
173
- type ReadonlySelectorOptions<T> = {
174
- key: string;
175
- get: Read<() => T>;
176
- };
177
- /**
178
- * @public
179
- * Declare a selector. The value of a selector should depend
180
- * on the value of atoms or other selectors in the store.
181
- *
182
- * A writable selector can be "set" to a new value.
183
- * It is advised to set its dependencies to values
184
- * that would produce the new value of the selector.
185
- * @param options - {@link WritableSelectorOptions}.
186
- * @returns
187
- * The token for your selector.
188
- * @overload Writable
189
- */
190
- declare function selector<T>(options: WritableSelectorOptions<T>): WritableSelectorToken<T>;
191
- /**
192
- * @public
193
- * Declare a selector. The value of a selector should depend
194
- * on the value of atoms or other selectors in the store.
195
- * @param options - {@link ReadonlySelectorOptions}.
196
- */
197
- declare function selector<T>(options: ReadonlySelectorOptions<T>): ReadonlySelectorToken<T>;
198
- type WritableSelectorFamilyOptions<T, K extends Canonical> = {
199
- key: string;
200
- get: (key: K) => Read<() => T>;
201
- set: (key: K) => Write<(newValue: T) => void>;
202
- };
203
- type ReadonlySelectorFamilyOptions<T, K extends Canonical> = {
204
- key: string;
205
- get: (key: K) => Read<() => T>;
206
- };
207
- type WritableSelectorFamilyToken<T, K extends Canonical> = {
208
- key: string;
209
- type: `selector_family`;
210
- __T?: T;
211
- __K?: K;
212
- };
213
- type ReadonlySelectorFamilyToken<T, K extends Canonical> = {
214
- key: string;
215
- type: `readonly_selector_family`;
216
- __T?: T;
217
- __K?: K;
218
- };
219
- type SelectorFamilyToken<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
220
- declare function selectorFamily<T, K extends Canonical>(options: WritableSelectorFamilyOptions<T, K>): WritableSelectorFamilyToken<T, K>;
221
- declare function selectorFamily<T, K extends Canonical>(options: ReadonlySelectorFamilyOptions<T, K>): ReadonlySelectorFamilyToken<T, K>;
222
-
223
- type TimelineManageable = AtomFamilyToken<any, any> | AtomToken<any>;
224
- type AtomOnly<M extends TimelineManageable> = M extends AtomFamilyToken<any, any> ? AtomToken<any> : M extends AtomToken<any> ? M : never;
225
- type TimelineToken<M> = {
226
- key: string;
227
- type: `timeline`;
228
- __M?: M;
229
- };
230
- type TimelineOptions<ManagedAtom extends TimelineManageable> = {
231
- key: string;
232
- scope: ManagedAtom[];
233
- shouldCapture?: (update: TimelineUpdate<ManagedAtom>, timeline: Timeline<TimelineManageable>) => boolean;
234
- };
235
- type TimelineUpdate<ManagedAtom extends TimelineManageable> = TimelineAtomUpdate<ManagedAtom> | TimelineMoleculeCreation | TimelineMoleculeDisposal | TimelineSelectorUpdate<ManagedAtom> | TimelineStateCreation<AtomOnly<ManagedAtom>> | TimelineStateDisposal<AtomOnly<ManagedAtom>> | TimelineTransactionUpdate;
236
- declare const timeline: <ManagedAtom extends TimelineManageable>(options: TimelineOptions<ManagedAtom>) => TimelineToken<ManagedAtom>;
237
- declare const redo: (tl: TimelineToken<any>) => void;
238
- declare const undo: (tl: TimelineToken<any>) => void;
239
-
240
- /**
241
- * @public
242
- * Disposes of a state in the implicit store
243
- * @param token - The token of the state to dispose
244
- * @overload Default
245
- */
246
- declare function disposeState(token: ReadableToken<any>): void;
247
- /**
248
- * @public
249
- * Disposes of a state family in the implicit store
250
- * @param token - The token of the state family to dispose
251
- * @param key - The unique key of the state to dispose
252
- */
253
- declare function disposeState<K extends Canonical>(token: ReadableFamilyToken<any, K>, key: K): void;
254
-
255
- /**
256
- * @public
257
- * Finds a {@link MutableAtomToken} in the store
258
- * @param token - A {@link MutableAtomFamilyToken}
259
- * @param key - The key of the state
260
- * @returns
261
- * The current value of the state
262
- * @overload Mutable Atom
263
- */
264
- declare function findState<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical, Key extends K>(token: MutableAtomFamilyToken$1<T, J, K>, key: Key): MutableAtomToken$1<T, J, K>;
265
- /**
266
- * @public
267
- * Finds a state in the store
268
- * @param token - The token of the state family
269
- * @param key - The key of the state
270
- * @returns
271
- * The current value of the state
272
- * @overload Regular Atom
273
- */
274
- declare function findState<T, K extends Canonical, Key extends K>(token: RegularAtomFamilyToken$1<T, K>, key: Key): RegularAtomToken$1<T, K>;
275
- /**
276
- * @public
277
- * Finds a state in the store
278
- * @param token - The token of the state family
279
- * @param key - The key of the state
280
- * @returns
281
- * The current value of the state
282
- * @overload Writable Selector
283
- */
284
- declare function findState<T, K extends Canonical, Key extends K>(token: WritableSelectorFamilyToken$1<T, K>, key: Key): WritableSelectorToken$1<T, K>;
285
- /**
286
- * @public
287
- * Finds a state in the store
288
- * @param token - The token of the state family
289
- * @param key - The key of the state
290
- * @returns
291
- * The current value of the state
292
- * @overload Readonly Selector
293
- */
294
- declare function findState<T, K extends Canonical, Key extends K>(token: ReadonlySelectorFamilyToken$1<T, K>, key: Key): ReadonlySelectorToken$1<T, K>;
295
- /**
296
- * @public
297
- * Finds a state in the store
298
- * @param token - The token of the state family
299
- * @param key - The key of the state
300
- * @returns
301
- * The current value of the state
302
- * @overload Writable State
303
- */
304
- declare function findState<T, K extends Canonical, Key extends K>(token: WritableFamilyToken$1<T, K>, key: Key): WritableToken$1<T, K>;
305
- /**
306
- * @public
307
- * Finds a {@link ReadableToken} in the store
308
- * @param token - A {@link ReadableFamilyToken}
309
- * @param key - The key of the state
310
- * @returns
311
- * The current value of the state
312
- * @overload Unknown
313
- * @default
314
- */
315
- declare function findState<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken$1<T, K>, key: Key): ReadableToken$1<T, K>;
316
-
317
- /**
318
- * @public
319
- * Get the current value of a state
320
- * @param token - The token of the state to get
321
- * @return The current value of the state
322
- * @overload Default
323
- * @default
324
- */
325
- declare function getState<T>(token: ReadableToken<T>): T;
326
- /**
327
- * @public
328
- * Get the current value of a state family
329
- * @param token - The token of a state family
330
- * @param key - The unique key of the state to get
331
- * @return The current value of the state
332
- * @overload Streamlined
333
- */
334
- declare function getState<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key): T;
335
-
336
- interface JoinOptions<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null> extends JunctionSchemaBase<ASide, BSide>, Partial<JunctionEntriesBase<AType, BType, Content>> {
337
- readonly key: string;
338
- readonly cardinality: Cardinality;
339
- readonly isAType: Refinement<string, AType>;
340
- readonly isBType: Refinement<string, BType>;
341
- }
342
- type JoinToken<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null = null> = {
343
- key: string;
344
- type: `join`;
345
- cardinality: Cardinality;
346
- a: ASide;
347
- b: BSide;
348
- __aType?: AType;
349
- __bType?: BType;
350
- __content?: Content;
351
- };
352
- declare function join<const ASide extends string, const AType extends string, const BSide extends string, const BType extends string, const Cardinality extends `1:1` | `1:n` | `n:n`>(options: JoinOptions<ASide, AType, BSide, BType, Cardinality, null>, defaultContent?: undefined, store?: Store): JoinToken<ASide, AType, BSide, BType, Cardinality, null>;
353
- declare function join<const ASide extends string, const AType extends string, const BSide extends string, const BType extends string, const Cardinality extends `1:1` | `1:n` | `n:n`, const Content extends Json.Object>(options: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>, defaultContent: Content, store?: Store): JoinToken<ASide, AType, BSide, BType, Cardinality, Content>;
354
- type JoinStates<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null> = Cardinality extends `1:1` ? (Content extends Json.Object ? {
355
- readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorToken$1<[
356
- AType,
357
- Content
358
- ] | null, BType>;
359
- } & {
360
- readonly [B in BSide as `${B}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorToken$1<[
361
- BType,
362
- Content
363
- ] | null, AType>;
364
- } : {}) & {
365
- readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorToken$1<AType | null, BType>;
366
- } & {
367
- readonly [B in BSide as `${B}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorToken$1<BType | null, AType>;
368
- } : Cardinality extends `1:n` ? (Content extends Json.Object ? {
369
- readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorToken$1<[
370
- AType,
371
- Content
372
- ] | null, BType>;
373
- } & {
374
- readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorToken$1<[
375
- BType,
376
- Content
377
- ][], AType>;
378
- } : {}) & {
379
- readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorToken$1<AType | null, BType>;
380
- } & {
381
- readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorToken$1<BType[], AType>;
382
- } : Cardinality extends `n:n` ? (Content extends Json.Object ? {
383
- readonly [A in ASide as `${A}EntriesOf${Capitalize<BSide>}`]: ReadonlySelectorToken$1<[
384
- AType,
385
- Content
386
- ][], BType>;
387
- } & {
388
- readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorToken$1<[
389
- BType,
390
- Content
391
- ][], AType>;
392
- } : {}) & {
393
- readonly [A in ASide as `${A}KeysOf${Capitalize<BSide>}`]: ReadonlySelectorToken$1<AType[], BType>;
394
- } & {
395
- readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorToken$1<BType[], AType>;
396
- } : never;
397
- declare function findRelations<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>, key: AType | BType): JoinStates<ASide, AType, BSide, BType, Cardinality, Content>;
398
- declare function editRelations<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>, change: (relations: Junction<ASide, AType, BSide, BType, Content>) => void): void;
399
- declare function getInternalRelations<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>): MutableAtomFamilyToken$1<SetRTX<string>, SetRTXJson<string>, string>;
400
-
401
- declare const LoggerIconDictionary: {
402
- readonly "\u231B": "Timeline event fully captured";
403
- readonly "\u23E9": "Timeline redo";
404
- readonly "\u23EA": "Timeline undo";
405
- readonly "\u23ED\uFE0F": "Transaction redo";
406
- readonly "\u23EE\uFE0F": "Transaction undo";
407
- readonly "\u23F3": "Timeline event partially captured";
408
- readonly "\u23F9\uFE0F": "Time-travel complete";
409
- readonly "\u2705": "Realtime transaction success";
410
- readonly "\u2728": "Computation complete";
411
- readonly "\u274C": "Conflict prevents attempted action";
412
- readonly "\u2B55": "Operation start";
413
- readonly "\uD83D\uDD34": "Operation complete";
414
- readonly "\u2757": "Operation blocked";
415
- readonly "\uD83D\uDFE2": "Operation unblocked";
416
- readonly "\uD83D\uDC1E": "Possible bug in AtomIO";
417
- readonly "\uD83D\uDC40": "Subscription added";
418
- readonly "\uD83D\uDC4B": "Greeting";
419
- readonly "\uD83D\uDC4D": "Realtime acknowledgment";
420
- readonly "\uD83D\uDC6A": "Family member added";
421
- readonly "\uD83D\uDC81": "Notice";
422
- readonly "\uD83D\uDCA5": "Caught";
423
- readonly "\uD83D\uDCC1": "Stow update";
424
- readonly "\uD83D\uDCC3": "Copy mutable";
425
- readonly "\uD83D\uDCD6": "Read state";
426
- readonly "\uD83D\uDCDD": "Write state";
427
- readonly "\uD83D\uDCE2": "Notify subscribers";
428
- readonly "\uD83D\uDD04": "Realtime transaction synchronized";
429
- readonly "\uD83D\uDD0C": "Register dependency";
430
- readonly "\uD83D\uDD0D": "Discover root";
431
- readonly "\uD83D\uDD25": "Delete state";
432
- readonly "\uD83D\uDD27": "Create mutable atom";
433
- readonly "\uD83D\uDD28": "Create immutable atom";
434
- readonly "\uD83D\uDDD1": "Evict cached value";
435
- readonly "\uD83D\uDE48": "Subscription canceled";
436
- readonly "\uD83D\uDE80": "Performance measure";
437
- readonly "\uD83D\uDEC4": "Apply transaction";
438
- readonly "\uD83D\uDEE0\uFE0F": "Install atom into store";
439
- readonly "\uD83D\uDEEB": "Begin transaction";
440
- readonly "\uD83D\uDEEC": "Complete transaction";
441
- readonly "\uD83E\uDDEE": "Computing selector";
442
- readonly "\uD83E\uDDF9": "Prepare to evict";
443
- readonly "\uD83E\uDE82": "Abort transaction";
444
- readonly "\uD83E\uDD1E": "Realtime optimistic update enqueued";
445
- readonly "\uD83D\uDC48": "Realtime confirmed update enqueued";
446
- readonly "\uD83E\uDDD1\u200D\u2696\uFE0F": "Realtime update beginning reconciliation";
447
- readonly "\uD83D\uDECE\uFE0F": "Realtime transaction received";
448
- readonly "\uD83D\uDD2D": "Determining realtime perspective";
449
- readonly "\uD83D\uDD8C": "Redacting realtime update";
450
- readonly "\uD83D\uDC41": "Determining perspective";
451
- };
452
- type LoggerIcon = keyof typeof LoggerIconDictionary;
453
- type TokenDenomination = `atom_family` | `atom` | `continuity` | `molecule_family` | `molecule` | `mutable_atom_family` | `mutable_atom` | `readonly_selector_family` | `readonly_selector` | `selector_family` | `selector` | `state` | `timeline` | `transaction` | `unknown`;
454
- declare const LOG_LEVELS: readonly ["info", "warn", "error"];
455
- type LogLevel = (typeof LOG_LEVELS)[number];
456
- type LogFn = (icon: LoggerIcon, denomination: TokenDenomination, tokenKey: string, message: string, ...rest: unknown[]) => void;
457
- type LogFilter = (...params: Parameters<LogFn>) => boolean;
458
- type Logger = Record<LogLevel, LogFn>;
459
- declare const simpleLog: (logLevel: keyof Logger) => LogFn;
460
- declare const simpleLogger: Logger;
461
- declare class AtomIOLogger implements Logger {
462
- logLevel: `error` | `info` | `warn` | null;
463
- private readonly filter;
464
- private readonly logger;
465
- constructor(logLevel: `error` | `info` | `warn` | null, filter?: LogFilter, logger?: Logger);
466
- error: LogFn;
467
- info: LogFn;
468
- warn: LogFn;
469
- }
470
-
471
- declare const $claim: unique symbol;
472
- type Claim<K extends Canonical> = K & {
473
- [$claim]?: true;
474
- };
475
- declare class Realm<H extends Hierarchy> {
476
- store: Store;
477
- constructor(store?: Store);
478
- allocate<V extends Vassal<H>, A extends Above<V, H>>(provenance: A, key: V, attachmentStyle?: `all` | `any`): Claim<V>;
479
- fuse<C extends CompoundFrom<H>, T extends C extends CompoundTypedKey<infer t, any, any> ? t : never, A extends C extends CompoundTypedKey<any, infer v, any> ? v : never, B extends C extends CompoundTypedKey<any, any, infer m> ? m : never>(type: T, reagentA: SingularTypedKey<A>, reagentB: SingularTypedKey<B>): Claim<CompoundTypedKey<T, A, B>>;
480
- deallocate<V extends Vassal<H>>(claim: Claim<V>): void;
481
- claim<V extends Exclude<Vassal<H>, CompoundTypedKey>, A extends Above<V, H>>(newProvenance: A, claim: Claim<V>, exclusive?: `exclusive`): Claim<V>;
482
- }
483
- declare class Anarchy {
484
- store: Store;
485
- realm: Realm<any>;
486
- constructor(store?: Store);
487
- allocate(provenance: Canonical, key: Canonical, attachmentStyle?: `all` | `any`): void;
488
- deallocate(key: Canonical): void;
489
- claim(newProvenance: Canonical, key: Canonical, exclusive?: `exclusive`): void;
490
- }
491
- declare const T$ = "T$";
492
- type T$ = typeof T$;
493
- type TypeTag<T extends string> = `${T$}--${T}`;
494
- type SingularTypedKey<T extends string = string> = `${T}::${string}`;
495
- type CompoundTypedKey<A extends string = string, B extends string = string, C extends string = string> = `${TypeTag<A>}==${SingularTypedKey<B>}++${SingularTypedKey<C>}`;
496
- type TypedKey<A extends string = string, B extends string = string, C extends string = string> = CompoundTypedKey<A, B, C> | SingularTypedKey<A>;
497
- type Scope = SingularTypedKey[];
498
- type MutualFealty = {
499
- above: Scope;
500
- below: CompoundTypedKey;
501
- };
502
- type ExclusiveFealty = {
503
- above: TypedKey | `root`;
504
- below: Scope;
505
- };
506
- type Fealty = ExclusiveFealty | MutualFealty;
507
- type Hierarchy<F extends Fealty[] = Fealty[]> = Each<F>;
508
- type Vassal<H extends Hierarchy> = {
509
- [K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : H[K] extends {
510
- below: Array<infer V>;
511
- } ? V extends TypedKey ? V : never : never;
512
- }[keyof H];
513
- type Above<TK extends TypedKey, H extends Hierarchy> = {
514
- [K in keyof H]: H[K] extends MutualFealty ? TK extends H[K][`below`] ? H[K][`above`] : never : H[K] extends {
515
- below: Array<infer V>;
516
- } ? TK extends V ? H[K] extends ExclusiveFealty ? H[K][`above`] : never : never : never;
517
- }[keyof H];
518
- type Below<TK extends TypedKey | TypedKey[], H extends Hierarchy> = {
519
- [K in keyof H]: H[K] extends MutualFealty ? TK extends H[K][`above`] ? H[K][`below`] : TK extends H[K][`above`][number] ? H[K][`below`] : never : H[K] extends {
520
- above: infer V;
521
- } ? TK extends V ? H[K] extends ExclusiveFealty ? H[K][`below`][number] : never : never : never;
522
- }[keyof H];
523
- type Mutuals<TK extends TypedKey | TypedKey[], H extends Hierarchy> = {
524
- [K in keyof H]: H[K] extends MutualFealty ? TK extends H[K][`above`][number] ? [mutual: Exclude<H[K][`above`][number], TK>, below: H[K][`below`]] : never : never;
525
- }[keyof H];
526
- type CompoundFrom<H extends Hierarchy> = {
527
- [K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : never;
528
- }[keyof H];
529
-
530
- /**
531
- * @public
532
- * A function that sets the value of a state.
533
- * @param oldValue - The current value of the state.
534
- * @returns
535
- * The new value of the state.
536
- */
537
- type Setter<T, New extends T> = (oldValue: T) => New;
538
- /**
539
- * @public
540
- * Set the value of a state into the implicit store.
541
- * @param token - An atom or writable selector token.
542
- * @param value - The new value of the state.
543
- * @overload Default
544
- * @default
545
- */
546
- declare function setState<T, New extends T>(token: WritableToken<T>, value: New | Setter<T, New>): void;
547
- /**
548
- * @public
549
- * Set the value of a state into the implicit store.
550
- * @param token - An atom family or writable selector family token.
551
- * @param key - The unique key of the state to set.
552
- * @param value - The new value of the state.
553
- * @overload Streamlined
554
- */
555
- declare function setState<T, K extends Canonical, New extends T, Key extends K>(token: WritableFamilyToken<T, K>, key: Key, value: New | Setter<T, New>): void;
556
-
557
- declare class Silo {
558
- store: Store;
559
- atom: typeof atom;
560
- atomFamily: typeof atomFamily;
561
- selector: typeof selector;
562
- selectorFamily: typeof selectorFamily;
563
- transaction: typeof transaction;
564
- timeline: typeof timeline;
565
- findState: typeof findState$1;
566
- getState: typeof getState;
567
- setState: typeof setState;
568
- disposeState: typeof disposeState;
569
- subscribe: typeof subscribe;
570
- undo: typeof undo;
571
- redo: typeof redo;
572
- runTransaction: typeof runTransaction;
573
- install: (tokens: AtomIOToken[], store?: Store) => void;
574
- constructor(config: Store[`config`], fromStore?: Store | null);
575
- }
576
-
577
- type StateUpdate<T> = {
578
- newValue: T;
579
- oldValue: T;
580
- };
581
- type KeyedStateUpdate<T> = Flat<StateUpdate<T> & {
582
- key: string;
583
- type: `atom_update` | `selector_update`;
584
- family?: FamilyMetadata;
585
- }>;
586
- type UpdateHandler<T> = (update: StateUpdate<T>) => void;
587
- type TransactionUpdateHandler<F extends Func> = (data: TransactionUpdate<F>) => void;
588
- declare function subscribe<T>(token: ReadableToken<T>, handleUpdate: UpdateHandler<T>, key?: string): () => void;
589
- declare function subscribe<F extends Func>(token: TransactionToken<F>, handleUpdate: TransactionUpdateHandler<F>, key?: string): () => void;
590
- declare function subscribe<M extends TimelineManageable>(token: TimelineToken<M>, handleUpdate: (update: TimelineUpdate<M> | `redo` | `undo`) => void, key?: string): () => void;
591
-
592
- type TokenType<Comparison extends ReadableFamilyToken$1<any, any> | ReadableToken$1<any>> = Comparison extends ReadableToken$1<infer RepresentedValue> ? RepresentedValue : Comparison extends ReadableFamilyToken$1<infer RepresentedValue, any> ? RepresentedValue : never;
593
- declare function isToken<KnownToken extends RegularAtomToken$1<any>>(knownToken: KnownToken, unknownToken: ReadableToken$1<any>): unknownToken is RegularAtomToken$1<TokenType<KnownToken>>;
594
- declare function isToken<KnownToken extends MutableAtomToken$1<any, any>>(knownToken: KnownToken, unknownToken: ReadableToken$1<any>): unknownToken is MutableAtomToken$1<TokenType<KnownToken>, any>;
595
- declare function isToken<KnownToken extends WritableSelectorToken$1<any>>(knownToken: KnownToken, unknownToken: ReadableToken$1<any>): unknownToken is WritableSelectorToken$1<TokenType<KnownToken>>;
596
- declare function isToken<KnownToken extends ReadonlySelectorToken$1<any>>(knownToken: KnownToken, unknownToken: ReadableToken$1<any>): unknownToken is ReadonlySelectorToken$1<TokenType<KnownToken>>;
597
- declare function isToken<KnownToken extends WritableToken$1<any>>(knownToken: KnownToken, unknownToken: ReadableToken$1<any>): unknownToken is WritableToken$1<TokenType<KnownToken>>;
598
- declare function isToken<KnownToken extends ReadableToken$1<any>>(knownToken: KnownToken, unknownToken: ReadableToken$1<any>): unknownToken is ReadableToken$1<TokenType<KnownToken>>;
599
- declare function belongsTo<Family extends RegularAtomFamilyToken$1<any, any>>(family: Family, unknownToken: ReadableToken$1<any>): unknownToken is RegularAtomToken$1<TokenType<Family>>;
600
- declare function belongsTo<Family extends MutableAtomFamilyToken$1<any, any, any>>(family: Family, unknownToken: ReadableToken$1<any>): unknownToken is MutableAtomToken$1<TokenType<Family>, any>;
601
- declare function belongsTo<Family extends WritableSelectorFamilyToken$1<any, any>>(family: Family, unknownToken: ReadableToken$1<any>): unknownToken is WritableSelectorToken$1<TokenType<Family>>;
602
- declare function belongsTo<Family extends ReadonlySelectorFamilyToken$1<any, any>>(family: Family, unknownToken: ReadableToken$1<any>): unknownToken is ReadonlySelectorToken$1<TokenType<Family>>;
603
- declare function belongsTo<Family extends WritableFamilyToken$1<any, any>>(family: Family, unknownToken: ReadableToken$1<any>): unknownToken is WritableToken$1<TokenType<Family>>;
604
- declare function belongsTo<Family extends ReadableFamilyToken$1<any, any>>(family: Family, unknownToken: ReadableToken$1<any>): unknownToken is ReadableToken$1<TokenType<Family>>;
605
-
606
- /**
607
- * @public
608
- * A token is an object that uniquely identifies a particular state, family, timeline, or transaction.
609
- *
610
- * While they represent one of these resources, they are not the resource itself. Think of them like paper currency representing money in the bank.
611
- *
612
- * Tokens are returned from resource creation functions, such as {@link atom} and {@link transaction}.
613
- *
614
- * Tokens can be used as parameters to functions that take a token, such as {@link getState}, {@link setState}, or {@link runTransaction}.
615
- *
616
- * Tokens are fully serializable, so they can be passed between processes.
617
- */
618
- type AtomIOToken = ReadableFamilyToken<any, any> | ReadableToken<any> | TimelineToken<any> | TransactionToken<any>;
619
- /** @public */
620
- type RegularAtomToken<T, K extends Canonical = any> = {
621
- /** The unique identifier of the atom. */
622
- key: string;
623
- /** Discriminator. */
624
- type: `atom`;
625
- /** Present if the atom belongs to a family. */
626
- family?: FamilyMetadata<K>;
627
- /** Never present. This is a marker that preserves the type of the atom's value. */
628
- __T?: T;
629
- };
630
- /** @public */
631
- type MutableAtomToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical = any> = {
632
- /** The unique identifier of the atom. */
633
- key: string;
634
- /** Discriminator. */
635
- type: `mutable_atom`;
636
- /** Present if the atom belongs to a family. */
637
- family?: FamilyMetadata<K>;
638
- /** Never present. This is a marker that preserves the JSON form of the atom's transceiver value. */
639
- __J?: J;
640
- /** Never present. This is a marker that preserves the type of the atom's transceiver value. */
641
- __U?: T extends Transceiver<infer Update> ? Update : never;
642
- };
643
- /** @public */
644
- type AtomToken<T, K extends Canonical = any> = MutableAtomToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomToken<T, K>;
645
- /** @public */
646
- type WritableSelectorToken<T, K extends Canonical = any> = {
647
- /** The unique identifier of the selector. */
648
- key: string;
649
- /** Discriminator. */
650
- type: `selector`;
651
- /** Present if the selector belongs to a family. */
652
- family?: FamilyMetadata<K>;
653
- /** Never present. This is a marker that preserves the type of the selector's value. */
654
- __T?: T;
655
- };
656
- /** @public */
657
- type ReadonlySelectorToken<T, K extends Canonical = any> = {
658
- /** The unique identifier of the selector. */
659
- key: string;
660
- /** Discriminator. */
661
- type: `readonly_selector`;
662
- /** Present if the selector belongs to a family. */
663
- family?: FamilyMetadata<K>;
664
- /** Never present. This is a marker that preserves the type of the selector's value. */
665
- __T?: T;
666
- };
667
- /** @public */
668
- type SelectorToken<T, K extends Canonical = any> = ReadonlySelectorToken<T, K> | WritableSelectorToken<T, K>;
669
- /**
670
- * @public
671
- * These states can be set.
672
- */
673
- type WritableToken<T, K extends Canonical = any> = AtomToken<T, K> | WritableSelectorToken<T, K>;
674
- /**
675
- * @public
676
- * These states cannot be set.
677
- */
678
- type ReadableToken<T, K extends Canonical = any> = AtomToken<T, K> | SelectorToken<T, K>;
679
- /**
680
- * @public
681
- * States belonging to this family can be set.
682
- */
683
- type WritableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
684
- /**
685
- * @public
686
- * States belonging to this family cannot be set.
687
- */
688
- type ReadableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | SelectorFamilyToken<T, K>;
689
- /**
690
- * @public
691
- * Identifies a state's connection to its family.
692
- */
693
- type FamilyMetadata<K extends Canonical = any> = {
694
- /** The family's unique key. */
695
- key: string;
696
- /** The family member's unique identifier, in the form of a string. */
697
- subKey: stringified<K>;
698
- };
699
- type Loadable<T> = Promise<T> | T;
700
-
701
- export { $claim, type Above, type ActorToolkit, Anarchy, type AtomDisposal, type AtomEffect, type AtomFamilyToken, AtomIOLogger, type AtomIOToken, type AtomOnly, type AtomToken, type Below, type Claim, type CompoundFrom, type CompoundTypedKey, type Effectors, type FamilyMetadata, type GetterToolkit, type Hierarchy, type JoinOptions, type JoinStates, type JoinToken, type KeyedStateUpdate, LOG_LEVELS, type Loadable, type LogFilter, type LogFn, type LogLevel, type Logger, type LoggerIcon, type MoleculeCreation, type MoleculeDisposal, type MoleculeTransfer, type MutableAtomFamilyOptions, type MutableAtomFamilyToken, type MutableAtomOptions, type MutableAtomToken, type Mutuals, type Read, type ReadableFamilyToken, type ReadableToken, type ReadonlySelectorFamilyOptions, type ReadonlySelectorFamilyToken, type ReadonlySelectorOptions, type ReadonlySelectorToken, Realm, type RegularAtomFamilyOptions, type RegularAtomFamilyToken, type RegularAtomOptions, type RegularAtomToken, type SelectorDisposal, type SelectorFamilyToken, type SelectorToken, type Setter, type SetterToolkit, Silo, type SingularTypedKey, type StateCreation, type StateDisposal, type StateUpdate, T$, 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 TypeTag, type TypedKey, type UpdateHandler, type Vassal, type WritableFamilyToken, type WritableSelectorFamilyOptions, type WritableSelectorFamilyToken, type WritableSelectorOptions, type WritableSelectorToken, type WritableToken, type Write, atom, atomFamily, belongsTo, disposeState, editRelations, findRelations, findState, getInternalRelations, getState, isToken, join, redo, runTransaction, selector, selectorFamily, setState, simpleLog, simpleLogger, subscribe, timeline, transaction, undo };