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