atom.io 0.6.9 → 0.7.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/README.md +21 -2
- package/dist/index.d.mts +34 -421
- package/dist/index.d.ts +34 -421
- package/dist/index.js +248 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +209 -4
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +342 -0
- package/internal/dist/index.d.ts +342 -0
- package/internal/dist/index.js +1873 -0
- package/internal/dist/index.js.map +1 -0
- package/internal/dist/index.mjs +1798 -0
- package/internal/dist/index.mjs.map +1 -0
- package/internal/package.json +15 -0
- package/internal/src/atom/create-atom.ts +75 -0
- package/internal/src/atom/delete-atom.ts +10 -0
- package/internal/src/atom/index.ts +3 -0
- package/internal/src/atom/is-default.ts +37 -0
- package/internal/src/caching.ts +21 -0
- package/internal/src/families/create-atom-family.ts +59 -0
- package/internal/src/families/create-readonly-selector-family.ts +45 -0
- package/internal/src/families/create-selector-family.ts +67 -0
- package/internal/src/families/index.ts +3 -0
- package/internal/src/get-state-internal.ts +23 -0
- package/internal/src/index.ts +13 -0
- package/internal/src/mutable/create-mutable-atom-family.ts +25 -0
- package/internal/src/mutable/create-mutable-atom.ts +49 -0
- package/internal/src/mutable/get-json-token.ts +22 -0
- package/internal/src/mutable/get-update-token.ts +20 -0
- package/internal/src/mutable/index.ts +17 -0
- package/internal/src/mutable/is-atom-token-mutable.ts +7 -0
- package/internal/src/mutable/tracker-family.ts +61 -0
- package/internal/src/mutable/tracker.ts +164 -0
- package/internal/src/mutable/transceiver.ts +110 -0
- package/internal/src/operation.ts +68 -0
- package/internal/src/selector/create-read-write-selector.ts +65 -0
- package/internal/src/selector/create-readonly-selector.ts +49 -0
- package/internal/src/selector/create-selector.ts +65 -0
- package/internal/src/selector/index.ts +5 -0
- package/internal/src/selector/lookup-selector-sources.ts +20 -0
- package/internal/src/selector/register-selector.ts +61 -0
- package/internal/src/selector/trace-selector-atoms.ts +45 -0
- package/internal/src/selector/update-selector-atoms.ts +34 -0
- package/internal/src/set-state/become.ts +10 -0
- package/internal/src/set-state/copy-mutable-if-needed.ts +23 -0
- package/internal/src/set-state/copy-mutable-in-transaction.ts +59 -0
- package/internal/src/set-state/copy-mutable-into-new-store.ts +34 -0
- package/internal/src/set-state/emit-update.ts +23 -0
- package/internal/src/set-state/evict-downstream.ts +39 -0
- package/internal/src/set-state/index.ts +2 -0
- package/internal/src/set-state/set-atom-state.ts +38 -0
- package/internal/src/set-state/set-selector-state.ts +19 -0
- package/internal/src/set-state/set-state-internal.ts +18 -0
- package/internal/src/set-state/stow-update.ts +42 -0
- package/internal/src/store/deposit.ts +43 -0
- package/internal/src/store/index.ts +5 -0
- package/internal/src/store/lookup.ts +26 -0
- package/internal/src/store/store.ts +154 -0
- package/internal/src/store/withdraw-new-family-member.ts +53 -0
- package/internal/src/store/withdraw.ts +113 -0
- package/internal/src/subject.ts +21 -0
- package/internal/src/subscribe/index.ts +1 -0
- package/internal/src/subscribe/recall-state.ts +19 -0
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +47 -0
- package/internal/src/timeline/add-atom-to-timeline.ts +189 -0
- package/internal/src/timeline/index.ts +3 -0
- package/internal/src/timeline/time-travel-internal.ts +91 -0
- package/internal/src/timeline/timeline-internal.ts +115 -0
- package/internal/src/transaction/abort-transaction.ts +12 -0
- package/internal/src/transaction/apply-transaction.ts +64 -0
- package/internal/src/transaction/build-transaction.ts +39 -0
- package/internal/src/transaction/index.ts +26 -0
- package/internal/src/transaction/redo-transaction.ts +22 -0
- package/internal/src/transaction/transaction-internal.ts +64 -0
- package/internal/src/transaction/undo-transaction.ts +22 -0
- package/introspection/dist/index.d.mts +3 -197
- package/introspection/dist/index.d.ts +3 -197
- package/introspection/dist/index.js +329 -4
- package/introspection/dist/index.js.map +1 -1
- package/introspection/dist/index.mjs +310 -4
- package/introspection/dist/index.mjs.map +1 -1
- package/introspection/src/attach-atom-index.ts +84 -0
- package/introspection/src/attach-introspection-states.ts +38 -0
- package/introspection/src/attach-selector-index.ts +90 -0
- package/introspection/src/attach-timeline-family.ts +59 -0
- package/introspection/src/attach-timeline-index.ts +38 -0
- package/introspection/src/attach-transaction-index.ts +40 -0
- package/introspection/src/attach-transaction-logs.ts +43 -0
- package/introspection/src/index.ts +20 -0
- package/json/dist/index.d.mts +10 -2
- package/json/dist/index.d.ts +10 -2
- package/json/dist/index.js +83 -26
- package/json/dist/index.js.map +1 -1
- package/json/dist/index.mjs +74 -3
- package/json/dist/index.mjs.map +1 -1
- package/json/src/index.ts +5 -0
- package/json/src/select-json-family.ts +35 -0
- package/json/src/select-json.ts +22 -0
- package/package.json +103 -63
- package/react/dist/index.d.mts +9 -17
- package/react/dist/index.d.ts +9 -17
- package/react/dist/index.js +44 -27
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs +24 -4
- package/react/dist/index.mjs.map +1 -1
- package/react/src/index.ts +2 -0
- package/react/src/store-context.tsx +12 -0
- package/react/src/store-hooks.ts +36 -0
- package/react-devtools/dist/index.css +50 -1
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +104 -71
- package/react-devtools/dist/index.d.ts +104 -71
- package/react-devtools/dist/index.js +2806 -44
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +2775 -10
- package/react-devtools/dist/index.mjs.map +1 -1
- package/react-devtools/src/AtomIODevtools.tsx +109 -0
- package/react-devtools/src/Button.tsx +23 -0
- package/react-devtools/src/StateEditor.tsx +75 -0
- package/react-devtools/src/StateIndex.tsx +159 -0
- package/react-devtools/src/TimelineIndex.tsx +88 -0
- package/react-devtools/src/TransactionIndex.tsx +70 -0
- package/react-devtools/src/Updates.tsx +150 -0
- package/react-devtools/src/devtools.scss +310 -0
- package/react-devtools/src/index.ts +72 -0
- package/realtime-react/dist/index.d.mts +8 -22
- package/realtime-react/dist/index.d.ts +8 -22
- package/realtime-react/dist/index.js +87 -32
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-react/dist/index.mjs +62 -6
- package/realtime-react/dist/index.mjs.map +1 -1
- package/realtime-react/src/index.ts +7 -0
- package/realtime-react/src/realtime-context.tsx +29 -0
- package/realtime-react/src/use-pull-family-member.ts +15 -0
- package/realtime-react/src/use-pull-mutable-family-member.ts +20 -0
- package/realtime-react/src/use-pull-mutable.ts +17 -0
- package/realtime-react/src/use-pull.ts +15 -0
- package/realtime-react/src/use-push.ts +19 -0
- package/realtime-react/src/use-server-action.ts +18 -0
- package/realtime-testing/dist/index.d.mts +49 -0
- package/realtime-testing/dist/index.d.ts +49 -0
- package/realtime-testing/dist/index.js +147 -0
- package/realtime-testing/dist/index.js.map +1 -0
- package/realtime-testing/dist/index.mjs +116 -0
- package/realtime-testing/dist/index.mjs.map +1 -0
- package/realtime-testing/src/index.ts +1 -0
- package/realtime-testing/src/setup-realtime-test.tsx +161 -0
- package/src/atom.ts +64 -9
- package/src/index.ts +36 -32
- package/src/logger.ts +3 -3
- package/src/selector.ts +3 -3
- package/src/silo.ts +29 -20
- package/src/subscribe.ts +3 -3
- package/src/timeline.ts +2 -2
- package/transceivers/set-rtx/dist/index.d.mts +39 -0
- package/transceivers/set-rtx/dist/index.d.ts +39 -0
- package/transceivers/set-rtx/dist/index.js +213 -0
- package/transceivers/set-rtx/dist/index.js.map +1 -0
- package/transceivers/set-rtx/dist/index.mjs +211 -0
- package/transceivers/set-rtx/dist/index.mjs.map +1 -0
- package/{realtime → transceivers/set-rtx}/package.json +1 -1
- package/transceivers/set-rtx/src/index.ts +1 -0
- package/transceivers/set-rtx/src/set-rtx.ts +242 -0
- package/realtime/dist/index.d.mts +0 -23
- package/realtime/dist/index.d.ts +0 -23
- package/realtime/dist/index.js +0 -32
- package/realtime/dist/index.js.map +0 -1
- package/realtime/dist/index.mjs +0 -7
- package/realtime/dist/index.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../hamr/src/react-data-designer/RelationEditor.module.scss","../src/devtools.scss"],"sourcesContent":[".class {\n display: flex;\n flex-flow: row wrap;\n gap: 4px;\n section {\n display: flex;\n flex-flow: row;\n margin-bottom: 1rem;\n border: 1px solid #ccc;\n padding: 2px;\n margin: 0;\n span {\n display: flex;\n }\n }\n}\n","main.atom_io_devtools {\n --fg-color: #eee;\n --bg-color: #111;\n --bg-tint1: #222;\n --fg-border: 1px solid var(--fg-color);\n @media (prefers-color-scheme: light) {\n --fg-color: #444;\n --bg-color: #ddd;\n --bg-tint1: #e3e3e3;\n }\n box-sizing: border-box;\n color: var(--fg-color);\n background-color: var(--bg-color);\n border: 2px solid var(--fg-color);\n position: fixed;\n right: 0;\n bottom: 0;\n height: 100%;\n display: flex;\n flex-flow: column;\n max-height: 800px;\n width: 100%;\n max-width: 500px;\n overflow-y: scroll;\n * {\n font-size: 16px;\n font-family: theia, monospace;\n }\n > header {\n padding: 5px;\n padding-left: 10px;\n padding-bottom: 0;\n display: flex;\n justify-content: space-between;\n h1 {\n font-size: inherit;\n margin: 0;\n font-size: 24px;\n font-family: charter;\n }\n nav {\n display: flex;\n flex-flow: row nowrap;\n button {\n cursor: pointer;\n background: none;\n border: none;\n padding: none;\n margin-bottom: -2px;\n z-index: 1000;\n &:disabled {\n cursor: default;\n background-color: var(--bg-tint1);\n color: var(--fg-color);\n border: var(--fg-border);\n border-bottom: none;\n }\n }\n }\n }\n > main {\n background: var(--bg-tint1);\n }\n main {\n overflow-y: scroll;\n flex-grow: 1;\n display: flex;\n flex-flow: column;\n gap: 0;\n article.index {\n .node .node {\n border-right: var(--fg-border);\n padding-right: 0;\n background: #fff3;\n }\n .node > .node {\n margin: 5px 0;\n margin-left: 12px;\n border-left: var(--fg-border);\n }\n .node {\n border-top: var(--fg-border);\n overflow-x: scroll;\n padding: 5px;\n &:last-of-type {\n border-bottom: var(--fg-border);\n }\n &.transaction_update {\n padding: 0;\n }\n header {\n display: flex;\n flex-flow: row;\n gap: 5px;\n position: sticky;\n z-index: 999;\n top: 0;\n button.carat {\n cursor: pointer;\n background: none;\n border: none;\n width: 20px;\n &.open {\n transform: rotate(90deg);\n }\n &:disabled {\n cursor: default;\n }\n }\n label {\n display: flex;\n flex-flow: row;\n gap: 5px;\n cursor: help;\n h2 {\n display: inline-block;\n margin: 0;\n }\n .detail {\n color: #777;\n @media (prefers-color-scheme: light) {\n color: #999;\n }\n }\n }\n }\n main {\n margin-left: 15px;\n }\n }\n section.transaction_log {\n margin-top: 0;\n header: {\n padding: 5px;\n }\n main {\n display: flex;\n flex-flow: row wrap;\n gap: 5px;\n .transaction_update {\n width: 100%;\n display: flex;\n flex-flow: row;\n align-items: flex-start;\n justify-content: flex-start;\n justify-items: flex-start;\n align-content: flex-start;\n border-left: var(--fg-border);\n border-top: var(--fg-border);\n header {\n padding: 5px;\n h4 {\n margin: 0;\n padding: 0;\n font-size: inherit;\n }\n }\n main {\n margin-left: 0;\n display: flex;\n flex-flow: column;\n gap: 0px;\n border-left: 1px solid #333;\n section ~ section {\n border-top: 1px solid #333;\n }\n section {\n padding: 5px;\n &.transaction_output {\n border-right: none;\n }\n &.transaction_impact {\n padding: 5px;\n }\n margin: 0;\n article {\n border-left: var(--fg-border);\n border-right: var(--fg-border);\n .summary {\n white-space: nowrap;\n }\n }\n }\n }\n }\n }\n }\n section.timeline_log {\n header {\n display: flex;\n label {\n display: flex;\n width: 100%;\n flex-grow: 1;\n .gap {\n flex-grow: 1;\n }\n nav {\n display: flex;\n flex-flow: row nowrap;\n gap: 5px;\n }\n }\n }\n .timeline_update {\n padding: 5px;\n border-left: var(--fg-border);\n h4 {\n margin: 0;\n padding: 0;\n font-size: inherit;\n }\n main {\n margin: 0;\n .node.atom_update {\n border-left: var(--fg-border);\n }\n }\n }\n .you_are_here {\n background: var(--fg-color);\n color: var(--bg-color);\n text-align: center;\n }\n }\n }\n }\n footer {\n display: flex;\n justify-content: flex-end;\n button {\n cursor: pointer;\n background: none;\n border: none;\n padding: none;\n position: absolute;\n right: 0;\n bottom: 0;\n }\n }\n\n .json_editor {\n input {\n font-family: theia;\n border: none;\n border-bottom: 1px solid;\n background: none;\n &:disabled {\n border: none;\n }\n }\n button {\n background: none;\n margin-left: auto;\n color: #777;\n border: none;\n font-family: theia;\n font-size: 14px;\n margin: none;\n padding: 4px;\n padding-bottom: 6px;\n cursor: pointer;\n &:hover {\n color: #333;\n background-color: #aaa;\n }\n }\n select {\n font-family: theia;\n font-size: 14px;\n background: none;\n border: none;\n color: #777;\n @media (prefers-color-scheme: light) {\n color: #999;\n }\n }\n .json_editor_unofficial {\n background-color: #777;\n button {\n color: #333;\n }\n }\n .json_editor_missing {\n background-color: #f055;\n }\n .json_editor_key {\n padding-right: 10px;\n input {\n color: #999;\n @media (prefers-color-scheme: light) {\n color: #777;\n }\n }\n }\n .json_editor_object {\n border-left: 2px solid #333;\n padding-left: 20px;\n @media (prefers-color-scheme: light) {\n border-color: #ccc;\n }\n .json_editor_properties {\n > * {\n border-bottom: var(--fg-border);\n margin-bottom: 2px;\n }\n }\n }\n }\n}\n"],"mappings":"AAAA,CAAC,MACC,QAAS,KACT,UAAW,IAAI,KACf,IAAK,IACL,QAAQ,CACN,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,GAAG,EACd,aAAa,EAAE,IAAI,EACnB,MAAM,EAAE,IAAI,MAAM,IAAI,EACtB,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,CAAC,EACT,KAAK,CACH,OAAO,EAAE,IAAI,GAGnB,CCfA,IAAI,CAAC,iBACH,YAAY,KACZ,YAAY,KACZ,YAAY,KACZ,aAAa,IAAI,MAAM,IAAI,YAC3B,OAAO,CAAC,oBAAoB,EAAE,OAC5B,YAAY,KACZ,YAAY,KACZ,YAAY,OACd,CACA,WAAY,WACZ,MAAO,IAAI,YACX,iBAAkB,IAAI,YACtB,OAAQ,IAAI,MAAM,IAAI,YACtB,SAAU,MACV,MAAO,EACP,OAAQ,EACR,OAAQ,KACR,QAAS,KACT,UAAW,OACX,WAAY,MACZ,MAAO,K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CACtB,EAAE,EAAE,CACF,aAAa,EAAE,IAAI,YAAY,EAC/B,aAAa,EAAE,GAAG,KAK5B","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../hamr/src/react-data-designer/RelationEditor.module.scss","../src/devtools.scss"],"sourcesContent":[".class {\n display: flex;\n flex-flow: row wrap;\n gap: 4px;\n section {\n display: flex;\n flex-flow: row;\n margin-bottom: 1rem;\n border: 1px solid #ccc;\n padding: 2px;\n margin: 0;\n span {\n display: flex;\n }\n }\n}\n","main.atom_io_devtools {\n --fg-color: #eee;\n --bg-color: #111;\n --bg-tint1: #222;\n --fg-border: 1px solid var(--fg-color);\n @media (prefers-color-scheme: light) {\n --fg-color: #444;\n --bg-color: #ddd;\n --bg-tint1: #e3e3e3;\n }\n box-sizing: border-box;\n color: var(--fg-color);\n background-color: var(--bg-color);\n border: 2px solid var(--fg-color);\n position: fixed;\n right: 0;\n bottom: 0;\n height: 100%;\n display: flex;\n flex-flow: column;\n max-height: 800px;\n width: 100%;\n max-width: 500px;\n overflow-y: scroll;\n * {\n font-size: 16px;\n font-family: theia, monospace;\n }\n > header {\n padding: 5px;\n padding-left: 10px;\n padding-bottom: 0;\n display: flex;\n justify-content: space-between;\n h1 {\n font-size: inherit;\n margin: 0;\n font-size: 24px;\n font-family: charter;\n }\n nav {\n display: flex;\n flex-flow: row nowrap;\n button {\n cursor: pointer;\n background: none;\n border: none;\n padding: none;\n margin-bottom: -2px;\n z-index: 1000;\n &:disabled {\n cursor: default;\n background-color: var(--bg-tint1);\n color: var(--fg-color);\n border: var(--fg-border);\n border-bottom: none;\n }\n }\n }\n }\n > main {\n background: var(--bg-tint1);\n }\n main {\n overflow-y: scroll;\n flex-grow: 1;\n display: flex;\n flex-flow: column;\n gap: 0;\n article.index {\n .node .node {\n border-right: var(--fg-border);\n padding-right: 0;\n background: #fff3;\n }\n .node > .node {\n margin: 5px 0;\n margin-left: 12px;\n border-left: var(--fg-border);\n }\n .node {\n border-top: var(--fg-border);\n overflow-x: scroll;\n padding: 5px;\n &:last-of-type {\n border-bottom: var(--fg-border);\n }\n &.transaction_update {\n padding: 0;\n }\n header {\n display: flex;\n flex-flow: row;\n gap: 5px;\n position: sticky;\n z-index: 999;\n top: 0;\n button.carat {\n cursor: pointer;\n background: none;\n border: none;\n width: 20px;\n &.open {\n transform: rotate(90deg);\n }\n &:disabled {\n cursor: default;\n }\n }\n label {\n display: flex;\n flex-flow: row;\n gap: 5px;\n cursor: help;\n h2 {\n display: inline-block;\n margin: 0;\n }\n .detail {\n color: #777;\n @media (prefers-color-scheme: light) {\n color: #999;\n }\n }\n }\n }\n main {\n margin-left: 15px;\n }\n }\n section.transaction_log {\n margin-top: 0;\n header: {\n padding: 5px;\n }\n main {\n display: flex;\n flex-flow: row wrap;\n gap: 5px;\n .transaction_update {\n width: 100%;\n display: flex;\n flex-flow: row;\n align-items: flex-start;\n justify-content: flex-start;\n justify-items: flex-start;\n align-content: flex-start;\n border-left: var(--fg-border);\n border-top: var(--fg-border);\n header {\n padding: 5px;\n h4 {\n margin: 0;\n padding: 0;\n font-size: inherit;\n }\n }\n main {\n margin-left: 0;\n display: flex;\n flex-flow: column;\n gap: 0px;\n border-left: 1px solid #333;\n section ~ section {\n border-top: 1px solid #333;\n }\n section {\n padding: 5px;\n &.transaction_output {\n border-right: none;\n }\n &.transaction_impact {\n padding: 5px;\n }\n margin: 0;\n article {\n border-left: var(--fg-border);\n border-right: var(--fg-border);\n .summary {\n white-space: nowrap;\n }\n }\n }\n }\n }\n }\n }\n section.timeline_log {\n header {\n display: flex;\n label {\n display: flex;\n width: 100%;\n flex-grow: 1;\n .gap {\n flex-grow: 1;\n }\n nav {\n display: flex;\n flex-flow: row nowrap;\n gap: 5px;\n }\n }\n }\n .timeline_update {\n padding: 5px;\n border-left: var(--fg-border);\n h4 {\n margin: 0;\n padding: 0;\n font-size: inherit;\n }\n main {\n margin: 0;\n .node.atom_update {\n border-left: var(--fg-border);\n }\n }\n }\n .you_are_here {\n background: var(--fg-color);\n color: var(--bg-color);\n text-align: center;\n }\n }\n }\n }\n footer {\n display: flex;\n justify-content: flex-end;\n button {\n cursor: pointer;\n background: none;\n border: none;\n padding: none;\n position: absolute;\n right: 0;\n bottom: 0;\n }\n }\n\n .json_editor {\n input {\n font-family: theia;\n border: none;\n border-bottom: 1px solid;\n background: none;\n &:disabled {\n border: none;\n }\n }\n button {\n background: none;\n margin-left: auto;\n color: #777;\n border: none;\n font-family: theia;\n font-size: 14px;\n margin: none;\n padding: 4px;\n padding-bottom: 6px;\n cursor: pointer;\n &:hover {\n color: #333;\n background-color: #aaa;\n }\n }\n select {\n font-family: theia;\n font-size: 14px;\n background: none;\n border: none;\n color: #777;\n @media (prefers-color-scheme: light) {\n color: #999;\n }\n }\n .json_editor_unofficial {\n background-color: #777;\n button {\n color: #333;\n }\n }\n .json_editor_missing {\n background-color: #f055;\n }\n .json_editor_key {\n padding-right: 10px;\n input {\n color: #999;\n @media (prefers-color-scheme: light) {\n color: #777;\n }\n }\n }\n .json_editor_object {\n border-left: 2px solid #333;\n padding-left: 20px;\n @media (prefers-color-scheme: light) {\n border-color: #ccc;\n }\n .json_editor_properties {\n > * {\n border-bottom: var(--fg-border);\n margin-bottom: 2px;\n }\n }\n }\n }\n}\n"],"mappings":";AAAA,CAAC;AACC,WAAS;AACT,aAAW,IAAI;AACf,OAAK;AACL,UAAQ,EACN,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,GAAG,EACd,aAAa,EAAE,IAAI,EACnB,MAAM,EAAE,IAAI,MAAM,IAAI,EACtB,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,CAAC,EACT,KAAK,EACH,OAAO,EAAE,IAAI;AAGnB;;;ACfA,IAAI,CAAC;AACH,cAAY;AACZ,cAAY;AACZ,cAAY;AACZ,eAAa,IAAI,MAAM,IAAI;AAC3B,SAAO,CAAC,oBAAoB,EAAE;AAC5B,gBAAY;AACZ,gBAAY;AACZ,gBAAY;AACd;AACA,cAAY;AACZ,SAAO,IAAI;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,mBAAmB,EAClB,WAAW,EAAE,IAAI,MAAM,IAAI,EAC3B,YAAY,EAAE,IAAI,EAClB,OAAO,CAAC,oBAAoB,EAAE,OAAO,EACnC,YAAY,EAAE,IAAI,IAEpB,CAAC,uBAAuB,EACtB,EAAE,EAAE,EACF,aAAa,EAAE,IAAI,YAAY,EAC/B,aAAa,EAAE,GAAG;AAK5B;","names":[]}
|
|
@@ -1,9 +1,79 @@
|
|
|
1
1
|
import * as atom_io from 'atom.io';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FamilyMetadata, ƒn, TransactionUpdate, StateToken, TimelineUpdate, StateUpdate, AtomFamily, ReadonlySelectorFamily, SelectorFamily, AtomToken, ReadonlySelectorToken, SelectorToken, TransactionToken, TimelineToken, Logger } from 'atom.io';
|
|
3
|
+
import { Json } from 'atom.io/json';
|
|
4
|
+
|
|
5
|
+
type ClassSignature = abstract new (...args: any) => any;
|
|
6
|
+
|
|
7
|
+
type RefinementStrategy = ClassSignature | Refinement$1<unknown, any>;
|
|
8
|
+
type Supported<Refine extends RefinementStrategy> = Refine extends Refinement$1<unknown, infer T> ? T : Refine extends ClassSignature ? InstanceType<Refine> : never;
|
|
9
|
+
type RefinementSupport = Record<string, RefinementStrategy>;
|
|
10
|
+
declare class Refinery<SupportedTypes extends RefinementSupport> {
|
|
11
|
+
supported: SupportedTypes;
|
|
12
|
+
constructor(supported: SupportedTypes);
|
|
13
|
+
refine(input: unknown): {
|
|
14
|
+
[K in keyof SupportedTypes]: {
|
|
15
|
+
type: K;
|
|
16
|
+
data: Supported<SupportedTypes[K]>;
|
|
17
|
+
};
|
|
18
|
+
}[keyof SupportedTypes] | null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Refinement$1<A, B extends A> {
|
|
22
|
+
(a: A): a is B;
|
|
23
|
+
}
|
|
4
24
|
|
|
5
25
|
type PlainObject = Record<keyof any, unknown>;
|
|
6
26
|
|
|
27
|
+
declare class Subject<T> {
|
|
28
|
+
Subscriber: (value: T) => void;
|
|
29
|
+
subscribers: Map<string, this[`Subscriber`]>;
|
|
30
|
+
subscribe(key: string, subscriber: this[`Subscriber`]): () => void;
|
|
31
|
+
private unsubscribe;
|
|
32
|
+
next(value: T): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type Selector<T> = {
|
|
36
|
+
key: string;
|
|
37
|
+
type: `selector`;
|
|
38
|
+
family?: FamilyMetadata;
|
|
39
|
+
install: (store: Store) => void;
|
|
40
|
+
subject: Subject<{
|
|
41
|
+
newValue: T;
|
|
42
|
+
oldValue: T;
|
|
43
|
+
}>;
|
|
44
|
+
get: () => T;
|
|
45
|
+
set: (newValue: T | ((oldValue: T) => T)) => void;
|
|
46
|
+
};
|
|
47
|
+
type ReadonlySelector<T> = {
|
|
48
|
+
key: string;
|
|
49
|
+
type: `readonly_selector`;
|
|
50
|
+
family?: FamilyMetadata;
|
|
51
|
+
install: (store: Store) => void;
|
|
52
|
+
subject: Subject<{
|
|
53
|
+
newValue: T;
|
|
54
|
+
oldValue: T;
|
|
55
|
+
}>;
|
|
56
|
+
get: () => T;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
type Transaction<ƒ extends ƒn> = {
|
|
60
|
+
key: string;
|
|
61
|
+
type: `transaction`;
|
|
62
|
+
install: (store: Store) => void;
|
|
63
|
+
subject: Subject<TransactionUpdate<ƒ>>;
|
|
64
|
+
run: (...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
type TransactionUpdateInProgress<ƒ extends ƒn> = TransactionUpdate<ƒ> & {
|
|
68
|
+
phase: `applying` | `building`;
|
|
69
|
+
time: number;
|
|
70
|
+
core: StoreCore;
|
|
71
|
+
};
|
|
72
|
+
type TransactionIdle = {
|
|
73
|
+
phase: `idle`;
|
|
74
|
+
};
|
|
75
|
+
type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
|
|
76
|
+
|
|
7
77
|
type primitive = boolean | number | string | null;
|
|
8
78
|
|
|
9
79
|
type Serializable = primitive | Readonly<{
|
|
@@ -30,7 +100,7 @@ type JunctionAdvancedConfiguration<Content extends Object$1 | null> = {
|
|
|
30
100
|
} : {
|
|
31
101
|
getContent: (contentKey: string) => Content | undefined;
|
|
32
102
|
setContent: (contentKey: string, content: Content) => void;
|
|
33
|
-
deleteContent: (
|
|
103
|
+
deleteContent: (contentKey: string) => void;
|
|
34
104
|
}) & {
|
|
35
105
|
addRelation: (a: string, b: string) => void;
|
|
36
106
|
deleteRelation: (a: string, b: string) => void;
|
|
@@ -69,6 +139,32 @@ declare class Junction<ASide extends string, BSide extends string, Content exten
|
|
|
69
139
|
has(a: string, b?: string): boolean;
|
|
70
140
|
}
|
|
71
141
|
|
|
142
|
+
interface Transceiver<Signal extends Json.Serializable> {
|
|
143
|
+
do: (update: Signal) => void;
|
|
144
|
+
undo: (update: Signal) => void;
|
|
145
|
+
subscribe: (key: string, fn: (update: Signal) => void) => () => void;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @internal Give the tracker a transceiver state and a store, and it will
|
|
150
|
+
* subscribe to the transceiver's inner value. When the inner value changes,
|
|
151
|
+
* the tracker will update its own state to reflect the change.
|
|
152
|
+
*/
|
|
153
|
+
declare class Tracker<Mutable extends Transceiver<any>> {
|
|
154
|
+
private Update;
|
|
155
|
+
private initializeState;
|
|
156
|
+
private unsubscribeFromInnerValue;
|
|
157
|
+
private observeCore;
|
|
158
|
+
private updateCore;
|
|
159
|
+
mutableState: atom_io.MutableAtomToken<Mutable, Json.Serializable>;
|
|
160
|
+
latestUpdateState: atom_io.AtomToken<typeof this$1.Update | null>;
|
|
161
|
+
constructor(mutableState: atom_io.MutableAtomToken<Mutable, Json.Serializable>, store?: Store);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
interface MutableAtom<T> extends Atom<T> {
|
|
165
|
+
mutable: true;
|
|
166
|
+
}
|
|
167
|
+
|
|
72
168
|
type OperationProgress = {
|
|
73
169
|
open: false;
|
|
74
170
|
} | {
|
|
@@ -79,38 +175,6 @@ type OperationProgress = {
|
|
|
79
175
|
token: StateToken<any>;
|
|
80
176
|
};
|
|
81
177
|
|
|
82
|
-
type Subscriber<T> = (value: T) => void;
|
|
83
|
-
declare class Subject<T> {
|
|
84
|
-
subscribers: Map<string, Subscriber<T>>;
|
|
85
|
-
subscribe(key: string, subscriber: Subscriber<T>): () => void;
|
|
86
|
-
private unsubscribe;
|
|
87
|
-
next(value: T): void;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
type Selector<T> = {
|
|
91
|
-
key: string;
|
|
92
|
-
type: `selector`;
|
|
93
|
-
family?: FamilyMetadata;
|
|
94
|
-
install: (store: Store) => void;
|
|
95
|
-
subject: Subject<{
|
|
96
|
-
newValue: T;
|
|
97
|
-
oldValue: T;
|
|
98
|
-
}>;
|
|
99
|
-
get: () => T;
|
|
100
|
-
set: (newValue: T | ((oldValue: T) => T)) => void;
|
|
101
|
-
};
|
|
102
|
-
type ReadonlySelector<T> = {
|
|
103
|
-
key: string;
|
|
104
|
-
type: `readonly_selector`;
|
|
105
|
-
family?: FamilyMetadata;
|
|
106
|
-
install: (store: Store) => void;
|
|
107
|
-
subject: Subject<{
|
|
108
|
-
newValue: T;
|
|
109
|
-
oldValue: T;
|
|
110
|
-
}>;
|
|
111
|
-
get: () => T;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
178
|
type TimelineAtomUpdate = StateUpdate<unknown> & {
|
|
115
179
|
key: string;
|
|
116
180
|
type: `atom_update`;
|
|
@@ -140,30 +204,14 @@ type Timeline = {
|
|
|
140
204
|
subject: Subject<TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate | `redo` | `undo`>;
|
|
141
205
|
};
|
|
142
206
|
|
|
143
|
-
type
|
|
144
|
-
key: string;
|
|
145
|
-
type: `transaction`;
|
|
146
|
-
install: (store: Store) => void;
|
|
147
|
-
subject: Subject<TransactionUpdate<ƒ>>;
|
|
148
|
-
run: (...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
type TransactionUpdateInProgress<ƒ extends ƒn> = TransactionUpdate<ƒ> & {
|
|
152
|
-
phase: `applying` | `building`;
|
|
153
|
-
time: number;
|
|
154
|
-
core: StoreCore;
|
|
155
|
-
};
|
|
156
|
-
type TransactionIdle = {
|
|
157
|
-
phase: `idle`;
|
|
158
|
-
};
|
|
159
|
-
type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
|
|
160
|
-
|
|
161
|
-
type StoreCore = Pick<Store, `atoms` | `atomsThatAreDefault` | `operation` | `readonlySelectors` | `selectorAtoms` | `selectorGraph` | `selectors` | `timelineAtoms` | `timelines` | `transactions` | `valueMap`>;
|
|
207
|
+
type StoreCore = Pick<Store, `atoms` | `atomsThatAreDefault` | `families` | `operation` | `readonlySelectors` | `selectorAtoms` | `selectorGraph` | `selectors` | `timelineAtoms` | `timelines` | `trackers` | `transactions` | `valueMap`>;
|
|
162
208
|
declare class Store {
|
|
163
209
|
valueMap: Map<string, any>;
|
|
164
|
-
atoms: Map<string, Atom<any>>;
|
|
210
|
+
atoms: Map<string, Atom<any> | MutableAtom<any>>;
|
|
165
211
|
selectors: Map<string, Selector<any>>;
|
|
166
212
|
readonlySelectors: Map<string, ReadonlySelector<any>>;
|
|
213
|
+
trackers: Map<string, Tracker<Transceiver<any>>>;
|
|
214
|
+
families: Map<string, AtomFamily<any, any> | ReadonlySelectorFamily<any, any> | SelectorFamily<any, any>>;
|
|
167
215
|
timelines: Map<string, Timeline>;
|
|
168
216
|
transactions: Map<string, Transaction<ƒn>>;
|
|
169
217
|
atomsThatAreDefault: Set<string>;
|
|
@@ -193,6 +241,7 @@ type Atom<T> = {
|
|
|
193
241
|
key: string;
|
|
194
242
|
type: `atom`;
|
|
195
243
|
family?: FamilyMetadata;
|
|
244
|
+
install: (store: Store) => void;
|
|
196
245
|
subject: Subject<{
|
|
197
246
|
newValue: T;
|
|
198
247
|
oldValue: T;
|
|
@@ -210,22 +259,6 @@ type StateTokenIndex<Token extends AtomToken<unknown> | ReadonlySelectorToken<un
|
|
|
210
259
|
|
|
211
260
|
type SelectorTokenIndex = StateTokenIndex<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
212
261
|
|
|
213
|
-
type ClassSignature = abstract new (...args: any) => any;
|
|
214
|
-
|
|
215
|
-
type RefinementStrategy = ClassSignature | Refinement$1<unknown, any>;
|
|
216
|
-
type Supported<Refine extends RefinementStrategy> = Refine extends Refinement$1<unknown, infer T> ? T : Refine extends ClassSignature ? InstanceType<Refine> : never;
|
|
217
|
-
type RefinementSupport = Record<string, RefinementStrategy>;
|
|
218
|
-
declare class Refinery<SupportedTypes extends RefinementSupport> {
|
|
219
|
-
supported: SupportedTypes;
|
|
220
|
-
constructor(supported: SupportedTypes);
|
|
221
|
-
refine(input: unknown): {
|
|
222
|
-
[K in keyof SupportedTypes]: {
|
|
223
|
-
type: K;
|
|
224
|
-
data: Supported<SupportedTypes[K]>;
|
|
225
|
-
};
|
|
226
|
-
}[keyof SupportedTypes] | null;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
262
|
type Delta = {
|
|
230
263
|
summary: string;
|
|
231
264
|
added?: [path: string, addedStringifiedValue: string][];
|
|
@@ -1,9 +1,79 @@
|
|
|
1
1
|
import * as atom_io from 'atom.io';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FamilyMetadata, ƒn, TransactionUpdate, StateToken, TimelineUpdate, StateUpdate, AtomFamily, ReadonlySelectorFamily, SelectorFamily, AtomToken, ReadonlySelectorToken, SelectorToken, TransactionToken, TimelineToken, Logger } from 'atom.io';
|
|
3
|
+
import { Json } from 'atom.io/json';
|
|
4
|
+
|
|
5
|
+
type ClassSignature = abstract new (...args: any) => any;
|
|
6
|
+
|
|
7
|
+
type RefinementStrategy = ClassSignature | Refinement$1<unknown, any>;
|
|
8
|
+
type Supported<Refine extends RefinementStrategy> = Refine extends Refinement$1<unknown, infer T> ? T : Refine extends ClassSignature ? InstanceType<Refine> : never;
|
|
9
|
+
type RefinementSupport = Record<string, RefinementStrategy>;
|
|
10
|
+
declare class Refinery<SupportedTypes extends RefinementSupport> {
|
|
11
|
+
supported: SupportedTypes;
|
|
12
|
+
constructor(supported: SupportedTypes);
|
|
13
|
+
refine(input: unknown): {
|
|
14
|
+
[K in keyof SupportedTypes]: {
|
|
15
|
+
type: K;
|
|
16
|
+
data: Supported<SupportedTypes[K]>;
|
|
17
|
+
};
|
|
18
|
+
}[keyof SupportedTypes] | null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Refinement$1<A, B extends A> {
|
|
22
|
+
(a: A): a is B;
|
|
23
|
+
}
|
|
4
24
|
|
|
5
25
|
type PlainObject = Record<keyof any, unknown>;
|
|
6
26
|
|
|
27
|
+
declare class Subject<T> {
|
|
28
|
+
Subscriber: (value: T) => void;
|
|
29
|
+
subscribers: Map<string, this[`Subscriber`]>;
|
|
30
|
+
subscribe(key: string, subscriber: this[`Subscriber`]): () => void;
|
|
31
|
+
private unsubscribe;
|
|
32
|
+
next(value: T): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type Selector<T> = {
|
|
36
|
+
key: string;
|
|
37
|
+
type: `selector`;
|
|
38
|
+
family?: FamilyMetadata;
|
|
39
|
+
install: (store: Store) => void;
|
|
40
|
+
subject: Subject<{
|
|
41
|
+
newValue: T;
|
|
42
|
+
oldValue: T;
|
|
43
|
+
}>;
|
|
44
|
+
get: () => T;
|
|
45
|
+
set: (newValue: T | ((oldValue: T) => T)) => void;
|
|
46
|
+
};
|
|
47
|
+
type ReadonlySelector<T> = {
|
|
48
|
+
key: string;
|
|
49
|
+
type: `readonly_selector`;
|
|
50
|
+
family?: FamilyMetadata;
|
|
51
|
+
install: (store: Store) => void;
|
|
52
|
+
subject: Subject<{
|
|
53
|
+
newValue: T;
|
|
54
|
+
oldValue: T;
|
|
55
|
+
}>;
|
|
56
|
+
get: () => T;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
type Transaction<ƒ extends ƒn> = {
|
|
60
|
+
key: string;
|
|
61
|
+
type: `transaction`;
|
|
62
|
+
install: (store: Store) => void;
|
|
63
|
+
subject: Subject<TransactionUpdate<ƒ>>;
|
|
64
|
+
run: (...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
type TransactionUpdateInProgress<ƒ extends ƒn> = TransactionUpdate<ƒ> & {
|
|
68
|
+
phase: `applying` | `building`;
|
|
69
|
+
time: number;
|
|
70
|
+
core: StoreCore;
|
|
71
|
+
};
|
|
72
|
+
type TransactionIdle = {
|
|
73
|
+
phase: `idle`;
|
|
74
|
+
};
|
|
75
|
+
type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
|
|
76
|
+
|
|
7
77
|
type primitive = boolean | number | string | null;
|
|
8
78
|
|
|
9
79
|
type Serializable = primitive | Readonly<{
|
|
@@ -30,7 +100,7 @@ type JunctionAdvancedConfiguration<Content extends Object$1 | null> = {
|
|
|
30
100
|
} : {
|
|
31
101
|
getContent: (contentKey: string) => Content | undefined;
|
|
32
102
|
setContent: (contentKey: string, content: Content) => void;
|
|
33
|
-
deleteContent: (
|
|
103
|
+
deleteContent: (contentKey: string) => void;
|
|
34
104
|
}) & {
|
|
35
105
|
addRelation: (a: string, b: string) => void;
|
|
36
106
|
deleteRelation: (a: string, b: string) => void;
|
|
@@ -69,6 +139,32 @@ declare class Junction<ASide extends string, BSide extends string, Content exten
|
|
|
69
139
|
has(a: string, b?: string): boolean;
|
|
70
140
|
}
|
|
71
141
|
|
|
142
|
+
interface Transceiver<Signal extends Json.Serializable> {
|
|
143
|
+
do: (update: Signal) => void;
|
|
144
|
+
undo: (update: Signal) => void;
|
|
145
|
+
subscribe: (key: string, fn: (update: Signal) => void) => () => void;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @internal Give the tracker a transceiver state and a store, and it will
|
|
150
|
+
* subscribe to the transceiver's inner value. When the inner value changes,
|
|
151
|
+
* the tracker will update its own state to reflect the change.
|
|
152
|
+
*/
|
|
153
|
+
declare class Tracker<Mutable extends Transceiver<any>> {
|
|
154
|
+
private Update;
|
|
155
|
+
private initializeState;
|
|
156
|
+
private unsubscribeFromInnerValue;
|
|
157
|
+
private observeCore;
|
|
158
|
+
private updateCore;
|
|
159
|
+
mutableState: atom_io.MutableAtomToken<Mutable, Json.Serializable>;
|
|
160
|
+
latestUpdateState: atom_io.AtomToken<typeof this$1.Update | null>;
|
|
161
|
+
constructor(mutableState: atom_io.MutableAtomToken<Mutable, Json.Serializable>, store?: Store);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
interface MutableAtom<T> extends Atom<T> {
|
|
165
|
+
mutable: true;
|
|
166
|
+
}
|
|
167
|
+
|
|
72
168
|
type OperationProgress = {
|
|
73
169
|
open: false;
|
|
74
170
|
} | {
|
|
@@ -79,38 +175,6 @@ type OperationProgress = {
|
|
|
79
175
|
token: StateToken<any>;
|
|
80
176
|
};
|
|
81
177
|
|
|
82
|
-
type Subscriber<T> = (value: T) => void;
|
|
83
|
-
declare class Subject<T> {
|
|
84
|
-
subscribers: Map<string, Subscriber<T>>;
|
|
85
|
-
subscribe(key: string, subscriber: Subscriber<T>): () => void;
|
|
86
|
-
private unsubscribe;
|
|
87
|
-
next(value: T): void;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
type Selector<T> = {
|
|
91
|
-
key: string;
|
|
92
|
-
type: `selector`;
|
|
93
|
-
family?: FamilyMetadata;
|
|
94
|
-
install: (store: Store) => void;
|
|
95
|
-
subject: Subject<{
|
|
96
|
-
newValue: T;
|
|
97
|
-
oldValue: T;
|
|
98
|
-
}>;
|
|
99
|
-
get: () => T;
|
|
100
|
-
set: (newValue: T | ((oldValue: T) => T)) => void;
|
|
101
|
-
};
|
|
102
|
-
type ReadonlySelector<T> = {
|
|
103
|
-
key: string;
|
|
104
|
-
type: `readonly_selector`;
|
|
105
|
-
family?: FamilyMetadata;
|
|
106
|
-
install: (store: Store) => void;
|
|
107
|
-
subject: Subject<{
|
|
108
|
-
newValue: T;
|
|
109
|
-
oldValue: T;
|
|
110
|
-
}>;
|
|
111
|
-
get: () => T;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
178
|
type TimelineAtomUpdate = StateUpdate<unknown> & {
|
|
115
179
|
key: string;
|
|
116
180
|
type: `atom_update`;
|
|
@@ -140,30 +204,14 @@ type Timeline = {
|
|
|
140
204
|
subject: Subject<TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate | `redo` | `undo`>;
|
|
141
205
|
};
|
|
142
206
|
|
|
143
|
-
type
|
|
144
|
-
key: string;
|
|
145
|
-
type: `transaction`;
|
|
146
|
-
install: (store: Store) => void;
|
|
147
|
-
subject: Subject<TransactionUpdate<ƒ>>;
|
|
148
|
-
run: (...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
type TransactionUpdateInProgress<ƒ extends ƒn> = TransactionUpdate<ƒ> & {
|
|
152
|
-
phase: `applying` | `building`;
|
|
153
|
-
time: number;
|
|
154
|
-
core: StoreCore;
|
|
155
|
-
};
|
|
156
|
-
type TransactionIdle = {
|
|
157
|
-
phase: `idle`;
|
|
158
|
-
};
|
|
159
|
-
type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
|
|
160
|
-
|
|
161
|
-
type StoreCore = Pick<Store, `atoms` | `atomsThatAreDefault` | `operation` | `readonlySelectors` | `selectorAtoms` | `selectorGraph` | `selectors` | `timelineAtoms` | `timelines` | `transactions` | `valueMap`>;
|
|
207
|
+
type StoreCore = Pick<Store, `atoms` | `atomsThatAreDefault` | `families` | `operation` | `readonlySelectors` | `selectorAtoms` | `selectorGraph` | `selectors` | `timelineAtoms` | `timelines` | `trackers` | `transactions` | `valueMap`>;
|
|
162
208
|
declare class Store {
|
|
163
209
|
valueMap: Map<string, any>;
|
|
164
|
-
atoms: Map<string, Atom<any>>;
|
|
210
|
+
atoms: Map<string, Atom<any> | MutableAtom<any>>;
|
|
165
211
|
selectors: Map<string, Selector<any>>;
|
|
166
212
|
readonlySelectors: Map<string, ReadonlySelector<any>>;
|
|
213
|
+
trackers: Map<string, Tracker<Transceiver<any>>>;
|
|
214
|
+
families: Map<string, AtomFamily<any, any> | ReadonlySelectorFamily<any, any> | SelectorFamily<any, any>>;
|
|
167
215
|
timelines: Map<string, Timeline>;
|
|
168
216
|
transactions: Map<string, Transaction<ƒn>>;
|
|
169
217
|
atomsThatAreDefault: Set<string>;
|
|
@@ -193,6 +241,7 @@ type Atom<T> = {
|
|
|
193
241
|
key: string;
|
|
194
242
|
type: `atom`;
|
|
195
243
|
family?: FamilyMetadata;
|
|
244
|
+
install: (store: Store) => void;
|
|
196
245
|
subject: Subject<{
|
|
197
246
|
newValue: T;
|
|
198
247
|
oldValue: T;
|
|
@@ -210,22 +259,6 @@ type StateTokenIndex<Token extends AtomToken<unknown> | ReadonlySelectorToken<un
|
|
|
210
259
|
|
|
211
260
|
type SelectorTokenIndex = StateTokenIndex<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
212
261
|
|
|
213
|
-
type ClassSignature = abstract new (...args: any) => any;
|
|
214
|
-
|
|
215
|
-
type RefinementStrategy = ClassSignature | Refinement$1<unknown, any>;
|
|
216
|
-
type Supported<Refine extends RefinementStrategy> = Refine extends Refinement$1<unknown, infer T> ? T : Refine extends ClassSignature ? InstanceType<Refine> : never;
|
|
217
|
-
type RefinementSupport = Record<string, RefinementStrategy>;
|
|
218
|
-
declare class Refinery<SupportedTypes extends RefinementSupport> {
|
|
219
|
-
supported: SupportedTypes;
|
|
220
|
-
constructor(supported: SupportedTypes);
|
|
221
|
-
refine(input: unknown): {
|
|
222
|
-
[K in keyof SupportedTypes]: {
|
|
223
|
-
type: K;
|
|
224
|
-
data: Supported<SupportedTypes[K]>;
|
|
225
|
-
};
|
|
226
|
-
}[keyof SupportedTypes] | null;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
262
|
type Delta = {
|
|
230
263
|
summary: string;
|
|
231
264
|
added?: [path: string, addedStringifiedValue: string][];
|