@graphrefly/graphrefly 0.44.0 → 0.45.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 -17
- package/dist/compat/index.cjs +20 -10
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +1 -22
- package/dist/compat/index.d.ts +1 -22
- package/dist/compat/index.js +3 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +21 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +1 -2
- package/dist/compat/jotai/index.d.ts +1 -2
- package/dist/compat/jotai/index.js +3 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +21 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +1 -2
- package/dist/compat/nanostores/index.d.ts +1 -2
- package/dist/compat/nanostores/index.js +3 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +20 -10
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +1 -13
- package/dist/compat/nestjs/index.d.ts +1 -13
- package/dist/compat/nestjs/index.js +3 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +21 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +1 -2
- package/dist/compat/react/index.d.ts +1 -2
- package/dist/compat/react/index.js +3 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +21 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +1 -2
- package/dist/compat/solid/index.d.ts +1 -2
- package/dist/compat/solid/index.js +3 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +21 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +1 -2
- package/dist/compat/svelte/index.d.ts +1 -2
- package/dist/compat/svelte/index.js +3 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +21 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +1 -3
- package/dist/compat/vue/index.d.ts +1 -3
- package/dist/compat/vue/index.js +3 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +21 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +1 -6
- package/dist/compat/zustand/index.d.ts +1 -6
- package/dist/compat/zustand/index.js +3 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +21 -1
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1 -3
- package/dist/core/index.d.ts +1 -3
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -0
- package/dist/extra/browser.cjs +21 -1
- package/dist/extra/browser.cjs.map +1 -0
- package/dist/extra/browser.d.cts +1 -4
- package/dist/extra/browser.d.ts +1 -4
- package/dist/extra/browser.js +3 -1
- package/dist/extra/browser.js.map +1 -0
- package/dist/extra/index.cjs +20 -19
- package/dist/extra/index.cjs.map +1 -0
- package/dist/extra/index.d.cts +1 -17
- package/dist/extra/index.d.ts +1 -17
- package/dist/extra/index.js +3 -1
- package/dist/extra/index.js.map +1 -0
- package/dist/extra/node.cjs +21 -2
- package/dist/extra/node.cjs.map +1 -0
- package/dist/extra/node.d.cts +1 -187
- package/dist/extra/node.d.ts +1 -187
- package/dist/extra/node.js +3 -2
- package/dist/extra/node.js.map +1 -0
- package/dist/extra/operators.cjs +21 -1
- package/dist/extra/operators.cjs.map +1 -0
- package/dist/extra/operators.d.cts +1 -958
- package/dist/extra/operators.d.ts +1 -958
- package/dist/extra/operators.js +3 -1
- package/dist/extra/operators.js.map +1 -0
- package/dist/extra/reactive.cjs +21 -1
- package/dist/extra/reactive.cjs.map +1 -0
- package/dist/extra/reactive.d.cts +1 -353
- package/dist/extra/reactive.d.ts +1 -353
- package/dist/extra/reactive.js +3 -1
- package/dist/extra/reactive.js.map +1 -0
- package/dist/extra/render/index.cjs +21 -5
- package/dist/extra/render/index.cjs.map +1 -0
- package/dist/extra/render/index.d.cts +1 -183
- package/dist/extra/render/index.d.ts +1 -183
- package/dist/extra/render/index.js +3 -1
- package/dist/extra/render/index.js.map +1 -0
- package/dist/extra/sources.cjs +21 -3
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +1 -584
- package/dist/extra/sources.d.ts +1 -584
- package/dist/extra/sources.js +3 -1
- package/dist/extra/sources.js.map +1 -0
- package/dist/extra/storage-browser.cjs +21 -1
- package/dist/extra/storage-browser.cjs.map +1 -0
- package/dist/extra/storage-browser.d.cts +1 -37
- package/dist/extra/storage-browser.d.ts +1 -37
- package/dist/extra/storage-browser.js +3 -1
- package/dist/extra/storage-browser.js.map +1 -0
- package/dist/extra/storage-core.cjs +21 -1
- package/dist/extra/storage-core.cjs.map +1 -0
- package/dist/extra/storage-core.d.cts +1 -28
- package/dist/extra/storage-core.d.ts +1 -28
- package/dist/extra/storage-core.js +3 -1
- package/dist/extra/storage-core.js.map +1 -0
- package/dist/extra/storage-node.cjs +20 -0
- package/dist/extra/storage-node.cjs.map +1 -0
- package/dist/extra/storage-node.d.cts +1 -2
- package/dist/extra/storage-node.d.ts +1 -2
- package/dist/extra/storage-node.js +3 -0
- package/dist/extra/storage-node.js.map +1 -0
- package/dist/extra/storage-tiers-browser.cjs +21 -1
- package/dist/extra/storage-tiers-browser.cjs.map +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +1 -120
- package/dist/extra/storage-tiers-browser.d.ts +1 -120
- package/dist/extra/storage-tiers-browser.js +3 -1
- package/dist/extra/storage-tiers-browser.js.map +1 -0
- package/dist/extra/storage-tiers-node.cjs +21 -1
- package/dist/extra/storage-tiers-node.cjs.map +1 -0
- package/dist/extra/storage-tiers-node.d.cts +1 -210
- package/dist/extra/storage-tiers-node.d.ts +1 -210
- package/dist/extra/storage-tiers-node.js +3 -1
- package/dist/extra/storage-tiers-node.js.map +1 -0
- package/dist/extra/storage-tiers.cjs +21 -1
- package/dist/extra/storage-tiers.cjs.map +1 -0
- package/dist/extra/storage-tiers.d.cts +1 -412
- package/dist/extra/storage-tiers.d.ts +1 -412
- package/dist/extra/storage-tiers.js +3 -1
- package/dist/extra/storage-tiers.js.map +1 -0
- package/dist/extra/storage-wal.cjs +21 -0
- package/dist/extra/storage-wal.cjs.map +1 -0
- package/dist/extra/storage-wal.d.cts +1 -0
- package/dist/extra/storage-wal.d.ts +1 -0
- package/dist/extra/storage-wal.js +3 -0
- package/dist/extra/storage-wal.js.map +1 -0
- package/dist/graph/index.cjs +21 -7
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +1 -7
- package/dist/graph/index.d.ts +1 -7
- package/dist/graph/index.js +3 -1
- package/dist/graph/index.js.map +1 -0
- package/dist/index.cjs +20 -227
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -95
- package/dist/index.d.ts +45 -95
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -0
- package/dist/patterns/ai/browser.cjs +20 -7
- package/dist/patterns/ai/browser.cjs.map +1 -0
- package/dist/patterns/ai/browser.d.cts +1 -127
- package/dist/patterns/ai/browser.d.ts +1 -127
- package/dist/patterns/ai/browser.js +3 -3
- package/dist/patterns/ai/browser.js.map +1 -0
- package/dist/patterns/ai/index.cjs +20 -73
- package/dist/patterns/ai/index.cjs.map +1 -0
- package/dist/patterns/ai/index.d.cts +1 -20
- package/dist/patterns/ai/index.d.ts +1 -20
- package/dist/patterns/ai/index.js +3 -1
- package/dist/patterns/ai/index.js.map +1 -0
- package/dist/patterns/ai/node.cjs +21 -1
- package/dist/patterns/ai/node.cjs.map +1 -0
- package/dist/patterns/ai/node.d.cts +1 -59
- package/dist/patterns/ai/node.d.ts +1 -59
- package/dist/patterns/ai/node.js +3 -1
- package/dist/patterns/ai/node.js.map +1 -0
- package/dist/patterns/cqrs/index.cjs +21 -3
- package/dist/patterns/cqrs/index.cjs.map +1 -0
- package/dist/patterns/cqrs/index.d.cts +1 -8
- package/dist/patterns/cqrs/index.d.ts +1 -8
- package/dist/patterns/cqrs/index.js +3 -1
- package/dist/patterns/cqrs/index.js.map +1 -0
- package/dist/patterns/demo-shell/index.cjs +21 -5
- package/dist/patterns/demo-shell/index.cjs.map +1 -0
- package/dist/patterns/demo-shell/index.d.cts +1 -7
- package/dist/patterns/demo-shell/index.d.ts +1 -7
- package/dist/patterns/demo-shell/index.js +3 -1
- package/dist/patterns/demo-shell/index.js.map +1 -0
- package/dist/patterns/domain-templates/index.cjs +21 -3
- package/dist/patterns/domain-templates/index.cjs.map +1 -0
- package/dist/patterns/domain-templates/index.d.cts +1 -6
- package/dist/patterns/domain-templates/index.d.ts +1 -6
- package/dist/patterns/domain-templates/index.js +3 -1
- package/dist/patterns/domain-templates/index.js.map +1 -0
- package/dist/patterns/graphspec/index.cjs +21 -86
- package/dist/patterns/graphspec/index.cjs.map +1 -0
- package/dist/patterns/graphspec/index.d.cts +1 -8
- package/dist/patterns/graphspec/index.d.ts +1 -8
- package/dist/patterns/graphspec/index.js +3 -1
- package/dist/patterns/graphspec/index.js.map +1 -0
- package/dist/patterns/harness/index.cjs +21 -48
- package/dist/patterns/harness/index.cjs.map +1 -0
- package/dist/patterns/harness/index.d.cts +1 -13
- package/dist/patterns/harness/index.d.ts +1 -13
- package/dist/patterns/harness/index.js +3 -1
- package/dist/patterns/harness/index.js.map +1 -0
- package/dist/patterns/inspect/index.cjs +21 -3
- package/dist/patterns/inspect/index.cjs.map +1 -0
- package/dist/patterns/inspect/index.d.cts +1 -9
- package/dist/patterns/inspect/index.d.ts +1 -9
- package/dist/patterns/inspect/index.js +3 -1
- package/dist/patterns/inspect/index.js.map +1 -0
- package/dist/patterns/job-queue/index.cjs +21 -3
- package/dist/patterns/job-queue/index.cjs.map +1 -0
- package/dist/patterns/job-queue/index.d.cts +1 -9
- package/dist/patterns/job-queue/index.d.ts +1 -9
- package/dist/patterns/job-queue/index.js +3 -1
- package/dist/patterns/job-queue/index.js.map +1 -0
- package/dist/patterns/memory/index.cjs +21 -3
- package/dist/patterns/memory/index.cjs.map +1 -0
- package/dist/patterns/memory/index.d.cts +1 -8
- package/dist/patterns/memory/index.d.ts +1 -8
- package/dist/patterns/memory/index.js +3 -1
- package/dist/patterns/memory/index.js.map +1 -0
- package/dist/patterns/messaging/index.cjs +21 -3
- package/dist/patterns/messaging/index.cjs.map +1 -0
- package/dist/patterns/messaging/index.d.cts +1 -7
- package/dist/patterns/messaging/index.d.ts +1 -7
- package/dist/patterns/messaging/index.js +3 -1
- package/dist/patterns/messaging/index.js.map +1 -0
- package/dist/patterns/orchestration/index.cjs +21 -3
- package/dist/patterns/orchestration/index.cjs.map +1 -0
- package/dist/patterns/orchestration/index.d.cts +1 -8
- package/dist/patterns/orchestration/index.d.ts +1 -8
- package/dist/patterns/orchestration/index.js +3 -1
- package/dist/patterns/orchestration/index.js.map +1 -0
- package/dist/patterns/process/index.cjs +21 -3
- package/dist/patterns/process/index.cjs.map +1 -0
- package/dist/patterns/process/index.d.cts +1 -10
- package/dist/patterns/process/index.d.ts +1 -10
- package/dist/patterns/process/index.js +3 -1
- package/dist/patterns/process/index.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +21 -4
- package/dist/patterns/reactive-layout/index.cjs.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +1 -7
- package/dist/patterns/reactive-layout/index.d.ts +1 -7
- package/dist/patterns/reactive-layout/index.js +3 -1
- package/dist/patterns/reactive-layout/index.js.map +1 -0
- package/dist/patterns/reduction/index.cjs +21 -3
- package/dist/patterns/reduction/index.cjs.map +1 -0
- package/dist/patterns/reduction/index.d.cts +1 -6
- package/dist/patterns/reduction/index.d.ts +1 -6
- package/dist/patterns/reduction/index.js +3 -1
- package/dist/patterns/reduction/index.js.map +1 -0
- package/dist/patterns/surface/index.cjs +21 -13
- package/dist/patterns/surface/index.cjs.map +1 -0
- package/dist/patterns/surface/index.d.cts +1 -9
- package/dist/patterns/surface/index.d.ts +1 -9
- package/dist/patterns/surface/index.js +3 -1
- package/dist/patterns/surface/index.js.map +1 -0
- package/dist/patterns/topology-view/index.cjs +21 -0
- package/dist/patterns/topology-view/index.cjs.map +1 -0
- package/dist/patterns/topology-view/index.d.cts +1 -0
- package/dist/patterns/topology-view/index.d.ts +1 -0
- package/dist/patterns/topology-view/index.js +3 -0
- package/dist/patterns/topology-view/index.js.map +1 -0
- package/dist/testing/index.cjs +21 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +608 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/cascading-BglDkMdX.d.cts +0 -199
- package/dist/cascading-MFgxu7Yo.d.ts +0 -199
- package/dist/chunk-2T7U5EU6.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-5M4CCMMD.js +0 -45
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-5XJ6B66J.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-6X7AFUJV.js +0 -9
- package/dist/chunk-7K6PWTDQ.js +0 -1
- package/dist/chunk-7LIAPXJB.js +0 -1
- package/dist/chunk-7WPU3UHQ.js +0 -1
- package/dist/chunk-A5WCQ5NO.js +0 -1
- package/dist/chunk-APPIWSGD.js +0 -84
- package/dist/chunk-BEZWM2SY.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CB676TKJ.js +0 -1
- package/dist/chunk-CE6TI2TL.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLVB32RD.js +0 -1
- package/dist/chunk-CRVT7D2P.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-D7GPHKFH.js +0 -1
- package/dist/chunk-DHRX7JX4.js +0 -2
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FZMYDOWV.js +0 -1
- package/dist/chunk-GHBWHMRZ.js +0 -1
- package/dist/chunk-GLERH466.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-HIDYF36O.js +0 -1
- package/dist/chunk-HITNVN6B.js +0 -3
- package/dist/chunk-HY4DJBA7.js +0 -5
- package/dist/chunk-KZIEYVXN.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-N4MQX6JU.js +0 -18
- package/dist/chunk-N7FHEL4D.js +0 -1
- package/dist/chunk-NTEURFZH.js +0 -1
- package/dist/chunk-OIVP6KFV.js +0 -1
- package/dist/chunk-OPHBU3LG.js +0 -1
- package/dist/chunk-OYQOZP2F.js +0 -5
- package/dist/chunk-PTZK576G.js +0 -1
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-ST7UXLWR.js +0 -1
- package/dist/chunk-SVY7VUYU.js +0 -1
- package/dist/chunk-TK3NWWD4.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-UNGSTR4X.js +0 -61
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VV4N5P64.js +0 -1
- package/dist/chunk-W3I423PS.js +0 -1
- package/dist/chunk-WJR24TAG.js +0 -1
- package/dist/chunk-XTGKMHSW.js +0 -1
- package/dist/chunk-YBB7ZGTY.js +0 -1
- package/dist/chunk-Z4NPUARF.js +0 -1
- package/dist/chunk-ZGNQRPDT.js +0 -1
- package/dist/chunk-ZKPSFFKU.js +0 -1
- package/dist/chunk-ZLV5SQSX.js +0 -1
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/fallback-74oxi34l.d.cts +0 -250
- package/dist/fallback-DUyyBTBK.d.ts +0 -250
- package/dist/graph-CWvEUQAq.d.cts +0 -1861
- package/dist/graph-D9LFnda9.d.ts +0 -1861
- package/dist/index-5k1T6jl0.d.cts +0 -121
- package/dist/index-9770hRuQ.d.cts +0 -779
- package/dist/index-B-_tFaqV.d.cts +0 -468
- package/dist/index-B17QddL1.d.cts +0 -374
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-B5S8ULbU.d.ts +0 -515
- package/dist/index-B8YnZpIR.d.ts +0 -102
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BQSKmbuG.d.cts +0 -127
- package/dist/index-BaQaY_IQ.d.cts +0 -231
- package/dist/index-BmZXHqkE.d.ts +0 -36
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BrPrLl4e.d.cts +0 -86
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-Byu-OpX_.d.ts +0 -113
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C5stwKcw.d.cts +0 -44
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CBBLl_rc.d.ts +0 -127
- package/dist/index-CBGUK09R.d.ts +0 -754
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CK29LV56.d.cts +0 -34
- package/dist/index-CMh5Rz1y.d.ts +0 -385
- package/dist/index-CPQlGA29.d.ts +0 -34
- package/dist/index-CR8QpwX8.d.ts +0 -2680
- package/dist/index-CS0LTlB8.d.cts +0 -385
- package/dist/index-CSOmP7xT.d.cts +0 -291
- package/dist/index-CYq8vAyV.d.ts +0 -291
- package/dist/index-CZ3r5Rxp.d.ts +0 -374
- package/dist/index-CasX6Pfq.d.cts +0 -358
- package/dist/index-CdAlHFEt.d.ts +0 -44
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-CeFiHtAg.d.ts +0 -468
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Climxqsu.d.cts +0 -754
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-CviRnE4K.d.ts +0 -45
- package/dist/index-Cwv0KWcU.d.cts +0 -102
- package/dist/index-CzLVrjxn.d.ts +0 -231
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-DV_1YuVk.d.cts +0 -221
- package/dist/index-Dc4AYqrJ.d.cts +0 -515
- package/dist/index-Dgl1HpPn.d.ts +0 -86
- package/dist/index-DisjX8a-.d.ts +0 -221
- package/dist/index-UPSiS-X7.d.cts +0 -2680
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-ZVQhLa2i.d.cts +0 -37
- package/dist/index-_6ODbuOu.d.cts +0 -45
- package/dist/index-hcDJ8PSI.d.cts +0 -36
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/index-p09KSrTN.d.ts +0 -358
- package/dist/index-sqkqlb1p.d.ts +0 -37
- package/dist/index-tRCxuAXF.d.cts +0 -113
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/observable-DWjNfLvC.d.ts +0 -36
- package/dist/observable-e3eiPPFy.d.cts +0 -36
- package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
- package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
- package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
- package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
- package/dist/reactive-log-BKALbfal.d.ts +0 -223
- package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
- package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
- package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
- package/dist/resilience-6LYQJAC5.js +0 -1
- package/dist/sugar-DQjFmVqb.d.cts +0 -399
- package/dist/sugar-fhLIE7TT.d.ts +0 -399
- package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
- package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
- package/dist/types-C0_yquda.d.cts +0 -442
- package/dist/types-CWFysE9E.d.ts +0 -442
package/dist/extra/sources.d.cts
CHANGED
|
@@ -1,584 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Core reactive sources, sinks, and utilities (roadmap §2.3).
|
|
5
|
-
*
|
|
6
|
-
* Each API returns a {@link Node} built with {@link node}, {@link producer},
|
|
7
|
-
* {@link derived}, or {@link effect} — no second protocol.
|
|
8
|
-
*
|
|
9
|
-
* Protocol/system/ingest adapters (fromHTTP, fromWebSocket, fromKafka, etc.)
|
|
10
|
-
* live in {@link ./adapters.ts}.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
type ExtraOpts = Omit<NodeOptions<unknown>, "describeKind">;
|
|
14
|
-
/** Options for {@link fromTimer} / {@link fromPromise} / {@link fromAsyncIter}. */
|
|
15
|
-
type AsyncSourceOpts = ExtraOpts & {
|
|
16
|
-
signal?: AbortSignal;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Values accepted by {@link fromAny}.
|
|
20
|
-
*
|
|
21
|
-
* @category extra
|
|
22
|
-
*/
|
|
23
|
-
type NodeInput<T> = Node<T> | PromiseLike<T> | AsyncIterable<T> | Iterable<T> | T;
|
|
24
|
-
/** Options for {@link fromCron}. */
|
|
25
|
-
type FromCronOptions = ExtraOpts & {
|
|
26
|
-
/** Polling interval in ms. Default `60_000`. */
|
|
27
|
-
tickMs?: number;
|
|
28
|
-
/** Output format: `"timestamp_ns"` (default) emits wall-clock nanoseconds; `"date"` emits a `Date` object. */
|
|
29
|
-
output?: "timestamp_ns" | "date";
|
|
30
|
-
};
|
|
31
|
-
/** DOM-style event target (browser or `node:events`). */
|
|
32
|
-
type EventTargetLike = {
|
|
33
|
-
addEventListener(type: string, listener: (ev: unknown) => void, options?: boolean | {
|
|
34
|
-
capture?: boolean;
|
|
35
|
-
passive?: boolean;
|
|
36
|
-
once?: boolean;
|
|
37
|
-
}): void;
|
|
38
|
-
removeEventListener(type: string, listener: (ev: unknown) => void, options?: boolean | {
|
|
39
|
-
capture?: boolean;
|
|
40
|
-
passive?: boolean;
|
|
41
|
-
once?: boolean;
|
|
42
|
-
}): void;
|
|
43
|
-
};
|
|
44
|
-
/** @internal Shared with adapters.ts and sources-fs.ts for glob matching. */
|
|
45
|
-
declare function escapeRegexChar(ch: string): string;
|
|
46
|
-
/** @internal */
|
|
47
|
-
declare function globToRegExp(glob: string): RegExp;
|
|
48
|
-
/** @internal */
|
|
49
|
-
declare function matchesAnyPattern(path: string, patterns: RegExp[]): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Builds a timer-driven source: one-shot (first tick then `COMPLETE`) or periodic (`0`, `1`, `2`, …).
|
|
52
|
-
*
|
|
53
|
-
* @param ms - Milliseconds before the first emission.
|
|
54
|
-
* @param opts - Producer options plus optional `period` for repeating ticks and optional `signal` (`AbortSignal`) to cancel with `ERROR`.
|
|
55
|
-
* @returns `Node<number>` — tick counter from `0`; teardown clears timers.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* import { fromTimer } from "@graphrefly/graphrefly-ts";
|
|
60
|
-
*
|
|
61
|
-
* fromTimer(250, { period: 1_000 });
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* @category extra
|
|
65
|
-
*/
|
|
66
|
-
declare function fromTimer(ms: number, opts?: AsyncSourceOpts & {
|
|
67
|
-
period?: number;
|
|
68
|
-
}): Node<number>;
|
|
69
|
-
/**
|
|
70
|
-
* Animation-frame-driven source. Emits on every `requestAnimationFrame` tick,
|
|
71
|
-
* yielding the frame timestamp (DOMHighResTimeStamp, ms since navigation).
|
|
72
|
-
*
|
|
73
|
-
* Use instead of `fromTimer({ period: 16 })` when animation smoothness matters.
|
|
74
|
-
* In a real browser, `requestAnimationFrame` synchronizes with the display
|
|
75
|
-
* refresh. The source keeps ticking even when the tab is hidden — it
|
|
76
|
-
* transparently switches to `setTimeout` while the tab is backgrounded (so
|
|
77
|
-
* downstream state updates continue) and returns to `requestAnimationFrame`
|
|
78
|
-
* when the tab regains focus.
|
|
79
|
-
*
|
|
80
|
-
* When `requestAnimationFrame` is unavailable (Node test environments, SSR),
|
|
81
|
-
* this falls back to `setTimeout(~16ms)` unconditionally. Abortable via
|
|
82
|
-
* `signal` (emits `ERROR`).
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```ts
|
|
86
|
-
* import { fromRaf, derived } from "@graphrefly/graphrefly-ts";
|
|
87
|
-
*
|
|
88
|
-
* const frame = fromRaf();
|
|
89
|
-
* const bouncingX = derived([frame], ([t]) => 50 + 40 * Math.sin((t as number) * 0.001));
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* @category extra
|
|
93
|
-
*/
|
|
94
|
-
declare function fromRaf(opts?: AsyncSourceOpts): Node<number>;
|
|
95
|
-
/**
|
|
96
|
-
* Polls on an interval; when the current minute matches a 5-field cron expression, emits once (see {@link parseCron}).
|
|
97
|
-
*
|
|
98
|
-
* @param expr - Cron string (`min hour dom month dow`).
|
|
99
|
-
* @param opts - Producer options plus `tickMs` (default `60_000`) and `output` (`timestamp_ns` default, or `date` for `Date` values).
|
|
100
|
-
* @returns `Node<number>` (nanosecond timestamp) or `Node<Date>` when `output: "date"`.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```ts
|
|
104
|
-
* import { fromCron } from "@graphrefly/graphrefly-ts";
|
|
105
|
-
*
|
|
106
|
-
* fromCron("0 9 * * 1");
|
|
107
|
-
* ```
|
|
108
|
-
*
|
|
109
|
-
* @category extra
|
|
110
|
-
*/
|
|
111
|
-
declare function fromCron(expr: string, opts?: FromCronOptions & {
|
|
112
|
-
output: "date";
|
|
113
|
-
}): Node<Date>;
|
|
114
|
-
declare function fromCron(expr: string, opts?: FromCronOptions): Node<number>;
|
|
115
|
-
/**
|
|
116
|
-
* Wraps a DOM-style `addEventListener` target; each event becomes a `DATA` emission.
|
|
117
|
-
*
|
|
118
|
-
* @param target - Object with `addEventListener` / `removeEventListener`.
|
|
119
|
-
* @param type - Event name (e.g. `"click"`).
|
|
120
|
-
* @param opts - Producer options plus listener options (`capture`, `passive`, `once`).
|
|
121
|
-
* @returns `Node<T>` — event payloads; teardown removes the listener.
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* ```ts
|
|
125
|
-
* import { fromEvent } from "@graphrefly/graphrefly-ts";
|
|
126
|
-
*
|
|
127
|
-
* fromEvent(document.body, "click");
|
|
128
|
-
* ```
|
|
129
|
-
*
|
|
130
|
-
* @category extra
|
|
131
|
-
*/
|
|
132
|
-
declare function fromEvent<T = unknown>(target: EventTargetLike, type: string, opts?: ExtraOpts & {
|
|
133
|
-
capture?: boolean;
|
|
134
|
-
passive?: boolean;
|
|
135
|
-
once?: boolean;
|
|
136
|
-
}): Node<T>;
|
|
137
|
-
/**
|
|
138
|
-
* Drains a synchronous iterable; each item is `DATA`, then `COMPLETE`, or `ERROR` if iteration throws.
|
|
139
|
-
*
|
|
140
|
-
* @param iterable - Values to emit in order.
|
|
141
|
-
* @param opts - Optional producer options.
|
|
142
|
-
* @returns `Node<T>` — one emission per element.
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* ```ts
|
|
146
|
-
* import { fromIter } from "@graphrefly/graphrefly-ts";
|
|
147
|
-
*
|
|
148
|
-
* fromIter([1, 2, 3]);
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* @category extra
|
|
152
|
-
*/
|
|
153
|
-
declare function fromIter<T>(iterable: Iterable<T>, opts?: ExtraOpts): Node<T>;
|
|
154
|
-
/**
|
|
155
|
-
* Lifts a Promise (or thenable) to a single-value stream: one `DATA` then `COMPLETE`, or `ERROR` on rejection.
|
|
156
|
-
*
|
|
157
|
-
* @param p - Promise to await.
|
|
158
|
-
* @param opts - Producer options plus optional `signal` for abort → `ERROR` with reason.
|
|
159
|
-
* @returns `Node<T>` — settles once.
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```ts
|
|
163
|
-
* import { fromPromise } from "@graphrefly/graphrefly-ts";
|
|
164
|
-
*
|
|
165
|
-
* fromPromise(Promise.resolve(42));
|
|
166
|
-
* ```
|
|
167
|
-
*
|
|
168
|
-
* @category extra
|
|
169
|
-
*/
|
|
170
|
-
declare function fromPromise<T>(p: Promise<T> | PromiseLike<T>, opts?: AsyncSourceOpts): Node<T>;
|
|
171
|
-
/**
|
|
172
|
-
* Reads an async iterable; each `next()` value becomes `DATA`; `COMPLETE` when done; `ERROR` on failure.
|
|
173
|
-
*
|
|
174
|
-
* @param iterable - Async source (`for await` shape).
|
|
175
|
-
* @param opts - Producer options plus optional `signal` to abort the pump.
|
|
176
|
-
* @returns `Node<T>` — async pull stream.
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```ts
|
|
180
|
-
* import { fromAsyncIter } from "@graphrefly/graphrefly-ts";
|
|
181
|
-
*
|
|
182
|
-
* async function* gen() {
|
|
183
|
-
* yield 1;
|
|
184
|
-
* }
|
|
185
|
-
* fromAsyncIter(gen());
|
|
186
|
-
* ```
|
|
187
|
-
*
|
|
188
|
-
* @category extra
|
|
189
|
-
*/
|
|
190
|
-
declare function fromAsyncIter<T>(iterable: AsyncIterable<T>, opts?: AsyncSourceOpts): Node<T>;
|
|
191
|
-
/**
|
|
192
|
-
* Coerces a value to a `Node` by shape: existing `Node` passthrough, thenable → {@link fromPromise},
|
|
193
|
-
* async iterable → {@link fromAsyncIter}, sync iterable → {@link fromIter}, else scalar → {@link of}.
|
|
194
|
-
*
|
|
195
|
-
* @param input - Any value to wrap.
|
|
196
|
-
* @param opts - Passed through when a Promise/async path is chosen.
|
|
197
|
-
* @returns `Node` of the inferred element type.
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```ts
|
|
201
|
-
* import { fromAny, state } from "@graphrefly/graphrefly-ts";
|
|
202
|
-
*
|
|
203
|
-
* fromAny(state(1));
|
|
204
|
-
* fromAny(Promise.resolve(2));
|
|
205
|
-
* ```
|
|
206
|
-
*
|
|
207
|
-
* @category extra
|
|
208
|
-
*/
|
|
209
|
-
declare function fromAny<T>(input: NodeInput<T>, opts?: AsyncSourceOpts): Node<T>;
|
|
210
|
-
/**
|
|
211
|
-
* Emits each argument as `DATA` in order, then `COMPLETE` (implemented via {@link fromIter}).
|
|
212
|
-
*
|
|
213
|
-
* @param values - Values to emit.
|
|
214
|
-
* @returns `Node<T>` — finite sequence.
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* ```ts
|
|
218
|
-
* import { of } from "@graphrefly/graphrefly-ts";
|
|
219
|
-
*
|
|
220
|
-
* of(1, 2, 3);
|
|
221
|
-
* ```
|
|
222
|
-
*
|
|
223
|
-
* @category extra
|
|
224
|
-
*/
|
|
225
|
-
declare function of<T>(...values: T[]): Node<T>;
|
|
226
|
-
/**
|
|
227
|
-
* Completes immediately with no `DATA` (cold `EMPTY` analogue).
|
|
228
|
-
*
|
|
229
|
-
* @param opts - Optional producer options.
|
|
230
|
-
* @returns `Node<T>` — terminal `COMPLETE` only.
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```ts
|
|
234
|
-
* import { empty } from "@graphrefly/graphrefly-ts";
|
|
235
|
-
*
|
|
236
|
-
* empty();
|
|
237
|
-
* ```
|
|
238
|
-
*
|
|
239
|
-
* @category extra
|
|
240
|
-
*/
|
|
241
|
-
declare function empty<T = never>(opts?: ExtraOpts): Node<T>;
|
|
242
|
-
/**
|
|
243
|
-
* Never emits and never completes until teardown (cold `NEVER` analogue).
|
|
244
|
-
*
|
|
245
|
-
* @param opts - Optional producer options.
|
|
246
|
-
* @returns `Node<T>` — silent until unsubscribed.
|
|
247
|
-
*
|
|
248
|
-
* @example
|
|
249
|
-
* ```ts
|
|
250
|
-
* import { never } from "@graphrefly/graphrefly-ts";
|
|
251
|
-
*
|
|
252
|
-
* never();
|
|
253
|
-
* ```
|
|
254
|
-
*
|
|
255
|
-
* @category extra
|
|
256
|
-
*/
|
|
257
|
-
declare function never<T = never>(opts?: ExtraOpts): Node<T>;
|
|
258
|
-
/**
|
|
259
|
-
* Emits `ERROR` as soon as the producer starts (cold error source).
|
|
260
|
-
*
|
|
261
|
-
* @param err - Error payload forwarded as `ERROR` data.
|
|
262
|
-
* @param opts - Optional producer options.
|
|
263
|
-
* @returns `Node<never>` — terminates with `ERROR`.
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
266
|
-
* ```ts
|
|
267
|
-
* import { throwError } from "@graphrefly/graphrefly-ts";
|
|
268
|
-
*
|
|
269
|
-
* throwError(new Error("fail"));
|
|
270
|
-
* ```
|
|
271
|
-
*
|
|
272
|
-
* @category extra
|
|
273
|
-
*/
|
|
274
|
-
declare function throwError(err: unknown, opts?: ExtraOpts): Node<never>;
|
|
275
|
-
/**
|
|
276
|
-
* Lazily constructs a {@link Node} from a thunk that runs at **activation
|
|
277
|
-
* time** (first subscriber after a teardown to zero sinks), not factory time.
|
|
278
|
-
*
|
|
279
|
-
* **Resubscribable by default.** Diverges from `fromPromise` / `fromIter` /
|
|
280
|
-
* `fromAsyncIter` (which are single-shot — second subscriber sees the cached
|
|
281
|
-
* terminal value). `defer`'s contract matches RxJS `defer`: every fresh
|
|
282
|
-
* activation cycle re-runs the thunk. To opt out and get one-shot semantics,
|
|
283
|
-
* pass `{ resubscribable: false }`.
|
|
284
|
-
*
|
|
285
|
-
* **Sharing across overlapping subscribers.** The thunk only re-runs on a
|
|
286
|
-
* fresh activation cycle (zero → one sink). Overlapping subscribers share
|
|
287
|
-
* the single activation; the thunk does NOT re-run for each subscriber. If
|
|
288
|
-
* the thunk returns an existing `Node`, that Node is shared across activations
|
|
289
|
-
* — `defer` will subscribe to it on each activation but does not isolate state
|
|
290
|
-
* across subscribers. For per-subscriber isolation, the thunk must construct
|
|
291
|
-
* a fresh source (`state(...)`, `fromPromise(fetch(...))`, etc.) on each call.
|
|
292
|
-
*
|
|
293
|
-
* **Use cases:**
|
|
294
|
-
* - Lazy upstream construction (avoid eager evaluation of expensive factories
|
|
295
|
-
* at module load — the thunk runs only when something subscribes).
|
|
296
|
-
* - Per-activation resource construction (open a connection / file handle on
|
|
297
|
-
* subscribe, when paired with full teardown between sessions).
|
|
298
|
-
* - Bridging non-Node inputs (Promise, AsyncIterable, Iterable, scalar) into
|
|
299
|
-
* the graph behind a lazy boundary.
|
|
300
|
-
*
|
|
301
|
-
* The thunk's return value is bridged via {@link fromAny}. Errors thrown by
|
|
302
|
-
* the thunk surface as a single `[[ERROR, err]]` on the output (with `err`
|
|
303
|
-
* coerced to a non-`undefined` value to satisfy spec §1.3 — bare `throw` and
|
|
304
|
-
* `throw undefined` are wrapped in a `defer: thunk threw undefined` Error).
|
|
305
|
-
*
|
|
306
|
-
* Upstream messages are forwarded transparently (DIRTY / DATA / RESOLVED /
|
|
307
|
-
* COMPLETE / ERROR / INVALIDATE / PAUSE / RESUME / TEARDOWN), preserving
|
|
308
|
-
* batch boundaries. The producer's own `START` handshake is delivered to
|
|
309
|
-
* subscribers automatically; the upstream's `START` is filtered.
|
|
310
|
-
*
|
|
311
|
-
* @param thunk - Called on each activation; returns the upstream input.
|
|
312
|
-
* @param opts - Forwarded to `fromAny` (e.g. `signal` for async inputs).
|
|
313
|
-
* `signal` is only consumed by `fromAny` for async input shapes (Promise,
|
|
314
|
-
* AsyncIterable); it does NOT abort a Node-input or scalar-input defer.
|
|
315
|
-
* @returns `Node<T>` — lazy upstream-on-activation.
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* ```ts
|
|
319
|
-
* import { defer } from "@graphrefly/graphrefly-ts";
|
|
320
|
-
*
|
|
321
|
-
* // Lazy fetch — runs on the first activation, NOT at factory time.
|
|
322
|
-
* // Each fresh activation cycle (after teardown) re-runs the thunk →
|
|
323
|
-
* // a new fetch. Overlapping subscribers share the single activation.
|
|
324
|
-
* const live = defer(() => fetch("/api/feed").then((r) => r.json()));
|
|
325
|
-
* ```
|
|
326
|
-
*
|
|
327
|
-
* @category extra
|
|
328
|
-
*/
|
|
329
|
-
declare function defer<T>(thunk: () => NodeInput<T>, opts?: AsyncSourceOpts): Node<T>;
|
|
330
|
-
/**
|
|
331
|
-
* Subscribes immediately and runs `fn` for each upstream `DATA`; returns unsubscribe.
|
|
332
|
-
*
|
|
333
|
-
* @param source - Upstream node.
|
|
334
|
-
* @param fn - Side effect per value.
|
|
335
|
-
* @param opts - Effect node options.
|
|
336
|
-
* @returns Unsubscribe function (idempotent).
|
|
337
|
-
*
|
|
338
|
-
* @example
|
|
339
|
-
* ```ts
|
|
340
|
-
* import { forEach, state } from "@graphrefly/graphrefly-ts";
|
|
341
|
-
*
|
|
342
|
-
* const u = forEach(state(1), (v) => console.log(v));
|
|
343
|
-
* u();
|
|
344
|
-
* ```
|
|
345
|
-
*
|
|
346
|
-
* @category extra
|
|
347
|
-
*/
|
|
348
|
-
declare function forEach<T>(source: Node<T>, fn: (value: T) => void, opts?: ExtraOpts): () => void;
|
|
349
|
-
/**
|
|
350
|
-
* Buffers every `DATA`; on upstream `COMPLETE` emits one `DATA` with the full array then `COMPLETE`.
|
|
351
|
-
*
|
|
352
|
-
* @param source - Upstream node.
|
|
353
|
-
* @param opts - Optional node options (derived describe kind).
|
|
354
|
-
* @returns `Node<T[]>` — single array emission before completion.
|
|
355
|
-
*
|
|
356
|
-
* @example
|
|
357
|
-
* ```ts
|
|
358
|
-
* import { of, toArray } from "@graphrefly/graphrefly-ts";
|
|
359
|
-
*
|
|
360
|
-
* toArray(of(1, 2, 3));
|
|
361
|
-
* ```
|
|
362
|
-
*
|
|
363
|
-
* @category extra
|
|
364
|
-
*/
|
|
365
|
-
declare function toArray<T>(source: Node<T>, opts?: ExtraOpts): Node<T[]>;
|
|
366
|
-
/**
|
|
367
|
-
* Multicasts upstream: one subscription to `source` while this wrapper has subscribers (via {@link producer}).
|
|
368
|
-
*
|
|
369
|
-
* @param source - Upstream node to share.
|
|
370
|
-
* @param opts - Producer options; `initial` seeds from `source.cache` when set by factory.
|
|
371
|
-
* @returns `Node<T>` — hot ref-counted bridge.
|
|
372
|
-
*
|
|
373
|
-
* @example
|
|
374
|
-
* ```ts
|
|
375
|
-
* import { share, state } from "@graphrefly/graphrefly-ts";
|
|
376
|
-
*
|
|
377
|
-
* share(state(0));
|
|
378
|
-
* ```
|
|
379
|
-
*
|
|
380
|
-
* @category extra
|
|
381
|
-
*/
|
|
382
|
-
declare function share<T>(source: Node<T>, opts?: ExtraOpts): Node<T>;
|
|
383
|
-
/**
|
|
384
|
-
* Like {@link share} with a bounded replay buffer: new subscribers receive the last `bufferSize`
|
|
385
|
-
* `DATA` payloads (as separate batches) before live updates.
|
|
386
|
-
*
|
|
387
|
-
* @param source - Upstream node.
|
|
388
|
-
* @param bufferSize - Maximum past values to replay (≥ 1).
|
|
389
|
-
* @param opts - Producer options.
|
|
390
|
-
* @returns `Node<T>` — multicast with replay on subscribe.
|
|
391
|
-
*
|
|
392
|
-
* @example
|
|
393
|
-
* ```ts
|
|
394
|
-
* import { replay, state } from "@graphrefly/graphrefly-ts";
|
|
395
|
-
*
|
|
396
|
-
* replay(state(0), 3);
|
|
397
|
-
* ```
|
|
398
|
-
*
|
|
399
|
-
* @category extra
|
|
400
|
-
*/
|
|
401
|
-
declare function replay<T>(source: Node<T>, bufferSize: number, opts?: ExtraOpts): Node<T>;
|
|
402
|
-
/**
|
|
403
|
-
* {@link replay} with `bufferSize === 1` — replays the latest `DATA` to new subscribers.
|
|
404
|
-
*
|
|
405
|
-
* @param source - Upstream node.
|
|
406
|
-
* @param opts - Producer options.
|
|
407
|
-
* @returns `Node<T>` — share + last-value replay.
|
|
408
|
-
*
|
|
409
|
-
* @example
|
|
410
|
-
* ```ts
|
|
411
|
-
* import { cached, state } from "@graphrefly/graphrefly-ts";
|
|
412
|
-
*
|
|
413
|
-
* cached(state(0));
|
|
414
|
-
* ```
|
|
415
|
-
*
|
|
416
|
-
* @category extra
|
|
417
|
-
*/
|
|
418
|
-
declare function cached<T>(source: Node<T>, opts?: ExtraOpts): Node<T>;
|
|
419
|
-
/**
|
|
420
|
-
* Converts the first `DATA` on `source` into a Promise; rejects on `ERROR` or `COMPLETE` without data.
|
|
421
|
-
*
|
|
422
|
-
* **Important:** This subscribes and waits for a **future** emission. Data that
|
|
423
|
-
* has already flowed is gone and will not be seen. Call this *before* the upstream
|
|
424
|
-
* emits, or use `source.cache` / `source.status` for already-cached state.
|
|
425
|
-
* See COMPOSITION-GUIDE §2 (subscription ordering).
|
|
426
|
-
*
|
|
427
|
-
* @param source - Node to read once.
|
|
428
|
-
* @returns Promise of the first value.
|
|
429
|
-
*
|
|
430
|
-
* @example
|
|
431
|
-
* ```ts
|
|
432
|
-
* import { firstValueFrom, of } from "@graphrefly/graphrefly-ts";
|
|
433
|
-
*
|
|
434
|
-
* await firstValueFrom(of(42));
|
|
435
|
-
* ```
|
|
436
|
-
*
|
|
437
|
-
* @category extra
|
|
438
|
-
*/
|
|
439
|
-
declare function firstValueFrom<T>(source: Node<T>): Promise<T>;
|
|
440
|
-
/**
|
|
441
|
-
* Wait for the first DATA value from `source` that satisfies `predicate`.
|
|
442
|
-
*
|
|
443
|
-
* Subscribes directly and resolves on the first DATA value where
|
|
444
|
-
* `predicate` returns true. Reactive, no polling. Use in tests and
|
|
445
|
-
* bridging code where you need a single matching value as a Promise.
|
|
446
|
-
*
|
|
447
|
-
* **Important:** This only captures **future** emissions — data that has
|
|
448
|
-
* already flowed through the node is gone. Call this *before* the upstream
|
|
449
|
-
* emits. For already-cached values, use `source.cache` / `source.status`.
|
|
450
|
-
* See COMPOSITION-GUIDE §2 (subscription ordering).
|
|
451
|
-
*
|
|
452
|
-
* ```ts
|
|
453
|
-
* const val = await firstWhere(strategy.node, snap => snap.size > 0);
|
|
454
|
-
* ```
|
|
455
|
-
*
|
|
456
|
-
* @param source - Upstream node to observe.
|
|
457
|
-
* @param predicate - Returns `true` for the value to resolve on.
|
|
458
|
-
* @param opts - `{ skipCurrent?: boolean }`. When `skipCurrent: true`, any DATA
|
|
459
|
-
* delivered during the synchronous `subscribe()` call (push-on-subscribe §2.2
|
|
460
|
-
* replay of the cached value) is ignored — the promise resolves only on the
|
|
461
|
-
* next future emission. Useful when the caller wants to await the next
|
|
462
|
-
* settlement event after an imperative action (e.g. `run()` minting a new
|
|
463
|
-
* runVersion, where the currently-cached value belongs to the previous run).
|
|
464
|
-
*
|
|
465
|
-
* @category extra
|
|
466
|
-
*/
|
|
467
|
-
declare function firstWhere<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: {
|
|
468
|
-
skipCurrent?: boolean;
|
|
469
|
-
}): Promise<T>;
|
|
470
|
-
declare function awaitSettled<T>(source: Node<T>, opts?: {
|
|
471
|
-
predicate?: (value: T) => boolean;
|
|
472
|
-
timeoutMs?: number;
|
|
473
|
-
skipCurrent?: boolean;
|
|
474
|
-
}): Promise<NonNullable<T>>;
|
|
475
|
-
/**
|
|
476
|
-
* Converts a reactive `Node<boolean>` into a browser-standard `AbortSignal`
|
|
477
|
-
* that fires when the node settles on `true`. Useful for threading a reactive
|
|
478
|
-
* "cancel" flag into any async boundary that accepts a signal (fetch, LLM SDK
|
|
479
|
-
* calls, child-process APIs, timers).
|
|
480
|
-
*
|
|
481
|
-
* **Contract.**
|
|
482
|
-
* - `signal.abort(reason)` fires exactly once, on the first DATA emission with
|
|
483
|
-
* a truthy value. Subsequent emissions are ignored (AbortSignal is
|
|
484
|
-
* single-shot).
|
|
485
|
-
* - Null / `false` / sentinel values are ignored. Push-on-subscribe will
|
|
486
|
-
* check the currently-cached value on subscribe and abort immediately if
|
|
487
|
-
* it's already `true`.
|
|
488
|
-
* - `reason` defaults to `"cancelled via nodeSignal"`; pass `opts.reason` to
|
|
489
|
-
* override (`DOMException`, `Error`, or any value accepted by
|
|
490
|
-
* `AbortController.abort`).
|
|
491
|
-
*
|
|
492
|
-
* **Lifecycle.**
|
|
493
|
-
* - Returns a `{signal, dispose}` bundle. Call `dispose()` when you're done
|
|
494
|
-
* with the signal (e.g. in a `finally` after the async operation completes).
|
|
495
|
-
* `dispose()` unsubscribes from the node and is a no-op once the signal has
|
|
496
|
-
* fired.
|
|
497
|
-
* - **Memory note:** without `dispose()` the subscription keeps the reactive
|
|
498
|
-
* node alive for the lifetime of the process. For bridge calls inside a
|
|
499
|
-
* `switchMap` project fn, the switchMap supersede tears the inner subgraph
|
|
500
|
-
* down, which is usually the right lifetime — but still call `dispose()`
|
|
501
|
-
* from the caller's `finally` for clarity.
|
|
502
|
-
*
|
|
503
|
-
* @example
|
|
504
|
-
* ```ts
|
|
505
|
-
* const aborted = state(false);
|
|
506
|
-
* const { signal, dispose } = nodeSignal(aborted);
|
|
507
|
-
* try {
|
|
508
|
-
* const resp = await adapter.invoke(msgs, { signal });
|
|
509
|
-
* return resp;
|
|
510
|
-
* } finally {
|
|
511
|
-
* dispose();
|
|
512
|
-
* }
|
|
513
|
-
* ```
|
|
514
|
-
*
|
|
515
|
-
* @category extra
|
|
516
|
-
*/
|
|
517
|
-
declare function nodeSignal(source: Node<boolean>, opts?: {
|
|
518
|
-
reason?: unknown;
|
|
519
|
-
}): {
|
|
520
|
-
signal: AbortSignal;
|
|
521
|
-
dispose: () => void;
|
|
522
|
-
};
|
|
523
|
-
/**
|
|
524
|
-
* RxJS-named alias for {@link replay} — multicast with a replay buffer of size `bufferSize`.
|
|
525
|
-
*
|
|
526
|
-
* @param source - Upstream node.
|
|
527
|
-
* @param bufferSize - Replay depth (≥ 1).
|
|
528
|
-
* @param opts - Producer options.
|
|
529
|
-
* @returns Same behavior as `replay`.
|
|
530
|
-
*
|
|
531
|
-
* @example
|
|
532
|
-
* ```ts
|
|
533
|
-
* import { shareReplay, state } from "@graphrefly/graphrefly-ts";
|
|
534
|
-
*
|
|
535
|
-
* shareReplay(state(0), 5);
|
|
536
|
-
* ```
|
|
537
|
-
*
|
|
538
|
-
* @category extra
|
|
539
|
-
*/
|
|
540
|
-
declare const shareReplay: typeof replay;
|
|
541
|
-
/**
|
|
542
|
-
* Activate a compute node's upstream wiring without a real sink.
|
|
543
|
-
*
|
|
544
|
-
* Derived/effect nodes are lazy — they don't compute until at least one
|
|
545
|
-
* subscriber exists (COMPOSITION-GUIDE §5). `keepalive` subscribes with an
|
|
546
|
-
* empty sink so the node stays wired for `.cache` and upstream propagation.
|
|
547
|
-
*
|
|
548
|
-
* Returns the unsubscribe handle. Common usage:
|
|
549
|
-
* `graph.addDisposer(keepalive(node))`.
|
|
550
|
-
*
|
|
551
|
-
* @category extra
|
|
552
|
-
*/
|
|
553
|
-
declare function keepalive(n: Node<unknown>): () => void;
|
|
554
|
-
/** Bundle returned by {@link reactiveCounter}. */
|
|
555
|
-
type ReactiveCounterBundle = {
|
|
556
|
-
/** Reactive node holding the current count. */
|
|
557
|
-
readonly node: Node<number>;
|
|
558
|
-
/** Increment by 1. Returns `false` if cap would be exceeded. */
|
|
559
|
-
increment(): boolean;
|
|
560
|
-
/** Current count (synchronous read). */
|
|
561
|
-
get(): number;
|
|
562
|
-
/** Whether the counter has reached its cap. */
|
|
563
|
-
atCap(): boolean;
|
|
564
|
-
};
|
|
565
|
-
/**
|
|
566
|
-
* Reactive counter with a cap — the building block for circuit breakers.
|
|
567
|
-
*
|
|
568
|
-
* Wraps a `state(0)` node with `increment()` that respects a maximum.
|
|
569
|
-
* The `node` is subscribable and composable like any reactive node. When
|
|
570
|
-
* the cap is reached, `increment()` returns `false`.
|
|
571
|
-
*
|
|
572
|
-
* ```ts
|
|
573
|
-
* const retries = reactiveCounter(10);
|
|
574
|
-
* retries.increment(); // true — count is now 1
|
|
575
|
-
* retries.node.subscribe(...); // reactive updates
|
|
576
|
-
* retries.atCap(); // false
|
|
577
|
-
* ```
|
|
578
|
-
*
|
|
579
|
-
* @param cap - Maximum value (inclusive). 0 = no increments allowed.
|
|
580
|
-
* @category extra
|
|
581
|
-
*/
|
|
582
|
-
declare function reactiveCounter(cap: number): ReactiveCounterBundle;
|
|
583
|
-
|
|
584
|
-
export { type AsyncSourceOpts, type EventTargetLike, type FromCronOptions, type NodeInput, type ReactiveCounterBundle, awaitSettled, cached, defer, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, nodeSignal, of, reactiveCounter, replay, share, shareReplay, throwError, toArray };
|
|
1
|
+
export * from '@graphrefly/pure-ts/extra/sources';
|