@graphrefly/graphrefly 0.26.0 → 0.28.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/backoff-HPZMEZNF.js +1 -0
- package/dist/cascading-B-5zmAUv.d.cts +180 -0
- package/dist/cascading-D9WG1-9L.d.ts +180 -0
- package/dist/chunk-2FOAM3OR.js +1 -0
- package/dist/chunk-2PMCKKRK.js +1 -0
- package/dist/chunk-3JXNEPCD.js +2 -0
- package/dist/chunk-3R5HFPX7.js +78 -0
- package/dist/chunk-4GKB4OUJ.js +1 -0
- package/dist/chunk-4VVTGLXJ.js +1 -0
- package/dist/chunk-5QDBSZBV.js +1 -0
- package/dist/chunk-6QZNQS5B.js +1 -0
- package/dist/chunk-6V3SEX2I.js +1 -0
- package/dist/chunk-76A3HVQE.js +9 -0
- package/dist/chunk-7H6LGFUG.js +64 -0
- package/dist/chunk-CK2E7BTU.js +1 -0
- package/dist/chunk-CKCSDI7T.js +6 -0
- package/dist/chunk-CRXTH3SH.js +1 -0
- package/dist/chunk-CWLN3X3N.js +1 -0
- package/dist/chunk-D7A7DBE4.js +1 -0
- package/dist/chunk-DBGGMN3D.js +1 -0
- package/dist/chunk-DQA3UIQ2.js +1 -0
- package/dist/chunk-ERLIRFPA.js +1 -0
- package/dist/chunk-ESMPEKEV.js +1 -0
- package/dist/chunk-ETWTCCJI.js +1 -0
- package/dist/chunk-FNYWM6JC.js +1 -0
- package/dist/chunk-GHJJR5P4.js +1 -0
- package/dist/chunk-GPW2V3RE.js +1 -0
- package/dist/chunk-I6VIH3VA.js +1 -0
- package/dist/chunk-K2GNMCQT.js +1 -0
- package/dist/chunk-LBTDSCCO.js +3 -0
- package/dist/chunk-LQ3Y5NJS.js +1 -0
- package/dist/chunk-MIQTDPY4.js +5 -0
- package/dist/chunk-MTTAAPCK.js +1 -0
- package/dist/chunk-OAWLCNJJ.js +1 -0
- package/dist/chunk-OBKQQA5I.js +1 -0
- package/dist/chunk-OYHGKYQM.js +1 -0
- package/dist/chunk-PIOGHC63.js +1 -0
- package/dist/chunk-QWAPKG3O.js +2 -0
- package/dist/chunk-QYADASLV.js +1 -0
- package/dist/chunk-RHESUC3V.js +43 -0
- package/dist/chunk-S35VARIR.js +1 -0
- package/dist/chunk-SC3U7ETD.js +1 -0
- package/dist/chunk-U3AICJKU.js +1 -0
- package/dist/chunk-UMBIDLJ4.js +1 -0
- package/dist/chunk-UPHHLMHE.js +1 -0
- package/dist/chunk-UPXUCFMX.js +1 -0
- package/dist/chunk-UWJE5FQA.js +18 -0
- package/dist/chunk-V6YQICXZ.js +1 -0
- package/dist/chunk-VIMF6LGM.js +1 -0
- package/dist/chunk-VJLMUKOI.js +1 -0
- package/dist/chunk-VPYBOXVT.js +1 -0
- package/dist/chunk-VTPVOGHH.js +1 -0
- package/dist/chunk-WQ2BN6X6.js +1 -0
- package/dist/chunk-XAUNPIMX.js +1 -0
- package/dist/chunk-Y2EMPB3I.js +1 -0
- package/dist/chunk-Z4HDAS2Q.js +1 -0
- package/dist/chunk-ZB5EHBIO.js +1 -0
- package/dist/chunk-ZV2DXV5A.js +23 -0
- package/dist/compat/index.cjs +14 -7656
- package/dist/compat/index.d.cts +15 -14
- package/dist/compat/index.d.ts +15 -14
- package/dist/compat/index.js +1 -49
- package/dist/compat/jotai/index.cjs +1 -2048
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +1 -9
- package/dist/compat/nanostores/index.cjs +1 -2175
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +1 -23
- package/dist/compat/nestjs/index.cjs +14 -6782
- package/dist/compat/nestjs/index.d.cts +7 -6
- package/dist/compat/nestjs/index.d.ts +7 -6
- package/dist/compat/nestjs/index.js +1 -82
- package/dist/compat/react/index.cjs +1 -141
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/react/index.js +1 -12
- package/dist/compat/solid/index.cjs +1 -128
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/solid/index.js +1 -12
- package/dist/compat/svelte/index.cjs +1 -131
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/svelte/index.js +1 -12
- package/dist/compat/vue/index.cjs +1 -146
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/vue/index.js +1 -12
- package/dist/compat/zustand/index.cjs +6 -4931
- package/dist/compat/zustand/index.d.cts +5 -5
- package/dist/compat/zustand/index.d.ts +5 -5
- package/dist/compat/zustand/index.js +1 -12
- package/dist/composite-B-xqw4Kk.d.cts +69 -0
- package/dist/composite-BhbKHbOS.d.ts +69 -0
- package/dist/core/index.cjs +1 -2271
- package/dist/core/index.d.cts +4 -3
- package/dist/core/index.d.ts +4 -3
- package/dist/core/index.js +1 -110
- package/dist/extra/browser.cjs +1 -0
- package/dist/extra/browser.d.cts +3 -0
- package/dist/extra/browser.d.ts +3 -0
- package/dist/extra/browser.js +1 -0
- package/dist/extra/index.cjs +23 -9971
- package/dist/extra/index.d.cts +13 -5
- package/dist/extra/index.d.ts +13 -5
- package/dist/extra/index.js +1 -375
- package/dist/extra/node.cjs +3 -0
- package/dist/extra/node.d.cts +81 -0
- package/dist/extra/node.d.ts +81 -0
- package/dist/extra/node.js +2 -0
- package/dist/extra/operators.cjs +1 -0
- package/dist/extra/operators.d.cts +910 -0
- package/dist/extra/operators.d.ts +910 -0
- package/dist/extra/operators.js +1 -0
- package/dist/extra/reactive.cjs +1 -0
- package/dist/extra/reactive.d.cts +352 -0
- package/dist/extra/reactive.d.ts +352 -0
- package/dist/extra/reactive.js +1 -0
- package/dist/extra/sources.cjs +1 -2486
- package/dist/extra/sources.d.cts +6 -2
- package/dist/extra/sources.d.ts +6 -2
- package/dist/extra/sources.js +1 -57
- package/dist/extra/storage-browser.cjs +1 -0
- package/dist/extra/storage-browser.d.cts +71 -0
- package/dist/extra/storage-browser.d.ts +71 -0
- package/dist/extra/storage-browser.js +1 -0
- package/dist/extra/storage-core.cjs +1 -0
- package/dist/extra/storage-core.d.cts +98 -0
- package/dist/extra/storage-core.d.ts +98 -0
- package/dist/extra/storage-core.js +1 -0
- package/dist/extra/storage-node.cjs +2 -0
- package/dist/extra/storage-node.d.cts +60 -0
- package/dist/extra/storage-node.d.ts +60 -0
- package/dist/extra/storage-node.js +1 -0
- package/dist/fallback-BaTS7vVY.d.cts +258 -0
- package/dist/fallback-eOm3LNxP.d.ts +258 -0
- package/dist/graph/index.cjs +6 -5030
- package/dist/graph/index.d.cts +6 -5
- package/dist/graph/index.d.ts +6 -5
- package/dist/graph/index.js +1 -50
- package/dist/{graph-6tZ5jEzr.d.cts → graph-BZGRXwOm.d.ts} +134 -31
- package/dist/{graph-DQ69XU0g.d.ts → graph-D48Qw9Cg.d.cts} +134 -31
- package/dist/index-8FSVk4Uf.d.ts +135 -0
- package/dist/index-9oDeHH2u.d.cts +291 -0
- package/dist/index-B0c4cmIO.d.ts +207 -0
- package/dist/{index-CDAjUFIv.d.ts → index-B1AmmSlb.d.ts} +1 -1
- package/dist/{index-Bd_fwmLf.d.cts → index-B2pwesl9.d.cts} +1 -1
- package/dist/index-BHvIquRZ.d.ts +1957 -0
- package/dist/{index-CPgZ5wRl.d.ts → index-BVHOrDwO.d.ts} +1 -1
- package/dist/{index-DrISNAOm.d.ts → index-BWJV63ti.d.ts} +1 -1
- package/dist/{index-B_IP40nB.d.cts → index-B_agccPe.d.cts} +1 -1
- package/dist/index-BgyGlizc.d.ts +163 -0
- package/dist/index-BpA5c4G9.d.ts +357 -0
- package/dist/index-BpIFjILY.d.cts +357 -0
- package/dist/{index-qldRdbQw.d.ts → index-Bqachn9_.d.ts} +1 -1
- package/dist/index-Btib9rsU.d.ts +607 -0
- package/dist/{index-BYOHF0zP.d.ts → index-BwM9BEkt.d.ts} +1 -1
- package/dist/index-BxJ86YZZ.d.cts +105 -0
- package/dist/index-C73n7lo-.d.cts +251 -0
- package/dist/index-CEXXwWVH.d.cts +192 -0
- package/dist/index-CHEswufn.d.cts +163 -0
- package/dist/{index-xdGjv0nO.d.ts → index-CMn8S8Hw.d.ts} +1 -1
- package/dist/{index-QBpffFW-.d.cts → index-CRO83MmV.d.cts} +1 -1
- package/dist/{index-BjI6ty9z.d.ts → index-CloUk1kY.d.ts} +9 -9
- package/dist/index-CpgYhnrG.d.ts +291 -0
- package/dist/{index-CUyrtuOf.d.cts → index-Cyojz0AE.d.cts} +1 -1
- package/dist/{demo-shell-DEp-nMTl.d.ts → index-CzobVSMr.d.ts} +14 -14
- package/dist/index-Czq6ynh8.d.ts +143 -0
- package/dist/index-D-YB-Vl3.d.ts +195 -0
- package/dist/index-DAlweici.d.ts +231 -0
- package/dist/index-DEwTb_fm.d.cts +1957 -0
- package/dist/{index-DFhjO4Gg.d.cts → index-DL-rYJrx.d.cts} +1 -1
- package/dist/index-DP4ZTkdw.d.ts +139 -0
- package/dist/{index-BeIdBfcb.d.cts → index-DUqMOlKZ.d.cts} +200 -2366
- package/dist/{index-Bxb5ZYc9.d.cts → index-D_NwnRYS.d.cts} +1 -1
- package/dist/index-DaLJvH8Z.d.ts +105 -0
- package/dist/index-DcXZBF5a.d.cts +135 -0
- package/dist/index-DfyOkTvs.d.ts +321 -0
- package/dist/{index-CmnuOibw.d.ts → index-DiOXyAwt.d.ts} +1 -1
- package/dist/index-DpHe5e0Q.d.ts +186 -0
- package/dist/index-DraikLjn.d.ts +86 -0
- package/dist/{index-BEfE8H_G.d.cts → index-DxsnAMWD.d.cts} +9 -9
- package/dist/index-DyxjtScX.d.cts +207 -0
- package/dist/index-HDpJe9hX.d.ts +251 -0
- package/dist/index-O6TgGUBV.d.cts +195 -0
- package/dist/{index-B4MP_8V_.d.cts → index-Oi8d8w4R.d.cts} +1 -1
- package/dist/{index-BW1z3BN9.d.ts → index-ROpQmGjE.d.ts} +30 -6
- package/dist/index-RukJ4DLS.d.cts +607 -0
- package/dist/{index-DdD5MVDL.d.ts → index-ZftwfxJM.d.ts} +200 -2366
- package/dist/{index-CuYwdKO-.d.ts → index-cByzxQIC.d.cts} +10 -195
- package/dist/index-dtN7YA2x.d.cts +143 -0
- package/dist/{index-C8mdwMXc.d.cts → index-fM6y00vT.d.cts} +30 -6
- package/dist/{index-_oMEWlDq.d.cts → index-m-yHof5p.d.ts} +10 -195
- package/dist/index-pXrDMpRO.d.cts +231 -0
- package/dist/index-rHJSKsU8.d.cts +186 -0
- package/dist/index-rX8HBM5h.d.cts +321 -0
- package/dist/{index-CUwyr1Kk.d.cts → index-rnwQly8X.d.cts} +147 -20
- package/dist/index-sm373fsH.d.ts +192 -0
- package/dist/index-tbf2gKHd.d.cts +139 -0
- package/dist/{demo-shell-26p5fVxn.d.cts → index-u15meRxL.d.cts} +14 -14
- package/dist/{index-eJ6T_qGM.d.ts → index-umtoWT8K.d.ts} +147 -20
- package/dist/index-vscRDkjW.d.cts +86 -0
- package/dist/index.cjs +150 -24142
- package/dist/index.d.cts +69 -3756
- package/dist/index.d.ts +69 -3756
- package/dist/index.js +1 -7292
- package/dist/{meta-C0-8XW6Q.d.cts → meta-Cgj6zeji.d.cts} +5 -5
- package/dist/{meta-BGqSZ7mt.d.ts → meta-CwesDrMD.d.ts} +5 -5
- package/dist/{node-C_IBuvX2.d.cts → node-Cc1TniY8.d.cts} +36 -9
- package/dist/{node-C_IBuvX2.d.ts → node-Cc1TniY8.d.ts} +36 -9
- package/dist/{observable-DCk45RH5.d.ts → observable-Ct-gJ9jI.d.ts} +1 -1
- package/dist/{observable-Crr1jgzx.d.cts → observable-glXQoGj2.d.cts} +1 -1
- package/dist/patterns/ai/browser.cjs +25 -0
- package/dist/patterns/ai/browser.d.cts +127 -0
- package/dist/patterns/ai/browser.d.ts +127 -0
- package/dist/patterns/ai/browser.js +3 -0
- package/dist/patterns/ai/index.cjs +91 -0
- package/dist/patterns/ai/index.d.cts +17 -0
- package/dist/patterns/ai/index.d.ts +17 -0
- package/dist/patterns/ai/index.js +1 -0
- package/dist/patterns/ai/node.cjs +2 -0
- package/dist/patterns/ai/node.d.cts +58 -0
- package/dist/patterns/ai/node.d.ts +58 -0
- package/dist/patterns/ai/node.js +1 -0
- package/dist/patterns/audit/index.cjs +6 -0
- package/dist/patterns/audit/index.d.cts +6 -0
- package/dist/patterns/audit/index.d.ts +6 -0
- package/dist/patterns/audit/index.js +1 -0
- package/dist/patterns/cqrs/index.cjs +6 -0
- package/dist/patterns/cqrs/index.d.cts +5 -0
- package/dist/patterns/cqrs/index.d.ts +5 -0
- package/dist/patterns/cqrs/index.js +1 -0
- package/dist/patterns/demo-shell/index.cjs +7 -0
- package/dist/patterns/demo-shell/index.d.cts +6 -0
- package/dist/patterns/demo-shell/index.d.ts +6 -0
- package/dist/patterns/demo-shell/index.js +1 -0
- package/dist/patterns/domain-templates/index.cjs +6 -0
- package/dist/patterns/domain-templates/index.d.cts +5 -0
- package/dist/patterns/domain-templates/index.d.ts +5 -0
- package/dist/patterns/domain-templates/index.js +1 -0
- package/dist/patterns/graphspec/index.cjs +83 -0
- package/dist/patterns/graphspec/index.d.cts +7 -0
- package/dist/patterns/graphspec/index.d.ts +7 -0
- package/dist/patterns/graphspec/index.js +1 -0
- package/dist/patterns/guarded-execution/index.cjs +6 -0
- package/dist/patterns/guarded-execution/index.d.cts +7 -0
- package/dist/patterns/guarded-execution/index.d.ts +7 -0
- package/dist/patterns/guarded-execution/index.js +1 -0
- package/dist/patterns/harness/index.cjs +48 -0
- package/dist/patterns/harness/index.d.cts +8 -0
- package/dist/patterns/harness/index.d.ts +8 -0
- package/dist/patterns/harness/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +6 -0
- package/dist/patterns/job-queue/index.d.cts +5 -0
- package/dist/patterns/job-queue/index.d.ts +5 -0
- package/dist/patterns/job-queue/index.js +1 -0
- package/dist/patterns/lens/index.cjs +6 -0
- package/dist/patterns/lens/index.d.cts +7 -0
- package/dist/patterns/lens/index.d.ts +7 -0
- package/dist/patterns/lens/index.js +1 -0
- package/dist/patterns/memory/index.cjs +6 -0
- package/dist/patterns/memory/index.d.cts +5 -0
- package/dist/patterns/memory/index.d.ts +5 -0
- package/dist/patterns/memory/index.js +1 -0
- package/dist/patterns/messaging/index.cjs +6 -0
- package/dist/patterns/messaging/index.d.cts +5 -0
- package/dist/patterns/messaging/index.d.ts +5 -0
- package/dist/patterns/messaging/index.js +1 -0
- package/dist/patterns/orchestration/index.cjs +6 -0
- package/dist/patterns/orchestration/index.d.cts +6 -0
- package/dist/patterns/orchestration/index.d.ts +6 -0
- package/dist/patterns/orchestration/index.js +1 -0
- package/dist/patterns/reactive-layout/index.cjs +7 -6444
- package/dist/patterns/reactive-layout/index.d.cts +6 -6
- package/dist/patterns/reactive-layout/index.d.ts +6 -6
- package/dist/patterns/reactive-layout/index.js +1 -56
- package/dist/patterns/reduction/index.cjs +6 -0
- package/dist/patterns/reduction/index.d.cts +5 -0
- package/dist/patterns/reduction/index.d.ts +5 -0
- package/dist/patterns/reduction/index.js +1 -0
- package/dist/patterns/refine-loop/index.cjs +8 -0
- package/dist/patterns/refine-loop/index.d.cts +7 -0
- package/dist/patterns/refine-loop/index.d.ts +7 -0
- package/dist/patterns/refine-loop/index.js +1 -0
- package/dist/patterns/resilient-pipeline/index.cjs +1 -0
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -0
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -0
- package/dist/patterns/resilient-pipeline/index.js +1 -0
- package/dist/patterns/surface/index.cjs +14 -0
- package/dist/patterns/surface/index.d.cts +8 -0
- package/dist/patterns/surface/index.d.ts +8 -0
- package/dist/patterns/surface/index.js +1 -0
- package/dist/{reactive-layout-BaOQefHu.d.cts → reactive-layout-CpYb5qLP.d.cts} +2 -2
- package/dist/{reactive-layout-D9gejYXE.d.ts → reactive-layout-D8u4wuUR.d.ts} +2 -2
- package/dist/reactive-log-DPzuUDj5.d.cts +190 -0
- package/dist/reactive-log-YuH9VYN8.d.ts +190 -0
- package/dist/reactive-map-CdbNoSgP.d.ts +238 -0
- package/dist/reactive-map-DUeRmb9d.d.cts +238 -0
- package/dist/resilience-Ba5-b4WD.d.cts +493 -0
- package/dist/resilience-CGRzhnD3.d.ts +493 -0
- package/dist/resilience-QAHKANT5.js +1 -0
- package/dist/sugar-BV0htudb.d.cts +205 -0
- package/dist/sugar-Dtyrq2_q.d.ts +205 -0
- package/dist/topology-tree-CYHOwQZ_.d.ts +25 -0
- package/dist/topology-tree-DROUdq5B.d.cts +25 -0
- package/dist/types-O3GzJY2U.d.cts +401 -0
- package/dist/types-u64Ose53.d.ts +401 -0
- package/package.json +267 -7
- package/dist/chunk-3ZWCKRHX.js +0 -117
- package/dist/chunk-3ZWCKRHX.js.map +0 -1
- package/dist/chunk-6LDQFTYS.js +0 -102
- package/dist/chunk-6LDQFTYS.js.map +0 -1
- package/dist/chunk-7TAQJHQV.js +0 -103
- package/dist/chunk-7TAQJHQV.js.map +0 -1
- package/dist/chunk-AMCG74RZ.js +0 -7000
- package/dist/chunk-AMCG74RZ.js.map +0 -1
- package/dist/chunk-BVZYTZ5H.js +0 -599
- package/dist/chunk-BVZYTZ5H.js.map +0 -1
- package/dist/chunk-FQMKGR6L.js +0 -330
- package/dist/chunk-FQMKGR6L.js.map +0 -1
- package/dist/chunk-HXZEYDUR.js +0 -94
- package/dist/chunk-HXZEYDUR.js.map +0 -1
- package/dist/chunk-IZYUSJC7.js +0 -1369
- package/dist/chunk-IZYUSJC7.js.map +0 -1
- package/dist/chunk-J22W6HV3.js +0 -107
- package/dist/chunk-J22W6HV3.js.map +0 -1
- package/dist/chunk-JSCT3CR4.js +0 -38
- package/dist/chunk-JSCT3CR4.js.map +0 -1
- package/dist/chunk-JYXEWPH4.js +0 -62
- package/dist/chunk-JYXEWPH4.js.map +0 -1
- package/dist/chunk-LCE3GF5P.js +0 -866
- package/dist/chunk-LCE3GF5P.js.map +0 -1
- package/dist/chunk-MJ2NKQQL.js +0 -119
- package/dist/chunk-MJ2NKQQL.js.map +0 -1
- package/dist/chunk-N6UR7YVY.js +0 -198
- package/dist/chunk-N6UR7YVY.js.map +0 -1
- package/dist/chunk-OHISZPOJ.js +0 -97
- package/dist/chunk-OHISZPOJ.js.map +0 -1
- package/dist/chunk-PHOUUNK7.js +0 -2291
- package/dist/chunk-PHOUUNK7.js.map +0 -1
- package/dist/chunk-RB6QPHJ7.js +0 -393
- package/dist/chunk-RB6QPHJ7.js.map +0 -1
- package/dist/chunk-SN4YWWYO.js +0 -171
- package/dist/chunk-SN4YWWYO.js.map +0 -1
- package/dist/chunk-SX52TAR4.js +0 -110
- package/dist/chunk-SX52TAR4.js.map +0 -1
- package/dist/chunk-THTWHNU4.js +0 -2712
- package/dist/chunk-THTWHNU4.js.map +0 -1
- package/dist/chunk-VYPWMZ6H.js +0 -98
- package/dist/chunk-VYPWMZ6H.js.map +0 -1
- package/dist/chunk-XGPU467M.js +0 -136
- package/dist/chunk-XGPU467M.js.map +0 -1
- package/dist/chunk-ZQMEI34O.js +0 -713
- package/dist/chunk-ZQMEI34O.js.map +0 -1
- package/dist/compat/index.cjs.map +0 -1
- package/dist/compat/index.js.map +0 -1
- package/dist/compat/jotai/index.cjs.map +0 -1
- package/dist/compat/jotai/index.js.map +0 -1
- package/dist/compat/nanostores/index.cjs.map +0 -1
- package/dist/compat/nanostores/index.js.map +0 -1
- package/dist/compat/nestjs/index.cjs.map +0 -1
- package/dist/compat/nestjs/index.js.map +0 -1
- package/dist/compat/react/index.cjs.map +0 -1
- package/dist/compat/react/index.js.map +0 -1
- package/dist/compat/solid/index.cjs.map +0 -1
- package/dist/compat/solid/index.js.map +0 -1
- package/dist/compat/svelte/index.cjs.map +0 -1
- package/dist/compat/svelte/index.js.map +0 -1
- package/dist/compat/vue/index.cjs.map +0 -1
- package/dist/compat/vue/index.js.map +0 -1
- package/dist/compat/zustand/index.cjs.map +0 -1
- package/dist/compat/zustand/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/extra/index.cjs.map +0 -1
- package/dist/extra/index.js.map +0 -1
- package/dist/extra/sources.cjs.map +0 -1
- package/dist/extra/sources.js.map +0 -1
- package/dist/graph/index.cjs.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/index-C0ZXMaXO.d.cts +0 -392
- package/dist/index-CY2TljO4.d.ts +0 -392
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/patterns/demo-shell.cjs +0 -5604
- package/dist/patterns/demo-shell.cjs.map +0 -1
- package/dist/patterns/demo-shell.d.cts +0 -6
- package/dist/patterns/demo-shell.d.ts +0 -6
- package/dist/patterns/demo-shell.js +0 -15
- package/dist/patterns/demo-shell.js.map +0 -1
- package/dist/patterns/reactive-layout/index.cjs.map +0 -1
- package/dist/patterns/reactive-layout/index.js.map +0 -1
- package/dist/storage-BMycWEh2.d.ts +0 -190
- package/dist/storage-DiqWHzVI.d.cts +0 -190
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { N as NodeOptions, a as Node, M as Message, b as Messages } from './node-Cc1TniY8.js';
|
|
2
|
+
import { d as BackoffStrategy, B as BackoffPreset, v as retrySource, k as WithStatusBundle, e as CircuitBreaker, a as CircuitBreakerOptions, f as CircuitOpenError, C as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, c as NS_PER_SEC, R as RateLimiterOptions, g as RateLimiterOverflowError, h as RateLimiterOverflowPolicy, b as RetryOptions, i as RetrySourceOptions, S as StatusValue, T as TimeoutError, j as TokenBucket, W as WithBreakerBundle, l as circuitBreaker, m as constant, n as decorrelatedJitter, o as exponential, p as fallback, q as fibonacci, r as linear, s as rateLimiter, t as resolveBackoffPreset, u as retry, w as timeout, x as tokenBucket, y as withBreaker, z as withMaxAttempts, A as withStatus } from './resilience-CGRzhnD3.js';
|
|
3
|
+
import { AsyncSourceOpts, NodeInput, EventTargetLike, FromCronOptions, ReactiveCounterBundle, awaitSettled, cached, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.js';
|
|
4
|
+
import { StorageTier, StorageHandle, dictStorage, memoryStorage, sortJsonValue, stableJsonString } from './extra/storage-core.js';
|
|
5
|
+
import { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as distill, v as verifiable } from './composite-BhbKHbOS.js';
|
|
6
|
+
import { T as ToObservableOptions, t as toObservable } from './observable-Ct-gJ9jI.js';
|
|
7
|
+
import { MergeMapOptions, TapObserver, ThrottleOptions, audit, buffer, bufferCount, bufferTime, catchError, combine, combineLatest, concat, concatMap, debounce, debounceTime, delay, distinctUntilChanged, elementAt, exhaustMap, filter, find, first, flatMap, interval, last, map, merge, mergeMap, pairwise, pausable, race, reduce, repeat, rescue, sample, scan, skip, switchMap, take, takeUntil, takeWhile, tap, throttle, throttleTime, valve, window, windowCount, windowTime, withLatestFrom, zip } from './extra/operators.js';
|
|
8
|
+
import { IndexBackend, IndexRow, ListBackend, NativeIndexBackend, NativeListBackend, ReactiveIndexBundle, ReactiveIndexOptions, ReactiveListBundle, ReactiveListOptions, UpsertOptions, reactiveIndex, reactiveList } from './extra/reactive.js';
|
|
9
|
+
import { L as LogBackend, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, r as reactiveLog } from './reactive-log-YuH9VYN8.js';
|
|
10
|
+
import { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, r as reactiveMap } from './reactive-map-CdbNoSgP.js';
|
|
11
|
+
import { a as GraphOptions, G as Graph } from './graph-BZGRXwOm.js';
|
|
5
12
|
|
|
6
13
|
/**
|
|
7
14
|
* External-register helpers — the common `register({emit, error, complete})`
|
|
@@ -22,7 +29,7 @@ import { T as ToObservableOptions, t as toObservable } from './observable-DCk45R
|
|
|
22
29
|
* torn down.
|
|
23
30
|
*/
|
|
24
31
|
|
|
25
|
-
type ExtraOpts$
|
|
32
|
+
type ExtraOpts$1 = Omit<NodeOptions<unknown>, "describeKind">;
|
|
26
33
|
/**
|
|
27
34
|
* Standard emit-triad passed to a single-channel external registrar.
|
|
28
35
|
*
|
|
@@ -85,7 +92,7 @@ type ExternalRegister<H> = (handlers: H) => (() => void) | undefined;
|
|
|
85
92
|
*
|
|
86
93
|
* @category extra
|
|
87
94
|
*/
|
|
88
|
-
declare function externalProducer<T = unknown>(register: ExternalRegister<EmitTriad<T>>, opts?: ExtraOpts$
|
|
95
|
+
declare function externalProducer<T = unknown>(register: ExternalRegister<EmitTriad<T>>, opts?: ExtraOpts$1): Node<T>;
|
|
89
96
|
/**
|
|
90
97
|
* Options for {@link externalBundle}.
|
|
91
98
|
*
|
|
@@ -96,7 +103,7 @@ type ExternalBundleOptions<TChannels extends Record<string, unknown>> = {
|
|
|
96
103
|
name?: string;
|
|
97
104
|
/** Per-channel node options (equals, resubscribable, ...). */
|
|
98
105
|
channelOpts?: {
|
|
99
|
-
[K in keyof TChannels]?: ExtraOpts$
|
|
106
|
+
[K in keyof TChannels]?: ExtraOpts$1;
|
|
100
107
|
};
|
|
101
108
|
};
|
|
102
109
|
/**
|
|
@@ -138,159 +145,6 @@ declare function externalBundle<TChannels extends Record<string, unknown>>(regis
|
|
|
138
145
|
dispose(): void;
|
|
139
146
|
};
|
|
140
147
|
|
|
141
|
-
/**
|
|
142
|
-
* Backoff strategies for {@link retry} (roadmap §3.1). Delays are in **nanoseconds**.
|
|
143
|
-
*
|
|
144
|
-
* Convention: all graphrefly-ts timestamps and durations use nanoseconds (`_ns` suffix).
|
|
145
|
-
* 1 second = 1_000_000_000 ns, 1 ms = 1_000_000 ns.
|
|
146
|
-
*/
|
|
147
|
-
declare const NS_PER_MS = 1000000;
|
|
148
|
-
declare const NS_PER_SEC = 1000000000;
|
|
149
|
-
type JitterMode = "none" | "full" | "equal";
|
|
150
|
-
type BackoffPreset = "constant" | "linear" | "exponential" | "fibonacci" | "decorrelatedJitter";
|
|
151
|
-
/** `(attempt, error?, previousDelayNs?) => delayNs | null` — `null` means zero delay. */
|
|
152
|
-
type BackoffStrategy = (attempt: number, error?: unknown, prevDelayNs?: number | null) => number | null;
|
|
153
|
-
/**
|
|
154
|
-
* Builds a strategy that always returns the same delay in nanoseconds.
|
|
155
|
-
*
|
|
156
|
-
* @param delayNs - Non-negative delay in nanoseconds; values below zero are clamped to zero.
|
|
157
|
-
* @returns `BackoffStrategy` for use with {@link retry} or custom timers.
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```ts
|
|
161
|
-
* import { constant, retry, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
162
|
-
*
|
|
163
|
-
* const out = retry(source, { count: 3, backoff: constant(0.25 * NS_PER_SEC) });
|
|
164
|
-
* ```
|
|
165
|
-
*
|
|
166
|
-
* @category extra
|
|
167
|
-
*/
|
|
168
|
-
declare function constant(delayNs: number): BackoffStrategy;
|
|
169
|
-
/**
|
|
170
|
-
* Builds linear backoff: `baseNs + stepNs * attempt` (`stepNs` defaults to `baseNs`).
|
|
171
|
-
*
|
|
172
|
-
* @param baseNs - Base delay in nanoseconds (clamped non-negative).
|
|
173
|
-
* @param stepNs - Added per retry attempt in nanoseconds (clamped non-negative).
|
|
174
|
-
* @returns `BackoffStrategy` for {@link retry}.
|
|
175
|
-
*
|
|
176
|
-
* @example
|
|
177
|
-
* ```ts
|
|
178
|
-
* import { linear, retry, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
179
|
-
*
|
|
180
|
-
* // Attempt 0 → 1 s, attempt 1 → 2 s, attempt 2 → 3 s …
|
|
181
|
-
* const out = retry(source, { count: 4, backoff: linear(NS_PER_SEC) });
|
|
182
|
-
* ```
|
|
183
|
-
*
|
|
184
|
-
* @category extra
|
|
185
|
-
*/
|
|
186
|
-
declare function linear(baseNs: number, stepNs?: number): BackoffStrategy;
|
|
187
|
-
type ExponentialBackoffOptions = {
|
|
188
|
-
baseNs?: number;
|
|
189
|
-
factor?: number;
|
|
190
|
-
maxDelayNs?: number;
|
|
191
|
-
jitter?: JitterMode;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Builds exponential backoff in nanoseconds, capped by `maxDelayNs`, with optional jitter.
|
|
195
|
-
*
|
|
196
|
-
* @param options - Base, factor, cap, and jitter mode.
|
|
197
|
-
* @returns `BackoffStrategy` for {@link retry}.
|
|
198
|
-
*
|
|
199
|
-
* @remarks
|
|
200
|
-
* **Jitter:** `"full"` spreads delay across `[0, delay]`; `"equal"` uses `[delay/2, delay]`.
|
|
201
|
-
*
|
|
202
|
-
* @example
|
|
203
|
-
* ```ts
|
|
204
|
-
* import { exponential, retry, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
205
|
-
*
|
|
206
|
-
* // 100 ms → 200 ms → 400 ms … capped at 30 s, with full jitter
|
|
207
|
-
* const out = retry(source, {
|
|
208
|
-
* count: 5,
|
|
209
|
-
* backoff: exponential({ baseNs: 100 * NS_PER_SEC / 1000, jitter: "full" }),
|
|
210
|
-
* });
|
|
211
|
-
* ```
|
|
212
|
-
*
|
|
213
|
-
* @category extra
|
|
214
|
-
*/
|
|
215
|
-
declare function exponential(options?: ExponentialBackoffOptions): BackoffStrategy;
|
|
216
|
-
/**
|
|
217
|
-
* Builds Fibonacci-scaled delays: `1, 2, 3, 5, … × baseNs`, capped at `maxDelayNs`.
|
|
218
|
-
*
|
|
219
|
-
* @param baseNs - Multiplier applied to the Fibonacci unit (default `100ms` in nanoseconds).
|
|
220
|
-
* @param maxDelayNs - Upper bound in nanoseconds (default `30s`).
|
|
221
|
-
* @returns `BackoffStrategy` for {@link retry}.
|
|
222
|
-
*
|
|
223
|
-
* @example
|
|
224
|
-
* ```ts
|
|
225
|
-
* import { fibonacci, retry, NS_PER_MS } from "@graphrefly/graphrefly-ts";
|
|
226
|
-
*
|
|
227
|
-
* // Delays: 100 ms, 200 ms, 300 ms, 500 ms, 800 ms … (× 100 ms base)
|
|
228
|
-
* const out = retry(source, { count: 5, backoff: fibonacci(100 * NS_PER_MS) });
|
|
229
|
-
* ```
|
|
230
|
-
*
|
|
231
|
-
* @category extra
|
|
232
|
-
*/
|
|
233
|
-
declare function fibonacci(baseNs?: number, maxDelayNs?: number): BackoffStrategy;
|
|
234
|
-
/**
|
|
235
|
-
* Decorrelated jitter (AWS-recommended): `random(baseNs, min(maxNs, lastDelay * 3))`.
|
|
236
|
-
*
|
|
237
|
-
* Stateless — uses `prevDelayNs` (passed by the consumer) instead of closure state.
|
|
238
|
-
* Safe to share across concurrent retry sequences.
|
|
239
|
-
*
|
|
240
|
-
* @param baseNs - Floor of the random range (default `100ms` in nanoseconds).
|
|
241
|
-
* @param maxNs - Ceiling cap (default `30s` in nanoseconds).
|
|
242
|
-
* @returns `BackoffStrategy` for {@link retry}.
|
|
243
|
-
*
|
|
244
|
-
* @example
|
|
245
|
-
* ```ts
|
|
246
|
-
* import { decorrelatedJitter, retry, NS_PER_MS, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
247
|
-
*
|
|
248
|
-
* const out = retry(source, {
|
|
249
|
-
* count: 6,
|
|
250
|
-
* backoff: decorrelatedJitter(100 * NS_PER_MS, 10 * NS_PER_SEC),
|
|
251
|
-
* });
|
|
252
|
-
* ```
|
|
253
|
-
*
|
|
254
|
-
* @category extra
|
|
255
|
-
*/
|
|
256
|
-
declare function decorrelatedJitter(baseNs?: number, maxNs?: number): BackoffStrategy;
|
|
257
|
-
/**
|
|
258
|
-
* Decorator that caps any strategy at `maxAttempts`. Returns `null` (stop retrying) after the cap.
|
|
259
|
-
*
|
|
260
|
-
* @param strategy - Inner strategy to wrap.
|
|
261
|
-
* @param maxAttempts - Maximum number of attempts (inclusive).
|
|
262
|
-
* @returns Wrapped `BackoffStrategy`.
|
|
263
|
-
*
|
|
264
|
-
* @example
|
|
265
|
-
* ```ts
|
|
266
|
-
* import { withMaxAttempts, exponential } from "@graphrefly/graphrefly-ts";
|
|
267
|
-
*
|
|
268
|
-
* const capped = withMaxAttempts(exponential(), 3);
|
|
269
|
-
* capped(3); // null — no more retries beyond attempt 3
|
|
270
|
-
* ```
|
|
271
|
-
*
|
|
272
|
-
* @category extra
|
|
273
|
-
*/
|
|
274
|
-
declare function withMaxAttempts(strategy: BackoffStrategy, maxAttempts: number): BackoffStrategy;
|
|
275
|
-
/**
|
|
276
|
-
* Maps a preset name to a concrete {@link BackoffStrategy} with library-default parameters.
|
|
277
|
-
*
|
|
278
|
-
* @param name - One of `constant`, `linear`, `exponential`, `fibonacci`, or `decorrelatedJitter`.
|
|
279
|
-
* @returns Configured strategy with default parameters.
|
|
280
|
-
* @throws Error when `name` is not a known preset.
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* ```ts
|
|
284
|
-
* import { resolveBackoffPreset, retry } from "@graphrefly/graphrefly-ts";
|
|
285
|
-
*
|
|
286
|
-
* const out = retry(source, { count: 3, backoff: resolveBackoffPreset("exponential") });
|
|
287
|
-
* // Equivalent to retry(source, { count: 3, backoff: exponential() })
|
|
288
|
-
* ```
|
|
289
|
-
*
|
|
290
|
-
* @category extra
|
|
291
|
-
*/
|
|
292
|
-
declare function resolveBackoffPreset(name: BackoffPreset): BackoffStrategy;
|
|
293
|
-
|
|
294
148
|
/**
|
|
295
149
|
* {@link reactiveSink} — canonical sink factory for Wave 5 adapters.
|
|
296
150
|
*
|
|
@@ -472,335 +326,6 @@ type ReactiveSinkConfig<T, Ctx = unknown> = ReactiveSinkOptions<T> & {
|
|
|
472
326
|
*/
|
|
473
327
|
declare function reactiveSink<T, Ctx = unknown>(source: Node<T>, config: ReactiveSinkConfig<T, Ctx>): ReactiveSinkHandle<T>;
|
|
474
328
|
|
|
475
|
-
type RetryOptions = {
|
|
476
|
-
/** Max retry attempts after each terminal `ERROR` (not counting the first failure). */
|
|
477
|
-
count?: number;
|
|
478
|
-
/** Delay between attempts; strategies use **nanoseconds**. */
|
|
479
|
-
backoff?: BackoffStrategy | BackoffPreset;
|
|
480
|
-
};
|
|
481
|
-
/**
|
|
482
|
-
* Resubscribes to the upstream node after each terminal `ERROR`, after an optional delay.
|
|
483
|
-
*
|
|
484
|
-
* @param source - Upstream node (should use `resubscribable: true`).
|
|
485
|
-
* @param opts - `count` caps attempts; `backoff` supplies delay in **nanoseconds** (or a preset name).
|
|
486
|
-
* @returns Node that retries on error.
|
|
487
|
-
*
|
|
488
|
-
* @remarks
|
|
489
|
-
* **Resubscribable sources:** The upstream should use `resubscribable: true` if it must emit again after `ERROR`.
|
|
490
|
-
* **Protocol:** Forwards unknown message tuples unchanged; handles `DIRTY`, `DATA`, `RESOLVED`, `COMPLETE`, `ERROR`.
|
|
491
|
-
*
|
|
492
|
-
* @example
|
|
493
|
-
* ```ts
|
|
494
|
-
* import { ERROR, NS_PER_SEC, pipe, producer, retry, constant } from "@graphrefly/graphrefly-ts";
|
|
495
|
-
*
|
|
496
|
-
* const src = producer(
|
|
497
|
-
* (a) => {
|
|
498
|
-
* a.down([[ERROR, new Error("x")]]);
|
|
499
|
-
* },
|
|
500
|
-
* { resubscribable: true },
|
|
501
|
-
* );
|
|
502
|
-
* const out = retry(src, { count: 2, backoff: constant(0.25 * NS_PER_SEC) });
|
|
503
|
-
* ```
|
|
504
|
-
*
|
|
505
|
-
* @category extra
|
|
506
|
-
*/
|
|
507
|
-
declare function retry<T>(source: Node<T>, opts?: RetryOptions): Node<T>;
|
|
508
|
-
/**
|
|
509
|
-
* Options for {@link retrySource}. Superset of {@link RetryOptions} with an
|
|
510
|
-
* optional `initial` forwarded to the outer node cache.
|
|
511
|
-
*
|
|
512
|
-
* @category extra
|
|
513
|
-
*/
|
|
514
|
-
type RetrySourceOptions<T> = RetryOptions & {
|
|
515
|
-
/** Initial cache value for the outer node (forwarded to `NodeOptions.initial`). */
|
|
516
|
-
initial?: T;
|
|
517
|
-
};
|
|
518
|
-
/**
|
|
519
|
-
* Fresh-instance variant of {@link retry}: invokes the `factory` to build a
|
|
520
|
-
* new `Node<T>` on every connect / reconnect. Unlike {@link retry}, which
|
|
521
|
-
* re-subscribes to the same node (requiring `resubscribable: true`), this
|
|
522
|
-
* creates a new source per attempt — ideal for producers that capture
|
|
523
|
-
* per-attempt resources (sockets, clients, file handles) that become unusable
|
|
524
|
-
* after an error.
|
|
525
|
-
*
|
|
526
|
-
* Synchronous exceptions thrown by `factory` are treated as terminal ERROR
|
|
527
|
-
* and run through the same retry pipeline as inner-node ERROR.
|
|
528
|
-
*
|
|
529
|
-
* @param factory - Called to build a fresh source per attempt.
|
|
530
|
-
* @param opts - `count` caps attempts; `backoff` supplies delay (ns) or preset.
|
|
531
|
-
* @returns Node that retries by rebuilding the source.
|
|
532
|
-
*
|
|
533
|
-
* @example
|
|
534
|
-
* ```ts
|
|
535
|
-
* import { NS_PER_SEC, exponential, retrySource, fromWebSocket } from "@graphrefly/graphrefly-ts";
|
|
536
|
-
*
|
|
537
|
-
* // Each reconnect opens a fresh WebSocket:
|
|
538
|
-
* const connected$ = retrySource(
|
|
539
|
-
* () => fromWebSocket(new WebSocket("wss://example/stream")),
|
|
540
|
-
* { count: 10, backoff: exponential({ baseNs: 1 * NS_PER_SEC }) },
|
|
541
|
-
* );
|
|
542
|
-
* ```
|
|
543
|
-
*
|
|
544
|
-
* @category extra
|
|
545
|
-
*/
|
|
546
|
-
declare function retrySource<T>(factory: () => Node<T>, opts?: RetrySourceOptions<T>): Node<T>;
|
|
547
|
-
type CircuitState = "closed" | "open" | "half-open";
|
|
548
|
-
/**
|
|
549
|
-
* Thrown when {@link withBreaker} is configured with `onOpen: "error"` and the breaker rejects work.
|
|
550
|
-
*
|
|
551
|
-
* @category extra
|
|
552
|
-
*/
|
|
553
|
-
declare class CircuitOpenError extends Error {
|
|
554
|
-
name: string;
|
|
555
|
-
constructor();
|
|
556
|
-
}
|
|
557
|
-
interface CircuitBreakerOptions {
|
|
558
|
-
/** Number of consecutive failures before opening. Default: 5. */
|
|
559
|
-
failureThreshold?: number;
|
|
560
|
-
/** Base cooldown in nanoseconds before transitioning to half-open. Default: 30s. */
|
|
561
|
-
cooldownNs?: number;
|
|
562
|
-
/** Backoff strategy for cooldown escalation across consecutive open cycles. Overrides `cooldownNs` when provided. */
|
|
563
|
-
cooldown?: BackoffStrategy;
|
|
564
|
-
/** Max trial requests allowed in half-open state. Default: 1. */
|
|
565
|
-
halfOpenMax?: number;
|
|
566
|
-
/** Clock function returning nanoseconds (for testability). Default: `monotonicNs`. */
|
|
567
|
-
now?: () => number;
|
|
568
|
-
}
|
|
569
|
-
interface CircuitBreaker {
|
|
570
|
-
/** Whether a request should be allowed through. Triggers open→half-open transition when cooldown expires. */
|
|
571
|
-
canExecute(): boolean;
|
|
572
|
-
/** Record a successful execution. Resets to closed. */
|
|
573
|
-
recordSuccess(): void;
|
|
574
|
-
/** Record a failed execution. May transition to open. */
|
|
575
|
-
recordFailure(error?: unknown): void;
|
|
576
|
-
/** Current circuit state (read-only, does not trigger transitions). */
|
|
577
|
-
readonly state: CircuitState;
|
|
578
|
-
/** Number of consecutive failures in the current closed period. */
|
|
579
|
-
readonly failureCount: number;
|
|
580
|
-
/** Manually reset to closed state, clearing all counters. */
|
|
581
|
-
reset(): void;
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* Factory for a synchronous circuit breaker with `closed`, `open`, and `half-open` states.
|
|
585
|
-
*
|
|
586
|
-
* Supports escalating cooldown via an optional {@link BackoffStrategy} — each consecutive
|
|
587
|
-
* open→half-open→open cycle increments the backoff attempt.
|
|
588
|
-
*
|
|
589
|
-
* @param options - Threshold, cooldown, half-open limit, and optional clock override.
|
|
590
|
-
* @returns {@link CircuitBreaker} instance.
|
|
591
|
-
*
|
|
592
|
-
* @remarks
|
|
593
|
-
* **Timing:** Uses `monotonicNs()` by default (nanoseconds). Override `now` for tests.
|
|
594
|
-
*
|
|
595
|
-
* @example
|
|
596
|
-
* ```ts
|
|
597
|
-
* import { circuitBreaker, exponential, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
598
|
-
*
|
|
599
|
-
* const b = circuitBreaker({
|
|
600
|
-
* failureThreshold: 3,
|
|
601
|
-
* cooldown: exponential({ baseNs: 1 * NS_PER_SEC }),
|
|
602
|
-
* });
|
|
603
|
-
* ```
|
|
604
|
-
*
|
|
605
|
-
* @category extra
|
|
606
|
-
*/
|
|
607
|
-
declare function circuitBreaker(options?: CircuitBreakerOptions): CircuitBreaker;
|
|
608
|
-
type WithBreakerBundle<T> = {
|
|
609
|
-
node: Node<T>;
|
|
610
|
-
breakerState: Node<CircuitState>;
|
|
611
|
-
};
|
|
612
|
-
/**
|
|
613
|
-
* Returns a unary wrapper that gates upstream `DATA` through a {@link CircuitBreaker}.
|
|
614
|
-
*
|
|
615
|
-
* @param breaker - Shared breaker instance (typically one per resource).
|
|
616
|
-
* @param options - `onOpen: "skip"` emits `RESOLVED` when open; `"error"` emits {@link CircuitOpenError}.
|
|
617
|
-
* @returns Function mapping `Node<T>` to `{ node, breakerState }` companion nodes.
|
|
618
|
-
*
|
|
619
|
-
* @remarks
|
|
620
|
-
* **Success path:** `COMPLETE` calls {@link CircuitBreaker.recordSuccess}. **Failure path:** upstream `ERROR` calls {@link CircuitBreaker.recordFailure} and is forwarded.
|
|
621
|
-
*
|
|
622
|
-
* @example
|
|
623
|
-
* ```ts
|
|
624
|
-
* import { state, withBreaker, circuitBreaker } from "@graphrefly/graphrefly-ts";
|
|
625
|
-
*
|
|
626
|
-
* const b = circuitBreaker({ failureThreshold: 2 });
|
|
627
|
-
* const s = state(1);
|
|
628
|
-
* const { node, breakerState } = withBreaker(b)(s);
|
|
629
|
-
* ```
|
|
630
|
-
*
|
|
631
|
-
* @category extra
|
|
632
|
-
*/
|
|
633
|
-
declare function withBreaker<T>(breaker: CircuitBreaker, options?: {
|
|
634
|
-
onOpen?: "skip" | "error";
|
|
635
|
-
}): (source: Node<T>) => WithBreakerBundle<T>;
|
|
636
|
-
interface TokenBucket {
|
|
637
|
-
/** Number of tokens currently available (after refill). */
|
|
638
|
-
available(): number;
|
|
639
|
-
/** Try to consume `cost` tokens. Returns `true` if successful. */
|
|
640
|
-
tryConsume(cost?: number): boolean;
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* Token-bucket meter (capacity + refill rate per second). Use with {@link rateLimiter} or custom gates.
|
|
644
|
-
*
|
|
645
|
-
* @param capacity - Maximum tokens (must be positive).
|
|
646
|
-
* @param refillPerSecond - Tokens added per elapsed second (non-negative).
|
|
647
|
-
* @returns {@link TokenBucket} instance.
|
|
648
|
-
*
|
|
649
|
-
* @example
|
|
650
|
-
* ```ts
|
|
651
|
-
* import { tokenBucket } from "@graphrefly/graphrefly-ts";
|
|
652
|
-
*
|
|
653
|
-
* const bucket = tokenBucket(10, 2); // capacity 10, refill 2 tokens/sec
|
|
654
|
-
* bucket.tryConsume(3); // true — 7 tokens remaining
|
|
655
|
-
* bucket.available(); // ~7 (plus any elapsed refill)
|
|
656
|
-
* ```
|
|
657
|
-
*
|
|
658
|
-
* @category extra
|
|
659
|
-
*/
|
|
660
|
-
declare function tokenBucket(capacity: number, refillPerSecond: number): TokenBucket;
|
|
661
|
-
type RateLimiterOverflowPolicy = "drop-oldest" | "drop-newest" | "error";
|
|
662
|
-
type RateLimiterOptions = {
|
|
663
|
-
/** Maximum `DATA` emissions per window (must be > 0). */
|
|
664
|
-
maxEvents: number;
|
|
665
|
-
/** Window length in nanoseconds (must be > 0). */
|
|
666
|
-
windowNs: number;
|
|
667
|
-
/** Cap on items queued while waiting for token refill (must be >= 1). Unbounded if omitted. */
|
|
668
|
-
maxBuffer?: number;
|
|
669
|
-
/** Overflow policy when `maxBuffer` is exceeded. Default: `"drop-newest"`. */
|
|
670
|
-
onOverflow?: RateLimiterOverflowPolicy;
|
|
671
|
-
};
|
|
672
|
-
/**
|
|
673
|
-
* Thrown by {@link rateLimiter} when `onOverflow: "error"` and the pending buffer is full.
|
|
674
|
-
*
|
|
675
|
-
* @category extra
|
|
676
|
-
*/
|
|
677
|
-
declare class RateLimiterOverflowError extends Error {
|
|
678
|
-
name: string;
|
|
679
|
-
constructor(maxBuffer: number);
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Token-bucket rate limiter: at most `maxEvents` `DATA` values per `windowNs`.
|
|
683
|
-
*
|
|
684
|
-
* Uses {@link tokenBucket} internally (capacity = `maxEvents`, refill = `maxEvents / windowSeconds`).
|
|
685
|
-
* Excess items are queued FIFO until a token is available. The queue may be bounded via
|
|
686
|
-
* `maxBuffer` with a configurable overflow policy.
|
|
687
|
-
*
|
|
688
|
-
* @param source - Upstream node.
|
|
689
|
-
* @param opts - Rate + optional bounded-buffer configuration.
|
|
690
|
-
* @returns Node that emits DATA at most `maxEvents` per `windowNs`.
|
|
691
|
-
*
|
|
692
|
-
* @remarks
|
|
693
|
-
* **Terminal:** `COMPLETE` / `ERROR` cancel the refill timer, drop the pending queue, and propagate.
|
|
694
|
-
*
|
|
695
|
-
* @example
|
|
696
|
-
* ```ts
|
|
697
|
-
* import { rateLimiter, state, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
698
|
-
*
|
|
699
|
-
* const src = state(0);
|
|
700
|
-
* // Allow at most 5 DATA values per second; queue up to 100 excess items, drop newest beyond.
|
|
701
|
-
* const limited = rateLimiter(src, { maxEvents: 5, windowNs: NS_PER_SEC, maxBuffer: 100 });
|
|
702
|
-
* ```
|
|
703
|
-
*
|
|
704
|
-
* @category extra
|
|
705
|
-
*/
|
|
706
|
-
declare function rateLimiter<T>(source: Node<T>, opts: RateLimiterOptions): Node<T>;
|
|
707
|
-
type StatusValue = "pending" | "active" | "completed" | "errored";
|
|
708
|
-
type WithStatusBundle<T> = {
|
|
709
|
-
node: Node<T>;
|
|
710
|
-
status: Node<StatusValue>;
|
|
711
|
-
error: Node<unknown | null>;
|
|
712
|
-
};
|
|
713
|
-
/**
|
|
714
|
-
* Wraps `src` with `status` and `error` {@link state} companions for UI or meta snapshots.
|
|
715
|
-
*
|
|
716
|
-
* @param src - Upstream node to mirror.
|
|
717
|
-
* @param options - `initialStatus` defaults to `"pending"`.
|
|
718
|
-
* @returns `{ node, status, error }` where `error` holds the last `ERROR` payload.
|
|
719
|
-
*
|
|
720
|
-
* @remarks
|
|
721
|
-
* **Recovery:** After `errored`, the next `DATA` clears `error` and sets `active` inside {@link batch} (matches graphrefly-py).
|
|
722
|
-
*
|
|
723
|
-
* @example
|
|
724
|
-
* ```ts
|
|
725
|
-
* import { withStatus, state } from "@graphrefly/graphrefly-ts";
|
|
726
|
-
*
|
|
727
|
-
* const src = state<number>(0);
|
|
728
|
-
* const { node, status, error } = withStatus(src);
|
|
729
|
-
*
|
|
730
|
-
* status.subscribe((msgs) => console.log("status:", msgs));
|
|
731
|
-
* src.down([[DATA, 42]]); // status → "active"
|
|
732
|
-
* ```
|
|
733
|
-
*
|
|
734
|
-
* @category extra
|
|
735
|
-
*/
|
|
736
|
-
declare function withStatus<T>(src: Node<T>, options?: {
|
|
737
|
-
initialStatus?: StatusValue;
|
|
738
|
-
}): WithStatusBundle<T>;
|
|
739
|
-
/**
|
|
740
|
-
* Thrown by {@link timeout} when no `DATA` arrives within the deadline.
|
|
741
|
-
*
|
|
742
|
-
* @category extra
|
|
743
|
-
*/
|
|
744
|
-
declare class TimeoutError extends Error {
|
|
745
|
-
name: string;
|
|
746
|
-
constructor(ns: number);
|
|
747
|
-
}
|
|
748
|
-
/** Inputs accepted by {@link fallback}. */
|
|
749
|
-
type FallbackInput<T> = T | Node<T> | PromiseLike<T> | AsyncIterable<T>;
|
|
750
|
-
/**
|
|
751
|
-
* On upstream terminal `ERROR`, switch to a fallback source instead of propagating the error.
|
|
752
|
-
*
|
|
753
|
-
* Accepts any of:
|
|
754
|
-
* - **scalar value** — emits `[[DATA, fb], [COMPLETE]]`
|
|
755
|
-
* - **`Node<T>`** — subscribes and forwards all messages (push-on-subscribe delivers current cache)
|
|
756
|
-
* - **`Promise<T>` / thenable** — resolves into a one-shot `DATA` then `COMPLETE` (via {@link fromAny})
|
|
757
|
-
* - **`AsyncIterable<T>`** — streams each yielded value as `DATA`, then `COMPLETE` (via {@link fromAny})
|
|
758
|
-
*
|
|
759
|
-
* Non-`Node` inputs are routed through {@link fromAny} so the fallback participates in the
|
|
760
|
-
* reactive protocol uniformly. Bare strings, arrays, and other synchronous scalars are treated
|
|
761
|
-
* as single values (NOT split into characters / elements) to avoid the `fromAny`-on-string
|
|
762
|
-
* iteration gotcha.
|
|
763
|
-
*
|
|
764
|
-
* Composes naturally with {@link retry}:
|
|
765
|
-
* `pipe(source, retry({count:3}), fallback("default"))`.
|
|
766
|
-
*
|
|
767
|
-
* @param source - Upstream node.
|
|
768
|
-
* @param fb - Fallback value, node, promise, or async iterable.
|
|
769
|
-
* @returns Node that replaces errors with the fallback.
|
|
770
|
-
*
|
|
771
|
-
* @example
|
|
772
|
-
* ```ts
|
|
773
|
-
* import { fallback, throwError } from "@graphrefly/graphrefly-ts";
|
|
774
|
-
*
|
|
775
|
-
* const safe = fallback(throwError(new Error("boom")), "default");
|
|
776
|
-
* safe.cache; // "default" after subscribe
|
|
777
|
-
* ```
|
|
778
|
-
*
|
|
779
|
-
* @category extra
|
|
780
|
-
*/
|
|
781
|
-
declare function fallback<T>(source: Node<T>, fb: FallbackInput<T>): Node<T>;
|
|
782
|
-
/**
|
|
783
|
-
* Emits `ERROR` with {@link TimeoutError} if no `DATA` arrives within the deadline.
|
|
784
|
-
*
|
|
785
|
-
* The timer starts on subscription and resets on each `DATA`. `DIRTY` does NOT reset
|
|
786
|
-
* the timer. Terminal messages (`COMPLETE`/`ERROR`) cancel the timer.
|
|
787
|
-
*
|
|
788
|
-
* @param source - Upstream node.
|
|
789
|
-
* @param timeoutNs - Deadline in nanoseconds.
|
|
790
|
-
* @returns Node that errors on timeout.
|
|
791
|
-
*
|
|
792
|
-
* @example
|
|
793
|
-
* ```ts
|
|
794
|
-
* import { timeout, never, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
795
|
-
*
|
|
796
|
-
* const t = timeout(never(), 5 * NS_PER_SEC);
|
|
797
|
-
* // After 5 seconds with no DATA: [[ERROR, TimeoutError]]
|
|
798
|
-
* ```
|
|
799
|
-
*
|
|
800
|
-
* @category extra
|
|
801
|
-
*/
|
|
802
|
-
declare function timeout<T>(source: Node<T>, timeoutNs: number): Node<T>;
|
|
803
|
-
|
|
804
329
|
/**
|
|
805
330
|
* Protocol, system, and ingest adapters (roadmap §5.2, §5.2c).
|
|
806
331
|
*
|
|
@@ -825,7 +350,7 @@ type SinkHandle = {
|
|
|
825
350
|
/** Manually drain the internal buffer (buffered sinks only). */
|
|
826
351
|
flush?: () => Promise<void>;
|
|
827
352
|
};
|
|
828
|
-
type ExtraOpts
|
|
353
|
+
type ExtraOpts = Omit<NodeOptions, "describeKind">;
|
|
829
354
|
/** WebSocket-like transport accepted by {@link fromWebSocket} / {@link toWebSocket}. */
|
|
830
355
|
type WebSocketLike = {
|
|
831
356
|
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
@@ -845,11 +370,11 @@ type WebSocketRegister<T> = (emit: (payload: T) => void, error: (err: unknown) =
|
|
|
845
370
|
*
|
|
846
371
|
* @category extra
|
|
847
372
|
*/
|
|
848
|
-
declare function fromWebSocket<T = unknown>(socket: WebSocketLike, opts?: ExtraOpts
|
|
373
|
+
declare function fromWebSocket<T = unknown>(socket: WebSocketLike, opts?: ExtraOpts & {
|
|
849
374
|
parse?: (payload: unknown, event: unknown) => T;
|
|
850
375
|
closeOnTeardown?: boolean;
|
|
851
376
|
}): Node<T>;
|
|
852
|
-
declare function fromWebSocket<T = unknown>(register: WebSocketRegister<T>, opts?: ExtraOpts
|
|
377
|
+
declare function fromWebSocket<T = unknown>(register: WebSocketRegister<T>, opts?: ExtraOpts & {
|
|
853
378
|
parse?: (payload: unknown, event: unknown) => T;
|
|
854
379
|
closeOnTeardown?: boolean;
|
|
855
380
|
}): Node<T>;
|
|
@@ -915,7 +440,7 @@ type WebhookRegister<T> = ExternalRegister<EmitTriad<T>>;
|
|
|
915
440
|
*
|
|
916
441
|
* @category extra
|
|
917
442
|
*/
|
|
918
|
-
declare function fromWebhook<T = unknown>(register: WebhookRegister<T>, opts?: ExtraOpts
|
|
443
|
+
declare function fromWebhook<T = unknown>(register: WebhookRegister<T>, opts?: ExtraOpts): Node<T>;
|
|
919
444
|
/**
|
|
920
445
|
* Options for {@link fromHTTP}.
|
|
921
446
|
*
|
|
@@ -972,7 +497,7 @@ type HTTPBundle<T> = WithStatusBundle<T> & {
|
|
|
972
497
|
*/
|
|
973
498
|
declare function fromHTTP<T = any>(url: string, opts?: FromHTTPOptions): HTTPBundle<T>;
|
|
974
499
|
/** Options for {@link toHTTP}. */
|
|
975
|
-
type ToHTTPOptions<T> = ExtraOpts
|
|
500
|
+
type ToHTTPOptions<T> = ExtraOpts & {
|
|
976
501
|
/** HTTP method. Default: `"POST"`. */
|
|
977
502
|
method?: string;
|
|
978
503
|
/** Request headers applied to every call. Caller sets Content-Type. */
|
|
@@ -1063,7 +588,7 @@ type SSEEvent<T = string> = {
|
|
|
1063
588
|
retry?: number;
|
|
1064
589
|
};
|
|
1065
590
|
/** Options for {@link fromSSE}. */
|
|
1066
|
-
type FromSSEOptions<T = string> = ExtraOpts
|
|
591
|
+
type FromSSEOptions<T = string> = ExtraOpts & {
|
|
1067
592
|
/** Parse the raw `data:` payload. Default: identity (string). */
|
|
1068
593
|
parse?: (raw: string) => T;
|
|
1069
594
|
};
|
|
@@ -1078,7 +603,7 @@ type FromSSEOptions<T = string> = ExtraOpts$2 & {
|
|
|
1078
603
|
*/
|
|
1079
604
|
declare function fromSSE<T = string>(source: ReadableStream<Uint8Array> | Response | AsyncIterable<Uint8Array>, opts?: FromSSEOptions<T>): Node<SSEEvent<T>>;
|
|
1080
605
|
/** Options for {@link fromHTTPStream}. */
|
|
1081
|
-
type FromHTTPStreamOptions = ExtraOpts
|
|
606
|
+
type FromHTTPStreamOptions = ExtraOpts & {
|
|
1082
607
|
method?: string;
|
|
1083
608
|
headers?: Record<string, string>;
|
|
1084
609
|
body?: unknown;
|
|
@@ -1147,7 +672,7 @@ type ToWebSocketOptions<T> = {
|
|
|
1147
672
|
*/
|
|
1148
673
|
declare function toWebSocket<T>(source: Node<T>, socket: WebSocketLike, opts?: ToWebSocketOptions<T>): ReactiveSinkHandle<T>;
|
|
1149
674
|
/** Options for {@link fromWebSocketReconnect}. */
|
|
1150
|
-
type FromWebSocketReconnectOptions<T> = ExtraOpts
|
|
675
|
+
type FromWebSocketReconnectOptions<T> = ExtraOpts & {
|
|
1151
676
|
/** Optional parser applied to incoming messages. */
|
|
1152
677
|
parse?: (payload: unknown, event: unknown) => T;
|
|
1153
678
|
/** Max reconnect attempts. Default: `Infinity` (implied when `backoff` is set). */
|
|
@@ -1190,7 +715,7 @@ type MCPClientLike = {
|
|
|
1190
715
|
setNotificationHandler(method: string, handler: (notification: unknown) => void): void;
|
|
1191
716
|
};
|
|
1192
717
|
/** Options for {@link fromMCP}. */
|
|
1193
|
-
type FromMCPOptions = ExtraOpts
|
|
718
|
+
type FromMCPOptions = ExtraOpts & {
|
|
1194
719
|
/** MCP notification method to subscribe to. Default `"notifications/message"`. */
|
|
1195
720
|
method?: string;
|
|
1196
721
|
onDisconnect?: (cb: (err?: unknown) => void) => void;
|
|
@@ -1201,36 +726,6 @@ type FromMCPOptions = ExtraOpts$2 & {
|
|
|
1201
726
|
* @category extra
|
|
1202
727
|
*/
|
|
1203
728
|
declare function fromMCP<T = unknown>(client: MCPClientLike, opts?: FromMCPOptions): Node<T>;
|
|
1204
|
-
/** Git hook type for {@link fromGitHook}. */
|
|
1205
|
-
type GitHookType = "post-commit" | "post-merge" | "post-checkout" | "post-rewrite";
|
|
1206
|
-
/** Structured git event emitted by {@link fromGitHook}. */
|
|
1207
|
-
type GitEvent = {
|
|
1208
|
-
hook: GitHookType;
|
|
1209
|
-
commit: string;
|
|
1210
|
-
files: string[];
|
|
1211
|
-
message: string;
|
|
1212
|
-
author: string;
|
|
1213
|
-
timestamp_ns: number;
|
|
1214
|
-
};
|
|
1215
|
-
/** Options for {@link fromGitHook}. */
|
|
1216
|
-
type FromGitHookOptions = ExtraOpts$2 & {
|
|
1217
|
-
pollMs?: number;
|
|
1218
|
-
include?: string[];
|
|
1219
|
-
exclude?: string[];
|
|
1220
|
-
/**
|
|
1221
|
-
* Maximum consecutive poll errors before terminating the source. Prevents
|
|
1222
|
-
* error storms when the repository is unavailable (e.g. deleted, corrupt,
|
|
1223
|
-
* permissions lost). Default: `1` (terminate on first error — preserves pre-switchMap back-compat). Raise it (or set `Infinity`) to keep retrying
|
|
1224
|
-
* indefinitely (legacy behavior).
|
|
1225
|
-
*/
|
|
1226
|
-
maxConsecutiveErrors?: number;
|
|
1227
|
-
};
|
|
1228
|
-
/**
|
|
1229
|
-
* Git change detection as a reactive source.
|
|
1230
|
-
*
|
|
1231
|
-
* @category extra
|
|
1232
|
-
*/
|
|
1233
|
-
declare function fromGitHook(repoPath: string, opts?: FromGitHookOptions): Node<GitEvent>;
|
|
1234
729
|
/** Standard handler triple for adapters that accept injected registrations. Alias of {@link EmitTriad}. */
|
|
1235
730
|
type AdapterHandlers<T> = EmitTriad<T>;
|
|
1236
731
|
/**
|
|
@@ -1328,7 +823,7 @@ type OTelRegister = (handlers: {
|
|
|
1328
823
|
onError: (err: unknown) => void;
|
|
1329
824
|
}) => (() => void) | undefined;
|
|
1330
825
|
/** Options for {@link fromOTel}. */
|
|
1331
|
-
type FromOTelOptions = ExtraOpts
|
|
826
|
+
type FromOTelOptions = ExtraOpts & {};
|
|
1332
827
|
/** Bundle returned by {@link fromOTel}. */
|
|
1333
828
|
type OTelBundle = {
|
|
1334
829
|
traces: Node<OTelSpan>;
|
|
@@ -1382,7 +877,7 @@ type SyslogMessage = {
|
|
|
1382
877
|
/** Registration callback for syslog receiver. Alias of {@link ExternalRegister} over {@link EmitTriad}. */
|
|
1383
878
|
type SyslogRegister = ExternalRegister<EmitTriad<SyslogMessage>>;
|
|
1384
879
|
/** Options for {@link fromSyslog}. */
|
|
1385
|
-
type FromSyslogOptions = ExtraOpts
|
|
880
|
+
type FromSyslogOptions = ExtraOpts & {};
|
|
1386
881
|
/**
|
|
1387
882
|
* RFC 5424 syslog receiver as a reactive source.
|
|
1388
883
|
*
|
|
@@ -1432,7 +927,7 @@ type StatsDMetric = {
|
|
|
1432
927
|
/** Registration callback for StatsD receiver. Alias of {@link ExternalRegister} over {@link EmitTriad}. */
|
|
1433
928
|
type StatsDRegister = ExternalRegister<EmitTriad<StatsDMetric>>;
|
|
1434
929
|
/** Options for {@link fromStatsD}. */
|
|
1435
|
-
type FromStatsDOptions = ExtraOpts
|
|
930
|
+
type FromStatsDOptions = ExtraOpts & {};
|
|
1436
931
|
/**
|
|
1437
932
|
* StatsD/DogStatsD UDP receiver as a reactive source.
|
|
1438
933
|
*
|
|
@@ -1570,7 +1065,7 @@ type KafkaMessage<T = unknown> = {
|
|
|
1570
1065
|
timestampNs: number;
|
|
1571
1066
|
};
|
|
1572
1067
|
/** Options for {@link fromKafka}. */
|
|
1573
|
-
type FromKafkaOptions = ExtraOpts
|
|
1068
|
+
type FromKafkaOptions = ExtraOpts & {
|
|
1574
1069
|
/** Start from beginning of topic. Default: `false`. */
|
|
1575
1070
|
fromBeginning?: boolean;
|
|
1576
1071
|
/** Deserialize message value. Default: `JSON.parse(buffer.toString())`. */
|
|
@@ -1603,7 +1098,7 @@ type FromKafkaOptions = ExtraOpts$2 & {
|
|
|
1603
1098
|
*/
|
|
1604
1099
|
declare function fromKafka<T = unknown>(consumer: KafkaConsumerLike, topic: string, opts?: FromKafkaOptions): Node<KafkaMessage<T>>;
|
|
1605
1100
|
/** Options for {@link toKafka}. */
|
|
1606
|
-
type ToKafkaOptions<T> = ExtraOpts
|
|
1101
|
+
type ToKafkaOptions<T> = ExtraOpts & {
|
|
1607
1102
|
/** Serialize value for Kafka. Default: `JSON.stringify`. */
|
|
1608
1103
|
serialize?: (value: T) => string | Buffer;
|
|
1609
1104
|
/** Extract message key from value. Default: `null` (no key). */
|
|
@@ -1637,7 +1132,7 @@ type RedisStreamEntry<T = unknown> = {
|
|
|
1637
1132
|
timestampNs: number;
|
|
1638
1133
|
};
|
|
1639
1134
|
/** Options for {@link fromRedisStream}. */
|
|
1640
|
-
type FromRedisStreamOptions = ExtraOpts
|
|
1135
|
+
type FromRedisStreamOptions = ExtraOpts & {
|
|
1641
1136
|
/** Block timeout in ms for XREAD. Default: `5000`. */
|
|
1642
1137
|
blockMs?: number;
|
|
1643
1138
|
/** Start ID. Default: `"$"` (new entries only). */
|
|
@@ -1669,7 +1164,7 @@ type FromRedisStreamOptions = ExtraOpts$2 & {
|
|
|
1669
1164
|
*/
|
|
1670
1165
|
declare function fromRedisStream<T = unknown>(client: RedisClientLike, key: string, opts?: FromRedisStreamOptions): Node<RedisStreamEntry<T>>;
|
|
1671
1166
|
/** Options for {@link toRedisStream}. */
|
|
1672
|
-
type ToRedisStreamOptions<T> = ExtraOpts
|
|
1167
|
+
type ToRedisStreamOptions<T> = ExtraOpts & {
|
|
1673
1168
|
/** Serialize value to Redis hash fields. Default: `["data", JSON.stringify(value)]`. */
|
|
1674
1169
|
serialize?: (value: T) => string[];
|
|
1675
1170
|
/** Max stream length (MAXLEN ~). Default: no trimming. */
|
|
@@ -1692,7 +1187,7 @@ declare function toRedisStream<T>(source: Node<T>, client: RedisClientLike, key:
|
|
|
1692
1187
|
/** Parsed CSV row. */
|
|
1693
1188
|
type CSVRow = Record<string, string>;
|
|
1694
1189
|
/** Options for {@link fromCSV}. */
|
|
1695
|
-
type FromCSVOptions = ExtraOpts
|
|
1190
|
+
type FromCSVOptions = ExtraOpts & {
|
|
1696
1191
|
/** Column delimiter. Default: `","`. */
|
|
1697
1192
|
delimiter?: string;
|
|
1698
1193
|
/** Whether the first row is a header. Default: `true`. */
|
|
@@ -1749,9 +1244,9 @@ declare function csvRows(source: Node<string>, opts?: FromCSVOptions): Node<CSVR
|
|
|
1749
1244
|
*
|
|
1750
1245
|
* @category extra
|
|
1751
1246
|
*/
|
|
1752
|
-
declare function ndjsonRows<T = unknown>(source: Node<string>, opts?: ExtraOpts
|
|
1247
|
+
declare function ndjsonRows<T = unknown>(source: Node<string>, opts?: ExtraOpts): Node<T>;
|
|
1753
1248
|
/** Options for {@link fromNDJSON}. */
|
|
1754
|
-
type FromNDJSONOptions = ExtraOpts
|
|
1249
|
+
type FromNDJSONOptions = ExtraOpts & {};
|
|
1755
1250
|
/**
|
|
1756
1251
|
* Newline-delimited JSON stream ingest for batch replay.
|
|
1757
1252
|
*
|
|
@@ -1857,7 +1352,7 @@ type PulsarMessage<T = unknown> = {
|
|
|
1857
1352
|
timestampNs: number;
|
|
1858
1353
|
};
|
|
1859
1354
|
/** Options for {@link fromPulsar}. */
|
|
1860
|
-
type FromPulsarOptions = ExtraOpts
|
|
1355
|
+
type FromPulsarOptions = ExtraOpts & {
|
|
1861
1356
|
/** Deserialize message data. Default: `JSON.parse(buffer.toString())`. */
|
|
1862
1357
|
deserialize?: (data: Buffer) => unknown;
|
|
1863
1358
|
/** Acknowledge messages automatically. Default: `true`. */
|
|
@@ -1904,7 +1399,7 @@ declare function fromPulsar<T = unknown>(consumer: PulsarConsumerLike, opts: Fro
|
|
|
1904
1399
|
autoAck: false;
|
|
1905
1400
|
}): Node<AckableMessage<PulsarMessage<T>>>;
|
|
1906
1401
|
/** Options for {@link toPulsar}. */
|
|
1907
|
-
type ToPulsarOptions<T> = ExtraOpts
|
|
1402
|
+
type ToPulsarOptions<T> = ExtraOpts & {
|
|
1908
1403
|
/** Serialize value for Pulsar. Default: `JSON.stringify` → Buffer. */
|
|
1909
1404
|
serialize?: (value: T) => Buffer;
|
|
1910
1405
|
/** Extract partition key from value. Default: none. */
|
|
@@ -1957,7 +1452,7 @@ type NATSMessage<T = unknown> = {
|
|
|
1957
1452
|
timestampNs: number;
|
|
1958
1453
|
};
|
|
1959
1454
|
/** Options for {@link fromNATS}. */
|
|
1960
|
-
type FromNATSOptions = ExtraOpts
|
|
1455
|
+
type FromNATSOptions = ExtraOpts & {
|
|
1961
1456
|
/** Queue group name for load balancing. */
|
|
1962
1457
|
queue?: string;
|
|
1963
1458
|
/** Deserialize message data. Default: `JSON.parse(textDecoder.decode(data))`. */
|
|
@@ -1991,7 +1486,7 @@ type FromNATSOptions = ExtraOpts$2 & {
|
|
|
1991
1486
|
*/
|
|
1992
1487
|
declare function fromNATS<T = unknown>(client: NATSClientLike, subject: string, opts?: FromNATSOptions): Node<NATSMessage<T>>;
|
|
1993
1488
|
/** Options for {@link toNATS}. */
|
|
1994
|
-
type ToNATSOptions<T> = ExtraOpts
|
|
1489
|
+
type ToNATSOptions<T> = ExtraOpts & {
|
|
1995
1490
|
/** Serialize value for NATS. Default: `JSON.stringify` → Uint8Array. */
|
|
1996
1491
|
serialize?: (value: T) => Uint8Array;
|
|
1997
1492
|
/** Called on serialization failures. */
|
|
@@ -2042,7 +1537,7 @@ type RabbitMQMessage<T = unknown> = {
|
|
|
2042
1537
|
timestampNs: number;
|
|
2043
1538
|
};
|
|
2044
1539
|
/** Options for {@link fromRabbitMQ}. */
|
|
2045
|
-
type FromRabbitMQOptions = ExtraOpts
|
|
1540
|
+
type FromRabbitMQOptions = ExtraOpts & {
|
|
2046
1541
|
/** Deserialize message content. Default: `JSON.parse(buffer.toString())`. */
|
|
2047
1542
|
deserialize?: (content: Buffer) => unknown;
|
|
2048
1543
|
/** Auto-acknowledge messages. Default: `true`. */
|
|
@@ -2091,7 +1586,7 @@ declare function fromRabbitMQ<T = unknown>(channel: RabbitMQChannelLike, queue:
|
|
|
2091
1586
|
autoAck: false;
|
|
2092
1587
|
}): Node<AckableMessage<RabbitMQMessage<T>>>;
|
|
2093
1588
|
/** Options for {@link toRabbitMQ}. */
|
|
2094
|
-
type ToRabbitMQOptions<T> = ExtraOpts
|
|
1589
|
+
type ToRabbitMQOptions<T> = ExtraOpts & {
|
|
2095
1590
|
/** Serialize value for RabbitMQ. Default: `Buffer.from(JSON.stringify(value))`. */
|
|
2096
1591
|
serialize?: (value: T) => Buffer;
|
|
2097
1592
|
/** Extract routing key from value. Default: `""`. */
|
|
@@ -2122,7 +1617,7 @@ type FileWriterLike = {
|
|
|
2122
1617
|
end(): void;
|
|
2123
1618
|
};
|
|
2124
1619
|
/** Options for {@link toFile}. */
|
|
2125
|
-
type ToFileOptions<T> = ExtraOpts
|
|
1620
|
+
type ToFileOptions<T> = ExtraOpts & {
|
|
2126
1621
|
/** Serialize a value to a string line. Default: `JSON.stringify(v) + "\n"`. */
|
|
2127
1622
|
serialize?: (value: T) => string;
|
|
2128
1623
|
/** `"append"` (default) or `"overwrite"` — controls initial file behavior hint. */
|
|
@@ -2148,7 +1643,7 @@ type ToFileOptions<T> = ExtraOpts$2 & {
|
|
|
2148
1643
|
*/
|
|
2149
1644
|
declare function toFile<T>(source: Node<T>, writer: FileWriterLike, opts?: ToFileOptions<T>): ReactiveSinkHandle<T>;
|
|
2150
1645
|
/** Options for {@link toCSV}. */
|
|
2151
|
-
type ToCSVOptions<T> = ExtraOpts
|
|
1646
|
+
type ToCSVOptions<T> = ExtraOpts & {
|
|
2152
1647
|
/** Column names. Required — determines header row and field order. */
|
|
2153
1648
|
columns: string[];
|
|
2154
1649
|
/** Column delimiter. Default: `","`. */
|
|
@@ -2183,7 +1678,7 @@ type ClickHouseInsertClientLike = {
|
|
|
2183
1678
|
}): Promise<void>;
|
|
2184
1679
|
};
|
|
2185
1680
|
/** Options for {@link toClickHouse}. */
|
|
2186
|
-
type ToClickHouseOptions<T> = ExtraOpts
|
|
1681
|
+
type ToClickHouseOptions<T> = ExtraOpts & {
|
|
2187
1682
|
/** Batch size before auto-flush. Default: `1000`. */
|
|
2188
1683
|
batchSize?: number;
|
|
2189
1684
|
/** Flush interval in ms. Default: `5000`. */
|
|
@@ -2218,7 +1713,7 @@ type S3ClientLike = {
|
|
|
2218
1713
|
}): Promise<unknown>;
|
|
2219
1714
|
};
|
|
2220
1715
|
/** Options for {@link toS3}. */
|
|
2221
|
-
type ToS3Options<T> = ExtraOpts
|
|
1716
|
+
type ToS3Options<T> = ExtraOpts & {
|
|
2222
1717
|
/** Output format. Default: `"ndjson"`. */
|
|
2223
1718
|
format?: "ndjson" | "json";
|
|
2224
1719
|
/** Generate the S3 key for each batch. Receives `(seq, wallClockNs)`. Default: ISO timestamp + sequence. */
|
|
@@ -2248,7 +1743,7 @@ type PostgresClientLike = {
|
|
|
2248
1743
|
query(sql: string, params?: unknown[]): Promise<unknown>;
|
|
2249
1744
|
};
|
|
2250
1745
|
/** Options for {@link toPostgres}. */
|
|
2251
|
-
type ToPostgresOptions<T> = ExtraOpts
|
|
1746
|
+
type ToPostgresOptions<T> = ExtraOpts & {
|
|
2252
1747
|
/** Build the SQL + params for an insert. Default: JSON insert into `table`. */
|
|
2253
1748
|
toSQL?: (value: T, table: string) => {
|
|
2254
1749
|
sql: string;
|
|
@@ -2273,7 +1768,7 @@ type MongoCollectionLike = {
|
|
|
2273
1768
|
insertOne(doc: unknown): Promise<unknown>;
|
|
2274
1769
|
};
|
|
2275
1770
|
/** Options for {@link toMongo}. */
|
|
2276
|
-
type ToMongoOptions<T> = ExtraOpts
|
|
1771
|
+
type ToMongoOptions<T> = ExtraOpts & {
|
|
2277
1772
|
/** Transform value to a MongoDB document. Default: identity. */
|
|
2278
1773
|
toDocument?: (value: T) => unknown;
|
|
2279
1774
|
onTransportError?: (err: SinkTransportError) => void;
|
|
@@ -2301,7 +1796,7 @@ type LokiClientLike = {
|
|
|
2301
1796
|
}): Promise<unknown>;
|
|
2302
1797
|
};
|
|
2303
1798
|
/** Options for {@link toLoki}. */
|
|
2304
|
-
type ToLokiOptions<T> = ExtraOpts
|
|
1799
|
+
type ToLokiOptions<T> = ExtraOpts & {
|
|
2305
1800
|
/** Static labels applied to every log entry. */
|
|
2306
1801
|
labels?: Record<string, string>;
|
|
2307
1802
|
/** Extract the log line from a value. Default: `JSON.stringify(v)`. */
|
|
@@ -2328,7 +1823,7 @@ type TempoClientLike = {
|
|
|
2328
1823
|
}): Promise<unknown>;
|
|
2329
1824
|
};
|
|
2330
1825
|
/** Options for {@link toTempo}. */
|
|
2331
|
-
type ToTempoOptions<T> = ExtraOpts
|
|
1826
|
+
type ToTempoOptions<T> = ExtraOpts & {
|
|
2332
1827
|
/** Transform a value into OTLP resourceSpans entries. */
|
|
2333
1828
|
toResourceSpans?: (value: T) => unknown[];
|
|
2334
1829
|
onTransportError?: (err: SinkTransportError) => void;
|
|
@@ -2421,7 +1916,7 @@ type SqliteDbLike = {
|
|
|
2421
1916
|
query(sql: string, params?: unknown[]): unknown[];
|
|
2422
1917
|
};
|
|
2423
1918
|
/** Options for {@link fromSqlite}. */
|
|
2424
|
-
type FromSqliteOptions<T> = ExtraOpts
|
|
1919
|
+
type FromSqliteOptions<T> = ExtraOpts & {
|
|
2425
1920
|
/** Map a raw row object to the desired type. Default: identity cast. */
|
|
2426
1921
|
mapRow?: (row: unknown) => T;
|
|
2427
1922
|
/** Bind parameters for the query. */
|
|
@@ -2473,7 +1968,7 @@ type SqliteIterableDbLike = {
|
|
|
2473
1968
|
*/
|
|
2474
1969
|
declare function fromSqliteCursor<T = unknown>(db: SqliteIterableDbLike, query: string, opts?: FromSqliteOptions<T>): Node<T>;
|
|
2475
1970
|
/** Options for {@link toSqlite}. */
|
|
2476
|
-
type ToSqliteOptions<T> = ExtraOpts
|
|
1971
|
+
type ToSqliteOptions<T> = ExtraOpts & {
|
|
2477
1972
|
/** Build SQL + params for an insert. Default: JSON insert into `(data)` column. */
|
|
2478
1973
|
toSQL?: (value: T, table: string) => {
|
|
2479
1974
|
sql: string;
|
|
@@ -2529,7 +2024,7 @@ type PrismaModelLike<T = unknown> = {
|
|
|
2529
2024
|
findMany(args?: unknown): Promise<T[]>;
|
|
2530
2025
|
};
|
|
2531
2026
|
/** Options for {@link fromPrisma}. */
|
|
2532
|
-
type FromPrismaOptions<T, U = T> = ExtraOpts
|
|
2027
|
+
type FromPrismaOptions<T, U = T> = ExtraOpts & {
|
|
2533
2028
|
/** Prisma `findMany` args (where, orderBy, select, include, take, skip, etc.). */
|
|
2534
2029
|
args?: unknown;
|
|
2535
2030
|
/** Map each row to the desired shape. Default: identity cast. */
|
|
@@ -2570,7 +2065,7 @@ type DrizzleQueryLike<T = unknown> = {
|
|
|
2570
2065
|
execute(): Promise<T[]>;
|
|
2571
2066
|
};
|
|
2572
2067
|
/** Options for {@link fromDrizzle}. */
|
|
2573
|
-
type FromDrizzleOptions<T, U = T> = ExtraOpts
|
|
2068
|
+
type FromDrizzleOptions<T, U = T> = ExtraOpts & {
|
|
2574
2069
|
/** Map each row to the desired shape. Default: identity cast. */
|
|
2575
2070
|
mapRow?: (row: T) => U;
|
|
2576
2071
|
};
|
|
@@ -2606,7 +2101,7 @@ type KyselyQueryLike<T = unknown> = {
|
|
|
2606
2101
|
execute(): Promise<T[]>;
|
|
2607
2102
|
};
|
|
2608
2103
|
/** Options for {@link fromKysely}. */
|
|
2609
|
-
type FromKyselyOptions<T, U = T> = ExtraOpts
|
|
2104
|
+
type FromKyselyOptions<T, U = T> = ExtraOpts & {
|
|
2610
2105
|
/** Map each row to the desired shape. Default: identity cast. */
|
|
2611
2106
|
mapRow?: (row: T) => U;
|
|
2612
2107
|
};
|
|
@@ -2765,1242 +2260,56 @@ interface CascadingCache<V> {
|
|
|
2765
2260
|
*/
|
|
2766
2261
|
declare function cascadingCache<V = unknown>(tiers: readonly StorageTier[], opts?: CascadingCacheOptions): CascadingCache<V>;
|
|
2767
2262
|
|
|
2768
|
-
type ReactiveMapOptions<K, V> = {
|
|
2769
|
-
/** Optional registry name for `describe()` / debugging. */
|
|
2770
|
-
name?: string;
|
|
2771
|
-
/**
|
|
2772
|
-
* LRU cap. When set, evicts least-recently-used keys after inserts that exceed this size.
|
|
2773
|
-
* Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
|
|
2774
|
-
*/
|
|
2775
|
-
maxSize?: number;
|
|
2776
|
-
/**
|
|
2777
|
-
* Default TTL in seconds. Used when `set`/`setMany` omits per-call `ttl`.
|
|
2778
|
-
* Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
|
|
2779
|
-
*/
|
|
2780
|
-
defaultTtl?: number;
|
|
2781
|
-
/**
|
|
2782
|
-
* Storage backend. Defaults to `NativeMapBackend`. Users can plug in persistent
|
|
2783
|
-
* (HAMT / Immutable.js) or shared-state backends via the {@link MapBackend} interface.
|
|
2784
|
-
*/
|
|
2785
|
-
backend?: MapBackend<K, V>;
|
|
2786
|
-
/**
|
|
2787
|
-
* Optional versioning level for the underlying `entries` state node. Set at
|
|
2788
|
-
* construction time; cannot be changed later. Pass `0` for V0 identity +
|
|
2789
|
-
* monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
2790
|
-
*/
|
|
2791
|
-
versioning?: VersioningLevel;
|
|
2792
|
-
} & Omit<NodeOptions, "initial" | "describeKind" | "equals" | "versioning">;
|
|
2793
|
-
type ReactiveMapBundle<K, V> = {
|
|
2794
|
-
/** Emits `ReadonlyMap<K, V>` on each structural change (two-phase). */
|
|
2795
|
-
entries: Node<ReadonlyMap<K, V>>;
|
|
2796
|
-
/**
|
|
2797
|
-
* Checks existence. O(1) for live keys. If the key is expired, prunes it AND
|
|
2798
|
-
* emits a snapshot so the reactive surface stays consistent with the return
|
|
2799
|
-
* value. Reads on expired keys are therefore **observable side effects**.
|
|
2800
|
-
*
|
|
2801
|
-
* **LRU touch (F4):** When `maxSize` is configured, a live-key `has` also
|
|
2802
|
-
* marks the entry as most-recently-used — which rearranges internal insertion
|
|
2803
|
-
* order without bumping `version` or emitting. If you care about iteration
|
|
2804
|
-
* order in a downstream subscriber, rely on the `entries` snapshot (a fresh
|
|
2805
|
-
* `ReadonlyMap` per mutation) rather than iterating the backend directly.
|
|
2806
|
-
*/
|
|
2807
|
-
has: (key: K) => boolean;
|
|
2808
|
-
/**
|
|
2809
|
-
* Gets value. O(1) for live keys. If the key is expired, prunes it AND emits
|
|
2810
|
-
* a snapshot. Reads on expired keys are therefore **observable side effects**.
|
|
2811
|
-
*
|
|
2812
|
-
* **LRU touch (F4):** When `maxSize` is configured, a live-key `get` also
|
|
2813
|
-
* marks the entry as most-recently-used (no version bump, no emission). See
|
|
2814
|
-
* `has` for the full note on iteration order.
|
|
2815
|
-
*/
|
|
2816
|
-
get: (key: K) => V | undefined;
|
|
2817
|
-
/**
|
|
2818
|
-
* Sets value with optional TTL (seconds). Throws on `ttl <= 0`. Applies LRU eviction
|
|
2819
|
-
* if `maxSize` is set. Always emits.
|
|
2820
|
-
*/
|
|
2821
|
-
set: (key: K, value: V, opts?: {
|
|
2822
|
-
ttl?: number;
|
|
2823
|
-
}) => void;
|
|
2824
|
-
/**
|
|
2825
|
-
* Bulk set — emits one snapshot for the whole batch. Applies `opts.ttl` (falls back
|
|
2826
|
-
* to `defaultTtl`) to every entry. No-op if `entries` is empty.
|
|
2827
|
-
*
|
|
2828
|
-
* **Iterable consumption:** Consumes `entries` once (single-pass). Pass an array
|
|
2829
|
-
* or `Set` for multi-shot consumers. If the iterator throws mid-iteration,
|
|
2830
|
-
* entries already applied remain committed and a snapshot IS emitted (via the
|
|
2831
|
-
* wrapper's finally-block).
|
|
2832
|
-
*/
|
|
2833
|
-
setMany: (entries: Iterable<readonly [K, V]>, opts?: {
|
|
2834
|
-
ttl?: number;
|
|
2835
|
-
}) => void;
|
|
2836
|
-
delete: (key: K) => void;
|
|
2837
|
-
/**
|
|
2838
|
-
* Bulk delete — emits one snapshot. No-op if no keys were present.
|
|
2839
|
-
*
|
|
2840
|
-
* **Iterable consumption:** Consumes `keys` once (single-pass).
|
|
2841
|
-
*/
|
|
2842
|
-
deleteMany: (keys: Iterable<K>) => void;
|
|
2843
|
-
clear: () => void;
|
|
2844
|
-
/**
|
|
2845
|
-
* Current entry count — O(1), **pure read** (no emission). May include
|
|
2846
|
-
* expired entries on TTL maps until a mutation or explicit
|
|
2847
|
-
* `pruneExpired()` / `has(key)` / `get(key)` prunes them. Call
|
|
2848
|
-
* `pruneExpired()` first if you need a live count.
|
|
2849
|
-
*/
|
|
2850
|
-
readonly size: number;
|
|
2851
|
-
/** Explicitly prunes all expired entries. Emits if any were removed. */
|
|
2852
|
-
pruneExpired: () => void;
|
|
2853
|
-
/**
|
|
2854
|
-
* Releases any internal keepalive subscriptions so the bundle can be
|
|
2855
|
-
* GC'd. `reactiveMap` currently holds none (the `entries` node lives only
|
|
2856
|
-
* as long as external subscribers keep it alive), so `dispose()` is a
|
|
2857
|
-
* no-op today — exposed for API parity with `reactiveIndex.dispose` /
|
|
2858
|
-
* `reactiveList.dispose` / `reactiveLog.dispose`. Idempotent. D6(a).
|
|
2859
|
-
*/
|
|
2860
|
-
dispose: () => void;
|
|
2861
|
-
};
|
|
2862
|
-
/**
|
|
2863
|
-
* Storage contract for {@link reactiveMap}. Implementations own the mutable state,
|
|
2864
|
-
* including optional TTL and LRU semantics, and expose a monotonic `version` counter
|
|
2865
|
-
* that increments on every change to visible state.
|
|
2866
|
-
*
|
|
2867
|
-
* The reactive layer reads `version` before and after each backend call; when it
|
|
2868
|
-
* advances, a snapshot is emitted. Reads (`has`, `get`) may internally prune the
|
|
2869
|
-
* target key if expired and advance `version` — in which case the layer emits so
|
|
2870
|
-
* subscribers see state consistent with the read's return value.
|
|
2871
|
-
*
|
|
2872
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
2873
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
2874
|
-
* should treat all methods here as stable.
|
|
2875
|
-
*
|
|
2876
|
-
* @category extra
|
|
2877
|
-
*/
|
|
2878
|
-
interface MapBackend<K, V> {
|
|
2879
|
-
/** Monotonic mutation counter; increments on every visible state change. */
|
|
2880
|
-
readonly version: number;
|
|
2881
|
-
/** Raw entry count (may include expired entries until a read / prune removes them). */
|
|
2882
|
-
readonly size: number;
|
|
2883
|
-
/** Checks existence. May prune target key if expired; advances `version` if pruned. */
|
|
2884
|
-
has(key: K): boolean;
|
|
2885
|
-
/** Gets value. May prune target key if expired; advances `version` if pruned. */
|
|
2886
|
-
get(key: K): V | undefined;
|
|
2887
|
-
/**
|
|
2888
|
-
* Sets a value with optional TTL (seconds). Throws `RangeError` if `ttl <= 0`.
|
|
2889
|
-
* Applies LRU eviction if `maxSize` is configured. Advances `version`.
|
|
2890
|
-
*
|
|
2891
|
-
* **Atomicity contract:** Either fully succeeds or throws before any state
|
|
2892
|
-
* change; `version` advances only on success.
|
|
2893
|
-
*/
|
|
2894
|
-
set(key: K, value: V, ttl?: number): void;
|
|
2895
|
-
/**
|
|
2896
|
-
* Atomic bulk set. Pre-validates TTL once, then applies all entries. Advances
|
|
2897
|
-
* `version` at most once (even for N entries). No-op if iterable is empty.
|
|
2898
|
-
*
|
|
2899
|
-
* **Consumes `entries` once** — pass an array if you want repeatability.
|
|
2900
|
-
*
|
|
2901
|
-
* **Atomicity contract:** TTL validation throws before any mutation. If the
|
|
2902
|
-
* iterable itself throws mid-iteration, entries committed before the throw
|
|
2903
|
-
* remain persisted AND `version` is bumped once (surfaced via finally) so
|
|
2904
|
-
* the reactive wrapper emits a snapshot reflecting the partial state. "At
|
|
2905
|
-
* most once" invariant is preserved.
|
|
2906
|
-
*/
|
|
2907
|
-
setMany(entries: Iterable<readonly [K, V]>, ttl?: number): void;
|
|
2908
|
-
/** Removes a key. Returns `true` if the key existed. Advances `version` only if true. */
|
|
2909
|
-
delete(key: K): boolean;
|
|
2910
|
-
/**
|
|
2911
|
-
* Atomic bulk delete. Returns count removed. Advances `version` at most once
|
|
2912
|
-
* (even for N keys). No-op if no keys were present. Consumes `keys` once.
|
|
2913
|
-
*/
|
|
2914
|
-
deleteMany(keys: Iterable<K>): number;
|
|
2915
|
-
/** Removes all entries. Returns count removed. Advances `version` only if non-zero. */
|
|
2916
|
-
clear(): number;
|
|
2917
|
-
/** Removes all expired entries. Returns count removed. Advances `version` only if non-zero. */
|
|
2918
|
-
pruneExpired(): number;
|
|
2919
|
-
/** Fresh snapshot of non-expired entries (does NOT mutate state). */
|
|
2920
|
-
toMap(): ReadonlyMap<K, V>;
|
|
2921
|
-
}
|
|
2922
|
-
type NativeMapBackendOptions = {
|
|
2923
|
-
maxSize?: number;
|
|
2924
|
-
/** Default TTL in seconds. */
|
|
2925
|
-
defaultTtl?: number;
|
|
2926
|
-
};
|
|
2927
|
-
/**
|
|
2928
|
-
* Default `Map<K, {value, expiresAt}>` backend with optional per-key TTL and LRU cap.
|
|
2929
|
-
*
|
|
2930
|
-
* **Complexity:**
|
|
2931
|
-
* - `has`, `get`, `delete`, `size`: O(1)
|
|
2932
|
-
* - `set`: O(1) amortized (LRU touch + eviction)
|
|
2933
|
-
* - `pruneExpired`, `toMap`: O(n)
|
|
2934
|
-
*
|
|
2935
|
-
* LRU order uses native `Map` insertion order. `get` / `has` on a live key "touches"
|
|
2936
|
-
* it by delete-then-reinsert (moving it to the end). This touch does NOT advance
|
|
2937
|
-
* `version` — it's an internal optimization; the externally visible snapshot
|
|
2938
|
-
* preserves iteration order as of the last mutation. **Note:** because touch
|
|
2939
|
-
* reorders the internal `_store` without emitting, an in-process consumer iterating
|
|
2940
|
-
* `_store` directly (custom subclasses) could observe changing order; external
|
|
2941
|
-
* subscribers only see `toMap()` snapshots which are defensively copied and stable.
|
|
2942
|
-
*
|
|
2943
|
-
* @category extra
|
|
2944
|
-
*/
|
|
2945
|
-
declare class NativeMapBackend<K, V> implements MapBackend<K, V> {
|
|
2946
|
-
private _version;
|
|
2947
|
-
private readonly _store;
|
|
2948
|
-
private readonly _maxSize?;
|
|
2949
|
-
private readonly _defaultTtl?;
|
|
2950
|
-
constructor(options?: NativeMapBackendOptions);
|
|
2951
|
-
get version(): number;
|
|
2952
|
-
get size(): number;
|
|
2953
|
-
has(key: K): boolean;
|
|
2954
|
-
get(key: K): V | undefined;
|
|
2955
|
-
set(key: K, value: V, ttl?: number): void;
|
|
2956
|
-
setMany(entries: Iterable<readonly [K, V]>, ttl?: number): void;
|
|
2957
|
-
delete(key: K): boolean;
|
|
2958
|
-
deleteMany(keys: Iterable<K>): number;
|
|
2959
|
-
clear(): number;
|
|
2960
|
-
pruneExpired(): number;
|
|
2961
|
-
toMap(): ReadonlyMap<K, V>;
|
|
2962
|
-
private _resolveExpiresAt;
|
|
2963
|
-
private _isExpired;
|
|
2964
|
-
private _touchLru;
|
|
2965
|
-
private _evictLruWhileOver;
|
|
2966
|
-
}
|
|
2967
|
-
/**
|
|
2968
|
-
* Creates a reactive `Map` with optional per-key TTL and optional LRU max size.
|
|
2969
|
-
*
|
|
2970
|
-
* @param options - `name`, `maxSize`, `defaultTtl` (seconds), or custom `backend`.
|
|
2971
|
-
* @returns `ReactiveMapBundle` — imperative methods (`has`/`get`/`set`/`setMany`/`delete`/
|
|
2972
|
-
* `deleteMany`/`clear`/`pruneExpired`), reactive `entries` node, and O(1)-ish `size`.
|
|
2973
|
-
*
|
|
2974
|
-
* @remarks
|
|
2975
|
-
* **TTL:** Expiry is checked on `get`, `has`, `size`, `pruneExpired`, and before each
|
|
2976
|
-
* snapshot emission (expired keys are pruned first). Reads that discover expired keys
|
|
2977
|
-
* emit a snapshot so subscribers see state consistent with the read's return value.
|
|
2978
|
-
* There is no background timer; monotonic-clock expiry is immune to wall-clock changes.
|
|
2979
|
-
*
|
|
2980
|
-
* **LRU:** Uses native `Map` insertion order — `get` / `has` refreshes position via
|
|
2981
|
-
* delete-then-reinsert; under `maxSize` pressure the first key in iteration order is
|
|
2982
|
-
* evicted. LRU touching does NOT trigger emission (internal optimization).
|
|
2983
|
-
*
|
|
2984
|
-
* **Backend:** The default {@link NativeMapBackend} owns LRU/TTL. For persistent /
|
|
2985
|
-
* HAMT / shared-state semantics plug in a custom {@link MapBackend}. `maxSize` and
|
|
2986
|
-
* `defaultTtl` on the options object are only applied to the default backend — if
|
|
2987
|
-
* you supply `backend`, configure those on your backend directly.
|
|
2988
|
-
*
|
|
2989
|
-
* @example
|
|
2990
|
-
* ```ts
|
|
2991
|
-
* import { reactiveMap } from "@graphrefly/graphrefly-ts";
|
|
2992
|
-
*
|
|
2993
|
-
* const m = reactiveMap<string, number>({ name: "cache", maxSize: 100, defaultTtl: 60 });
|
|
2994
|
-
* m.set("x", 1);
|
|
2995
|
-
* m.setMany([["y", 2], ["z", 3]]);
|
|
2996
|
-
* m.entries.subscribe((msgs) => { console.log(msgs); });
|
|
2997
|
-
* ```
|
|
2998
|
-
*
|
|
2999
|
-
* @category extra
|
|
3000
|
-
*/
|
|
3001
|
-
declare function reactiveMap<K, V>(options?: ReactiveMapOptions<K, V>): ReactiveMapBundle<K, V>;
|
|
3002
|
-
|
|
3003
|
-
/**
|
|
3004
|
-
* Composite data patterns (roadmap §3.2b).
|
|
3005
|
-
*
|
|
3006
|
-
* These helpers compose existing primitives (`node`, `switchMap`, `reactiveMap`,
|
|
3007
|
-
* `dynamicNode`, `fromAny`) without introducing new protocol semantics.
|
|
3008
|
-
*/
|
|
3009
|
-
|
|
3010
|
-
/**
|
|
3011
|
-
* Verification payload shape is intentionally user-defined.
|
|
3012
|
-
*/
|
|
3013
|
-
type VerifyValue = unknown;
|
|
3014
|
-
type VerifiableOptions<TVerify = VerifyValue> = Omit<NodeOptions, "describeKind" | "initial"> & {
|
|
3015
|
-
/** Reactive re-verification trigger. */
|
|
3016
|
-
trigger?: NodeInput<unknown>;
|
|
3017
|
-
/** Re-run verification whenever `source` settles. */
|
|
3018
|
-
autoVerify?: boolean;
|
|
3019
|
-
/** Initial verification companion value. */
|
|
3020
|
-
initialVerified?: TVerify | null;
|
|
3021
|
-
};
|
|
3022
|
-
type VerifiableBundle<T, TVerify = VerifyValue> = {
|
|
3023
|
-
/** Coerced source node. */
|
|
3024
|
-
node: Node<T>;
|
|
3025
|
-
/** Latest verification result (`null` before first verification). */
|
|
3026
|
-
verified: Node<TVerify | null>;
|
|
3027
|
-
/** Effective trigger node used for verification, if any. */
|
|
3028
|
-
trigger: Node<unknown> | null;
|
|
3029
|
-
};
|
|
3030
|
-
/**
|
|
3031
|
-
* Composes a value node with a reactive verification companion.
|
|
3032
|
-
*
|
|
3033
|
-
* Uses `switchMap` so newer triggers cancel stale in-flight verification work.
|
|
3034
|
-
*/
|
|
3035
|
-
declare function verifiable<T, TVerify = VerifyValue>(source: NodeInput<T>, verifyFn: (value: T) => NodeInput<TVerify>, opts?: VerifiableOptions<TVerify>): VerifiableBundle<T, TVerify>;
|
|
3036
|
-
type Extraction<TMem> = {
|
|
3037
|
-
upsert: Array<{
|
|
3038
|
-
key: string;
|
|
3039
|
-
value: TMem;
|
|
3040
|
-
}>;
|
|
3041
|
-
remove?: string[];
|
|
3042
|
-
};
|
|
3043
|
-
type DistillOptions<TMem> = {
|
|
3044
|
-
score: (mem: TMem, context: unknown) => number;
|
|
3045
|
-
cost: (mem: TMem) => number;
|
|
3046
|
-
budget?: number;
|
|
3047
|
-
evict?: (key: string, mem: TMem) => boolean | Node<boolean>;
|
|
3048
|
-
consolidate?: (entries: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
|
|
3049
|
-
consolidateTrigger?: NodeInput<unknown>;
|
|
3050
|
-
context?: NodeInput<unknown>;
|
|
3051
|
-
mapOptions?: ReactiveMapOptions<string, TMem>;
|
|
3052
|
-
};
|
|
3053
|
-
type DistillBundle<TMem> = {
|
|
3054
|
-
store: ReactiveMapBundle<string, TMem>;
|
|
3055
|
-
compact: Node<Array<{
|
|
3056
|
-
key: string;
|
|
3057
|
-
value: TMem;
|
|
3058
|
-
score: number;
|
|
3059
|
-
}>>;
|
|
3060
|
-
size: Node<number>;
|
|
3061
|
-
};
|
|
3062
|
-
/**
|
|
3063
|
-
* Budget-constrained reactive memory composition.
|
|
3064
|
-
*/
|
|
3065
|
-
declare function distill<TRaw, TMem>(source: NodeInput<TRaw>, extractFn: (raw: TRaw, existing: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>, opts: DistillOptions<TMem>): DistillBundle<TMem>;
|
|
3066
|
-
|
|
3067
|
-
/**
|
|
3068
|
-
* Minimal 5-field cron parser and matcher (minute hour day-of-month month day-of-week).
|
|
3069
|
-
* Ported from callbag-recharge `extra/cron.ts` for `fromCron` (roadmap §2.3).
|
|
3070
|
-
*/
|
|
3071
|
-
interface CronSchedule {
|
|
3072
|
-
minutes: Set<number>;
|
|
3073
|
-
hours: Set<number>;
|
|
3074
|
-
daysOfMonth: Set<number>;
|
|
3075
|
-
months: Set<number>;
|
|
3076
|
-
daysOfWeek: Set<number>;
|
|
3077
|
-
}
|
|
3078
|
-
/**
|
|
3079
|
-
* Parses a standard 5-field cron expression into a {@link CronSchedule}.
|
|
3080
|
-
*
|
|
3081
|
-
* Supports `*`, ranges (`1-5`), steps (`*\/5`, `0-30/10`), and comma-separated
|
|
3082
|
-
* lists. Fields are: minute (0–59), hour (0–23), day-of-month (1–31),
|
|
3083
|
-
* month (1–12), day-of-week (0–6, Sunday = 0).
|
|
3084
|
-
*
|
|
3085
|
-
* @param expr - Five-field whitespace-separated cron string (e.g. `"0 9 * * 1-5"`).
|
|
3086
|
-
* @returns Parsed {@link CronSchedule} with one `Set<number>` per field.
|
|
3087
|
-
* @throws Error when the expression does not have exactly 5 fields, contains
|
|
3088
|
-
* out-of-range values, or uses an invalid step.
|
|
3089
|
-
*
|
|
3090
|
-
* @example
|
|
3091
|
-
* ```ts
|
|
3092
|
-
* import { parseCron } from "@graphrefly/graphrefly-ts";
|
|
3093
|
-
*
|
|
3094
|
-
* const sched = parseCron("0 9 * * 1-5"); // weekdays at 09:00
|
|
3095
|
-
* sched.hours; // Set { 9 }
|
|
3096
|
-
* sched.daysOfWeek; // Set { 1, 2, 3, 4, 5 }
|
|
3097
|
-
* ```
|
|
3098
|
-
*/
|
|
3099
|
-
declare function parseCron(expr: string): CronSchedule;
|
|
3100
|
-
/**
|
|
3101
|
-
* Returns `true` if `date` satisfies every field of `schedule`.
|
|
3102
|
-
*
|
|
3103
|
-
* @param schedule - Parsed schedule from {@link parseCron}.
|
|
3104
|
-
* @param date - Moment to test (local time via `getMinutes`, `getHours`, etc.).
|
|
3105
|
-
* @returns `true` when all five cron fields match the given date.
|
|
3106
|
-
*
|
|
3107
|
-
* @example
|
|
3108
|
-
* ```ts
|
|
3109
|
-
* import { parseCron, matchesCron } from "@graphrefly/graphrefly-ts";
|
|
3110
|
-
*
|
|
3111
|
-
* const sched = parseCron("30 8 * * 1"); // Mondays at 08:30
|
|
3112
|
-
* const monday = new Date("2026-03-30T08:30:00"); // a Monday
|
|
3113
|
-
* matchesCron(sched, monday); // true
|
|
3114
|
-
* ```
|
|
3115
|
-
*/
|
|
3116
|
-
declare function matchesCron(schedule: CronSchedule, date: Date): boolean;
|
|
3117
|
-
|
|
3118
|
-
/**
|
|
3119
|
-
* Tier 1 sync operators (roadmap §2.1) and Tier 2 async/dynamic operators (roadmap §2.2) —
|
|
3120
|
-
* each returns a {@link Node} built with {@link node} (or {@link producer} for cold sources).
|
|
3121
|
-
*
|
|
3122
|
-
* v5 foundation redesign: all operators use `actions.emit()` for value emission,
|
|
3123
|
-
* `ctx.store` for persistent state, `ctx.terminalDeps` for terminal handling,
|
|
3124
|
-
* and `data[i]` batch shape for DATA vs RESOLVED discrimination. `onMessage`
|
|
3125
|
-
* and `onResubscribe` are removed.
|
|
3126
|
-
*/
|
|
3127
|
-
|
|
3128
|
-
type ExtraOpts$1 = Omit<NodeOptions<unknown>, "describeKind">;
|
|
3129
|
-
/**
|
|
3130
|
-
* Maps each settled value from `source` through `project`.
|
|
3131
|
-
*
|
|
3132
|
-
* @param source - Upstream node.
|
|
3133
|
-
* @param project - Transform for each value.
|
|
3134
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3135
|
-
* @returns `Node<R>` - Derived node emitting mapped values.
|
|
3136
|
-
*
|
|
3137
|
-
* @example
|
|
3138
|
-
* ```ts
|
|
3139
|
-
* import { map, state } from "@graphrefly/graphrefly-ts";
|
|
3140
|
-
*
|
|
3141
|
-
* const n = map(state(2), (x) => x * 3);
|
|
3142
|
-
* ```
|
|
3143
|
-
*
|
|
3144
|
-
* @category extra
|
|
3145
|
-
*/
|
|
3146
|
-
declare function map<T, R>(source: Node<T>, project: (value: T) => R, opts?: ExtraOpts$1): Node<R>;
|
|
3147
|
-
/**
|
|
3148
|
-
* Forwards values that satisfy `predicate`; otherwise emits `RESOLVED` with no `DATA` (two-phase semantics).
|
|
3149
|
-
*
|
|
3150
|
-
* @param source - Upstream node.
|
|
3151
|
-
* @param predicate - Inclusion test.
|
|
3152
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3153
|
-
* @returns `Node<T>` - Filtered node.
|
|
3154
|
-
*
|
|
3155
|
-
* @example
|
|
3156
|
-
* ```ts
|
|
3157
|
-
* import { filter, state } from "@graphrefly/graphrefly-ts";
|
|
3158
|
-
*
|
|
3159
|
-
* const n = filter(state(1), (x) => x > 0);
|
|
3160
|
-
* ```
|
|
3161
|
-
*
|
|
3162
|
-
* @category extra
|
|
3163
|
-
*/
|
|
3164
|
-
declare function filter<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: ExtraOpts$1): Node<T>;
|
|
3165
|
-
/**
|
|
3166
|
-
* Folds each upstream value into an accumulator; emits the new accumulator every time.
|
|
3167
|
-
*
|
|
3168
|
-
* Unlike RxJS, `seed` is always required — there is no seedless mode where the first
|
|
3169
|
-
* value silently becomes the accumulator.
|
|
3170
|
-
*
|
|
3171
|
-
* @param source - Upstream node.
|
|
3172
|
-
* @param reducer - `(acc, value) => nextAcc`.
|
|
3173
|
-
* @param seed - Initial accumulator (required).
|
|
3174
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3175
|
-
* @returns `Node<R>` - Scan node.
|
|
3176
|
-
*
|
|
3177
|
-
* @example
|
|
3178
|
-
* ```ts
|
|
3179
|
-
* import { scan, state } from "@graphrefly/graphrefly-ts";
|
|
3180
|
-
*
|
|
3181
|
-
* const n = scan(state(1), (a, x) => a + x, 0);
|
|
3182
|
-
* ```
|
|
3183
|
-
*
|
|
3184
|
-
* @category extra
|
|
3185
|
-
*/
|
|
3186
|
-
declare function scan<T, R>(source: Node<T>, reducer: (acc: R, value: T) => R, seed: R, opts?: ExtraOpts$1): Node<R>;
|
|
3187
|
-
/**
|
|
3188
|
-
* Reduces to one value emitted when `source` completes; if no `DATA` arrived, emits `seed`.
|
|
3189
|
-
*
|
|
3190
|
-
* Unlike RxJS, `seed` is always required. If the source completes without emitting
|
|
3191
|
-
* DATA, the seed value is emitted (RxJS would throw without a seed).
|
|
3192
|
-
*
|
|
3193
|
-
* @param source - Upstream node.
|
|
3194
|
-
* @param reducer - `(acc, value) => nextAcc`.
|
|
3195
|
-
* @param seed - Empty-completion default and initial accumulator (required).
|
|
3196
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3197
|
-
* @returns `Node<R>` - Node that emits once on completion.
|
|
3198
|
-
*
|
|
3199
|
-
* @example
|
|
3200
|
-
* ```ts
|
|
3201
|
-
* import { reduce, state } from "@graphrefly/graphrefly-ts";
|
|
3202
|
-
*
|
|
3203
|
-
* const n = reduce(state(1), (a, x) => a + x, 0);
|
|
3204
|
-
* ```
|
|
3205
|
-
*
|
|
3206
|
-
* @category extra
|
|
3207
|
-
*/
|
|
3208
|
-
declare function reduce<T, R>(source: Node<T>, reducer: (acc: R, value: T) => R, seed: R, opts?: ExtraOpts$1): Node<R>;
|
|
3209
|
-
/**
|
|
3210
|
-
* Emits at most `count` **`DATA`** values, then **`COMPLETE`**. `RESOLVED` does not advance the counter.
|
|
3211
|
-
*
|
|
3212
|
-
* @param source - Upstream node.
|
|
3213
|
-
* @param count - Maximum `DATA` emissions (≤0 completes immediately).
|
|
3214
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3215
|
-
* @returns `Node<T>` - Limited stream.
|
|
3216
|
-
*
|
|
3217
|
-
* @example
|
|
3218
|
-
* ```ts
|
|
3219
|
-
* import { take, state } from "@graphrefly/graphrefly-ts";
|
|
3220
|
-
*
|
|
3221
|
-
* const n = take(state(0), 3);
|
|
3222
|
-
* ```
|
|
3223
|
-
*
|
|
3224
|
-
* @category extra
|
|
3225
|
-
*/
|
|
3226
|
-
declare function take<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T>;
|
|
3227
|
-
/**
|
|
3228
|
-
* Skips the first `count` **`DATA`** emissions. `RESOLVED` does not advance the counter.
|
|
3229
|
-
*
|
|
3230
|
-
* @param source - Upstream node.
|
|
3231
|
-
* @param count - Number of `DATA` values to drop.
|
|
3232
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3233
|
-
* @returns `Node<T>` - Skipped stream.
|
|
3234
|
-
*
|
|
3235
|
-
* @example
|
|
3236
|
-
* ```ts
|
|
3237
|
-
* import { skip, state } from "@graphrefly/graphrefly-ts";
|
|
3238
|
-
*
|
|
3239
|
-
* const n = skip(state(0), 2);
|
|
3240
|
-
* ```
|
|
3241
|
-
*
|
|
3242
|
-
* @category extra
|
|
3243
|
-
*/
|
|
3244
|
-
declare function skip<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T>;
|
|
3245
|
-
/**
|
|
3246
|
-
* Emits while `predicate` holds; on first false, sends **`COMPLETE`**.
|
|
3247
|
-
*
|
|
3248
|
-
* @param source - Upstream node.
|
|
3249
|
-
* @param predicate - Continuation test.
|
|
3250
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3251
|
-
* @returns `Node<T>` - Truncated stream.
|
|
3252
|
-
*
|
|
3253
|
-
* @example
|
|
3254
|
-
* ```ts
|
|
3255
|
-
* import { takeWhile, state } from "@graphrefly/graphrefly-ts";
|
|
3256
|
-
*
|
|
3257
|
-
* const n = takeWhile(state(1), (x) => x < 10);
|
|
3258
|
-
* ```
|
|
3259
|
-
*
|
|
3260
|
-
* @category extra
|
|
3261
|
-
*/
|
|
3262
|
-
declare function takeWhile<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: ExtraOpts$1): Node<T>;
|
|
3263
|
-
/**
|
|
3264
|
-
* Forwards `source` until `notifier` matches `predicate` (default: notifier **`DATA`**), then **`COMPLETE`**.
|
|
3265
|
-
*
|
|
3266
|
-
* @param source - Main upstream.
|
|
3267
|
-
* @param notifier - Triggers completion when `predicate(msg)` is true.
|
|
3268
|
-
* @param opts - Optional {@link NodeOptions}, plus `predicate` for custom notifier matching.
|
|
3269
|
-
* @returns `Node<T>` - Truncated stream.
|
|
3270
|
-
*
|
|
3271
|
-
* @example
|
|
3272
|
-
* ```ts
|
|
3273
|
-
* import { producer, takeUntil, state } from "@graphrefly/graphrefly-ts";
|
|
3274
|
-
*
|
|
3275
|
-
* const src = state(1);
|
|
3276
|
-
* const stop = producer((_d, a) => a.emit(undefined));
|
|
3277
|
-
* const n = takeUntil(src, stop);
|
|
3278
|
-
* ```
|
|
3279
|
-
*
|
|
3280
|
-
* @category extra
|
|
3281
|
-
*/
|
|
3282
|
-
declare function takeUntil<T>(source: Node<T>, notifier: Node, opts?: ExtraOpts$1 & {
|
|
3283
|
-
predicate?: (msg: Message) => boolean;
|
|
3284
|
-
}): Node<T>;
|
|
3285
|
-
/**
|
|
3286
|
-
* Emits the first **`DATA`** then **`COMPLETE`** (same as `take(source, 1)`).
|
|
3287
|
-
*
|
|
3288
|
-
* @param source - Upstream node.
|
|
3289
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3290
|
-
* @returns `Node<T>` - Single-value stream.
|
|
3291
|
-
*
|
|
3292
|
-
* @example
|
|
3293
|
-
* ```ts
|
|
3294
|
-
* import { first, state } from "@graphrefly/graphrefly-ts";
|
|
3295
|
-
*
|
|
3296
|
-
* const n = first(state(42));
|
|
3297
|
-
* ```
|
|
3298
|
-
*
|
|
3299
|
-
* @category extra
|
|
3300
|
-
*/
|
|
3301
|
-
declare function first<T>(source: Node<T>, opts?: ExtraOpts$1): Node<T>;
|
|
3302
|
-
/**
|
|
3303
|
-
* Buffers values and emits the last **`DATA`** on **`COMPLETE`**; optional `defaultValue` if none arrived.
|
|
3304
|
-
*
|
|
3305
|
-
* @param source - Upstream node.
|
|
3306
|
-
* @param options - Optional {@link NodeOptions} and `defaultValue` when empty.
|
|
3307
|
-
* @returns `Node<T>` - Last-or-default node.
|
|
3308
|
-
*
|
|
3309
|
-
* @example
|
|
3310
|
-
* ```ts
|
|
3311
|
-
* import { last, state } from "@graphrefly/graphrefly-ts";
|
|
3312
|
-
*
|
|
3313
|
-
* const n = last(state(1), { defaultValue: 0 });
|
|
3314
|
-
* ```
|
|
3315
|
-
*
|
|
3316
|
-
* @category extra
|
|
3317
|
-
*/
|
|
3318
|
-
declare function last<T>(source: Node<T>, options?: ExtraOpts$1 & {
|
|
3319
|
-
defaultValue?: T;
|
|
3320
|
-
}): Node<T>;
|
|
3321
|
-
/**
|
|
3322
|
-
* Emits the first value matching `predicate`, then **`COMPLETE`**.
|
|
3323
|
-
*
|
|
3324
|
-
* @param source - Upstream node.
|
|
3325
|
-
* @param predicate - Match test.
|
|
3326
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3327
|
-
* @returns `Node<T>` - First-match stream.
|
|
3328
|
-
*
|
|
3329
|
-
* @example
|
|
3330
|
-
* ```ts
|
|
3331
|
-
* import { find, state } from "@graphrefly/graphrefly-ts";
|
|
3332
|
-
*
|
|
3333
|
-
* const n = find(state(1), (x) => x > 0);
|
|
3334
|
-
* ```
|
|
3335
|
-
*
|
|
3336
|
-
* @category extra
|
|
3337
|
-
*/
|
|
3338
|
-
declare function find<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: ExtraOpts$1): Node<T>;
|
|
3339
|
-
/**
|
|
3340
|
-
* Emits the `index`th **`DATA`** (zero-based), then **`COMPLETE`**.
|
|
3341
|
-
*
|
|
3342
|
-
* @param source - Upstream node.
|
|
3343
|
-
* @param index - Zero-based emission index.
|
|
3344
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3345
|
-
* @returns `Node<T>` - Single indexed value.
|
|
3346
|
-
*
|
|
3347
|
-
* @example
|
|
3348
|
-
* ```ts
|
|
3349
|
-
* import { elementAt, state } from "@graphrefly/graphrefly-ts";
|
|
3350
|
-
*
|
|
3351
|
-
* const n = elementAt(state(0), 2);
|
|
3352
|
-
* ```
|
|
3353
|
-
*
|
|
3354
|
-
* @category extra
|
|
3355
|
-
*/
|
|
3356
|
-
declare function elementAt<T>(source: Node<T>, index: number, opts?: ExtraOpts$1): Node<T>;
|
|
3357
|
-
/**
|
|
3358
|
-
* Observer shape for {@link tap} — side effects for data, error, and/or complete.
|
|
3359
|
-
*/
|
|
3360
|
-
type TapObserver<T> = {
|
|
3361
|
-
data?: (value: T) => void;
|
|
3362
|
-
error?: (err: unknown) => void;
|
|
3363
|
-
complete?: () => void;
|
|
3364
|
-
};
|
|
3365
|
-
/**
|
|
3366
|
-
* Invokes side effects; values pass through unchanged.
|
|
3367
|
-
*
|
|
3368
|
-
* Accepts either a function (called on each DATA) or an observer object
|
|
3369
|
-
* `{ data?, error?, complete? }` for lifecycle-aware side effects.
|
|
3370
|
-
*
|
|
3371
|
-
* @param source - Upstream node.
|
|
3372
|
-
* @param fnOrObserver - Side effect function or observer object.
|
|
3373
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3374
|
-
* @returns `Node<T>` - Passthrough node.
|
|
3375
|
-
*
|
|
3376
|
-
* @example
|
|
3377
|
-
* ```ts
|
|
3378
|
-
* import { tap, state } from "@graphrefly/graphrefly-ts";
|
|
3379
|
-
*
|
|
3380
|
-
* // Function form (DATA only)
|
|
3381
|
-
* tap(state(1), (x) => console.log(x));
|
|
3382
|
-
*
|
|
3383
|
-
* // Observer form (DATA + ERROR + COMPLETE)
|
|
3384
|
-
* tap(state(1), { data: console.log, error: console.error, complete: () => console.log("done") });
|
|
3385
|
-
* ```
|
|
3386
|
-
*
|
|
3387
|
-
* @category extra
|
|
3388
|
-
*/
|
|
3389
|
-
declare function tap<T>(source: Node<T>, fnOrObserver: ((value: T) => void) | TapObserver<T>, opts?: ExtraOpts$1): Node<T>;
|
|
3390
|
-
/**
|
|
3391
|
-
* Suppresses adjacent duplicates using `equals` (default `Object.is`).
|
|
3392
|
-
*
|
|
3393
|
-
* @param source - Upstream node.
|
|
3394
|
-
* @param equals - Optional equality for consecutive values.
|
|
3395
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3396
|
-
* @returns `Node<T>` - Deduped stream.
|
|
3397
|
-
*
|
|
3398
|
-
* @example
|
|
3399
|
-
* ```ts
|
|
3400
|
-
* import { distinctUntilChanged, state } from "@graphrefly/graphrefly-ts";
|
|
3401
|
-
*
|
|
3402
|
-
* const n = distinctUntilChanged(state(1));
|
|
3403
|
-
* ```
|
|
3404
|
-
*
|
|
3405
|
-
* @category extra
|
|
3406
|
-
*/
|
|
3407
|
-
declare function distinctUntilChanged<T>(source: Node<T>, equals?: (a: T, b: T) => boolean, opts?: ExtraOpts$1): Node<T>;
|
|
3408
|
-
/**
|
|
3409
|
-
* Emits `[previous, current]` pairs starting after the second value (first pair uses `RESOLVED` only).
|
|
3410
|
-
*
|
|
3411
|
-
* @param source - Upstream node.
|
|
3412
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3413
|
-
* @returns `Node<readonly [T, T]>` - Pair stream.
|
|
3414
|
-
*
|
|
3415
|
-
* @example
|
|
3416
|
-
* ```ts
|
|
3417
|
-
* import { pairwise, state } from "@graphrefly/graphrefly-ts";
|
|
3418
|
-
*
|
|
3419
|
-
* const n = pairwise(state(0));
|
|
3420
|
-
* ```
|
|
3421
|
-
*
|
|
3422
|
-
* @category extra
|
|
3423
|
-
*/
|
|
3424
|
-
declare function pairwise<T>(source: Node<T>, opts?: ExtraOpts$1): Node<readonly [T, T]>;
|
|
3425
|
-
/**
|
|
3426
|
-
* Combines the latest value from each dependency whenever any dep settles (combineLatest).
|
|
3427
|
-
*
|
|
3428
|
-
* @param sources - Nodes to combine (variadic).
|
|
3429
|
-
* @returns `Node<T>` - Tuple of latest values.
|
|
3430
|
-
*
|
|
3431
|
-
* @example
|
|
3432
|
-
* ```ts
|
|
3433
|
-
* import { combine, state } from "@graphrefly/graphrefly-ts";
|
|
3434
|
-
*
|
|
3435
|
-
* const n = combine(state(1), state("a"));
|
|
3436
|
-
* ```
|
|
3437
|
-
*
|
|
3438
|
-
* @remarks
|
|
3439
|
-
* Unlike RxJS `combineLatest`, this is named `combine`. Use the {@link combineLatest} alias
|
|
3440
|
-
* if you prefer the RxJS name. Seed is always required for `scan`/`reduce` (no seedless mode).
|
|
3441
|
-
*
|
|
3442
|
-
* @category extra
|
|
3443
|
-
*/
|
|
3444
|
-
declare function combine<const T extends readonly unknown[]>(...sources: {
|
|
3445
|
-
[K in keyof T]: Node<T[K]>;
|
|
3446
|
-
}): Node<T>;
|
|
3447
|
-
/**
|
|
3448
|
-
* When `primary` settles, emits `[primary, latestSecondary]`. `secondary` alone updates cache only.
|
|
3449
|
-
*
|
|
3450
|
-
* @param primary - Main stream.
|
|
3451
|
-
* @param secondary - Latest value is paired on each primary emission.
|
|
3452
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3453
|
-
* @returns `Node<readonly [A, B]>` - Paired stream.
|
|
3454
|
-
*
|
|
3455
|
-
* @example
|
|
3456
|
-
* ```ts
|
|
3457
|
-
* import { state, withLatestFrom } from "@graphrefly/graphrefly-ts";
|
|
3458
|
-
*
|
|
3459
|
-
* const n = withLatestFrom(state(1), state("x"));
|
|
3460
|
-
* ```
|
|
3461
|
-
*
|
|
3462
|
-
* @category extra
|
|
3463
|
-
*/
|
|
3464
|
-
declare function withLatestFrom<A, B>(primary: Node<A>, secondary: Node<B>, opts?: ExtraOpts$1): Node<readonly [A, B]>;
|
|
3465
|
-
/**
|
|
3466
|
-
* Merges **`DATA`** from any source with correct two-phase dirty tracking. **`COMPLETE`** after **all** sources complete (spec §1.3.5).
|
|
3467
|
-
*
|
|
3468
|
-
* @param sources - Nodes to merge (variadic; empty completes immediately).
|
|
3469
|
-
* @returns `Node<T>` - Merged stream.
|
|
3470
|
-
*
|
|
3471
|
-
* @remarks
|
|
3472
|
-
* **Ordering:** DIRTY/RESOLVED rules follow multi-source semantics in `~/src/graphrefly/GRAPHREFLY-SPEC.md`.
|
|
3473
|
-
*
|
|
3474
|
-
* @example
|
|
3475
|
-
* ```ts
|
|
3476
|
-
* import { merge, state } from "@graphrefly/graphrefly-ts";
|
|
3477
|
-
*
|
|
3478
|
-
* const n = merge(state(1), state(2));
|
|
3479
|
-
* ```
|
|
3480
|
-
*
|
|
3481
|
-
* @category extra
|
|
3482
|
-
*/
|
|
3483
|
-
declare function merge<T>(...sources: readonly Node<T>[]): Node<T>;
|
|
3484
|
-
/**
|
|
3485
|
-
* Zips one **`DATA`** from each source per cycle into a tuple. Only **`DATA`** enqueues (spec §1.3.3).
|
|
3486
|
-
*
|
|
3487
|
-
* @param sources - Nodes to zip (variadic).
|
|
3488
|
-
* @returns `Node<T>` - Zipped tuples.
|
|
3489
|
-
*
|
|
3490
|
-
* @example
|
|
3491
|
-
* ```ts
|
|
3492
|
-
* import { state, zip } from "@graphrefly/graphrefly-ts";
|
|
3493
|
-
*
|
|
3494
|
-
* const n = zip(state(1), state(2));
|
|
3495
|
-
* ```
|
|
3496
|
-
*
|
|
3497
|
-
* @category extra
|
|
3498
|
-
*/
|
|
3499
|
-
declare function zip<const T extends readonly unknown[]>(...sources: {
|
|
3500
|
-
[K in keyof T]: Node<T[K]>;
|
|
3501
|
-
}): Node<T>;
|
|
3502
|
-
/**
|
|
3503
|
-
* Plays all of `firstSrc`, then all of `secondSrc`. **`DATA`** from `secondSrc` during phase one is buffered until handoff.
|
|
3504
|
-
*
|
|
3505
|
-
* @param firstSrc - First segment.
|
|
3506
|
-
* @param secondSrc - Second segment.
|
|
3507
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3508
|
-
* @returns `Node<T>` - Concatenated stream.
|
|
3509
|
-
*
|
|
3510
|
-
* @example
|
|
3511
|
-
* ```ts
|
|
3512
|
-
* import { concat, state } from "@graphrefly/graphrefly-ts";
|
|
3513
|
-
*
|
|
3514
|
-
* const n = concat(state(1), state(2));
|
|
3515
|
-
* ```
|
|
3516
|
-
*
|
|
3517
|
-
* @category extra
|
|
3518
|
-
*/
|
|
3519
|
-
declare function concat<T>(firstSrc: Node<T>, secondSrc: Node<T>, opts?: ExtraOpts$1): Node<T>;
|
|
3520
|
-
/**
|
|
3521
|
-
* First source to emit **`DATA`** wins; later traffic follows only the winner (Rx-style `race`).
|
|
3522
|
-
*
|
|
3523
|
-
* @param sources - Contestants (variadic; empty completes immediately; one node is identity).
|
|
3524
|
-
* @returns `Node<T>` - Winning stream.
|
|
3525
|
-
*
|
|
3526
|
-
* @example
|
|
3527
|
-
* ```ts
|
|
3528
|
-
* import { race, state } from "@graphrefly/graphrefly-ts";
|
|
3529
|
-
*
|
|
3530
|
-
* const n = race(state(1), state(2));
|
|
3531
|
-
* ```
|
|
3532
|
-
*
|
|
3533
|
-
* @category extra
|
|
3534
|
-
*/
|
|
3535
|
-
declare function race<T>(...sources: readonly Node<T>[]): Node<T>;
|
|
3536
|
-
/**
|
|
3537
|
-
* Maps each settled value to an inner node; unsubscribes the previous inner (Rx-style `switchMap`).
|
|
3538
|
-
*
|
|
3539
|
-
* @param source - Upstream node.
|
|
3540
|
-
* @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
|
|
3541
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3542
|
-
* @returns `Node<R>` - Emissions from the active inner subscription.
|
|
3543
|
-
* @example
|
|
3544
|
-
* ```ts
|
|
3545
|
-
* import { switchMap, state } from "@graphrefly/graphrefly-ts";
|
|
3546
|
-
*
|
|
3547
|
-
* const src = state(0);
|
|
3548
|
-
* switchMap(src, (n) => state((n as number) * 2));
|
|
3549
|
-
* ```
|
|
3550
|
-
*
|
|
3551
|
-
* @category extra
|
|
3552
|
-
*/
|
|
3553
|
-
declare function switchMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: ExtraOpts$1): Node<R>;
|
|
3554
|
-
/**
|
|
3555
|
-
* Like {@link switchMap}, but ignores outer `DATA` while an inner subscription is active (`exhaustMap`).
|
|
3556
|
-
*
|
|
3557
|
-
* @param source - Upstream node.
|
|
3558
|
-
* @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
|
|
3559
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3560
|
-
* @returns `Node<R>` - Emissions from the active inner while it runs.
|
|
3561
|
-
* @example
|
|
3562
|
-
* ```ts
|
|
3563
|
-
* import { exhaustMap, state } from "@graphrefly/graphrefly-ts";
|
|
3564
|
-
*
|
|
3565
|
-
* exhaustMap(state(0), () => state(1));
|
|
3566
|
-
* ```
|
|
3567
|
-
*
|
|
3568
|
-
* @category extra
|
|
3569
|
-
*/
|
|
3570
|
-
declare function exhaustMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: ExtraOpts$1): Node<R>;
|
|
3571
|
-
/**
|
|
3572
|
-
* Enqueues each outer value and subscribes to inners one at a time (`concatMap`).
|
|
3573
|
-
*
|
|
3574
|
-
* @param source - Upstream node.
|
|
3575
|
-
* @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
|
|
3576
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3577
|
-
* @returns `Node<R>` - Sequential concatenation of inner streams.
|
|
3578
|
-
* @example
|
|
3579
|
-
* ```ts
|
|
3580
|
-
* import { concatMap, state } from "@graphrefly/graphrefly-ts";
|
|
3581
|
-
*
|
|
3582
|
-
* concatMap(state(0), (n) => state((n as number) + 1));
|
|
3583
|
-
* ```
|
|
3584
|
-
*
|
|
3585
|
-
* @category extra
|
|
3586
|
-
*/
|
|
3587
|
-
declare function concatMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: ExtraOpts$1 & {
|
|
3588
|
-
maxBuffer?: number;
|
|
3589
|
-
}): Node<R>;
|
|
3590
|
-
/** Options for {@link mergeMap}. */
|
|
3591
|
-
type MergeMapOptions = ExtraOpts$1 & {
|
|
3592
|
-
/** Maximum number of concurrent inner subscriptions. Default: `Infinity` (unbounded). */
|
|
3593
|
-
concurrent?: number;
|
|
3594
|
-
};
|
|
3595
|
-
/**
|
|
3596
|
-
* Subscribes to inner nodes in parallel (up to `concurrent`) and merges outputs (`mergeMap` / `flatMap`).
|
|
3597
|
-
*
|
|
3598
|
-
* @param source - Upstream node.
|
|
3599
|
-
* @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
|
|
3600
|
-
* @param opts - Optional options including `concurrent` limit.
|
|
3601
|
-
* @returns `Node<R>` - Merged output of all active inners; completes when the outer and every inner complete.
|
|
3602
|
-
*
|
|
3603
|
-
* @remarks
|
|
3604
|
-
* **ERROR handling:** An `ERROR` from the outer source cancels all active inner
|
|
3605
|
-
* subscriptions and propagates the error downstream. An `ERROR` from an inner
|
|
3606
|
-
* subscription propagates downstream immediately but does **not** cancel sibling
|
|
3607
|
-
* inner subscriptions — other active inners continue until they complete or the
|
|
3608
|
-
* outer errors/completes. This is intentional: for parallel work, isolating
|
|
3609
|
-
* failures per-inner is more useful than Rx-style "first error cancels all."
|
|
3610
|
-
*
|
|
3611
|
-
* @example
|
|
3612
|
-
* ```ts
|
|
3613
|
-
* import { mergeMap, state } from "@graphrefly/graphrefly-ts";
|
|
3614
|
-
*
|
|
3615
|
-
* // Unbounded (default)
|
|
3616
|
-
* mergeMap(state(0), (n) => state((n as number) + 1));
|
|
3617
|
-
*
|
|
3618
|
-
* // Limited concurrency
|
|
3619
|
-
* mergeMap(state(0), (n) => state((n as number) + 1), { concurrent: 3 });
|
|
3620
|
-
* ```
|
|
3621
|
-
*
|
|
3622
|
-
* @category extra
|
|
3623
|
-
*/
|
|
3624
|
-
declare function mergeMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: MergeMapOptions): Node<R>;
|
|
3625
|
-
/**
|
|
3626
|
-
* RxJS-named alias for {@link mergeMap} — projects each `DATA` to an inner node and merges outputs.
|
|
3627
|
-
*
|
|
3628
|
-
* @param source - Upstream node.
|
|
3629
|
-
* @param project - Returns an inner `Node<R>` per value.
|
|
3630
|
-
* @param opts - Optional concurrency cap and node options (excluding `describeKind`).
|
|
3631
|
-
* @returns Merged projection; behavior matches `mergeMap`.
|
|
3632
|
-
*
|
|
3633
|
-
* @example
|
|
3634
|
-
* ```ts
|
|
3635
|
-
* import { flatMap, state } from "@graphrefly/graphrefly-ts";
|
|
3636
|
-
*
|
|
3637
|
-
* flatMap(state(0), (n) => state(n));
|
|
3638
|
-
* ```
|
|
3639
|
-
*
|
|
3640
|
-
* @category extra
|
|
3641
|
-
*/
|
|
3642
|
-
declare const flatMap: typeof mergeMap;
|
|
3643
|
-
/**
|
|
3644
|
-
* Delays phase-2 emissions by `ms` (timers). `DIRTY` still forwards immediately.
|
|
3645
|
-
*
|
|
3646
|
-
* @param source - Upstream node.
|
|
3647
|
-
* @param ms - Delay in milliseconds.
|
|
3648
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3649
|
-
* @returns `Node<T>` - Same values, shifted in time.
|
|
3650
|
-
* @example
|
|
3651
|
-
* ```ts
|
|
3652
|
-
* import { delay, state } from "@graphrefly/graphrefly-ts";
|
|
3653
|
-
*
|
|
3654
|
-
* delay(state(1), 100);
|
|
3655
|
-
* ```
|
|
3656
|
-
*
|
|
3657
|
-
* @category extra
|
|
3658
|
-
*/
|
|
3659
|
-
declare function delay<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T>;
|
|
3660
|
-
/**
|
|
3661
|
-
* Emits the latest value only after `ms` quiet time since the last trigger (`debounce`).
|
|
3662
|
-
*
|
|
3663
|
-
* @param source - Upstream node.
|
|
3664
|
-
* @param ms - Quiet window in milliseconds.
|
|
3665
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3666
|
-
* @returns `Node<T>` - Debounced stream.
|
|
3667
|
-
* @example
|
|
3668
|
-
* ```ts
|
|
3669
|
-
* import { debounce, state } from "@graphrefly/graphrefly-ts";
|
|
3670
|
-
*
|
|
3671
|
-
* debounce(state(0), 50);
|
|
3672
|
-
* ```
|
|
3673
|
-
*
|
|
3674
|
-
* @category extra
|
|
3675
|
-
*/
|
|
3676
|
-
declare function debounce<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T>;
|
|
3677
|
-
type ThrottleOptions = {
|
|
3678
|
-
leading?: boolean;
|
|
3679
|
-
trailing?: boolean;
|
|
3680
|
-
};
|
|
3681
|
-
/**
|
|
3682
|
-
* Rate-limits emissions to at most once per `ms` window (`throttleTime`).
|
|
3683
|
-
*
|
|
3684
|
-
* @param source - Upstream node.
|
|
3685
|
-
* @param ms - Minimum spacing in milliseconds.
|
|
3686
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`) plus `leading` / `trailing`.
|
|
3687
|
-
* @returns `Node<T>` - Throttled stream.
|
|
3688
|
-
* @example
|
|
3689
|
-
* ```ts
|
|
3690
|
-
* import { throttle, state } from "@graphrefly/graphrefly-ts";
|
|
3691
|
-
*
|
|
3692
|
-
* throttle(state(0), 1_000, { trailing: false });
|
|
3693
|
-
* ```
|
|
3694
|
-
*
|
|
3695
|
-
* @category extra
|
|
3696
|
-
*/
|
|
3697
|
-
declare function throttle<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1 & ThrottleOptions): Node<T>;
|
|
3698
|
-
/**
|
|
3699
|
-
* Emits the most recent source value whenever `notifier` emits `DATA` (`sample`).
|
|
3700
|
-
*
|
|
3701
|
-
* Source `COMPLETE` stops sampling (clears held value); notifier `COMPLETE` terminates the
|
|
3702
|
-
* operator. `ERROR` from either dep terminates immediately. At most one terminal message is
|
|
3703
|
-
* emitted downstream (latch). Supports `resubscribable` — `ctx.store` resets automatically.
|
|
3704
|
-
*
|
|
3705
|
-
* @param source - Node whose latest value is sampled.
|
|
3706
|
-
* @param notifier - When this node emits `DATA`, a sample is taken.
|
|
3707
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3708
|
-
* @returns `Node<T>` - Sampled snapshots of `source`.
|
|
3709
|
-
* @example
|
|
3710
|
-
* ```ts
|
|
3711
|
-
* import { sample, state } from "@graphrefly/graphrefly-ts";
|
|
3712
|
-
*
|
|
3713
|
-
* sample(state(1), state(0));
|
|
3714
|
-
* ```
|
|
3715
|
-
*
|
|
3716
|
-
* @category extra
|
|
3717
|
-
*/
|
|
3718
|
-
declare function sample<T>(source: Node<T>, notifier: Node<unknown>, opts?: ExtraOpts$1): Node<T>;
|
|
3719
|
-
/**
|
|
3720
|
-
* After each source `DATA`, waits `ms` then emits the latest value if another `DATA` has not arrived (`auditTime` / trailing window).
|
|
3721
|
-
*
|
|
3722
|
-
* @param source - Upstream node.
|
|
3723
|
-
* @param ms - Window in milliseconds after each `DATA`.
|
|
3724
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3725
|
-
* @returns `Node<T>` - Trailing-edge sampled stream.
|
|
3726
|
-
* @example
|
|
3727
|
-
* ```ts
|
|
3728
|
-
* import { audit, state } from "@graphrefly/graphrefly-ts";
|
|
3729
|
-
*
|
|
3730
|
-
* audit(state(0), 100);
|
|
3731
|
-
* ```
|
|
3732
|
-
*
|
|
3733
|
-
* @category extra
|
|
3734
|
-
*/
|
|
3735
|
-
declare function audit<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T>;
|
|
3736
|
-
/**
|
|
3737
|
-
* Buffers source `DATA` values; flushes an array when `notifier` settles (`buffer`).
|
|
3738
|
-
*
|
|
3739
|
-
* @param source - Upstream node.
|
|
3740
|
-
* @param notifier - Flush trigger on each settlement.
|
|
3741
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3742
|
-
* @returns `Node<T[]>` - Emits buffered arrays (may be empty-handled via `RESOLVED` when nothing buffered).
|
|
3743
|
-
* @example
|
|
3744
|
-
* ```ts
|
|
3745
|
-
* import { buffer, state } from "@graphrefly/graphrefly-ts";
|
|
3746
|
-
*
|
|
3747
|
-
* buffer(state(0), state(0));
|
|
3748
|
-
* ```
|
|
3749
|
-
*
|
|
3750
|
-
* @category extra
|
|
3751
|
-
*/
|
|
3752
|
-
declare function buffer<T>(source: Node<T>, notifier: Node<unknown>, opts?: ExtraOpts$1): Node<T[]>;
|
|
3753
|
-
/**
|
|
3754
|
-
* Batches consecutive `DATA` values into arrays of length `count` (`bufferCount` / `windowCount`).
|
|
3755
|
-
*
|
|
3756
|
-
* @param source - Upstream node.
|
|
3757
|
-
* @param count - Buffer size before emit; must be > 0.
|
|
3758
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3759
|
-
* @returns `Node<T[]>` - Emits fixed-size arrays; remainder flushes on `COMPLETE`.
|
|
3760
|
-
* @example
|
|
3761
|
-
* ```ts
|
|
3762
|
-
* import { bufferCount, state } from "@graphrefly/graphrefly-ts";
|
|
3763
|
-
*
|
|
3764
|
-
* bufferCount(state(0), 3);
|
|
3765
|
-
* ```
|
|
3766
|
-
*
|
|
3767
|
-
* @category extra
|
|
3768
|
-
*/
|
|
3769
|
-
declare function bufferCount<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T[]>;
|
|
3770
|
-
/**
|
|
3771
|
-
* Splits source `DATA` into sub-nodes of `count` values each. Each sub-node completes after `count` items or when source completes.
|
|
3772
|
-
*
|
|
3773
|
-
* @param source - Upstream node.
|
|
3774
|
-
* @param count - Items per window.
|
|
3775
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3776
|
-
* @returns `Node<Node<T>>` - Each emission is a sub-node carrying that window's values.
|
|
3777
|
-
*
|
|
3778
|
-
* @example
|
|
3779
|
-
* ```ts
|
|
3780
|
-
* import { windowCount, state } from "@graphrefly/graphrefly-ts";
|
|
3781
|
-
*
|
|
3782
|
-
* windowCount(state(0), 3);
|
|
3783
|
-
* ```
|
|
3784
|
-
*
|
|
3785
|
-
* @category extra
|
|
3786
|
-
*/
|
|
3787
|
-
declare function windowCount<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<Node<T>>;
|
|
3788
|
-
/**
|
|
3789
|
-
* Flushes buffered `DATA` values every `ms` (`bufferTime` / `windowTime`).
|
|
3790
|
-
*
|
|
3791
|
-
* @param source - Upstream node.
|
|
3792
|
-
* @param ms - Flush interval in milliseconds.
|
|
3793
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3794
|
-
* @returns `Node<T[]>` - Time-windowed batches.
|
|
3795
|
-
* @example
|
|
3796
|
-
* ```ts
|
|
3797
|
-
* import { bufferTime, state } from "@graphrefly/graphrefly-ts";
|
|
3798
|
-
*
|
|
3799
|
-
* bufferTime(state(0), 250);
|
|
3800
|
-
* ```
|
|
3801
|
-
*
|
|
3802
|
-
* @category extra
|
|
3803
|
-
*/
|
|
3804
|
-
declare function bufferTime<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T[]>;
|
|
3805
|
-
/**
|
|
3806
|
-
* Splits source `DATA` into time-windowed sub-nodes; each window lasts `ms`.
|
|
3807
|
-
*
|
|
3808
|
-
* @param source - Upstream node.
|
|
3809
|
-
* @param ms - Window duration in milliseconds.
|
|
3810
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3811
|
-
* @returns `Node<Node<T>>` - Each emission is a sub-node carrying that window's values.
|
|
3812
|
-
*
|
|
3813
|
-
* @example
|
|
3814
|
-
* ```ts
|
|
3815
|
-
* import { windowTime, state } from "@graphrefly/graphrefly-ts";
|
|
3816
|
-
*
|
|
3817
|
-
* windowTime(state(0), 500);
|
|
3818
|
-
* ```
|
|
3819
|
-
*
|
|
3820
|
-
* @category extra
|
|
3821
|
-
*/
|
|
3822
|
-
declare function windowTime<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<Node<T>>;
|
|
3823
|
-
/**
|
|
3824
|
-
* Splits source `DATA` into sub-nodes, opening a new window each time `notifier` emits `DATA`.
|
|
3825
|
-
*
|
|
3826
|
-
* @param source - Upstream node.
|
|
3827
|
-
* @param notifier - Each `DATA` from `notifier` closes the current window and opens a new one.
|
|
3828
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3829
|
-
* @returns `Node<Node<T>>` - Each emission is a sub-node carrying that window's values.
|
|
3830
|
-
*
|
|
3831
|
-
* @example
|
|
3832
|
-
* ```ts
|
|
3833
|
-
* import { state, window } from "@graphrefly/graphrefly-ts";
|
|
3834
|
-
*
|
|
3835
|
-
* window(state(0), state(0));
|
|
3836
|
-
* ```
|
|
3837
|
-
*
|
|
3838
|
-
* @category extra
|
|
3839
|
-
*/
|
|
3840
|
-
declare function window<T>(source: Node<T>, notifier: Node<unknown>, opts?: ExtraOpts$1): Node<Node<T>>;
|
|
3841
|
-
/**
|
|
3842
|
-
* Increments on each tick (`interval`); uses `setInterval` via {@link producer}.
|
|
3843
|
-
*
|
|
3844
|
-
* @param periodMs - Time between ticks.
|
|
3845
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3846
|
-
* @returns `Node<number>` - Emits `0`, `1`, `2`, … while subscribed.
|
|
3847
|
-
* @example
|
|
3848
|
-
* ```ts
|
|
3849
|
-
* import { interval } from "@graphrefly/graphrefly-ts";
|
|
3850
|
-
*
|
|
3851
|
-
* interval(1_000);
|
|
3852
|
-
* ```
|
|
3853
|
-
*
|
|
3854
|
-
* @category extra
|
|
3855
|
-
*/
|
|
3856
|
-
declare function interval(periodMs: number, opts?: ExtraOpts$1): Node<number>;
|
|
3857
|
-
/**
|
|
3858
|
-
* Subscribes to `source` repeatedly (`count` times, sequentially). Best with a fresh or `resubscribable` source.
|
|
3859
|
-
*
|
|
3860
|
-
* @param source - Upstream node to replay.
|
|
3861
|
-
* @param count - Number of subscription rounds.
|
|
3862
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3863
|
-
* @returns `Node<T>` - Forwards each round then completes after the last inner `COMPLETE`.
|
|
3864
|
-
* @example
|
|
3865
|
-
* ```ts
|
|
3866
|
-
* import { repeat, state } from "@graphrefly/graphrefly-ts";
|
|
3867
|
-
*
|
|
3868
|
-
* repeat(state(1, { resubscribable: true }), 2);
|
|
3869
|
-
* ```
|
|
3870
|
-
*
|
|
3871
|
-
* @category extra
|
|
3872
|
-
*/
|
|
3873
|
-
declare function repeat<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T>;
|
|
3874
|
-
/**
|
|
3875
|
-
* Identity passthrough — `pausable()` has been promoted to default node behavior in v5 (§4).
|
|
3876
|
-
*
|
|
3877
|
-
* @deprecated Default node behavior now handles PAUSE/RESUME. This operator is a no-op
|
|
3878
|
-
* identity passthrough kept only for migration compatibility.
|
|
3879
|
-
*
|
|
3880
|
-
* @param source - Upstream node.
|
|
3881
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3882
|
-
* @returns `Node<T>` - Pass-through (identity).
|
|
3883
|
-
* @example
|
|
3884
|
-
* ```ts
|
|
3885
|
-
* import { pausable, state } from "@graphrefly/graphrefly-ts";
|
|
3886
|
-
*
|
|
3887
|
-
* // No longer needed — default nodes handle PAUSE/RESUME.
|
|
3888
|
-
* const s = state(0);
|
|
3889
|
-
* pausable(s); // identity passthrough
|
|
3890
|
-
* ```
|
|
3891
|
-
*
|
|
3892
|
-
* @category extra
|
|
3893
|
-
*/
|
|
3894
|
-
declare function pausable<T>(source: Node<T>, opts?: ExtraOpts$1): Node<T>;
|
|
3895
|
-
/**
|
|
3896
|
-
* Replaces an upstream `ERROR` with a recovered value (`catchError`-style).
|
|
3897
|
-
*
|
|
3898
|
-
* @param source - Upstream node.
|
|
3899
|
-
* @param recover - Maps the error payload to a replacement value; if it throws, `ERROR` is forwarded.
|
|
3900
|
-
* @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
|
|
3901
|
-
* @returns `Node<T>` - Recovered stream.
|
|
3902
|
-
* @example
|
|
3903
|
-
* ```ts
|
|
3904
|
-
* import { rescue, state } from "@graphrefly/graphrefly-ts";
|
|
3905
|
-
*
|
|
3906
|
-
* rescue(state(0), () => 0);
|
|
3907
|
-
* ```
|
|
3908
|
-
*
|
|
3909
|
-
* @category extra
|
|
3910
|
-
*/
|
|
3911
|
-
declare function rescue<T>(source: Node<T>, recover: (err: unknown) => T, opts?: ExtraOpts$1): Node<T>;
|
|
3912
|
-
/**
|
|
3913
|
-
* Forwards upstream `DATA` only while `control.get()` is truthy; when closed, emits `RESOLVED`
|
|
3914
|
-
* instead of repeating the last value (value-level valve). For protocol pause/resume, use default
|
|
3915
|
-
* node PAUSE/RESUME behavior.
|
|
3916
|
-
*
|
|
3917
|
-
* @param source - Upstream value node.
|
|
3918
|
-
* @param control - Boolean node; when falsy, output stays "closed" for that tick.
|
|
3919
|
-
* @param opts - Optional node options (excluding `describeKind`).
|
|
3920
|
-
* @returns `Node<T>` gated by `control`.
|
|
3921
|
-
*
|
|
3922
|
-
* @example
|
|
3923
|
-
* ```ts
|
|
3924
|
-
* import { valve, state } from "@graphrefly/graphrefly-ts";
|
|
3925
|
-
*
|
|
3926
|
-
* const data = state(1);
|
|
3927
|
-
* const open = state(true);
|
|
3928
|
-
* valve(data, open);
|
|
3929
|
-
* ```
|
|
3930
|
-
*
|
|
3931
|
-
* @category extra
|
|
3932
|
-
*/
|
|
3933
|
-
declare function valve<T>(source: Node<T>, control: Node<boolean>, opts?: ExtraOpts$1): Node<T>;
|
|
3934
2263
|
/**
|
|
3935
|
-
*
|
|
3936
|
-
*
|
|
3937
|
-
* @param sources - Upstream nodes as separate arguments (same calling shape as `combine`).
|
|
3938
|
-
* @returns Combined node; signature matches `combine`.
|
|
3939
|
-
*
|
|
3940
|
-
* @example
|
|
3941
|
-
* ```ts
|
|
3942
|
-
* import { combineLatest, state } from "@graphrefly/graphrefly-ts";
|
|
3943
|
-
*
|
|
3944
|
-
* const n = combineLatest(state(1), state("a"));
|
|
3945
|
-
* ```
|
|
3946
|
-
*
|
|
3947
|
-
* @category extra
|
|
2264
|
+
* Minimal 5-field cron parser and matcher (minute hour day-of-month month day-of-week).
|
|
2265
|
+
* Ported from callbag-recharge `extra/cron.ts` for `fromCron` (roadmap §2.3).
|
|
3948
2266
|
*/
|
|
3949
|
-
|
|
2267
|
+
interface CronSchedule {
|
|
2268
|
+
minutes: Set<number>;
|
|
2269
|
+
hours: Set<number>;
|
|
2270
|
+
daysOfMonth: Set<number>;
|
|
2271
|
+
months: Set<number>;
|
|
2272
|
+
daysOfWeek: Set<number>;
|
|
2273
|
+
}
|
|
3950
2274
|
/**
|
|
3951
|
-
*
|
|
3952
|
-
*
|
|
3953
|
-
* @param source - Upstream node.
|
|
3954
|
-
* @param ms - Quiet period in milliseconds.
|
|
3955
|
-
* @param opts - Optional node options (excluding `describeKind`).
|
|
3956
|
-
* @returns Debounced node; behavior matches `debounce`.
|
|
3957
|
-
*
|
|
3958
|
-
* @example
|
|
3959
|
-
* ```ts
|
|
3960
|
-
* import { debounceTime, state } from "@graphrefly/graphrefly-ts";
|
|
3961
|
-
*
|
|
3962
|
-
* debounceTime(state(0), 100);
|
|
3963
|
-
* ```
|
|
2275
|
+
* Parses a standard 5-field cron expression into a {@link CronSchedule}.
|
|
3964
2276
|
*
|
|
3965
|
-
*
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
/**
|
|
3969
|
-
* RxJS-named alias for {@link throttle} — emits on leading/trailing edges within `ms`.
|
|
2277
|
+
* Supports `*`, ranges (`1-5`), steps (`*\/5`, `0-30/10`), and comma-separated
|
|
2278
|
+
* lists. Fields are: minute (0–59), hour (0–23), day-of-month (1–31),
|
|
2279
|
+
* month (1–12), day-of-week (0–6, Sunday = 0).
|
|
3970
2280
|
*
|
|
3971
|
-
* @param
|
|
3972
|
-
* @
|
|
3973
|
-
* @
|
|
3974
|
-
*
|
|
2281
|
+
* @param expr - Five-field whitespace-separated cron string (e.g. `"0 9 * * 1-5"`).
|
|
2282
|
+
* @returns Parsed {@link CronSchedule} with one `Set<number>` per field.
|
|
2283
|
+
* @throws Error when the expression does not have exactly 5 fields, contains
|
|
2284
|
+
* out-of-range values, or uses an invalid step.
|
|
3975
2285
|
*
|
|
3976
2286
|
* @example
|
|
3977
2287
|
* ```ts
|
|
3978
|
-
* import {
|
|
2288
|
+
* import { parseCron } from "@graphrefly/graphrefly-ts";
|
|
3979
2289
|
*
|
|
3980
|
-
*
|
|
2290
|
+
* const sched = parseCron("0 9 * * 1-5"); // weekdays at 09:00
|
|
2291
|
+
* sched.hours; // Set { 9 }
|
|
2292
|
+
* sched.daysOfWeek; // Set { 1, 2, 3, 4, 5 }
|
|
3981
2293
|
* ```
|
|
3982
|
-
*
|
|
3983
|
-
* @category extra
|
|
3984
2294
|
*/
|
|
3985
|
-
declare
|
|
2295
|
+
declare function parseCron(expr: string): CronSchedule;
|
|
3986
2296
|
/**
|
|
3987
|
-
*
|
|
2297
|
+
* Returns `true` if `date` satisfies every field of `schedule`.
|
|
3988
2298
|
*
|
|
3989
|
-
* @param
|
|
3990
|
-
* @param
|
|
3991
|
-
* @
|
|
3992
|
-
* @returns Recovered stream; behavior matches `rescue`.
|
|
2299
|
+
* @param schedule - Parsed schedule from {@link parseCron}.
|
|
2300
|
+
* @param date - Moment to test (local time via `getMinutes`, `getHours`, etc.).
|
|
2301
|
+
* @returns `true` when all five cron fields match the given date.
|
|
3993
2302
|
*
|
|
3994
2303
|
* @example
|
|
3995
2304
|
* ```ts
|
|
3996
|
-
* import {
|
|
2305
|
+
* import { parseCron, matchesCron } from "@graphrefly/graphrefly-ts";
|
|
3997
2306
|
*
|
|
3998
|
-
*
|
|
2307
|
+
* const sched = parseCron("30 8 * * 1"); // Mondays at 08:30
|
|
2308
|
+
* const monday = new Date("2026-03-30T08:30:00"); // a Monday
|
|
2309
|
+
* matchesCron(sched, monday); // true
|
|
3999
2310
|
* ```
|
|
4000
|
-
*
|
|
4001
|
-
* @category extra
|
|
4002
2311
|
*/
|
|
4003
|
-
declare
|
|
2312
|
+
declare function matchesCron(schedule: CronSchedule, date: Date): boolean;
|
|
4004
2313
|
|
|
4005
2314
|
/**
|
|
4006
2315
|
* Lazy per-topic state hub (roadmap §3.2) — lightweight last-value broadcasts.
|
|
@@ -4133,571 +2442,108 @@ interface PubSubHub {
|
|
|
4133
2442
|
*/
|
|
4134
2443
|
declare function pubsub(options?: PubSubHubOptions): PubSubHub;
|
|
4135
2444
|
|
|
4136
|
-
type IndexRow<K, V = unknown> = {
|
|
4137
|
-
readonly primary: K;
|
|
4138
|
-
readonly secondary: unknown;
|
|
4139
|
-
readonly value: V;
|
|
4140
|
-
};
|
|
4141
|
-
type ReactiveIndexOptions<K, V = unknown> = {
|
|
4142
|
-
/** Optional registry name for `describe()` / debugging. */
|
|
4143
|
-
name?: string;
|
|
4144
|
-
/**
|
|
4145
|
-
* Storage backend. Defaults to `NativeIndexBackend` (flat array + parallel `Map<K,IndexRow>`).
|
|
4146
|
-
* Users can plug in persistent / B-tree backends via the {@link IndexBackend} interface.
|
|
4147
|
-
*/
|
|
4148
|
-
backend?: IndexBackend<K, V>;
|
|
4149
|
-
/**
|
|
4150
|
-
* Optional versioning level for the underlying `ordered` state node. Set at
|
|
4151
|
-
* construction time; cannot be changed later. Pass `0` for V0 identity +
|
|
4152
|
-
* monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
4153
|
-
* (The `byPrimary` derived node inherits through the dep graph.)
|
|
4154
|
-
*/
|
|
4155
|
-
versioning?: VersioningLevel;
|
|
4156
|
-
/**
|
|
4157
|
-
* Default row-equality used to short-circuit idempotent upserts. When
|
|
4158
|
-
* provided, every `upsert` / `upsertMany` that finds an existing primary
|
|
4159
|
-
* compares the stored and candidate rows via `equals(existing, next)` —
|
|
4160
|
-
* on `true` the call is a no-op (no version bump, no emission). Per-call
|
|
4161
|
-
* `UpsertOptions.equals` overrides this default. Analogous to
|
|
4162
|
-
* `NodeOptions.equals` on the core `node()` primitive.
|
|
4163
|
-
*/
|
|
4164
|
-
equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
|
|
4165
|
-
};
|
|
4166
|
-
type ReactiveIndexBundle<K, V = unknown> = {
|
|
4167
|
-
/** Rows sorted by `(secondary, primary)`. */
|
|
4168
|
-
readonly ordered: Node<readonly IndexRow<K, V>[]>;
|
|
4169
|
-
/** Map from primary key to stored value. */
|
|
4170
|
-
readonly byPrimary: Node<ReadonlyMap<K, V>>;
|
|
4171
|
-
/** O(1) primary-key existence check. */
|
|
4172
|
-
has: (primary: K) => boolean;
|
|
4173
|
-
/** O(1) value lookup by primary key. */
|
|
4174
|
-
get: (primary: K) => V | undefined;
|
|
4175
|
-
/** Number of rows currently in the index (O(1)). */
|
|
4176
|
-
readonly size: number;
|
|
4177
|
-
/**
|
|
4178
|
-
* Upserts a row. When `opts.equals(existing, next)` returns `true` for an
|
|
4179
|
-
* existing primary key, the upsert is a no-op (no version bump, no emission).
|
|
4180
|
-
* Useful for idempotent writes.
|
|
4181
|
-
*
|
|
4182
|
-
* @returns `true` if a new row was inserted (primary key was absent),
|
|
4183
|
-
* `false` if the primary key was already present (updated in place OR
|
|
4184
|
-
* skipped idempotently via `opts.equals`). D5(a).
|
|
4185
|
-
*/
|
|
4186
|
-
upsert: (primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>) => boolean;
|
|
4187
|
-
/**
|
|
4188
|
-
* Bulk upsert — emits one snapshot for the whole batch. `opts.equals` applied
|
|
4189
|
-
* per-row. No-op if empty or all rows skipped.
|
|
4190
|
-
*
|
|
4191
|
-
* **Iterable consumption:** Consumes `rows` once (single-pass).
|
|
4192
|
-
*/
|
|
4193
|
-
upsertMany: (rows: Iterable<{
|
|
4194
|
-
primary: K;
|
|
4195
|
-
secondary: unknown;
|
|
4196
|
-
value: V;
|
|
4197
|
-
}>, opts?: UpsertOptions<K, V>) => void;
|
|
4198
|
-
delete: (primary: K) => void;
|
|
4199
|
-
/**
|
|
4200
|
-
* Bulk delete — emits one snapshot for the whole batch. No-op if nothing was removed.
|
|
4201
|
-
*
|
|
4202
|
-
* **Iterable consumption:** Consumes `primaries` once (single-pass).
|
|
4203
|
-
*/
|
|
4204
|
-
deleteMany: (primaries: Iterable<K>) => void;
|
|
4205
|
-
clear: () => void;
|
|
4206
|
-
/**
|
|
4207
|
-
* Releases internal keepalive subscriptions (on `byPrimary`) so the bundle
|
|
4208
|
-
* can be GC'd. Safe to call more than once (subsequent calls are no-ops).
|
|
4209
|
-
* Subsequent mutations after `dispose()` still execute on the backend but
|
|
4210
|
-
* `byPrimary` may stop updating if no external subscriber is attached.
|
|
4211
|
-
* D6(a).
|
|
4212
|
-
*/
|
|
4213
|
-
dispose: () => void;
|
|
4214
|
-
};
|
|
4215
|
-
/**
|
|
4216
|
-
* Storage contract for {@link reactiveIndex}. Implementations own the mutable state and
|
|
4217
|
-
* expose a monotonic `version` counter that increments on every structural change.
|
|
4218
|
-
*
|
|
4219
|
-
* The reactive layer reads `version` to decide when to emit; it does not inspect
|
|
4220
|
-
* internal representation. Users can plug in B-tree / skip-list / persistent backends
|
|
4221
|
-
* without touching the reactive emission logic.
|
|
4222
|
-
*
|
|
4223
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
4224
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
4225
|
-
* should treat all methods here as stable.
|
|
4226
|
-
*
|
|
4227
|
-
* @category extra
|
|
4228
|
-
*/
|
|
4229
|
-
/**
|
|
4230
|
-
* Optional per-call options for {@link IndexBackend.upsert} and bulk upsert.
|
|
4231
|
-
*
|
|
4232
|
-
* @category extra
|
|
4233
|
-
*/
|
|
4234
|
-
type UpsertOptions<K, V> = {
|
|
4235
|
-
/**
|
|
4236
|
-
* Skip the upsert if an existing row is considered equal to the proposed row.
|
|
4237
|
-
* Default: no skip — every upsert advances `version`. Provide for idempotent
|
|
4238
|
-
* keys (e.g., `(a, b) => a.secondary === b.secondary && a.value === b.value`).
|
|
4239
|
-
*/
|
|
4240
|
-
equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
|
|
4241
|
-
};
|
|
4242
|
-
interface IndexBackend<K, V = unknown> {
|
|
4243
|
-
/** Monotonic mutation counter; increments on every upsert/delete/clear that changes state. */
|
|
4244
|
-
readonly version: number;
|
|
4245
|
-
/** Number of rows currently stored. */
|
|
4246
|
-
readonly size: number;
|
|
4247
|
-
/** O(1) primary-key existence check. */
|
|
4248
|
-
has(primary: K): boolean;
|
|
4249
|
-
/** Value lookup by primary key. */
|
|
4250
|
-
get(primary: K): V | undefined;
|
|
4251
|
-
/**
|
|
4252
|
-
* Insert or replace a row. Returns `true` if a row was inserted (primary
|
|
4253
|
-
* didn't exist), `false` otherwise (updated OR skipped via `opts.equals`).
|
|
4254
|
-
*
|
|
4255
|
-
* **Atomicity contract:** Either fully succeeds or throws before any state
|
|
4256
|
-
* change; `version` advances only on state change.
|
|
4257
|
-
*/
|
|
4258
|
-
upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
|
|
4259
|
-
/**
|
|
4260
|
-
* Atomic bulk upsert. Returns the number of rows that caused a state change
|
|
4261
|
-
* (inserts + non-skipped updates). Advances `version` at most once.
|
|
4262
|
-
* No-op if iterable is empty or all rows skipped by `opts.equals`.
|
|
4263
|
-
*
|
|
4264
|
-
* **Consumes `rows` once** — pass an array for multi-shot consumers.
|
|
4265
|
-
*/
|
|
4266
|
-
upsertMany(rows: Iterable<{
|
|
4267
|
-
primary: K;
|
|
4268
|
-
secondary: unknown;
|
|
4269
|
-
value: V;
|
|
4270
|
-
}>, opts?: UpsertOptions<K, V>): number;
|
|
4271
|
-
/** Remove a row by primary key. Returns `true` if the row existed. Advances `version` only if true. */
|
|
4272
|
-
delete(primary: K): boolean;
|
|
4273
|
-
/**
|
|
4274
|
-
* Atomic bulk delete. Returns count removed. Advances `version` at most once.
|
|
4275
|
-
* No-op if no keys were present. Consumes `primaries` once.
|
|
4276
|
-
*/
|
|
4277
|
-
deleteMany(primaries: Iterable<K>): number;
|
|
4278
|
-
/** Remove all rows. Returns the number removed. Advances `version` only if non-zero. */
|
|
4279
|
-
clear(): number;
|
|
4280
|
-
/** Rows in sorted `(secondary, primary)` order — fresh snapshot suitable for emission. */
|
|
4281
|
-
toArray(): readonly IndexRow<K, V>[];
|
|
4282
|
-
/** Primary-key → value map — fresh snapshot. */
|
|
4283
|
-
toPrimaryMap(): ReadonlyMap<K, V>;
|
|
4284
|
-
}
|
|
4285
|
-
/**
|
|
4286
|
-
* Default flat-array backend. Maintains `buf: IndexRow[]` sorted by `(secondary, primary)`
|
|
4287
|
-
* and a parallel `Map<K, IndexRow>` for O(1) primary-key lookup.
|
|
4288
|
-
*
|
|
4289
|
-
* **Complexity:**
|
|
4290
|
-
* - `has`, `get`: O(1)
|
|
4291
|
-
* - `upsert`: up to 2× O(log n) bisect (locate old + locate new) + up to 2× O(n) splice (remove-old + insert-new) = O(n)
|
|
4292
|
-
* - `upsertMany(k rows)`: O(k log n) bisect + O(k·n) splice worst case; single version bump
|
|
4293
|
-
* - `delete`: O(log n) bisect + O(n) splice = O(n)
|
|
4294
|
-
* - `deleteMany(k keys)`: O(k log n) + O(k·n) splice worst case; single version bump
|
|
4295
|
-
* - `clear`: O(1)
|
|
4296
|
-
* - `toArray`, `toPrimaryMap`: O(n)
|
|
4297
|
-
*
|
|
4298
|
-
* @category extra
|
|
4299
|
-
*/
|
|
4300
|
-
declare class NativeIndexBackend<K, V = unknown> implements IndexBackend<K, V> {
|
|
4301
|
-
private _version;
|
|
4302
|
-
private readonly _buf;
|
|
4303
|
-
private readonly _byPrimary;
|
|
4304
|
-
get version(): number;
|
|
4305
|
-
get size(): number;
|
|
4306
|
-
has(primary: K): boolean;
|
|
4307
|
-
get(primary: K): V | undefined;
|
|
4308
|
-
upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
|
|
4309
|
-
upsertMany(rows: Iterable<{
|
|
4310
|
-
primary: K;
|
|
4311
|
-
secondary: unknown;
|
|
4312
|
-
value: V;
|
|
4313
|
-
}>, opts?: UpsertOptions<K, V>): number;
|
|
4314
|
-
delete(primary: K): boolean;
|
|
4315
|
-
deleteMany(primaries: Iterable<K>): number;
|
|
4316
|
-
clear(): number;
|
|
4317
|
-
toArray(): readonly IndexRow<K, V>[];
|
|
4318
|
-
toPrimaryMap(): ReadonlyMap<K, V>;
|
|
4319
|
-
}
|
|
4320
2445
|
/**
|
|
4321
|
-
*
|
|
2446
|
+
* `singleFromAny` — keyed promise/Node de-duplication ("singleflight").
|
|
4322
2447
|
*
|
|
4323
|
-
*
|
|
4324
|
-
*
|
|
4325
|
-
*
|
|
2448
|
+
* Given a `factory: (key) => NodeInput<T>`, returns a callable that dedupes
|
|
2449
|
+
* concurrent invocations sharing the same key — all callers with the same
|
|
2450
|
+
* key while a request is in-flight receive the same `Promise<T>`. Once the
|
|
2451
|
+
* underlying source settles (DATA, ERROR, or COMPLETE), the cache entry is
|
|
2452
|
+
* cleared so the next call re-invokes the factory.
|
|
4326
2453
|
*
|
|
4327
|
-
*
|
|
4328
|
-
*
|
|
4329
|
-
*
|
|
4330
|
-
*
|
|
2454
|
+
* This is the classic "singleflight" pattern from Go, generalised over the
|
|
2455
|
+
* library's `NodeInput<T>` bridge so callers can pass Promise-returning
|
|
2456
|
+
* factories, Node-returning factories, or plain value factories with
|
|
2457
|
+
* identical semantics.
|
|
4331
2458
|
*
|
|
4332
|
-
*
|
|
4333
|
-
*
|
|
4334
|
-
*
|
|
2459
|
+
* Use cases:
|
|
2460
|
+
* - `withReplayCache` cache-miss thundering-herd dedup
|
|
2461
|
+
* - Shared HTTP fetches keyed by URL
|
|
2462
|
+
* - Expensive compute keyed by request fingerprint
|
|
4335
2463
|
*
|
|
4336
2464
|
* @example
|
|
4337
2465
|
* ```ts
|
|
4338
|
-
*
|
|
4339
|
-
*
|
|
4340
|
-
* const
|
|
4341
|
-
* idx.upsert("id1", 10, "row-a");
|
|
4342
|
-
* idx.upsert("id2", 5, "row-b");
|
|
2466
|
+
* const fetchUser = singleFromAny<string, User>((id) => fetch(`/users/${id}`).then(r => r.json()));
|
|
2467
|
+
* // Two concurrent callers with id="42" → one underlying fetch, two Promises resolving to the same User.
|
|
2468
|
+
* const [a, b] = await Promise.all([fetchUser("42"), fetchUser("42")]);
|
|
4343
2469
|
* ```
|
|
4344
2470
|
*
|
|
4345
2471
|
* @category extra
|
|
4346
2472
|
*/
|
|
4347
|
-
declare function reactiveIndex<K, V = unknown>(options?: ReactiveIndexOptions<K, V>): ReactiveIndexBundle<K, V>;
|
|
4348
2473
|
|
|
4349
|
-
|
|
4350
|
-
name?: string;
|
|
2474
|
+
interface SingleFromAnyOptions<K> {
|
|
4351
2475
|
/**
|
|
4352
|
-
*
|
|
4353
|
-
*
|
|
2476
|
+
* Convert a typed key into a cache-string. Defaults to `String(key)`, which
|
|
2477
|
+
* works for primitive keys; callers with object keys should provide a
|
|
2478
|
+
* stable serializer (e.g., canonical JSON).
|
|
4354
2479
|
*/
|
|
4355
|
-
|
|
4356
|
-
/**
|
|
4357
|
-
* Optional versioning level for the underlying `items` state node. Set at
|
|
4358
|
-
* construction time; cannot be changed later. Pass `0` for V0 identity +
|
|
4359
|
-
* monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
4360
|
-
*/
|
|
4361
|
-
versioning?: VersioningLevel;
|
|
4362
|
-
};
|
|
4363
|
-
type ReactiveListBundle<T> = {
|
|
4364
|
-
/** Emits `readonly T[]` on each structural change (two-phase). */
|
|
4365
|
-
readonly items: Node<readonly T[]>;
|
|
4366
|
-
/** Current entry count (O(1)). */
|
|
4367
|
-
readonly size: number;
|
|
4368
|
-
/** Positional access (O(1)); supports negative indices (Python-style). Returns `undefined` on out-of-range. */
|
|
4369
|
-
at: (index: number) => T | undefined;
|
|
4370
|
-
append: (value: T) => void;
|
|
4371
|
-
/** Push all values, emit one snapshot. No-op if `values` is empty. */
|
|
4372
|
-
appendMany: (values: readonly T[]) => void;
|
|
4373
|
-
/** Insert a value at `index`. Throws `RangeError` on out-of-range. */
|
|
4374
|
-
insert: (index: number, value: T) => void;
|
|
4375
|
-
/** Insert all values at `index` as one bulk op; emits one snapshot. No-op if `values` is empty. */
|
|
4376
|
-
insertMany: (index: number, values: readonly T[]) => void;
|
|
4377
|
-
/** Remove and return the value at `index` (default: last). Negative indices Python-style. Throws on empty / out-of-range. */
|
|
4378
|
-
pop: (index?: number) => T;
|
|
4379
|
-
clear: () => void;
|
|
4380
|
-
/**
|
|
4381
|
-
* Releases any internal keepalive subscriptions so the bundle can be
|
|
4382
|
-
* GC'd. `reactiveList` currently holds none (no internal derived nodes),
|
|
4383
|
-
* so `dispose()` is a no-op today — exposed for API parity with
|
|
4384
|
-
* `reactiveIndex.dispose` / `reactiveMap.dispose` / `reactiveLog.dispose`.
|
|
4385
|
-
* Idempotent. D6(a).
|
|
4386
|
-
*/
|
|
4387
|
-
dispose: () => void;
|
|
4388
|
-
};
|
|
4389
|
-
/**
|
|
4390
|
-
* Storage contract for {@link reactiveList}. Implementations own the mutable state
|
|
4391
|
-
* and expose a monotonic `version` counter that increments on every structural change.
|
|
4392
|
-
*
|
|
4393
|
-
* The reactive layer reads `version` before and after each backend call; when it
|
|
4394
|
-
* advances, a snapshot is emitted.
|
|
4395
|
-
*
|
|
4396
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
4397
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
4398
|
-
* should treat all methods here as stable.
|
|
4399
|
-
*
|
|
4400
|
-
* @category extra
|
|
4401
|
-
*/
|
|
4402
|
-
interface ListBackend<T> {
|
|
4403
|
-
/** Monotonic mutation counter; increments on every structural change. */
|
|
4404
|
-
readonly version: number;
|
|
4405
|
-
/** Number of items currently stored. */
|
|
4406
|
-
readonly size: number;
|
|
4407
|
-
/** Positional access; `undefined` on out-of-range. */
|
|
4408
|
-
at(index: number): T | undefined;
|
|
4409
|
-
/** Append a single value. Advances `version`. */
|
|
4410
|
-
append(value: T): void;
|
|
4411
|
-
/** Append a batch. Advances `version` once. No-op if empty. */
|
|
4412
|
-
appendMany(values: readonly T[]): void;
|
|
4413
|
-
/** Insert at index; throws `RangeError` on out-of-range `0 <= index <= size`. Advances `version`. */
|
|
4414
|
-
insert(index: number, value: T): void;
|
|
4415
|
-
/** Bulk insert at index; throws on out-of-range. Advances `version` once. No-op if `values` empty. */
|
|
4416
|
-
insertMany(index: number, values: readonly T[]): void;
|
|
4417
|
-
/** Remove and return value at index; throws on empty / out-of-range. Advances `version`. */
|
|
4418
|
-
pop(index: number): T;
|
|
4419
|
-
/** Clear all entries. Returns count removed. Advances `version` only if non-zero. */
|
|
4420
|
-
clear(): number;
|
|
4421
|
-
/** Full snapshot as a fresh array. */
|
|
4422
|
-
toArray(): readonly T[];
|
|
2480
|
+
keyFn?: (key: K) => string;
|
|
4423
2481
|
}
|
|
4424
2482
|
/**
|
|
4425
|
-
*
|
|
2483
|
+
* Dedupe concurrent `factory(key)` invocations. Returns a bound callable.
|
|
4426
2484
|
*
|
|
4427
|
-
*
|
|
4428
|
-
* -
|
|
4429
|
-
*
|
|
4430
|
-
* - `appendMany(values)`, `insertMany(index, values)`: O(n + k) where k = values.length
|
|
4431
|
-
* - `insert`, `pop` (middle): O(n) due to splice
|
|
4432
|
-
* - `pop` (last): O(1)
|
|
4433
|
-
* - `clear`: O(1)
|
|
4434
|
-
* - `toArray`: O(n)
|
|
4435
|
-
*
|
|
4436
|
-
* @category extra
|
|
2485
|
+
* @param factory - Produces a `NodeInput<T>` for each unique key.
|
|
2486
|
+
* @param opts - Optional key-stringification.
|
|
2487
|
+
* @returns A function `(key: K) => Promise<T>` whose inflight results are shared per key.
|
|
4437
2488
|
*/
|
|
4438
|
-
declare
|
|
4439
|
-
private _version;
|
|
4440
|
-
private readonly _buf;
|
|
4441
|
-
constructor(initial?: readonly T[]);
|
|
4442
|
-
get version(): number;
|
|
4443
|
-
get size(): number;
|
|
4444
|
-
at(index: number): T | undefined;
|
|
4445
|
-
append(value: T): void;
|
|
4446
|
-
appendMany(values: readonly T[]): void;
|
|
4447
|
-
insert(index: number, value: T): void;
|
|
4448
|
-
insertMany(index: number, values: readonly T[]): void;
|
|
4449
|
-
pop(index: number): T;
|
|
4450
|
-
clear(): number;
|
|
4451
|
-
toArray(): readonly T[];
|
|
4452
|
-
}
|
|
2489
|
+
declare function singleFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Promise<T>;
|
|
4453
2490
|
/**
|
|
4454
|
-
*
|
|
4455
|
-
*
|
|
4456
|
-
*
|
|
4457
|
-
*
|
|
4458
|
-
*
|
|
4459
|
-
*
|
|
4460
|
-
*
|
|
4461
|
-
* @remarks
|
|
4462
|
-
* **No `maxSize`:** insert/pop-anywhere semantics make eviction-under-cap ambiguous.
|
|
4463
|
-
* For bounded append-heavy workloads use `reactiveLog` (head-trim is well-defined for
|
|
4464
|
-
* append-only).
|
|
2491
|
+
* Reactive variant: returns a bound callable that hands out `Node<T>` values.
|
|
2492
|
+
* All concurrent callers with the same key during an in-flight source share
|
|
2493
|
+
* the same Node. When the underlying source **terminally** settles (ERROR
|
|
2494
|
+
* or COMPLETE), the Node is removed from the cache so the next call
|
|
2495
|
+
* re-invokes `factory`. DATA is NOT terminal — callers subscribing after
|
|
2496
|
+
* the first DATA still receive the shared Node (and push-on-subscribe per
|
|
2497
|
+
* the spec's cached-DATA contract).
|
|
4465
2498
|
*
|
|
4466
|
-
*
|
|
4467
|
-
* supply a custom {@link ListBackend}. If you provide a `backend`, `initial` is ignored
|
|
4468
|
-
* — seed the backend directly.
|
|
4469
|
-
*
|
|
4470
|
-
* @example
|
|
4471
|
-
* ```ts
|
|
4472
|
-
* import { reactiveList } from "@graphrefly/graphrefly-ts";
|
|
4473
|
-
*
|
|
4474
|
-
* const list = reactiveList<string>(["a"], { name: "queue" });
|
|
4475
|
-
* list.append("b");
|
|
4476
|
-
* list.insertMany(1, ["x", "y"]);
|
|
4477
|
-
* ```
|
|
2499
|
+
* Use when downstream wants reactive subscription (not a one-shot Promise).
|
|
4478
2500
|
*
|
|
4479
2501
|
* @category extra
|
|
4480
2502
|
*/
|
|
4481
|
-
declare function
|
|
2503
|
+
declare function singleNodeFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Node<T>;
|
|
4482
2504
|
|
|
4483
|
-
type ReactiveLogOptions<T> = {
|
|
4484
|
-
name?: string;
|
|
4485
|
-
maxSize?: number;
|
|
4486
|
-
/**
|
|
4487
|
-
* Optional versioning level for the underlying `entries` state node. Set
|
|
4488
|
-
* at construction time; cannot be changed later. Pass `0` for V0 identity
|
|
4489
|
-
* + monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
4490
|
-
*/
|
|
4491
|
-
versioning?: VersioningLevel;
|
|
4492
|
-
/**
|
|
4493
|
-
* Storage backend. Defaults to `NativeLogBackend` (ring buffer if `maxSize` is set,
|
|
4494
|
-
* flat array otherwise). Users can plug in persistent / RRB-tree backends via
|
|
4495
|
-
* the {@link LogBackend} interface.
|
|
4496
|
-
*/
|
|
4497
|
-
backend?: LogBackend<T>;
|
|
4498
|
-
};
|
|
4499
|
-
type ReactiveLogBundle<T> = {
|
|
4500
|
-
/** Emits `readonly T[]` on each append/clear/trim (two-phase). */
|
|
4501
|
-
readonly entries: Node<readonly T[]>;
|
|
4502
|
-
/** Current entry count (O(1)). */
|
|
4503
|
-
readonly size: number;
|
|
4504
|
-
/** Positional access (O(1)); returns `undefined` on out-of-range. Supports negative indices (Python-style). */
|
|
4505
|
-
at: (index: number) => T | undefined;
|
|
4506
|
-
append: (value: T) => void;
|
|
4507
|
-
/**
|
|
4508
|
-
* Push all values, emit one snapshot. No-op if `values` is empty.
|
|
4509
|
-
* **Iterable consumption:** `values` is a `readonly T[]` — safe to pass arrays.
|
|
4510
|
-
*/
|
|
4511
|
-
appendMany: (values: readonly T[]) => void;
|
|
4512
|
-
clear: () => void;
|
|
4513
|
-
/** Remove the first `n` entries (clamped to `size`). Throws on non-integer or negative `n`. */
|
|
4514
|
-
trimHead: (n: number) => void;
|
|
4515
|
-
/**
|
|
4516
|
-
* Last `n` entries (or fewer) as a derived reactive view. Memoized with
|
|
4517
|
-
* an LRU cache (default cap 64) — repeat calls with the same `n` return
|
|
4518
|
-
* the same node. Throws on non-integer or negative `n`.
|
|
4519
|
-
*
|
|
4520
|
-
* **LRU eviction contract (D3(b)):** when a 65th distinct `n` is passed,
|
|
4521
|
-
* the least-recently-used cached view is evicted and its keepalive is
|
|
4522
|
-
* disposed. External holders of the evicted node will NOT receive further
|
|
4523
|
-
* updates — re-call `tail(n)` for a fresh node, or dispose proactively
|
|
4524
|
-
* via {@link disposeTail} / {@link disposeAllViews}. To avoid surprise:
|
|
4525
|
-
* resolve `tail(n)` at the point of use rather than caching the returned
|
|
4526
|
-
* node across many distinct `n`s.
|
|
4527
|
-
*/
|
|
4528
|
-
tail: (n: number) => Node<readonly T[]>;
|
|
4529
|
-
/**
|
|
4530
|
-
* Reactive view of `entries.slice(start, stop)` — non-negative integer
|
|
4531
|
-
* `start`, non-negative integer `stop` (exclusive) or `undefined` (to end).
|
|
4532
|
-
* Memoized with an LRU cache (default cap 64) — repeat calls with the
|
|
4533
|
-
* same `(start, stop)` return the same node.
|
|
4534
|
-
*
|
|
4535
|
-
* Throws on non-integer `start`, negative `start`, non-integer `stop`, or
|
|
4536
|
-
* negative `stop` (P4 — the backend cannot cheaply honor JS-style
|
|
4537
|
-
* negative `stop` without scanning length; disallowed for a consistent
|
|
4538
|
-
* contract between backend, derived recomputation, and cached initial).
|
|
4539
|
-
*
|
|
4540
|
-
* **LRU eviction contract (D3(b)):** same as {@link tail} — past 64
|
|
4541
|
-
* distinct `(start, stop)` pairs, the oldest cached view is evicted and
|
|
4542
|
-
* its keepalive disposed. External holders stop receiving updates.
|
|
4543
|
-
*/
|
|
4544
|
-
slice: (start: number, stop?: number) => Node<readonly T[]>;
|
|
4545
|
-
/**
|
|
4546
|
-
* Releases the cached `tail(n)` view if present (disposes its keepalive
|
|
4547
|
-
* subscription). Subsequent `tail(n)` calls create a fresh node. No-op if
|
|
4548
|
-
* `n` was not cached. Returns `true` if a view was disposed.
|
|
4549
|
-
*/
|
|
4550
|
-
disposeTail: (n: number) => boolean;
|
|
4551
|
-
/**
|
|
4552
|
-
* Releases the cached `slice(start, stop?)` view if present. No-op if not cached.
|
|
4553
|
-
*/
|
|
4554
|
-
disposeSlice: (start: number, stop?: number) => boolean;
|
|
4555
|
-
/** Releases all cached tail/slice views and their keepalive subscriptions. */
|
|
4556
|
-
disposeAllViews: () => void;
|
|
4557
|
-
/**
|
|
4558
|
-
* Releases all internal keepalive subscriptions so the bundle can be
|
|
4559
|
-
* GC'd — currently equivalent to {@link disposeAllViews}, but exposed as
|
|
4560
|
-
* a uniform API across all reactive data structures for lifecycle
|
|
4561
|
-
* symmetry (mirrors `reactiveMap.dispose` / `reactiveList.dispose` /
|
|
4562
|
-
* `reactiveIndex.dispose`). Idempotent. D6(a).
|
|
4563
|
-
*/
|
|
4564
|
-
dispose: () => void;
|
|
4565
|
-
};
|
|
4566
|
-
/**
|
|
4567
|
-
* Storage contract for {@link reactiveLog}. Implementations own the mutable state and
|
|
4568
|
-
* expose a monotonic `version` counter that increments on every structural change.
|
|
4569
|
-
*
|
|
4570
|
-
* The reactive layer reads `version` to decide when to emit; it does not inspect
|
|
4571
|
-
* internal representation. Users can plug in persistent / ring-buffer / skip-list
|
|
4572
|
-
* backends without touching the reactive emission logic.
|
|
4573
|
-
*
|
|
4574
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
4575
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
4576
|
-
* should treat all methods here as stable.
|
|
4577
|
-
*
|
|
4578
|
-
* @category extra
|
|
4579
|
-
*/
|
|
4580
|
-
interface LogBackend<T> {
|
|
4581
|
-
/** Monotonic mutation counter; increments on every append/trim/clear that changes state. */
|
|
4582
|
-
readonly version: number;
|
|
4583
|
-
/** Number of entries currently stored. */
|
|
4584
|
-
readonly size: number;
|
|
4585
|
-
/** O(1) positional access; returns `undefined` on out-of-range. */
|
|
4586
|
-
at(index: number): T | undefined;
|
|
4587
|
-
/** Append a value. Applies `maxSize` head-drop if configured. Advances `version`. */
|
|
4588
|
-
append(value: T): void;
|
|
4589
|
-
/** Append a batch; advances `version` once. No-op if `values.length === 0`. */
|
|
4590
|
-
appendMany(values: readonly T[]): void;
|
|
4591
|
-
/** Remove all entries. Returns count removed. Advances `version` only if non-zero. */
|
|
4592
|
-
clear(): number;
|
|
4593
|
-
/** Remove the first `n` entries (clamped). Returns count removed. Throws on negative `n`. */
|
|
4594
|
-
trimHead(n: number): number;
|
|
4595
|
-
/** Fresh snapshot array for `[start, stop)`. Throws on negative `start`. */
|
|
4596
|
-
slice(start: number, stop?: number): readonly T[];
|
|
4597
|
-
/** Last `n` entries as a fresh array. Throws on negative `n`. */
|
|
4598
|
-
tail(n: number): readonly T[];
|
|
4599
|
-
/** Full snapshot as a fresh array. */
|
|
4600
|
-
toArray(): readonly T[];
|
|
4601
|
-
}
|
|
4602
|
-
/**
|
|
4603
|
-
* Default append-only log backend.
|
|
4604
|
-
*
|
|
4605
|
-
* - When `maxSize` is set: uses a **ring buffer** with `_head` index and circular
|
|
4606
|
-
* modular arithmetic. Append and trim become O(1); snapshot is O(size) unrolling.
|
|
4607
|
-
* - When `maxSize` is unset: uses a flat array with standard push/splice.
|
|
4608
|
-
*
|
|
4609
|
-
* `appendMany` pre-trims oversize input: if `values.length > maxSize`, only the
|
|
4610
|
-
* tail of `values` is pushed (the rest would be immediately evicted).
|
|
4611
|
-
*
|
|
4612
|
-
* @category extra
|
|
4613
|
-
*/
|
|
4614
|
-
declare class NativeLogBackend<T> implements LogBackend<T> {
|
|
4615
|
-
private _version;
|
|
4616
|
-
private readonly _maxSize?;
|
|
4617
|
-
private readonly _buf;
|
|
4618
|
-
private _head;
|
|
4619
|
-
private _size;
|
|
4620
|
-
constructor(initial?: readonly T[], maxSize?: number);
|
|
4621
|
-
get version(): number;
|
|
4622
|
-
get size(): number;
|
|
4623
|
-
at(index: number): T | undefined;
|
|
4624
|
-
append(value: T): void;
|
|
4625
|
-
appendMany(values: readonly T[]): void;
|
|
4626
|
-
clear(): number;
|
|
4627
|
-
trimHead(n: number): number;
|
|
4628
|
-
slice(start: number, stop?: number): readonly T[];
|
|
4629
|
-
tail(n: number): readonly T[];
|
|
4630
|
-
toArray(): readonly T[];
|
|
4631
|
-
/** Internal append without version bump — used by `appendMany`. */
|
|
4632
|
-
private _rawAppend;
|
|
4633
|
-
}
|
|
4634
2505
|
/**
|
|
4635
|
-
*
|
|
2506
|
+
* stratify — reactive branch routing over a classifier rule set.
|
|
4636
2507
|
*
|
|
4637
|
-
*
|
|
4638
|
-
*
|
|
4639
|
-
*
|
|
4640
|
-
*
|
|
2508
|
+
* Protocol-level primitive (no domain assumptions) that routes a source value
|
|
2509
|
+
* to independent branch subgraphs. Rules are reactive — update the `"rules"`
|
|
2510
|
+
* state node to rewrite classification at runtime. Rule updates affect
|
|
2511
|
+
* **future items only** (streaming semantics, not retroactive).
|
|
4641
2512
|
*
|
|
4642
|
-
* @
|
|
4643
|
-
* **Backend:** The default {@link NativeLogBackend} uses a ring buffer when `maxSize`
|
|
4644
|
-
* is set (O(1) append + trim) and a flat array otherwise. For persistent/structural-
|
|
4645
|
-
* sharing semantics plug in a custom {@link LogBackend}.
|
|
4646
|
-
*
|
|
4647
|
-
* **`initial` + custom `backend` (F5):** When you supply `options.backend`, the
|
|
4648
|
-
* `initial` argument is IGNORED — seed the backend yourself before passing it in.
|
|
4649
|
-
* The `initial` seed only applies to the default `NativeLogBackend`.
|
|
4650
|
-
*
|
|
4651
|
-
* **Memoized views:** {@link ReactiveLogBundle.tail} and {@link ReactiveLogBundle.slice}
|
|
4652
|
-
* cache derived nodes per-argument. Repeat calls with the same `n` / `(start, stop)`
|
|
4653
|
-
* return the same node, bounding keepalive-subscription count to one per unique argument.
|
|
4654
|
-
*
|
|
4655
|
-
* @example
|
|
4656
|
-
* ```ts
|
|
4657
|
-
* import { reactiveLog } from "@graphrefly/graphrefly-ts";
|
|
4658
|
-
*
|
|
4659
|
-
* const lg = reactiveLog<number>([1, 2], { name: "audit", maxSize: 100 });
|
|
4660
|
-
* lg.append(3);
|
|
4661
|
-
* lg.entries.subscribe((msgs) => console.log(msgs));
|
|
4662
|
-
* const last5 = lg.tail(5); // derived node
|
|
4663
|
-
* const window = lg.slice(10, 20); // derived node
|
|
4664
|
-
* ```
|
|
4665
|
-
*
|
|
4666
|
-
* @category extra
|
|
4667
|
-
*/
|
|
4668
|
-
declare function reactiveLog<T>(initial?: readonly T[], options?: ReactiveLogOptions<T>): ReactiveLogBundle<T>;
|
|
4669
|
-
|
|
4670
|
-
/**
|
|
4671
|
-
* Filesystem-watching source. Isolated from `./sources.ts` so bundlers
|
|
4672
|
-
* targeting the browser can import browser-safe sources (`fromTimer`,
|
|
4673
|
-
* `fromRaf`, etc.) without pulling in `node:fs`/`node:path`.
|
|
2513
|
+
* @module
|
|
4674
2514
|
*/
|
|
4675
2515
|
|
|
4676
|
-
|
|
4677
|
-
type
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
dest_path?: string;
|
|
4685
|
-
timestamp_ns: number;
|
|
2516
|
+
/** A single routing rule for {@link stratify}. */
|
|
2517
|
+
type StratifyRule<T> = {
|
|
2518
|
+
/** Branch name (used as node name under `branch/<name>`). */
|
|
2519
|
+
name: string;
|
|
2520
|
+
/** Classifier: returns `true` if the value belongs to this branch. */
|
|
2521
|
+
classify: (value: T) => boolean;
|
|
2522
|
+
/** Optional operator chain applied to the branch after classification. */
|
|
2523
|
+
ops?: (n: Node<T>) => Node;
|
|
4686
2524
|
};
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
include?: string[];
|
|
4691
|
-
exclude?: string[];
|
|
2525
|
+
/** Options for {@link stratify}. */
|
|
2526
|
+
type StratifyOptions = GraphOptions & {
|
|
2527
|
+
meta?: Record<string, unknown>;
|
|
4692
2528
|
};
|
|
4693
2529
|
/**
|
|
4694
|
-
*
|
|
2530
|
+
* Route input to different branches based on classifier functions.
|
|
2531
|
+
*
|
|
2532
|
+
* Each branch gets an independent operator chain. Branch nodes are structural —
|
|
2533
|
+
* created at construction time and persist for the graph's lifetime. If a rule
|
|
2534
|
+
* name is removed from the rules array, the corresponding branch silently
|
|
2535
|
+
* drops items (classifier not found). To tear down a dead branch, call
|
|
2536
|
+
* `graph.remove("branch/<name>")`.
|
|
4695
2537
|
*
|
|
4696
|
-
*
|
|
2538
|
+
* @param name - Graph name.
|
|
2539
|
+
* @param source - Input node (registered as `"source"`).
|
|
2540
|
+
* @param rules - Initial routing rules.
|
|
2541
|
+
* @param opts - Optional graph/meta options.
|
|
2542
|
+
* @returns Graph with `"source"`, `"rules"`, and `"branch/<name>"` nodes.
|
|
4697
2543
|
*
|
|
4698
2544
|
* @category extra
|
|
4699
2545
|
*/
|
|
4700
|
-
declare function
|
|
2546
|
+
declare function stratify<T>(name: string, source: Node<T>, rules: ReadonlyArray<StratifyRule<T>>, opts?: StratifyOptions): Graph;
|
|
4701
2547
|
|
|
4702
2548
|
/**
|
|
4703
2549
|
* Creates a resettable deadline timer for internal timeout, retry, and rate-limiting use.
|
|
@@ -4945,8 +2791,8 @@ declare function workerSelf<TImport extends readonly string[]>(target: unknown |
|
|
|
4945
2791
|
type index_AckableMessage<T> = AckableMessage<T>;
|
|
4946
2792
|
type index_AdapterHandlers<T> = AdapterHandlers<T>;
|
|
4947
2793
|
declare const index_AsyncSourceOpts: typeof AsyncSourceOpts;
|
|
4948
|
-
|
|
4949
|
-
|
|
2794
|
+
declare const index_BackoffPreset: typeof BackoffPreset;
|
|
2795
|
+
declare const index_BackoffStrategy: typeof BackoffStrategy;
|
|
4950
2796
|
type index_BatchMessage = BatchMessage;
|
|
4951
2797
|
type index_BridgeMessage = BridgeMessage;
|
|
4952
2798
|
type index_BufferedSinkHandle = BufferedSinkHandle;
|
|
@@ -4957,35 +2803,30 @@ type index_CascadingCache<V> = CascadingCache<V>;
|
|
|
4957
2803
|
type index_CascadingCacheOptions = CascadingCacheOptions;
|
|
4958
2804
|
type index_CheckpointToRedisOptions = CheckpointToRedisOptions;
|
|
4959
2805
|
type index_CheckpointToS3Options = CheckpointToS3Options;
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
type index_CircuitOpenError = CircuitOpenError;
|
|
2806
|
+
declare const index_CircuitBreaker: typeof CircuitBreaker;
|
|
2807
|
+
declare const index_CircuitBreakerOptions: typeof CircuitBreakerOptions;
|
|
4963
2808
|
declare const index_CircuitOpenError: typeof CircuitOpenError;
|
|
4964
|
-
|
|
2809
|
+
declare const index_CircuitState: typeof CircuitState;
|
|
4965
2810
|
type index_ClickHouseClientLike = ClickHouseClientLike;
|
|
4966
2811
|
type index_ClickHouseInsertClientLike = ClickHouseInsertClientLike;
|
|
4967
2812
|
type index_ClickHouseRow = ClickHouseRow;
|
|
4968
2813
|
type index_CronSchedule = CronSchedule;
|
|
4969
|
-
|
|
4970
|
-
|
|
2814
|
+
declare const index_DistillBundle: typeof DistillBundle;
|
|
2815
|
+
declare const index_DistillOptions: typeof DistillOptions;
|
|
4971
2816
|
type index_DrizzleQueryLike<T = unknown> = DrizzleQueryLike<T>;
|
|
4972
2817
|
type index_EmitTriad<T> = EmitTriad<T>;
|
|
4973
2818
|
type index_ErrorMessage = ErrorMessage;
|
|
4974
2819
|
declare const index_EventTargetLike: typeof EventTargetLike;
|
|
4975
|
-
|
|
2820
|
+
declare const index_ExponentialBackoffOptions: typeof ExponentialBackoffOptions;
|
|
4976
2821
|
type index_ExternalBundleOptions<TChannels extends Record<string, unknown>> = ExternalBundleOptions<TChannels>;
|
|
4977
2822
|
type index_ExternalRegister<H> = ExternalRegister<H>;
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
type index_FSEventType = FSEventType;
|
|
4981
|
-
type index_FallbackInput<T> = FallbackInput<T>;
|
|
2823
|
+
declare const index_Extraction: typeof Extraction;
|
|
2824
|
+
declare const index_FallbackInput: typeof FallbackInput;
|
|
4982
2825
|
type index_FileWriterLike = FileWriterLike;
|
|
4983
2826
|
type index_FromCSVOptions = FromCSVOptions;
|
|
4984
2827
|
type index_FromClickHouseWatchOptions = FromClickHouseWatchOptions;
|
|
4985
2828
|
declare const index_FromCronOptions: typeof FromCronOptions;
|
|
4986
2829
|
type index_FromDrizzleOptions<T, U = T> = FromDrizzleOptions<T, U>;
|
|
4987
|
-
type index_FromFSWatchOptions = FromFSWatchOptions;
|
|
4988
|
-
type index_FromGitHookOptions = FromGitHookOptions;
|
|
4989
2830
|
type index_FromHTTPOptions = FromHTTPOptions;
|
|
4990
2831
|
type index_FromHTTPPollOptions = FromHTTPPollOptions;
|
|
4991
2832
|
type index_FromHTTPStreamOptions = FromHTTPStreamOptions;
|
|
@@ -5005,40 +2846,33 @@ type index_FromSqliteOptions<T> = FromSqliteOptions<T>;
|
|
|
5005
2846
|
type index_FromStatsDOptions = FromStatsDOptions;
|
|
5006
2847
|
type index_FromSyslogOptions = FromSyslogOptions;
|
|
5007
2848
|
type index_FromWebSocketReconnectOptions<T> = FromWebSocketReconnectOptions<T>;
|
|
5008
|
-
type index_GitEvent = GitEvent;
|
|
5009
|
-
type index_GitHookType = GitHookType;
|
|
5010
2849
|
type index_HTTPBundle<T> = HTTPBundle<T>;
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
declare const index_IndexedDbStorageSpec: typeof IndexedDbStorageSpec;
|
|
2850
|
+
declare const index_IndexBackend: typeof IndexBackend;
|
|
2851
|
+
declare const index_IndexRow: typeof IndexRow;
|
|
5014
2852
|
type index_InitMessage = InitMessage;
|
|
5015
|
-
|
|
2853
|
+
declare const index_JitterMode: typeof JitterMode;
|
|
5016
2854
|
type index_KafkaConsumerLike = KafkaConsumerLike;
|
|
5017
2855
|
type index_KafkaMessage<T = unknown> = KafkaMessage<T>;
|
|
5018
2856
|
type index_KafkaProducerLike = KafkaProducerLike;
|
|
5019
2857
|
type index_KyselyQueryLike<T = unknown> = KyselyQueryLike<T>;
|
|
5020
|
-
|
|
5021
|
-
|
|
2858
|
+
declare const index_ListBackend: typeof ListBackend;
|
|
2859
|
+
declare const index_LogBackend: typeof LogBackend;
|
|
5022
2860
|
type index_LokiClientLike = LokiClientLike;
|
|
5023
2861
|
type index_LokiStream = LokiStream;
|
|
5024
2862
|
type index_MCPClientLike = MCPClientLike;
|
|
5025
|
-
|
|
5026
|
-
|
|
2863
|
+
declare const index_MapBackend: typeof MapBackend;
|
|
2864
|
+
declare const index_MergeMapOptions: typeof MergeMapOptions;
|
|
5027
2865
|
type index_MongoCollectionLike = MongoCollectionLike;
|
|
5028
2866
|
type index_NATSClientLike = NATSClientLike;
|
|
5029
2867
|
type index_NATSMessage<T = unknown> = NATSMessage<T>;
|
|
5030
2868
|
type index_NATSSubscriptionLike = NATSSubscriptionLike;
|
|
5031
2869
|
declare const index_NS_PER_MS: typeof NS_PER_MS;
|
|
5032
2870
|
declare const index_NS_PER_SEC: typeof NS_PER_SEC;
|
|
5033
|
-
type index_NativeIndexBackend<K, V = unknown> = NativeIndexBackend<K, V>;
|
|
5034
2871
|
declare const index_NativeIndexBackend: typeof NativeIndexBackend;
|
|
5035
|
-
type index_NativeListBackend<T> = NativeListBackend<T>;
|
|
5036
2872
|
declare const index_NativeListBackend: typeof NativeListBackend;
|
|
5037
|
-
type index_NativeLogBackend<T> = NativeLogBackend<T>;
|
|
5038
2873
|
declare const index_NativeLogBackend: typeof NativeLogBackend;
|
|
5039
|
-
type index_NativeMapBackend<K, V> = NativeMapBackend<K, V>;
|
|
5040
2874
|
declare const index_NativeMapBackend: typeof NativeMapBackend;
|
|
5041
|
-
|
|
2875
|
+
declare const index_NativeMapBackendOptions: typeof NativeMapBackendOptions;
|
|
5042
2876
|
type index_NativePubSubBackend = NativePubSubBackend;
|
|
5043
2877
|
declare const index_NativePubSubBackend: typeof NativePubSubBackend;
|
|
5044
2878
|
declare const index_NodeInput: typeof NodeInput;
|
|
@@ -5058,19 +2892,18 @@ type index_PulsarMessage<T = unknown> = PulsarMessage<T>;
|
|
|
5058
2892
|
type index_PulsarProducerLike = PulsarProducerLike;
|
|
5059
2893
|
type index_RabbitMQChannelLike = RabbitMQChannelLike;
|
|
5060
2894
|
type index_RabbitMQMessage<T = unknown> = RabbitMQMessage<T>;
|
|
5061
|
-
|
|
5062
|
-
type index_RateLimiterOverflowError = RateLimiterOverflowError;
|
|
2895
|
+
declare const index_RateLimiterOptions: typeof RateLimiterOptions;
|
|
5063
2896
|
declare const index_RateLimiterOverflowError: typeof RateLimiterOverflowError;
|
|
5064
|
-
|
|
2897
|
+
declare const index_RateLimiterOverflowPolicy: typeof RateLimiterOverflowPolicy;
|
|
5065
2898
|
declare const index_ReactiveCounterBundle: typeof ReactiveCounterBundle;
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
2899
|
+
declare const index_ReactiveIndexBundle: typeof ReactiveIndexBundle;
|
|
2900
|
+
declare const index_ReactiveIndexOptions: typeof ReactiveIndexOptions;
|
|
2901
|
+
declare const index_ReactiveListBundle: typeof ReactiveListBundle;
|
|
2902
|
+
declare const index_ReactiveListOptions: typeof ReactiveListOptions;
|
|
2903
|
+
declare const index_ReactiveLogBundle: typeof ReactiveLogBundle;
|
|
2904
|
+
declare const index_ReactiveLogOptions: typeof ReactiveLogOptions;
|
|
2905
|
+
declare const index_ReactiveMapBundle: typeof ReactiveMapBundle;
|
|
2906
|
+
declare const index_ReactiveMapOptions: typeof ReactiveMapOptions;
|
|
5074
2907
|
type index_ReactiveSinkBackpressureOptions = ReactiveSinkBackpressureOptions;
|
|
5075
2908
|
type index_ReactiveSinkConfig<T, Ctx = unknown> = ReactiveSinkConfig<T, Ctx>;
|
|
5076
2909
|
type index_ReactiveSinkHandle<T> = ReactiveSinkHandle<T>;
|
|
@@ -5082,11 +2915,12 @@ type index_RedisClientLike = RedisClientLike;
|
|
|
5082
2915
|
type index_RedisStreamEntry<T = unknown> = RedisStreamEntry<T>;
|
|
5083
2916
|
type index_ResettableTimer = ResettableTimer;
|
|
5084
2917
|
declare const index_ResettableTimer: typeof ResettableTimer;
|
|
5085
|
-
|
|
5086
|
-
|
|
2918
|
+
declare const index_RetryOptions: typeof RetryOptions;
|
|
2919
|
+
declare const index_RetrySourceOptions: typeof RetrySourceOptions;
|
|
5087
2920
|
type index_S3ClientLike = S3ClientLike;
|
|
5088
2921
|
type index_SSEEvent<T = string> = SSEEvent<T>;
|
|
5089
2922
|
type index_SignalMessage = SignalMessage;
|
|
2923
|
+
type index_SingleFromAnyOptions<K> = SingleFromAnyOptions<K>;
|
|
5090
2924
|
type index_SinkFailure<T> = SinkFailure<T>;
|
|
5091
2925
|
type index_SinkHandle = SinkHandle;
|
|
5092
2926
|
type index_SinkTransportError = SinkTransportError;
|
|
@@ -5094,15 +2928,16 @@ type index_SqliteDbLike = SqliteDbLike;
|
|
|
5094
2928
|
type index_SqliteIterableDbLike = SqliteIterableDbLike;
|
|
5095
2929
|
type index_StatsDMetric = StatsDMetric;
|
|
5096
2930
|
type index_StatsDRegister = StatsDRegister;
|
|
5097
|
-
|
|
2931
|
+
declare const index_StatusValue: typeof StatusValue;
|
|
5098
2932
|
declare const index_StorageHandle: typeof StorageHandle;
|
|
5099
2933
|
declare const index_StorageTier: typeof StorageTier;
|
|
2934
|
+
type index_StratifyOptions = StratifyOptions;
|
|
2935
|
+
type index_StratifyRule<T> = StratifyRule<T>;
|
|
5100
2936
|
type index_SyslogMessage = SyslogMessage;
|
|
5101
2937
|
type index_SyslogRegister = SyslogRegister;
|
|
5102
|
-
|
|
2938
|
+
declare const index_TapObserver: typeof TapObserver;
|
|
5103
2939
|
type index_TempoClientLike = TempoClientLike;
|
|
5104
|
-
|
|
5105
|
-
type index_TimeoutError = TimeoutError;
|
|
2940
|
+
declare const index_ThrottleOptions: typeof ThrottleOptions;
|
|
5106
2941
|
declare const index_TimeoutError: typeof TimeoutError;
|
|
5107
2942
|
type index_ToCSVOptions<T> = ToCSVOptions<T>;
|
|
5108
2943
|
type index_ToClickHouseOptions<T> = ToClickHouseOptions<T>;
|
|
@@ -5122,26 +2957,27 @@ type index_ToSSEOptions = ToSSEOptions;
|
|
|
5122
2957
|
type index_ToSqliteOptions<T> = ToSqliteOptions<T>;
|
|
5123
2958
|
type index_ToTempoOptions<T> = ToTempoOptions<T>;
|
|
5124
2959
|
type index_ToWebSocketOptions<T> = ToWebSocketOptions<T>;
|
|
5125
|
-
|
|
5126
|
-
|
|
2960
|
+
declare const index_TokenBucket: typeof TokenBucket;
|
|
2961
|
+
declare const index_UpsertOptions: typeof UpsertOptions;
|
|
5127
2962
|
type index_ValueMessage = ValueMessage;
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
2963
|
+
declare const index_VerifiableBundle: typeof VerifiableBundle;
|
|
2964
|
+
declare const index_VerifiableOptions: typeof VerifiableOptions;
|
|
2965
|
+
declare const index_VerifyValue: typeof VerifyValue;
|
|
5131
2966
|
type index_WatermarkController = WatermarkController;
|
|
5132
2967
|
type index_WatermarkOptions = WatermarkOptions;
|
|
5133
2968
|
type index_WebSocketLike = WebSocketLike;
|
|
5134
2969
|
type index_WebSocketMessageEventLike = WebSocketMessageEventLike;
|
|
5135
2970
|
type index_WebSocketRegister<T> = WebSocketRegister<T>;
|
|
5136
2971
|
type index_WebhookRegister<T> = WebhookRegister<T>;
|
|
5137
|
-
|
|
5138
|
-
|
|
2972
|
+
declare const index_WithBreakerBundle: typeof WithBreakerBundle;
|
|
2973
|
+
declare const index_WithStatusBundle: typeof WithStatusBundle;
|
|
5139
2974
|
type index_WorkerBridge<_TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> = WorkerBridge<_TExpose, TImport>;
|
|
5140
2975
|
type index_WorkerBridgeOptions<TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> = WorkerBridgeOptions<TExpose, TImport>;
|
|
5141
2976
|
type index_WorkerSelfHandle = WorkerSelfHandle;
|
|
5142
2977
|
type index_WorkerSelfOptions<TImport extends readonly string[]> = WorkerSelfOptions<TImport>;
|
|
5143
2978
|
type index_WorkerTransport = WorkerTransport;
|
|
5144
2979
|
declare const index_audit: typeof audit;
|
|
2980
|
+
declare const index_awaitSettled: typeof awaitSettled;
|
|
5145
2981
|
declare const index_buffer: typeof buffer;
|
|
5146
2982
|
declare const index_bufferCount: typeof bufferCount;
|
|
5147
2983
|
declare const index_bufferTime: typeof bufferTime;
|
|
@@ -5176,7 +3012,6 @@ declare const index_externalBundle: typeof externalBundle;
|
|
|
5176
3012
|
declare const index_externalProducer: typeof externalProducer;
|
|
5177
3013
|
declare const index_fallback: typeof fallback;
|
|
5178
3014
|
declare const index_fibonacci: typeof fibonacci;
|
|
5179
|
-
declare const index_fileStorage: typeof fileStorage;
|
|
5180
3015
|
declare const index_filter: typeof filter;
|
|
5181
3016
|
declare const index_find: typeof find;
|
|
5182
3017
|
declare const index_first: typeof first;
|
|
@@ -5191,13 +3026,9 @@ declare const index_fromClickHouseWatch: typeof fromClickHouseWatch;
|
|
|
5191
3026
|
declare const index_fromCron: typeof fromCron;
|
|
5192
3027
|
declare const index_fromDrizzle: typeof fromDrizzle;
|
|
5193
3028
|
declare const index_fromEvent: typeof fromEvent;
|
|
5194
|
-
declare const index_fromFSWatch: typeof fromFSWatch;
|
|
5195
|
-
declare const index_fromGitHook: typeof fromGitHook;
|
|
5196
3029
|
declare const index_fromHTTP: typeof fromHTTP;
|
|
5197
3030
|
declare const index_fromHTTPPoll: typeof fromHTTPPoll;
|
|
5198
3031
|
declare const index_fromHTTPStream: typeof fromHTTPStream;
|
|
5199
|
-
declare const index_fromIDBRequest: typeof fromIDBRequest;
|
|
5200
|
-
declare const index_fromIDBTransaction: typeof fromIDBTransaction;
|
|
5201
3032
|
declare const index_fromIter: typeof fromIter;
|
|
5202
3033
|
declare const index_fromKafka: typeof fromKafka;
|
|
5203
3034
|
declare const index_fromKysely: typeof fromKysely;
|
|
@@ -5222,7 +3053,6 @@ declare const index_fromWebSocket: typeof fromWebSocket;
|
|
|
5222
3053
|
declare const index_fromWebSocketReconnect: typeof fromWebSocketReconnect;
|
|
5223
3054
|
declare const index_fromWebhook: typeof fromWebhook;
|
|
5224
3055
|
declare const index_globToRegExp: typeof globToRegExp;
|
|
5225
|
-
declare const index_indexedDbStorage: typeof indexedDbStorage;
|
|
5226
3056
|
declare const index_interval: typeof interval;
|
|
5227
3057
|
declare const index_keepalive: typeof keepalive;
|
|
5228
3058
|
declare const index_last: typeof last;
|
|
@@ -5266,8 +3096,12 @@ declare const index_serializeError: typeof serializeError;
|
|
|
5266
3096
|
declare const index_share: typeof share;
|
|
5267
3097
|
declare const index_shareReplay: typeof shareReplay;
|
|
5268
3098
|
declare const index_signalToName: typeof signalToName;
|
|
3099
|
+
declare const index_singleFromAny: typeof singleFromAny;
|
|
3100
|
+
declare const index_singleNodeFromAny: typeof singleNodeFromAny;
|
|
5269
3101
|
declare const index_skip: typeof skip;
|
|
5270
|
-
declare const
|
|
3102
|
+
declare const index_sortJsonValue: typeof sortJsonValue;
|
|
3103
|
+
declare const index_stableJsonString: typeof stableJsonString;
|
|
3104
|
+
declare const index_stratify: typeof stratify;
|
|
5271
3105
|
declare const index_switchMap: typeof switchMap;
|
|
5272
3106
|
declare const index_take: typeof take;
|
|
5273
3107
|
declare const index_takeUntil: typeof takeUntil;
|
|
@@ -5312,7 +3146,7 @@ declare const index_workerBridge: typeof workerBridge;
|
|
|
5312
3146
|
declare const index_workerSelf: typeof workerSelf;
|
|
5313
3147
|
declare const index_zip: typeof zip;
|
|
5314
3148
|
declare namespace index {
|
|
5315
|
-
export { type index_AckableMessage as AckableMessage, type index_AdapterHandlers as AdapterHandlers, index_AsyncSourceOpts as AsyncSourceOpts, type index_BackoffPreset as BackoffPreset, type index_BackoffStrategy as BackoffStrategy, type index_BatchMessage as BatchMessage, type index_BridgeMessage as BridgeMessage, type index_BufferedSinkHandle as BufferedSinkHandle, type index_BundleTriad as BundleTriad, type index_CSVRow as CSVRow, type index_CacheEvictionPolicy as CacheEvictionPolicy, type index_CascadingCache as CascadingCache, type index_CascadingCacheOptions as CascadingCacheOptions, type index_CheckpointToRedisOptions as CheckpointToRedisOptions, type index_CheckpointToS3Options as CheckpointToS3Options, type index_CircuitBreaker as CircuitBreaker, type index_CircuitBreakerOptions as CircuitBreakerOptions, index_CircuitOpenError as CircuitOpenError, type index_CircuitState as CircuitState, type index_ClickHouseClientLike as ClickHouseClientLike, type index_ClickHouseInsertClientLike as ClickHouseInsertClientLike, type index_ClickHouseRow as ClickHouseRow, type index_CronSchedule as CronSchedule, type index_DistillBundle as DistillBundle, type index_DistillOptions as DistillOptions, type index_DrizzleQueryLike as DrizzleQueryLike, type index_EmitTriad as EmitTriad, type index_ErrorMessage as ErrorMessage, index_EventTargetLike as EventTargetLike, type index_ExponentialBackoffOptions as ExponentialBackoffOptions, type index_ExternalBundleOptions as ExternalBundleOptions, type index_ExternalRegister as ExternalRegister, type index_Extraction as Extraction, type index_FSEvent as FSEvent, type index_FSEventType as FSEventType, type index_FallbackInput as FallbackInput, type index_FileWriterLike as FileWriterLike, type index_FromCSVOptions as FromCSVOptions, type index_FromClickHouseWatchOptions as FromClickHouseWatchOptions, index_FromCronOptions as FromCronOptions, type index_FromDrizzleOptions as FromDrizzleOptions, type index_FromFSWatchOptions as FromFSWatchOptions, type index_FromGitHookOptions as FromGitHookOptions, type index_FromHTTPOptions as FromHTTPOptions, type index_FromHTTPPollOptions as FromHTTPPollOptions, type index_FromHTTPStreamOptions as FromHTTPStreamOptions, type index_FromKafkaOptions as FromKafkaOptions, type index_FromKyselyOptions as FromKyselyOptions, type index_FromMCPOptions as FromMCPOptions, type index_FromNATSOptions as FromNATSOptions, type index_FromNDJSONOptions as FromNDJSONOptions, type index_FromOTelOptions as FromOTelOptions, type index_FromPrismaOptions as FromPrismaOptions, type index_FromPrometheusOptions as FromPrometheusOptions, type index_FromPulsarOptions as FromPulsarOptions, type index_FromRabbitMQOptions as FromRabbitMQOptions, type index_FromRedisStreamOptions as FromRedisStreamOptions, type index_FromSSEOptions as FromSSEOptions, type index_FromSqliteOptions as FromSqliteOptions, type index_FromStatsDOptions as FromStatsDOptions, type index_FromSyslogOptions as FromSyslogOptions, type index_FromWebSocketReconnectOptions as FromWebSocketReconnectOptions, type index_GitEvent as GitEvent, type index_GitHookType as GitHookType, type index_HTTPBundle as HTTPBundle, type index_IndexBackend as IndexBackend, type index_IndexRow as IndexRow, index_IndexedDbStorageSpec as IndexedDbStorageSpec, type index_InitMessage as InitMessage, type index_JitterMode as JitterMode, type index_KafkaConsumerLike as KafkaConsumerLike, type index_KafkaMessage as KafkaMessage, type index_KafkaProducerLike as KafkaProducerLike, type index_KyselyQueryLike as KyselyQueryLike, type index_ListBackend as ListBackend, type index_LogBackend as LogBackend, type index_LokiClientLike as LokiClientLike, type index_LokiStream as LokiStream, type index_MCPClientLike as MCPClientLike, type index_MapBackend as MapBackend, type index_MergeMapOptions as MergeMapOptions, type index_MongoCollectionLike as MongoCollectionLike, type index_NATSClientLike as NATSClientLike, type index_NATSMessage as NATSMessage, type index_NATSSubscriptionLike as NATSSubscriptionLike, index_NS_PER_MS as NS_PER_MS, index_NS_PER_SEC as NS_PER_SEC, index_NativeIndexBackend as NativeIndexBackend, index_NativeListBackend as NativeListBackend, index_NativeLogBackend as NativeLogBackend, index_NativeMapBackend as NativeMapBackend, type index_NativeMapBackendOptions as NativeMapBackendOptions, index_NativePubSubBackend as NativePubSubBackend, index_NodeInput as NodeInput, type index_OTelBundle as OTelBundle, type index_OTelLog as OTelLog, type index_OTelMetric as OTelMetric, type index_OTelRegister as OTelRegister, type index_OTelSpan as OTelSpan, type index_PostgresClientLike as PostgresClientLike, type index_PrismaModelLike as PrismaModelLike, type index_PrometheusMetric as PrometheusMetric, type index_PubSubBackend as PubSubBackend, type index_PubSubHub as PubSubHub, type index_PubSubHubOptions as PubSubHubOptions, type index_PulsarConsumerLike as PulsarConsumerLike, type index_PulsarMessage as PulsarMessage, type index_PulsarProducerLike as PulsarProducerLike, type index_RabbitMQChannelLike as RabbitMQChannelLike, type index_RabbitMQMessage as RabbitMQMessage, type index_RateLimiterOptions as RateLimiterOptions, index_RateLimiterOverflowError as RateLimiterOverflowError, type index_RateLimiterOverflowPolicy as RateLimiterOverflowPolicy, index_ReactiveCounterBundle as ReactiveCounterBundle, type index_ReactiveIndexBundle as ReactiveIndexBundle, type index_ReactiveIndexOptions as ReactiveIndexOptions, type index_ReactiveListBundle as ReactiveListBundle, type index_ReactiveListOptions as ReactiveListOptions, type index_ReactiveLogBundle as ReactiveLogBundle, type index_ReactiveLogOptions as ReactiveLogOptions, type index_ReactiveMapBundle as ReactiveMapBundle, type index_ReactiveMapOptions as ReactiveMapOptions, type index_ReactiveSinkBackpressureOptions as ReactiveSinkBackpressureOptions, type index_ReactiveSinkConfig as ReactiveSinkConfig, type index_ReactiveSinkHandle as ReactiveSinkHandle, type index_ReactiveSinkOptions as ReactiveSinkOptions, type index_ReactiveSinkRetryOptions as ReactiveSinkRetryOptions, type index_ReadyMessage as ReadyMessage, type index_RedisCheckpointClientLike as RedisCheckpointClientLike, type index_RedisClientLike as RedisClientLike, type index_RedisStreamEntry as RedisStreamEntry, index_ResettableTimer as ResettableTimer, type index_RetryOptions as RetryOptions, type index_RetrySourceOptions as RetrySourceOptions, type index_S3ClientLike as S3ClientLike, type index_SSEEvent as SSEEvent, type index_SignalMessage as SignalMessage, type index_SinkFailure as SinkFailure, type index_SinkHandle as SinkHandle, type index_SinkTransportError as SinkTransportError, type index_SqliteDbLike as SqliteDbLike, type index_SqliteIterableDbLike as SqliteIterableDbLike, type index_StatsDMetric as StatsDMetric, type index_StatsDRegister as StatsDRegister, type index_StatusValue as StatusValue, index_StorageHandle as StorageHandle, index_StorageTier as StorageTier, type index_SyslogMessage as SyslogMessage, type index_SyslogRegister as SyslogRegister, type index_TapObserver as TapObserver, type index_TempoClientLike as TempoClientLike, type index_ThrottleOptions as ThrottleOptions, index_TimeoutError as TimeoutError, type index_ToCSVOptions as ToCSVOptions, type index_ToClickHouseOptions as ToClickHouseOptions, type index_ToFileOptions as ToFileOptions, type index_ToHTTPOptions as ToHTTPOptions, type index_ToKafkaOptions as ToKafkaOptions, type index_ToLokiOptions as ToLokiOptions, type index_ToMongoOptions as ToMongoOptions, type index_ToNATSOptions as ToNATSOptions, index_ToObservableOptions as ToObservableOptions, type index_ToPostgresOptions as ToPostgresOptions, type index_ToPulsarOptions as ToPulsarOptions, type index_ToRabbitMQOptions as ToRabbitMQOptions, type index_ToRedisStreamOptions as ToRedisStreamOptions, type index_ToS3Options as ToS3Options, type index_ToSSEOptions as ToSSEOptions, type index_ToSqliteOptions as ToSqliteOptions, type index_ToTempoOptions as ToTempoOptions, type index_ToWebSocketOptions as ToWebSocketOptions, type index_TokenBucket as TokenBucket, type index_UpsertOptions as UpsertOptions, type index_ValueMessage as ValueMessage, type index_VerifiableBundle as VerifiableBundle, type index_VerifiableOptions as VerifiableOptions, type index_VerifyValue as VerifyValue, type index_WatermarkController as WatermarkController, type index_WatermarkOptions as WatermarkOptions, type index_WebSocketLike as WebSocketLike, type index_WebSocketMessageEventLike as WebSocketMessageEventLike, type index_WebSocketRegister as WebSocketRegister, type index_WebhookRegister as WebhookRegister, type index_WithBreakerBundle as WithBreakerBundle, type index_WithStatusBundle as WithStatusBundle, type index_WorkerBridge as WorkerBridge, type index_WorkerBridgeOptions as WorkerBridgeOptions, type index_WorkerSelfHandle as WorkerSelfHandle, type index_WorkerSelfOptions as WorkerSelfOptions, type index_WorkerTransport as WorkerTransport, index_audit as audit, index_buffer as buffer, index_bufferCount as bufferCount, index_bufferTime as bufferTime, index_cached as cached, index_cascadingCache as cascadingCache, index_catchError as catchError, index_checkpointToRedis as checkpointToRedis, index_checkpointToS3 as checkpointToS3, index_circuitBreaker as circuitBreaker, index_combine as combine, index_combineLatest as combineLatest, index_concat as concat, index_concatMap as concatMap, index_constant as constant, index_createTransport as createTransport, index_createWatermarkController as createWatermarkController, index_csvRows as csvRows, index_debounce as debounce, index_debounceTime as debounceTime, index_decorrelatedJitter as decorrelatedJitter, index_delay as delay, index_deserializeError as deserializeError, index_dictStorage as dictStorage, index_distill as distill, index_distinctUntilChanged as distinctUntilChanged, index_elementAt as elementAt, index_empty as empty, index_escapeRegexChar as escapeRegexChar, index_exhaustMap as exhaustMap, index_exponential as exponential, index_externalBundle as externalBundle, index_externalProducer as externalProducer, index_fallback as fallback, index_fibonacci as fibonacci, index_fileStorage as fileStorage, index_filter as filter, index_find as find, index_first as first, index_firstValueFrom as firstValueFrom, index_firstWhere as firstWhere, index_flatMap as flatMap, index_forEach as forEach, index_fromAny as fromAny, index_fromAsyncIter as fromAsyncIter, index_fromCSV as fromCSV, index_fromClickHouseWatch as fromClickHouseWatch, index_fromCron as fromCron, index_fromDrizzle as fromDrizzle, index_fromEvent as fromEvent, index_fromFSWatch as fromFSWatch, index_fromGitHook as fromGitHook, index_fromHTTP as fromHTTP, index_fromHTTPPoll as fromHTTPPoll, index_fromHTTPStream as fromHTTPStream, index_fromIDBRequest as fromIDBRequest, index_fromIDBTransaction as fromIDBTransaction, index_fromIter as fromIter, index_fromKafka as fromKafka, index_fromKysely as fromKysely, index_fromMCP as fromMCP, index_fromNATS as fromNATS, index_fromNDJSON as fromNDJSON, index_fromOTel as fromOTel, index_fromPrisma as fromPrisma, index_fromPrometheus as fromPrometheus, index_fromPromise as fromPromise, index_fromPulsar as fromPulsar, index_fromRabbitMQ as fromRabbitMQ, index_fromRaf as fromRaf, index_fromRedisStream as fromRedisStream, index_fromSSE as fromSSE, index_fromSqlite as fromSqlite, index_fromSqliteCursor as fromSqliteCursor, index_fromStatsD as fromStatsD, index_fromSyslog as fromSyslog, index_fromTimer as fromTimer, index_fromWebSocket as fromWebSocket, index_fromWebSocketReconnect as fromWebSocketReconnect, index_fromWebhook as fromWebhook, index_globToRegExp as globToRegExp, index_indexedDbStorage as indexedDbStorage, index_interval as interval, index_keepalive as keepalive, index_last as last, index_linear as linear, index_lru as lru, index_map as map, index_matchesAnyPattern as matchesAnyPattern, index_matchesCron as matchesCron, index_memoryStorage as memoryStorage, index_merge as merge, index_mergeMap as mergeMap, index_nameToSignal as nameToSignal, index_ndjsonRows as ndjsonRows, index_never as never, index_of as of, index_pairwise as pairwise, index_parseCron as parseCron, index_parsePrometheusText as parsePrometheusText, index_parseStatsD as parseStatsD, index_parseSyslog as parseSyslog, index_pausable as pausable, index_pubsub as pubsub, index_race as race, index_rateLimiter as rateLimiter, index_reactiveCounter as reactiveCounter, index_reactiveIndex as reactiveIndex, index_reactiveList as reactiveList, index_reactiveLog as reactiveLog, index_reactiveMap as reactiveMap, index_reactiveSink as reactiveSink, index_reduce as reduce, index_repeat as repeat, index_replay as replay, index_rescue as rescue, index_resolveBackoffPreset as resolveBackoffPreset, index_retry as retry, index_retrySource as retrySource, index_sample as sample, index_scan as scan, index_serializeError as serializeError, index_share as share, index_shareReplay as shareReplay, index_signalToName as signalToName, index_skip as skip, index_sqliteStorage as sqliteStorage, index_switchMap as switchMap, index_take as take, index_takeUntil as takeUntil, index_takeWhile as takeWhile, index_tap as tap, index_throttle as throttle, index_throttleTime as throttleTime, index_throwError as throwError, index_timeout as timeout, index_toArray as toArray, index_toCSV as toCSV, index_toClickHouse as toClickHouse, index_toFile as toFile, index_toHTTP as toHTTP, index_toKafka as toKafka, index_toLoki as toLoki, index_toMongo as toMongo, index_toNATS as toNATS, index_toObservable as toObservable, index_toPostgres as toPostgres, index_toPulsar as toPulsar, index_toRabbitMQ as toRabbitMQ, index_toReadableStream as toReadableStream, index_toRedisStream as toRedisStream, index_toS3 as toS3, index_toSSE as toSSE, index_toSSEBytes as toSSEBytes, index_toSqlite as toSqlite, index_toTempo as toTempo, index_toWebSocket as toWebSocket, index_tokenBucket as tokenBucket, index_valve as valve, index_verifiable as verifiable, index_window as window, index_windowCount as windowCount, index_windowTime as windowTime, index_withBreaker as withBreaker, index_withLatestFrom as withLatestFrom, index_withMaxAttempts as withMaxAttempts, index_withStatus as withStatus, index_workerBridge as workerBridge, index_workerSelf as workerSelf, index_zip as zip };
|
|
3149
|
+
export { type index_AckableMessage as AckableMessage, type index_AdapterHandlers as AdapterHandlers, index_AsyncSourceOpts as AsyncSourceOpts, index_BackoffPreset as BackoffPreset, index_BackoffStrategy as BackoffStrategy, type index_BatchMessage as BatchMessage, type index_BridgeMessage as BridgeMessage, type index_BufferedSinkHandle as BufferedSinkHandle, type index_BundleTriad as BundleTriad, type index_CSVRow as CSVRow, type index_CacheEvictionPolicy as CacheEvictionPolicy, type index_CascadingCache as CascadingCache, type index_CascadingCacheOptions as CascadingCacheOptions, type index_CheckpointToRedisOptions as CheckpointToRedisOptions, type index_CheckpointToS3Options as CheckpointToS3Options, index_CircuitBreaker as CircuitBreaker, index_CircuitBreakerOptions as CircuitBreakerOptions, index_CircuitOpenError as CircuitOpenError, index_CircuitState as CircuitState, type index_ClickHouseClientLike as ClickHouseClientLike, type index_ClickHouseInsertClientLike as ClickHouseInsertClientLike, type index_ClickHouseRow as ClickHouseRow, type index_CronSchedule as CronSchedule, index_DistillBundle as DistillBundle, index_DistillOptions as DistillOptions, type index_DrizzleQueryLike as DrizzleQueryLike, type index_EmitTriad as EmitTriad, type index_ErrorMessage as ErrorMessage, index_EventTargetLike as EventTargetLike, index_ExponentialBackoffOptions as ExponentialBackoffOptions, type index_ExternalBundleOptions as ExternalBundleOptions, type index_ExternalRegister as ExternalRegister, index_Extraction as Extraction, index_FallbackInput as FallbackInput, type index_FileWriterLike as FileWriterLike, type index_FromCSVOptions as FromCSVOptions, type index_FromClickHouseWatchOptions as FromClickHouseWatchOptions, index_FromCronOptions as FromCronOptions, type index_FromDrizzleOptions as FromDrizzleOptions, type index_FromHTTPOptions as FromHTTPOptions, type index_FromHTTPPollOptions as FromHTTPPollOptions, type index_FromHTTPStreamOptions as FromHTTPStreamOptions, type index_FromKafkaOptions as FromKafkaOptions, type index_FromKyselyOptions as FromKyselyOptions, type index_FromMCPOptions as FromMCPOptions, type index_FromNATSOptions as FromNATSOptions, type index_FromNDJSONOptions as FromNDJSONOptions, type index_FromOTelOptions as FromOTelOptions, type index_FromPrismaOptions as FromPrismaOptions, type index_FromPrometheusOptions as FromPrometheusOptions, type index_FromPulsarOptions as FromPulsarOptions, type index_FromRabbitMQOptions as FromRabbitMQOptions, type index_FromRedisStreamOptions as FromRedisStreamOptions, type index_FromSSEOptions as FromSSEOptions, type index_FromSqliteOptions as FromSqliteOptions, type index_FromStatsDOptions as FromStatsDOptions, type index_FromSyslogOptions as FromSyslogOptions, type index_FromWebSocketReconnectOptions as FromWebSocketReconnectOptions, type index_HTTPBundle as HTTPBundle, index_IndexBackend as IndexBackend, index_IndexRow as IndexRow, type index_InitMessage as InitMessage, index_JitterMode as JitterMode, type index_KafkaConsumerLike as KafkaConsumerLike, type index_KafkaMessage as KafkaMessage, type index_KafkaProducerLike as KafkaProducerLike, type index_KyselyQueryLike as KyselyQueryLike, index_ListBackend as ListBackend, index_LogBackend as LogBackend, type index_LokiClientLike as LokiClientLike, type index_LokiStream as LokiStream, type index_MCPClientLike as MCPClientLike, index_MapBackend as MapBackend, index_MergeMapOptions as MergeMapOptions, type index_MongoCollectionLike as MongoCollectionLike, type index_NATSClientLike as NATSClientLike, type index_NATSMessage as NATSMessage, type index_NATSSubscriptionLike as NATSSubscriptionLike, index_NS_PER_MS as NS_PER_MS, index_NS_PER_SEC as NS_PER_SEC, index_NativeIndexBackend as NativeIndexBackend, index_NativeListBackend as NativeListBackend, index_NativeLogBackend as NativeLogBackend, index_NativeMapBackend as NativeMapBackend, index_NativeMapBackendOptions as NativeMapBackendOptions, index_NativePubSubBackend as NativePubSubBackend, index_NodeInput as NodeInput, type index_OTelBundle as OTelBundle, type index_OTelLog as OTelLog, type index_OTelMetric as OTelMetric, type index_OTelRegister as OTelRegister, type index_OTelSpan as OTelSpan, type index_PostgresClientLike as PostgresClientLike, type index_PrismaModelLike as PrismaModelLike, type index_PrometheusMetric as PrometheusMetric, type index_PubSubBackend as PubSubBackend, type index_PubSubHub as PubSubHub, type index_PubSubHubOptions as PubSubHubOptions, type index_PulsarConsumerLike as PulsarConsumerLike, type index_PulsarMessage as PulsarMessage, type index_PulsarProducerLike as PulsarProducerLike, type index_RabbitMQChannelLike as RabbitMQChannelLike, type index_RabbitMQMessage as RabbitMQMessage, index_RateLimiterOptions as RateLimiterOptions, index_RateLimiterOverflowError as RateLimiterOverflowError, index_RateLimiterOverflowPolicy as RateLimiterOverflowPolicy, index_ReactiveCounterBundle as ReactiveCounterBundle, index_ReactiveIndexBundle as ReactiveIndexBundle, index_ReactiveIndexOptions as ReactiveIndexOptions, index_ReactiveListBundle as ReactiveListBundle, index_ReactiveListOptions as ReactiveListOptions, index_ReactiveLogBundle as ReactiveLogBundle, index_ReactiveLogOptions as ReactiveLogOptions, index_ReactiveMapBundle as ReactiveMapBundle, index_ReactiveMapOptions as ReactiveMapOptions, type index_ReactiveSinkBackpressureOptions as ReactiveSinkBackpressureOptions, type index_ReactiveSinkConfig as ReactiveSinkConfig, type index_ReactiveSinkHandle as ReactiveSinkHandle, type index_ReactiveSinkOptions as ReactiveSinkOptions, type index_ReactiveSinkRetryOptions as ReactiveSinkRetryOptions, type index_ReadyMessage as ReadyMessage, type index_RedisCheckpointClientLike as RedisCheckpointClientLike, type index_RedisClientLike as RedisClientLike, type index_RedisStreamEntry as RedisStreamEntry, index_ResettableTimer as ResettableTimer, index_RetryOptions as RetryOptions, index_RetrySourceOptions as RetrySourceOptions, type index_S3ClientLike as S3ClientLike, type index_SSEEvent as SSEEvent, type index_SignalMessage as SignalMessage, type index_SingleFromAnyOptions as SingleFromAnyOptions, type index_SinkFailure as SinkFailure, type index_SinkHandle as SinkHandle, type index_SinkTransportError as SinkTransportError, type index_SqliteDbLike as SqliteDbLike, type index_SqliteIterableDbLike as SqliteIterableDbLike, type index_StatsDMetric as StatsDMetric, type index_StatsDRegister as StatsDRegister, index_StatusValue as StatusValue, index_StorageHandle as StorageHandle, index_StorageTier as StorageTier, type index_StratifyOptions as StratifyOptions, type index_StratifyRule as StratifyRule, type index_SyslogMessage as SyslogMessage, type index_SyslogRegister as SyslogRegister, index_TapObserver as TapObserver, type index_TempoClientLike as TempoClientLike, index_ThrottleOptions as ThrottleOptions, index_TimeoutError as TimeoutError, type index_ToCSVOptions as ToCSVOptions, type index_ToClickHouseOptions as ToClickHouseOptions, type index_ToFileOptions as ToFileOptions, type index_ToHTTPOptions as ToHTTPOptions, type index_ToKafkaOptions as ToKafkaOptions, type index_ToLokiOptions as ToLokiOptions, type index_ToMongoOptions as ToMongoOptions, type index_ToNATSOptions as ToNATSOptions, index_ToObservableOptions as ToObservableOptions, type index_ToPostgresOptions as ToPostgresOptions, type index_ToPulsarOptions as ToPulsarOptions, type index_ToRabbitMQOptions as ToRabbitMQOptions, type index_ToRedisStreamOptions as ToRedisStreamOptions, type index_ToS3Options as ToS3Options, type index_ToSSEOptions as ToSSEOptions, type index_ToSqliteOptions as ToSqliteOptions, type index_ToTempoOptions as ToTempoOptions, type index_ToWebSocketOptions as ToWebSocketOptions, index_TokenBucket as TokenBucket, index_UpsertOptions as UpsertOptions, type index_ValueMessage as ValueMessage, index_VerifiableBundle as VerifiableBundle, index_VerifiableOptions as VerifiableOptions, index_VerifyValue as VerifyValue, type index_WatermarkController as WatermarkController, type index_WatermarkOptions as WatermarkOptions, type index_WebSocketLike as WebSocketLike, type index_WebSocketMessageEventLike as WebSocketMessageEventLike, type index_WebSocketRegister as WebSocketRegister, type index_WebhookRegister as WebhookRegister, index_WithBreakerBundle as WithBreakerBundle, index_WithStatusBundle as WithStatusBundle, type index_WorkerBridge as WorkerBridge, type index_WorkerBridgeOptions as WorkerBridgeOptions, type index_WorkerSelfHandle as WorkerSelfHandle, type index_WorkerSelfOptions as WorkerSelfOptions, type index_WorkerTransport as WorkerTransport, index_audit as audit, index_awaitSettled as awaitSettled, index_buffer as buffer, index_bufferCount as bufferCount, index_bufferTime as bufferTime, index_cached as cached, index_cascadingCache as cascadingCache, index_catchError as catchError, index_checkpointToRedis as checkpointToRedis, index_checkpointToS3 as checkpointToS3, index_circuitBreaker as circuitBreaker, index_combine as combine, index_combineLatest as combineLatest, index_concat as concat, index_concatMap as concatMap, index_constant as constant, index_createTransport as createTransport, index_createWatermarkController as createWatermarkController, index_csvRows as csvRows, index_debounce as debounce, index_debounceTime as debounceTime, index_decorrelatedJitter as decorrelatedJitter, index_delay as delay, index_deserializeError as deserializeError, index_dictStorage as dictStorage, index_distill as distill, index_distinctUntilChanged as distinctUntilChanged, index_elementAt as elementAt, index_empty as empty, index_escapeRegexChar as escapeRegexChar, index_exhaustMap as exhaustMap, index_exponential as exponential, index_externalBundle as externalBundle, index_externalProducer as externalProducer, index_fallback as fallback, index_fibonacci as fibonacci, index_filter as filter, index_find as find, index_first as first, index_firstValueFrom as firstValueFrom, index_firstWhere as firstWhere, index_flatMap as flatMap, index_forEach as forEach, index_fromAny as fromAny, index_fromAsyncIter as fromAsyncIter, index_fromCSV as fromCSV, index_fromClickHouseWatch as fromClickHouseWatch, index_fromCron as fromCron, index_fromDrizzle as fromDrizzle, index_fromEvent as fromEvent, index_fromHTTP as fromHTTP, index_fromHTTPPoll as fromHTTPPoll, index_fromHTTPStream as fromHTTPStream, index_fromIter as fromIter, index_fromKafka as fromKafka, index_fromKysely as fromKysely, index_fromMCP as fromMCP, index_fromNATS as fromNATS, index_fromNDJSON as fromNDJSON, index_fromOTel as fromOTel, index_fromPrisma as fromPrisma, index_fromPrometheus as fromPrometheus, index_fromPromise as fromPromise, index_fromPulsar as fromPulsar, index_fromRabbitMQ as fromRabbitMQ, index_fromRaf as fromRaf, index_fromRedisStream as fromRedisStream, index_fromSSE as fromSSE, index_fromSqlite as fromSqlite, index_fromSqliteCursor as fromSqliteCursor, index_fromStatsD as fromStatsD, index_fromSyslog as fromSyslog, index_fromTimer as fromTimer, index_fromWebSocket as fromWebSocket, index_fromWebSocketReconnect as fromWebSocketReconnect, index_fromWebhook as fromWebhook, index_globToRegExp as globToRegExp, index_interval as interval, index_keepalive as keepalive, index_last as last, index_linear as linear, index_lru as lru, index_map as map, index_matchesAnyPattern as matchesAnyPattern, index_matchesCron as matchesCron, index_memoryStorage as memoryStorage, index_merge as merge, index_mergeMap as mergeMap, index_nameToSignal as nameToSignal, index_ndjsonRows as ndjsonRows, index_never as never, index_of as of, index_pairwise as pairwise, index_parseCron as parseCron, index_parsePrometheusText as parsePrometheusText, index_parseStatsD as parseStatsD, index_parseSyslog as parseSyslog, index_pausable as pausable, index_pubsub as pubsub, index_race as race, index_rateLimiter as rateLimiter, index_reactiveCounter as reactiveCounter, index_reactiveIndex as reactiveIndex, index_reactiveList as reactiveList, index_reactiveLog as reactiveLog, index_reactiveMap as reactiveMap, index_reactiveSink as reactiveSink, index_reduce as reduce, index_repeat as repeat, index_replay as replay, index_rescue as rescue, index_resolveBackoffPreset as resolveBackoffPreset, index_retry as retry, index_retrySource as retrySource, index_sample as sample, index_scan as scan, index_serializeError as serializeError, index_share as share, index_shareReplay as shareReplay, index_signalToName as signalToName, index_singleFromAny as singleFromAny, index_singleNodeFromAny as singleNodeFromAny, index_skip as skip, index_sortJsonValue as sortJsonValue, index_stableJsonString as stableJsonString, index_stratify as stratify, index_switchMap as switchMap, index_take as take, index_takeUntil as takeUntil, index_takeWhile as takeWhile, index_tap as tap, index_throttle as throttle, index_throttleTime as throttleTime, index_throwError as throwError, index_timeout as timeout, index_toArray as toArray, index_toCSV as toCSV, index_toClickHouse as toClickHouse, index_toFile as toFile, index_toHTTP as toHTTP, index_toKafka as toKafka, index_toLoki as toLoki, index_toMongo as toMongo, index_toNATS as toNATS, index_toObservable as toObservable, index_toPostgres as toPostgres, index_toPulsar as toPulsar, index_toRabbitMQ as toRabbitMQ, index_toReadableStream as toReadableStream, index_toRedisStream as toRedisStream, index_toS3 as toS3, index_toSSE as toSSE, index_toSSEBytes as toSSEBytes, index_toSqlite as toSqlite, index_toTempo as toTempo, index_toWebSocket as toWebSocket, index_tokenBucket as tokenBucket, index_valve as valve, index_verifiable as verifiable, index_window as window, index_windowCount as windowCount, index_windowTime as windowTime, index_withBreaker as withBreaker, index_withLatestFrom as withLatestFrom, index_withMaxAttempts as withMaxAttempts, index_withStatus as withStatus, index_workerBridge as workerBridge, index_workerSelf as workerSelf, index_zip as zip };
|
|
5316
3150
|
}
|
|
5317
3151
|
|
|
5318
|
-
export { type
|
|
3152
|
+
export { type MongoCollectionLike as $, type AckableMessage as A, type BatchMessage as B, type CSVRow as C, type DrizzleQueryLike as D, type EmitTriad as E, type FileWriterLike as F, type FromNDJSONOptions as G, type FromOTelOptions as H, type FromPrismaOptions as I, type FromPrometheusOptions as J, type FromPulsarOptions as K, type FromRabbitMQOptions as L, type FromRedisStreamOptions as M, type FromSSEOptions as N, type FromSqliteOptions as O, type FromStatsDOptions as P, type FromSyslogOptions as Q, type FromWebSocketReconnectOptions as R, type HTTPBundle as S, type InitMessage as T, type KafkaConsumerLike as U, type KafkaMessage as V, type KafkaProducerLike as W, type KyselyQueryLike as X, type LokiClientLike as Y, type LokiStream as Z, type MCPClientLike as _, type AdapterHandlers as a, type ValueMessage as a$, type NATSClientLike as a0, type NATSMessage as a1, type NATSSubscriptionLike as a2, NativePubSubBackend as a3, type OTelBundle as a4, type OTelLog as a5, type OTelMetric as a6, type OTelRegister as a7, type OTelSpan as a8, type PostgresClientLike as a9, type SinkTransportError as aA, type SqliteDbLike as aB, type SqliteIterableDbLike as aC, type StatsDMetric as aD, type StatsDRegister as aE, type StratifyOptions as aF, type StratifyRule as aG, type SyslogMessage as aH, type SyslogRegister as aI, type TempoClientLike as aJ, type ToCSVOptions as aK, type ToClickHouseOptions as aL, type ToFileOptions as aM, type ToHTTPOptions as aN, type ToKafkaOptions as aO, type ToLokiOptions as aP, type ToMongoOptions as aQ, type ToNATSOptions as aR, type ToPostgresOptions as aS, type ToPulsarOptions as aT, type ToRabbitMQOptions as aU, type ToRedisStreamOptions as aV, type ToS3Options as aW, type ToSSEOptions as aX, type ToSqliteOptions as aY, type ToTempoOptions as aZ, type ToWebSocketOptions as a_, type PrismaModelLike as aa, type PrometheusMetric as ab, type PubSubBackend as ac, type PubSubHub as ad, type PubSubHubOptions as ae, type PulsarConsumerLike as af, type PulsarMessage as ag, type PulsarProducerLike as ah, type RabbitMQChannelLike as ai, type RabbitMQMessage as aj, type ReactiveSinkBackpressureOptions as ak, type ReactiveSinkConfig as al, type ReactiveSinkHandle as am, type ReactiveSinkOptions as an, type ReactiveSinkRetryOptions as ao, type ReadyMessage as ap, type RedisCheckpointClientLike as aq, type RedisClientLike as ar, type RedisStreamEntry as as, ResettableTimer as at, type S3ClientLike as au, type SSEEvent as av, type SignalMessage as aw, type SingleFromAnyOptions as ax, type SinkFailure as ay, type SinkHandle as az, type BridgeMessage as b, toFile as b$, type WatermarkController as b0, type WatermarkOptions as b1, type WebSocketLike as b2, type WebSocketMessageEventLike as b3, type WebSocketRegister as b4, type WebhookRegister as b5, type WorkerBridge as b6, type WorkerBridgeOptions as b7, type WorkerSelfHandle as b8, type WorkerSelfOptions as b9, fromRabbitMQ as bA, fromRedisStream as bB, fromSSE as bC, fromSqlite as bD, fromSqliteCursor as bE, fromStatsD as bF, fromSyslog as bG, fromWebSocket as bH, fromWebSocketReconnect as bI, fromWebhook as bJ, lru as bK, matchesCron as bL, nameToSignal as bM, ndjsonRows as bN, parseCron as bO, parsePrometheusText as bP, parseStatsD as bQ, parseSyslog as bR, pubsub as bS, reactiveSink as bT, serializeError as bU, signalToName as bV, singleFromAny as bW, singleNodeFromAny as bX, stratify as bY, toCSV as bZ, toClickHouse as b_, type WorkerTransport as ba, cascadingCache as bb, checkpointToRedis as bc, checkpointToS3 as bd, createTransport as be, createWatermarkController as bf, csvRows as bg, deserializeError as bh, externalBundle as bi, externalProducer as bj, index as bk, fromCSV as bl, fromClickHouseWatch as bm, fromDrizzle as bn, fromHTTP as bo, fromHTTPPoll as bp, fromHTTPStream as bq, fromKafka as br, fromKysely as bs, fromMCP as bt, fromNATS as bu, fromNDJSON as bv, fromOTel as bw, fromPrisma as bx, fromPrometheus as by, fromPulsar as bz, type BufferedSinkHandle as c, toHTTP as c0, toKafka as c1, toLoki as c2, toMongo as c3, toNATS as c4, toPostgres as c5, toPulsar as c6, toRabbitMQ as c7, toReadableStream as c8, toRedisStream as c9, toS3 as ca, toSSE as cb, toSSEBytes as cc, toSqlite as cd, toTempo as ce, toWebSocket as cf, workerBridge as cg, workerSelf as ch, type BundleTriad as d, type CacheEvictionPolicy as e, type CascadingCache as f, type CascadingCacheOptions as g, type CheckpointToRedisOptions as h, type CheckpointToS3Options as i, type ClickHouseClientLike as j, type ClickHouseInsertClientLike as k, type ClickHouseRow as l, type CronSchedule as m, type ErrorMessage as n, type ExternalBundleOptions as o, type ExternalRegister as p, type FromCSVOptions as q, type FromClickHouseWatchOptions as r, type FromDrizzleOptions as s, type FromHTTPOptions as t, type FromHTTPPollOptions as u, type FromHTTPStreamOptions as v, type FromKafkaOptions as w, type FromKyselyOptions as x, type FromMCPOptions as y, type FromNATSOptions as z };
|