@graphrefly/graphrefly 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -17
- package/dist/compat/index.cjs +20 -10
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +1 -22
- package/dist/compat/index.d.ts +1 -22
- package/dist/compat/index.js +3 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +21 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +1 -2
- package/dist/compat/jotai/index.d.ts +1 -2
- package/dist/compat/jotai/index.js +3 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +21 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +1 -2
- package/dist/compat/nanostores/index.d.ts +1 -2
- package/dist/compat/nanostores/index.js +3 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +20 -10
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +1 -13
- package/dist/compat/nestjs/index.d.ts +1 -13
- package/dist/compat/nestjs/index.js +3 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +21 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +1 -2
- package/dist/compat/react/index.d.ts +1 -2
- package/dist/compat/react/index.js +3 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +21 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +1 -2
- package/dist/compat/solid/index.d.ts +1 -2
- package/dist/compat/solid/index.js +3 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +21 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +1 -2
- package/dist/compat/svelte/index.d.ts +1 -2
- package/dist/compat/svelte/index.js +3 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +21 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +1 -3
- package/dist/compat/vue/index.d.ts +1 -3
- package/dist/compat/vue/index.js +3 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +21 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +1 -6
- package/dist/compat/zustand/index.d.ts +1 -6
- package/dist/compat/zustand/index.js +3 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +21 -1
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1 -4
- package/dist/core/index.d.ts +1 -4
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -0
- package/dist/extra/browser.cjs +21 -1
- package/dist/extra/browser.cjs.map +1 -0
- package/dist/extra/browser.d.cts +1 -4
- package/dist/extra/browser.d.ts +1 -4
- package/dist/extra/browser.js +3 -1
- package/dist/extra/browser.js.map +1 -0
- package/dist/extra/index.cjs +20 -19
- package/dist/extra/index.cjs.map +1 -0
- package/dist/extra/index.d.cts +1 -17
- package/dist/extra/index.d.ts +1 -17
- package/dist/extra/index.js +3 -1
- package/dist/extra/index.js.map +1 -0
- package/dist/extra/node.cjs +21 -2
- package/dist/extra/node.cjs.map +1 -0
- package/dist/extra/node.d.cts +1 -187
- package/dist/extra/node.d.ts +1 -187
- package/dist/extra/node.js +3 -2
- package/dist/extra/node.js.map +1 -0
- package/dist/extra/operators.cjs +21 -1
- package/dist/extra/operators.cjs.map +1 -0
- package/dist/extra/operators.d.cts +1 -950
- package/dist/extra/operators.d.ts +1 -950
- package/dist/extra/operators.js +3 -1
- package/dist/extra/operators.js.map +1 -0
- package/dist/extra/reactive.cjs +21 -1
- package/dist/extra/reactive.cjs.map +1 -0
- package/dist/extra/reactive.d.cts +1 -353
- package/dist/extra/reactive.d.ts +1 -353
- package/dist/extra/reactive.js +3 -1
- package/dist/extra/reactive.js.map +1 -0
- package/dist/extra/render/index.cjs +21 -5
- package/dist/extra/render/index.cjs.map +1 -0
- package/dist/extra/render/index.d.cts +1 -183
- package/dist/extra/render/index.d.ts +1 -183
- package/dist/extra/render/index.js +3 -1
- package/dist/extra/render/index.js.map +1 -0
- package/dist/extra/sources.cjs +21 -3
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +1 -584
- package/dist/extra/sources.d.ts +1 -584
- package/dist/extra/sources.js +3 -1
- package/dist/extra/sources.js.map +1 -0
- package/dist/extra/storage-browser.cjs +21 -1
- package/dist/extra/storage-browser.cjs.map +1 -0
- package/dist/extra/storage-browser.d.cts +1 -37
- package/dist/extra/storage-browser.d.ts +1 -37
- package/dist/extra/storage-browser.js +3 -1
- package/dist/extra/storage-browser.js.map +1 -0
- package/dist/extra/storage-core.cjs +21 -1
- package/dist/extra/storage-core.cjs.map +1 -0
- package/dist/extra/storage-core.d.cts +1 -28
- package/dist/extra/storage-core.d.ts +1 -28
- package/dist/extra/storage-core.js +3 -1
- package/dist/extra/storage-core.js.map +1 -0
- package/dist/extra/storage-node.cjs +20 -0
- package/dist/extra/storage-node.cjs.map +1 -0
- package/dist/extra/storage-node.d.cts +1 -2
- package/dist/extra/storage-node.d.ts +1 -2
- package/dist/extra/storage-node.js +3 -0
- package/dist/extra/storage-node.js.map +1 -0
- package/dist/extra/storage-tiers-browser.cjs +21 -1
- package/dist/extra/storage-tiers-browser.cjs.map +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +1 -120
- package/dist/extra/storage-tiers-browser.d.ts +1 -120
- package/dist/extra/storage-tiers-browser.js +3 -1
- package/dist/extra/storage-tiers-browser.js.map +1 -0
- package/dist/extra/storage-tiers-node.cjs +21 -1
- package/dist/extra/storage-tiers-node.cjs.map +1 -0
- package/dist/extra/storage-tiers-node.d.cts +1 -210
- package/dist/extra/storage-tiers-node.d.ts +1 -210
- package/dist/extra/storage-tiers-node.js +3 -1
- package/dist/extra/storage-tiers-node.js.map +1 -0
- package/dist/extra/storage-tiers.cjs +21 -1
- package/dist/extra/storage-tiers.cjs.map +1 -0
- package/dist/extra/storage-tiers.d.cts +1 -412
- package/dist/extra/storage-tiers.d.ts +1 -412
- package/dist/extra/storage-tiers.js +3 -1
- package/dist/extra/storage-tiers.js.map +1 -0
- package/dist/extra/storage-wal.cjs +21 -0
- package/dist/extra/storage-wal.cjs.map +1 -0
- package/dist/extra/storage-wal.d.cts +1 -0
- package/dist/extra/storage-wal.d.ts +1 -0
- package/dist/extra/storage-wal.js +3 -0
- package/dist/extra/storage-wal.js.map +1 -0
- package/dist/graph/index.cjs +21 -7
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +1 -7
- package/dist/graph/index.d.ts +1 -7
- package/dist/graph/index.js +3 -1
- package/dist/graph/index.js.map +1 -0
- package/dist/index.cjs +20 -227
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -96
- package/dist/index.d.ts +45 -96
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -0
- package/dist/patterns/ai/browser.cjs +20 -7
- package/dist/patterns/ai/browser.cjs.map +1 -0
- package/dist/patterns/ai/browser.d.cts +1 -127
- package/dist/patterns/ai/browser.d.ts +1 -127
- package/dist/patterns/ai/browser.js +3 -3
- package/dist/patterns/ai/browser.js.map +1 -0
- package/dist/patterns/ai/index.cjs +20 -73
- package/dist/patterns/ai/index.cjs.map +1 -0
- package/dist/patterns/ai/index.d.cts +1 -21
- package/dist/patterns/ai/index.d.ts +1 -21
- package/dist/patterns/ai/index.js +3 -1
- package/dist/patterns/ai/index.js.map +1 -0
- package/dist/patterns/ai/node.cjs +21 -1
- package/dist/patterns/ai/node.cjs.map +1 -0
- package/dist/patterns/ai/node.d.cts +1 -59
- package/dist/patterns/ai/node.d.ts +1 -59
- package/dist/patterns/ai/node.js +3 -1
- package/dist/patterns/ai/node.js.map +1 -0
- package/dist/patterns/cqrs/index.cjs +21 -3
- package/dist/patterns/cqrs/index.cjs.map +1 -0
- package/dist/patterns/cqrs/index.d.cts +1 -8
- package/dist/patterns/cqrs/index.d.ts +1 -8
- package/dist/patterns/cqrs/index.js +3 -1
- package/dist/patterns/cqrs/index.js.map +1 -0
- package/dist/patterns/demo-shell/index.cjs +21 -5
- package/dist/patterns/demo-shell/index.cjs.map +1 -0
- package/dist/patterns/demo-shell/index.d.cts +1 -7
- package/dist/patterns/demo-shell/index.d.ts +1 -7
- package/dist/patterns/demo-shell/index.js +3 -1
- package/dist/patterns/demo-shell/index.js.map +1 -0
- package/dist/patterns/domain-templates/index.cjs +21 -3
- package/dist/patterns/domain-templates/index.cjs.map +1 -0
- package/dist/patterns/domain-templates/index.d.cts +1 -6
- package/dist/patterns/domain-templates/index.d.ts +1 -6
- package/dist/patterns/domain-templates/index.js +3 -1
- package/dist/patterns/domain-templates/index.js.map +1 -0
- package/dist/patterns/graphspec/index.cjs +21 -86
- package/dist/patterns/graphspec/index.cjs.map +1 -0
- package/dist/patterns/graphspec/index.d.cts +1 -8
- package/dist/patterns/graphspec/index.d.ts +1 -8
- package/dist/patterns/graphspec/index.js +3 -1
- package/dist/patterns/graphspec/index.js.map +1 -0
- package/dist/patterns/harness/index.cjs +21 -48
- package/dist/patterns/harness/index.cjs.map +1 -0
- package/dist/patterns/harness/index.d.cts +1 -14
- package/dist/patterns/harness/index.d.ts +1 -14
- package/dist/patterns/harness/index.js +3 -1
- package/dist/patterns/harness/index.js.map +1 -0
- package/dist/patterns/inspect/index.cjs +21 -3
- package/dist/patterns/inspect/index.cjs.map +1 -0
- package/dist/patterns/inspect/index.d.cts +1 -9
- package/dist/patterns/inspect/index.d.ts +1 -9
- package/dist/patterns/inspect/index.js +3 -1
- package/dist/patterns/inspect/index.js.map +1 -0
- package/dist/patterns/job-queue/index.cjs +21 -3
- package/dist/patterns/job-queue/index.cjs.map +1 -0
- package/dist/patterns/job-queue/index.d.cts +1 -9
- package/dist/patterns/job-queue/index.d.ts +1 -9
- package/dist/patterns/job-queue/index.js +3 -1
- package/dist/patterns/job-queue/index.js.map +1 -0
- package/dist/patterns/memory/index.cjs +21 -3
- package/dist/patterns/memory/index.cjs.map +1 -0
- package/dist/patterns/memory/index.d.cts +1 -8
- package/dist/patterns/memory/index.d.ts +1 -8
- package/dist/patterns/memory/index.js +3 -1
- package/dist/patterns/memory/index.js.map +1 -0
- package/dist/patterns/messaging/index.cjs +21 -3
- package/dist/patterns/messaging/index.cjs.map +1 -0
- package/dist/patterns/messaging/index.d.cts +1 -7
- package/dist/patterns/messaging/index.d.ts +1 -7
- package/dist/patterns/messaging/index.js +3 -1
- package/dist/patterns/messaging/index.js.map +1 -0
- package/dist/patterns/orchestration/index.cjs +21 -3
- package/dist/patterns/orchestration/index.cjs.map +1 -0
- package/dist/patterns/orchestration/index.d.cts +1 -9
- package/dist/patterns/orchestration/index.d.ts +1 -9
- package/dist/patterns/orchestration/index.js +3 -1
- package/dist/patterns/orchestration/index.js.map +1 -0
- package/dist/patterns/process/index.cjs +21 -1
- package/dist/patterns/process/index.cjs.map +1 -0
- package/dist/patterns/process/index.d.cts +1 -10
- package/dist/patterns/process/index.d.ts +1 -10
- package/dist/patterns/process/index.js +3 -1
- package/dist/patterns/process/index.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +21 -4
- package/dist/patterns/reactive-layout/index.cjs.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +1 -7
- package/dist/patterns/reactive-layout/index.d.ts +1 -7
- package/dist/patterns/reactive-layout/index.js +3 -1
- package/dist/patterns/reactive-layout/index.js.map +1 -0
- package/dist/patterns/reduction/index.cjs +21 -3
- package/dist/patterns/reduction/index.cjs.map +1 -0
- package/dist/patterns/reduction/index.d.cts +1 -6
- package/dist/patterns/reduction/index.d.ts +1 -6
- package/dist/patterns/reduction/index.js +3 -1
- package/dist/patterns/reduction/index.js.map +1 -0
- package/dist/patterns/surface/index.cjs +21 -13
- package/dist/patterns/surface/index.cjs.map +1 -0
- package/dist/patterns/surface/index.d.cts +1 -9
- package/dist/patterns/surface/index.d.ts +1 -9
- package/dist/patterns/surface/index.js +3 -1
- package/dist/patterns/surface/index.js.map +1 -0
- package/dist/patterns/topology-view/index.cjs +21 -0
- package/dist/patterns/topology-view/index.cjs.map +1 -0
- package/dist/patterns/topology-view/index.d.cts +1 -0
- package/dist/patterns/topology-view/index.d.ts +1 -0
- package/dist/patterns/topology-view/index.js +3 -0
- package/dist/patterns/topology-view/index.js.map +1 -0
- package/dist/testing/index.cjs +21 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +608 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/cascading-CH-_VwG9.d.cts +0 -199
- package/dist/cascading-OgKQZjsa.d.ts +0 -199
- package/dist/chunk-35JTVPOX.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-3XDYJRYU.js +0 -1
- package/dist/chunk-4I45FVQS.js +0 -1
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-4YAN45KM.js +0 -1
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-626TESAC.js +0 -3
- package/dist/chunk-6HOSXQKF.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLD3F4R5.js +0 -1
- package/dist/chunk-CUNIRONA.js +0 -1
- package/dist/chunk-D27JNOLZ.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-EBW4V6JN.js +0 -1
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F3IGTWCQ.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FDQGFWLF.js +0 -1
- package/dist/chunk-FG4TKHMC.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-I7IGYPSL.js +0 -1
- package/dist/chunk-INQD2KRQ.js +0 -1
- package/dist/chunk-JNWRYDJN.js +0 -1
- package/dist/chunk-JQFH2DV6.js +0 -1
- package/dist/chunk-K2Q24F5T.js +0 -1
- package/dist/chunk-KGKJCHEK.js +0 -1
- package/dist/chunk-KRH66M4O.js +0 -1
- package/dist/chunk-KVV66NN2.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-LYCLF26R.js +0 -1
- package/dist/chunk-NNKJUORL.js +0 -1
- package/dist/chunk-NON4NLIC.js +0 -45
- package/dist/chunk-O2BLLH7M.js +0 -18
- package/dist/chunk-OCKEEPRJ.js +0 -2
- package/dist/chunk-OFZG3TB3.js +0 -9
- package/dist/chunk-OYJKFY7V.js +0 -1
- package/dist/chunk-P6C4WHZO.js +0 -5
- package/dist/chunk-PT7W5FCD.js +0 -5
- package/dist/chunk-Q4U3A3L5.js +0 -1
- package/dist/chunk-QE4IGY7I.js +0 -61
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-QYVXF7GW.js +0 -1
- package/dist/chunk-S3EEIPO7.js +0 -1
- package/dist/chunk-SUWT3ZON.js +0 -1
- package/dist/chunk-TPKQW72B.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-TZQPPQEQ.js +0 -1
- package/dist/chunk-V5A7M7RJ.js +0 -1
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VNC3TMVY.js +0 -1
- package/dist/chunk-VOPGGIL7.js +0 -1
- package/dist/chunk-VQ4A6T2A.js +0 -1
- package/dist/chunk-XG62INFA.js +0 -1
- package/dist/chunk-Y4NI3X7O.js +0 -84
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/decay-2ZukgQ4o.d.cts +0 -112
- package/dist/decay-CdEBmDIs.d.ts +0 -112
- package/dist/fallback-CqYVLL6X.d.ts +0 -250
- package/dist/fallback-Ctlj2tMY.d.cts +0 -250
- package/dist/graph-7VguS7a4.d.ts +0 -1668
- package/dist/graph-C4SHb3Ly.d.cts +0 -1668
- package/dist/index-0rKFCVFp.d.cts +0 -557
- package/dist/index-B-i4_g3k.d.ts +0 -651
- package/dist/index-B5iz82A3.d.cts +0 -2655
- package/dist/index-BAOD98JD.d.cts +0 -754
- package/dist/index-BG0BN3PB.d.ts +0 -44
- package/dist/index-BJX94aud.d.cts +0 -34
- package/dist/index-BP8a88zx.d.ts +0 -385
- package/dist/index-BTQtTb_H.d.cts +0 -301
- package/dist/index-BVpm6noz.d.cts +0 -36
- package/dist/index-Bc41FuHp.d.cts +0 -291
- package/dist/index-BdGtBX-X.d.cts +0 -515
- package/dist/index-Bf7eqeSF.d.ts +0 -113
- package/dist/index-BiX1Nkgx.d.cts +0 -1844
- package/dist/index-BoLv_OfD.d.cts +0 -651
- package/dist/index-BojK2fwH.d.cts +0 -299
- package/dist/index-BsT7F2et.d.ts +0 -291
- package/dist/index-BwLvVVsy.d.cts +0 -189
- package/dist/index-C59mYFKp.d.ts +0 -121
- package/dist/index-C7O6r5fV.d.ts +0 -37
- package/dist/index-C9kSENB4.d.cts +0 -127
- package/dist/index-C9pjcz3l.d.cts +0 -209
- package/dist/index-CAC_rNzm.d.ts +0 -189
- package/dist/index-CCq87F7t.d.ts +0 -127
- package/dist/index-CDXc9zKM.d.cts +0 -26
- package/dist/index-CJK1JkYy.d.ts +0 -36
- package/dist/index-CLon-IWF.d.cts +0 -374
- package/dist/index-COD1kVoS.d.cts +0 -468
- package/dist/index-CPT7C_f1.d.ts +0 -374
- package/dist/index-CQG3D1cp.d.ts +0 -468
- package/dist/index-CZQXo5tH.d.ts +0 -209
- package/dist/index-CZjOhcBy.d.cts +0 -113
- package/dist/index-ChOyVLKm.d.cts +0 -86
- package/dist/index-CvrqGfNS.d.ts +0 -34
- package/dist/index-D-AEQVLo.d.ts +0 -2655
- package/dist/index-D4Y1cMG0.d.ts +0 -26
- package/dist/index-DBHK8O6H.d.ts +0 -301
- package/dist/index-DBevwHj_.d.ts +0 -515
- package/dist/index-DIOoAZUX.d.ts +0 -45
- package/dist/index-DSZ3ZCHF.d.ts +0 -3402
- package/dist/index-Dgs8zcj7.d.ts +0 -102
- package/dist/index-Dh_HJ82K.d.ts +0 -299
- package/dist/index-Dhc7a7Xo.d.cts +0 -102
- package/dist/index-Dmqp7KjD.d.ts +0 -86
- package/dist/index-Dn-wI9g4.d.ts +0 -231
- package/dist/index-Du7u1lSf.d.cts +0 -385
- package/dist/index-DwigL4lY.d.ts +0 -1844
- package/dist/index-DyR7eU5S.d.cts +0 -779
- package/dist/index-JZUPJIJy.d.ts +0 -779
- package/dist/index-K0_0eR8g.d.ts +0 -557
- package/dist/index-O16yXPK4.d.cts +0 -3402
- package/dist/index-O7fucFrU.d.cts +0 -121
- package/dist/index-RV_yDjOX.d.cts +0 -198
- package/dist/index-cm1GNcWE.d.ts +0 -754
- package/dist/index-f5IivDUX.d.cts +0 -37
- package/dist/index-hHcaFlJX.d.cts +0 -45
- package/dist/index-tJoTcnHh.d.cts +0 -231
- package/dist/index-wAzD9yVj.d.ts +0 -198
- package/dist/index-z96luz5O.d.cts +0 -44
- package/dist/meta-BgVAsg9j.d.ts +0 -102
- package/dist/meta-vE8bxW1E.d.cts +0 -102
- package/dist/node-ClS5yC-B.d.cts +0 -1347
- package/dist/node-ClS5yC-B.d.ts +0 -1347
- package/dist/observable-BsBzUrcI.d.ts +0 -36
- package/dist/observable-DLGPPtb8.d.cts +0 -36
- package/dist/pipeline-graph-DPqKDk59.d.cts +0 -137
- package/dist/pipeline-graph-loP57TBA.d.ts +0 -137
- package/dist/reactive-layout-Dsvob4zD.d.cts +0 -183
- package/dist/reactive-layout-v7KPvxoc.d.ts +0 -183
- package/dist/reactive-log-B00laMSQ.d.cts +0 -223
- package/dist/reactive-log-BezYsbA_.d.ts +0 -223
- package/dist/reactive-map-48mnZ-nu.d.cts +0 -296
- package/dist/reactive-map-BVVPdvmi.d.ts +0 -296
- package/dist/resilience-YIWPK4YC.js +0 -1
- package/dist/sugar-DLwvMr3F.d.ts +0 -223
- package/dist/sugar-DyVGtczU.d.cts +0 -223
- package/dist/topology-tree-BNGvuG82.d.ts +0 -25
- package/dist/topology-tree-BSdfSwMi.d.cts +0 -25
- package/dist/types-B1jDWVsM.d.cts +0 -442
- package/dist/types-DkzUUs0H.d.ts +0 -442
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { N as Node } from './node-ClS5yC-B.js';
|
|
2
|
-
import { G as Graph } from './graph-7VguS7a4.js';
|
|
3
|
-
|
|
4
|
-
/** Pluggable measurement backend. */
|
|
5
|
-
interface MeasurementAdapter {
|
|
6
|
-
measureSegment(text: string, font: string): {
|
|
7
|
-
width: number;
|
|
8
|
-
};
|
|
9
|
-
/** Optional; adapters may omit for read-only / stateless measurement. */
|
|
10
|
-
clearCache?(): void;
|
|
11
|
-
}
|
|
12
|
-
/** Mutable counters for `analyzeAndMeasure` cache hit ratio (hits / (hits + misses)). */
|
|
13
|
-
type SegmentMeasureStats = {
|
|
14
|
-
hits: number;
|
|
15
|
-
misses: number;
|
|
16
|
-
};
|
|
17
|
-
/** Break kind for each segment (ported from Pretext analysis.ts). */
|
|
18
|
-
type SegmentBreakKind = "text" | "space" | "zero-width-break" | "soft-hyphen" | "hard-break";
|
|
19
|
-
/** A measured text segment ready for line breaking. */
|
|
20
|
-
type PreparedSegment = {
|
|
21
|
-
text: string;
|
|
22
|
-
width: number;
|
|
23
|
-
kind: SegmentBreakKind;
|
|
24
|
-
/** Grapheme widths for overflow-wrap: break-word (null if single grapheme). */
|
|
25
|
-
graphemeWidths: number[] | null;
|
|
26
|
-
};
|
|
27
|
-
/** A laid-out line with start/end cursors. */
|
|
28
|
-
type LayoutLine = {
|
|
29
|
-
text: string;
|
|
30
|
-
width: number;
|
|
31
|
-
startSegment: number;
|
|
32
|
-
startGrapheme: number;
|
|
33
|
-
endSegment: number;
|
|
34
|
-
endGrapheme: number;
|
|
35
|
-
};
|
|
36
|
-
/** Per-character position for hit testing. */
|
|
37
|
-
type CharPosition = {
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
width: number;
|
|
41
|
-
height: number;
|
|
42
|
-
line: number;
|
|
43
|
-
};
|
|
44
|
-
/** Full layout result from the line-breaks derived node. */
|
|
45
|
-
type LineBreaksResult = {
|
|
46
|
-
lines: LayoutLine[];
|
|
47
|
-
lineCount: number;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* A position within `PreparedSegment[]` — segment + grapheme offset.
|
|
51
|
-
* `graphemeIndex: 0` at segment boundaries.
|
|
52
|
-
*
|
|
53
|
-
* Used by {@link layoutNextLine} for cursor-based line walking; needed when
|
|
54
|
-
* lines have varying widths (multi-column flow, text wrapping around obstacles).
|
|
55
|
-
*/
|
|
56
|
-
type LayoutCursor = {
|
|
57
|
-
segmentIndex: number;
|
|
58
|
-
graphemeIndex: number;
|
|
59
|
-
};
|
|
60
|
-
/** A horizontal span `[left, right]` in pixels — used by flow-layout slot carving. */
|
|
61
|
-
type Interval = {
|
|
62
|
-
left: number;
|
|
63
|
-
right: number;
|
|
64
|
-
};
|
|
65
|
-
/** Result of a single `layoutNextLine` call. */
|
|
66
|
-
type LayoutNextLineResult = {
|
|
67
|
-
text: string;
|
|
68
|
-
width: number;
|
|
69
|
-
start: LayoutCursor;
|
|
70
|
-
end: LayoutCursor;
|
|
71
|
-
};
|
|
72
|
-
/** Optional context for `layoutNextLine` — enables soft-hyphen visible-hyphen rendering. */
|
|
73
|
-
type LayoutNextLineContext = {
|
|
74
|
-
adapter?: MeasurementAdapter;
|
|
75
|
-
font?: string;
|
|
76
|
-
cache?: Map<string, Map<string, number>>;
|
|
77
|
-
};
|
|
78
|
-
/** Result of the reactive layout graph's describe-accessible state. */
|
|
79
|
-
type ReactiveLayoutBundle = {
|
|
80
|
-
graph: Graph;
|
|
81
|
-
/** Set input text. */
|
|
82
|
-
setText: (text: string) => void;
|
|
83
|
-
/** Set CSS font string. */
|
|
84
|
-
setFont: (font: string) => void;
|
|
85
|
-
/** Set line height (px). */
|
|
86
|
-
setLineHeight: (lineHeight: number) => void;
|
|
87
|
-
/** Set max width constraint (px). */
|
|
88
|
-
setMaxWidth: (maxWidth: number) => void;
|
|
89
|
-
/** Segments node. */
|
|
90
|
-
segments: Node<PreparedSegment[]>;
|
|
91
|
-
/** Line breaks node. */
|
|
92
|
-
lineBreaks: Node<LineBreaksResult>;
|
|
93
|
-
/** Total height node. */
|
|
94
|
-
height: Node<number>;
|
|
95
|
-
/** Per-character positions node. */
|
|
96
|
-
charPositions: Node<CharPosition[]>;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Merge segmentation pieces: sticky punctuation, CJK per-grapheme splitting,
|
|
100
|
-
* and produce the final measured segment list.
|
|
101
|
-
*/
|
|
102
|
-
declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats): PreparedSegment[];
|
|
103
|
-
/**
|
|
104
|
-
* Greedy line-breaking algorithm.
|
|
105
|
-
*
|
|
106
|
-
* Walks segments left to right, accumulating width. Breaks when a segment would
|
|
107
|
-
* overflow maxWidth. Supports:
|
|
108
|
-
* - Trailing space hang (spaces don't trigger breaks)
|
|
109
|
-
* - overflow-wrap: break-word via grapheme widths
|
|
110
|
-
* - Soft hyphens (break opportunity, adds visible hyphen width)
|
|
111
|
-
* - Hard breaks (forced newline)
|
|
112
|
-
*/
|
|
113
|
-
declare function computeLineBreaks(segments: PreparedSegment[], maxWidth: number, adapter: MeasurementAdapter, font: string, cache: Map<string, Map<string, number>>): LineBreaksResult;
|
|
114
|
-
/**
|
|
115
|
-
* Lay out the next single line starting from `cursor`, fitting into `slotWidth`.
|
|
116
|
-
*
|
|
117
|
-
* Unlike `computeLineBreaks`, which consumes whole text with one `maxWidth`,
|
|
118
|
-
* this is the cursor-based primitive needed when successive lines have different
|
|
119
|
-
* widths (multi-column flow, text wrapping around shape obstacles, mixed
|
|
120
|
-
* column+pullquote layouts).
|
|
121
|
-
*
|
|
122
|
-
* Returns `null` when the cursor is past all segments (text exhausted).
|
|
123
|
-
* At a hard-break with no preceding content, returns an empty line and advances
|
|
124
|
-
* the cursor past the break so the caller can continue.
|
|
125
|
-
*
|
|
126
|
-
* ```ts
|
|
127
|
-
* let cursor: LayoutCursor = { segmentIndex: 0, graphemeIndex: 0 };
|
|
128
|
-
* while (true) {
|
|
129
|
-
* const line = layoutNextLine(segments, cursor, availableWidth);
|
|
130
|
-
* if (line === null) break;
|
|
131
|
-
* render(line);
|
|
132
|
-
* cursor = line.end;
|
|
133
|
-
* }
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
declare function layoutNextLine(segments: PreparedSegment[], cursor: LayoutCursor, slotWidth: number, ctx?: LayoutNextLineContext): LayoutNextLineResult | null;
|
|
137
|
-
/**
|
|
138
|
-
* Subtract blocked horizontal intervals from a base interval, producing
|
|
139
|
-
* remaining ordered, non-overlapping slots wide enough to fit text.
|
|
140
|
-
*
|
|
141
|
-
* Pure geometry — no text dependency. Used by flow-layout to turn obstacle
|
|
142
|
-
* intersections into per-line layout slots.
|
|
143
|
-
*
|
|
144
|
-
* ```ts
|
|
145
|
-
* carveTextLineSlots({left: 0, right: 600}, [{left: 200, right: 280}])
|
|
146
|
-
* // → [{left: 0, right: 200}, {left: 280, right: 600}]
|
|
147
|
-
* ```
|
|
148
|
-
*/
|
|
149
|
-
declare function carveTextLineSlots(base: Interval, blocked: Interval[], minSlotWidth?: number): Interval[];
|
|
150
|
-
/** Compute per-character x,y positions from line breaks and segments. */
|
|
151
|
-
declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: PreparedSegment[], lineHeight: number): CharPosition[];
|
|
152
|
-
type ReactiveLayoutOptions = {
|
|
153
|
-
/** Measurement backend (required). */
|
|
154
|
-
adapter: MeasurementAdapter;
|
|
155
|
-
/** Graph name (default: "reactive-layout"). */
|
|
156
|
-
name?: string;
|
|
157
|
-
/** Initial text. */
|
|
158
|
-
text?: string;
|
|
159
|
-
/** Initial CSS font string. */
|
|
160
|
-
font?: string;
|
|
161
|
-
/** Initial line height in px. */
|
|
162
|
-
lineHeight?: number;
|
|
163
|
-
/** Initial max width in px (clamped to ≥ 0). */
|
|
164
|
-
maxWidth?: number;
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* Create a reactive text layout graph.
|
|
168
|
-
*
|
|
169
|
-
* ```
|
|
170
|
-
* Graph("reactive-layout")
|
|
171
|
-
* ├── state("text")
|
|
172
|
-
* ├── state("font")
|
|
173
|
-
* ├── state("line-height")
|
|
174
|
-
* ├── state("max-width")
|
|
175
|
-
* ├── derived("segments") — text + font → PreparedSegment[]
|
|
176
|
-
* ├── derived("line-breaks") — segments + max-width → LineBreaksResult
|
|
177
|
-
* ├── derived("height") — line-breaks → number
|
|
178
|
-
* └── derived("char-positions") — line-breaks + segments → CharPosition[]
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
declare function reactiveLayout(opts: ReactiveLayoutOptions): ReactiveLayoutBundle;
|
|
182
|
-
|
|
183
|
-
export { type CharPosition as C, type Interval as I, type LineBreaksResult as L, type MeasurementAdapter as M, type PreparedSegment as P, type ReactiveLayoutBundle as R, type SegmentBreakKind as S, type LayoutCursor as a, type LayoutLine as b, type LayoutNextLineContext as c, type LayoutNextLineResult as d, type ReactiveLayoutOptions as e, type SegmentMeasureStats as f, analyzeAndMeasure as g, carveTextLineSlots as h, computeCharPositions as i, computeLineBreaks as j, layoutNextLine as l, reactiveLayout as r };
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { V as VersioningLevel, b as NodeGuard, N as Node } from './node-ClS5yC-B.cjs';
|
|
2
|
-
import { AppendLogStorageTier } from './extra/storage-tiers.cjs';
|
|
3
|
-
|
|
4
|
-
type ReactiveLogOptions<T> = {
|
|
5
|
-
name?: string;
|
|
6
|
-
maxSize?: number;
|
|
7
|
-
/**
|
|
8
|
-
* Optional versioning level for the underlying `entries` state node. Set
|
|
9
|
-
* at construction time; cannot be changed later. Pass `0` for V0 identity
|
|
10
|
-
* + monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
11
|
-
*/
|
|
12
|
-
versioning?: VersioningLevel;
|
|
13
|
-
/**
|
|
14
|
-
* Optional guard policy applied to the `entries` node. Use to deny
|
|
15
|
-
* external `write` while permitting `observe` / `signal` — eliminates the
|
|
16
|
-
* passthrough-derived pattern in CQRS event streams (Audit 1 #7).
|
|
17
|
-
*/
|
|
18
|
-
guard?: NodeGuard;
|
|
19
|
-
/**
|
|
20
|
-
* Storage backend. Defaults to `NativeLogBackend` (ring buffer if `maxSize` is set,
|
|
21
|
-
* flat array otherwise). Users can plug in persistent / RRB-tree backends via
|
|
22
|
-
* the {@link LogBackend} interface.
|
|
23
|
-
*/
|
|
24
|
-
backend?: LogBackend<T>;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Discriminated view spec for {@link ReactiveLogBundle.view}. New `kind`s
|
|
28
|
-
* (e.g. `"filter"`, `"windowByTime"`) layer in without new methods.
|
|
29
|
-
*/
|
|
30
|
-
type ViewSpec<_T = unknown> = {
|
|
31
|
-
kind: "tail";
|
|
32
|
-
n: number;
|
|
33
|
-
} | {
|
|
34
|
-
kind: "slice";
|
|
35
|
-
start: number;
|
|
36
|
-
stop?: number;
|
|
37
|
-
} | {
|
|
38
|
-
kind: "fromCursor";
|
|
39
|
-
cursor: Node<number>;
|
|
40
|
-
};
|
|
41
|
-
type ReactiveLogBundle<T> = {
|
|
42
|
-
/** Emits `readonly T[]` on each append/clear/trim (two-phase). */
|
|
43
|
-
readonly entries: Node<readonly T[]>;
|
|
44
|
-
/** Current entry count (O(1)). */
|
|
45
|
-
readonly size: number;
|
|
46
|
-
/** Positional access (O(1)); returns `undefined` on out-of-range. Supports negative indices. */
|
|
47
|
-
at: (index: number) => T | undefined;
|
|
48
|
-
append: (value: T) => void;
|
|
49
|
-
/** Push all values, emit one snapshot. No-op if `values` is empty. */
|
|
50
|
-
appendMany: (values: readonly T[]) => void;
|
|
51
|
-
clear: () => void;
|
|
52
|
-
/** Remove the first `n` entries (clamped to `size`). */
|
|
53
|
-
trimHead: (n: number) => void;
|
|
54
|
-
/**
|
|
55
|
-
* Activate the {@link ReactiveLogBundle.lastValue} / {@link ReactiveLogBundle.hasLatest}
|
|
56
|
-
* companion nodes (lazy — installed on first call, reused thereafter).
|
|
57
|
-
* Returns `entries` so chaining reads naturally.
|
|
58
|
-
*
|
|
59
|
-
* **Companion-node access is on the bundle** (not `entries.meta`) because
|
|
60
|
-
* `Node.meta` is frozen at construction; bundle-level lazy properties
|
|
61
|
-
* give the same semantics with simpler ergonomics.
|
|
62
|
-
*/
|
|
63
|
-
withLatest: () => Node<readonly T[]>;
|
|
64
|
-
/**
|
|
65
|
-
* Most-recently-appended value, or `undefined` if no entries exist (spec
|
|
66
|
-
* §5.12 SENTINEL alignment). Accessing this property activates the
|
|
67
|
-
* companion lazily — same as calling {@link ReactiveLogBundle.withLatest}.
|
|
68
|
-
*
|
|
69
|
-
* **Empty-log path emits `RESOLVED`, not `DATA(undefined)`.** When the log
|
|
70
|
-
* holds no entries, `lastValue` settles via `[[RESOLVED]]` so the §1.2
|
|
71
|
-
* "DATA(undefined) is not a valid emission" invariant stands.
|
|
72
|
-
*
|
|
73
|
-
* **Caveat when `T` itself includes `undefined`:** if a literal `undefined`
|
|
74
|
-
* value is appended, `lastValue` emits `[[DATA, undefined]]` for that
|
|
75
|
-
* append wave — the per-value semantics are intentionally preserved so
|
|
76
|
-
* subscribers can observe the transition. Use
|
|
77
|
-
* {@link ReactiveLogBundle.hasLatest} to disambiguate "no entries yet"
|
|
78
|
-
* from "an undefined value was appended"; `lastValue.cache` alone cannot
|
|
79
|
-
* tell them apart.
|
|
80
|
-
*/
|
|
81
|
-
readonly lastValue: Node<T | undefined>;
|
|
82
|
-
/** Reactive `true` once at least one entry has been appended. */
|
|
83
|
-
readonly hasLatest: Node<boolean>;
|
|
84
|
-
/**
|
|
85
|
-
* Reactive view per discriminated `ViewSpec`. Memoized per-spec — repeat
|
|
86
|
-
* calls with identical spec return the same node.
|
|
87
|
-
*/
|
|
88
|
-
view: (spec: ViewSpec<T>) => Node<readonly T[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Subscribe to `upstream` and append every DATA into this log. Returns a
|
|
91
|
-
* disposer. ERROR / COMPLETE on `upstream` propagate through the disposer
|
|
92
|
-
* (caller is responsible for terminal handling on the log).
|
|
93
|
-
*/
|
|
94
|
-
attach: (upstream: Node<T>) => () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Wire one or more append-log storage tiers. Each tier receives entries on
|
|
97
|
-
* every append wave; tier-internal flush/rollback honors the wave-as-
|
|
98
|
-
* transaction model (Audit 4). Returns a disposer.
|
|
99
|
-
*/
|
|
100
|
-
attachStorage: (tiers: readonly AppendLogStorageTier<T>[]) => () => void;
|
|
101
|
-
/** Releases all cached views (tail + slice + fromCursor). */
|
|
102
|
-
disposeAllViews: () => void;
|
|
103
|
-
/** Releases all internal keepalives. Idempotent. */
|
|
104
|
-
dispose: () => void;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Storage contract for {@link reactiveLog}. Implementations own the mutable state and
|
|
108
|
-
* expose a monotonic `version` counter that increments on every structural change.
|
|
109
|
-
*
|
|
110
|
-
* **Audit 1:** `snapshot()` returns an immutable readonly view (codec encodes
|
|
111
|
-
* at the storage tier boundary). `restore(values)` replaces backend state on
|
|
112
|
-
* cold-tier startup load — fires one DATA emission for the restored shape.
|
|
113
|
-
*
|
|
114
|
-
* @category extra
|
|
115
|
-
*/
|
|
116
|
-
interface LogBackend<T> {
|
|
117
|
-
readonly version: number;
|
|
118
|
-
readonly size: number;
|
|
119
|
-
at(index: number): T | undefined;
|
|
120
|
-
append(value: T): void;
|
|
121
|
-
appendMany(values: readonly T[]): void;
|
|
122
|
-
clear(): number;
|
|
123
|
-
trimHead(n: number): number;
|
|
124
|
-
slice(start: number, stop?: number): readonly T[];
|
|
125
|
-
tail(n: number): readonly T[];
|
|
126
|
-
toArray(): readonly T[];
|
|
127
|
-
/** Immutable snapshot for codec serialization. Equivalent to `toArray()`. */
|
|
128
|
-
snapshot(): readonly T[];
|
|
129
|
-
/** Replace backend state with `values` (used by cold-tier restore). */
|
|
130
|
-
restore(values: readonly T[]): void;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Default append-only log backend.
|
|
134
|
-
*
|
|
135
|
-
* - When `maxSize` is set: uses a **ring buffer** with `_head` index and circular
|
|
136
|
-
* modular arithmetic. Append and trim become O(1); snapshot is O(size) unrolling.
|
|
137
|
-
* - When `maxSize` is unset: uses a flat array with standard push/splice.
|
|
138
|
-
*
|
|
139
|
-
* @category extra
|
|
140
|
-
*/
|
|
141
|
-
declare class NativeLogBackend<T> implements LogBackend<T> {
|
|
142
|
-
private _version;
|
|
143
|
-
private readonly _maxSize?;
|
|
144
|
-
private readonly _buf;
|
|
145
|
-
private _head;
|
|
146
|
-
private _size;
|
|
147
|
-
constructor(initial?: readonly T[], maxSize?: number);
|
|
148
|
-
get version(): number;
|
|
149
|
-
get size(): number;
|
|
150
|
-
at(index: number): T | undefined;
|
|
151
|
-
append(value: T): void;
|
|
152
|
-
appendMany(values: readonly T[]): void;
|
|
153
|
-
clear(): number;
|
|
154
|
-
trimHead(n: number): number;
|
|
155
|
-
slice(start: number, stop?: number): readonly T[];
|
|
156
|
-
tail(n: number): readonly T[];
|
|
157
|
-
toArray(): readonly T[];
|
|
158
|
-
snapshot(): readonly T[];
|
|
159
|
-
restore(values: readonly T[]): void;
|
|
160
|
-
private _rawAppend;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Creates an append-only reactive log that emits immutable `readonly T[]` snapshots.
|
|
164
|
-
*
|
|
165
|
-
* Each structural mutation (`append`, `appendMany`, `clear`, `trimHead`) triggers
|
|
166
|
-
* a two-phase `[DIRTY, DATA]` emission on the `entries` node so downstream
|
|
167
|
-
* derived nodes update reactively. Views (`tail`, `slice`, `fromCursor`) are
|
|
168
|
-
* memoized derived nodes — subscribe once and they stay live.
|
|
169
|
-
*
|
|
170
|
-
* @param initial - Optional initial entries loaded into the log at construction.
|
|
171
|
-
* @param options - Optional name, max size (ring buffer), versioning level, guard policy, and custom backend.
|
|
172
|
-
* @returns `ReactiveLogBundle<T>` with `entries`, `append`, `appendMany`, `clear`, `trimHead`, `view`, `attach`, `attachStorage`, and disposal methods.
|
|
173
|
-
*
|
|
174
|
-
* @example
|
|
175
|
-
* ```ts
|
|
176
|
-
* import { reactiveLog } from "@graphrefly/graphrefly/extra";
|
|
177
|
-
*
|
|
178
|
-
* const log = reactiveLog<string>([], { name: "messages" });
|
|
179
|
-
* log.entries.subscribe((msgs) => {
|
|
180
|
-
* for (const m of msgs) {
|
|
181
|
-
* if (m[0] === 1) console.log("entries:", m[1]);
|
|
182
|
-
* }
|
|
183
|
-
* });
|
|
184
|
-
* log.append("hello");
|
|
185
|
-
* log.append("world");
|
|
186
|
-
* ```
|
|
187
|
-
*
|
|
188
|
-
* @remarks
|
|
189
|
-
* **Ring buffer:** Pass `maxSize` to cap the log length; older entries are evicted on overflow.
|
|
190
|
-
* **Storage:** Call `attachStorage(tiers)` to wire one or more `AppendLogStorageTier` instances for persistence.
|
|
191
|
-
*
|
|
192
|
-
* @category extra
|
|
193
|
-
*/
|
|
194
|
-
declare function reactiveLog<T>(initial?: readonly T[], options?: ReactiveLogOptions<T>): ReactiveLogBundle<T>;
|
|
195
|
-
/**
|
|
196
|
-
* Bundle returned by {@link mergeReactiveLogs}. `node` is the merged output;
|
|
197
|
-
* `dispose()` releases the internal subscriptions to all input logs and the
|
|
198
|
-
* keepalive on `node`. After dispose the merge stops responding to inputs
|
|
199
|
-
* but `node`'s last cached value remains queryable.
|
|
200
|
-
*
|
|
201
|
-
* @category extra
|
|
202
|
-
*/
|
|
203
|
-
interface MergedReactiveLog<T> {
|
|
204
|
-
readonly node: Node<readonly T[]>;
|
|
205
|
-
dispose(): void;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Fan-in helper that merges N reactive logs into a single time-ordered output
|
|
209
|
-
* by concatenation. Returns `{ node, dispose }`. Producer-pattern: subscribes
|
|
210
|
-
* to each input internally; COMPLETE on an input drops it from the active
|
|
211
|
-
* set; ERROR propagates per spec §2.2. Memoized by reference identity on the
|
|
212
|
-
* `logs` array — repeat calls with the same reference return the same bundle.
|
|
213
|
-
*
|
|
214
|
-
* Internal subscriptions are invisible in `describe()` (sanctioned per §24);
|
|
215
|
-
* `explain()` across the merge surfaces only the merged stream. Caller must
|
|
216
|
-
* `dispose()` when done to release subscriptions to input logs (no auto-GC
|
|
217
|
-
* because of the memoization map).
|
|
218
|
-
*
|
|
219
|
-
* @category extra
|
|
220
|
-
*/
|
|
221
|
-
declare function mergeReactiveLogs<T>(logs: readonly Node<readonly T[]>[]): MergedReactiveLog<T>;
|
|
222
|
-
|
|
223
|
-
export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogOptions as R, type ViewSpec as V, type ReactiveLogBundle as a, mergeReactiveLogs as m, reactiveLog as r };
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { V as VersioningLevel, b as NodeGuard, N as Node } from './node-ClS5yC-B.js';
|
|
2
|
-
import { AppendLogStorageTier } from './extra/storage-tiers.js';
|
|
3
|
-
|
|
4
|
-
type ReactiveLogOptions<T> = {
|
|
5
|
-
name?: string;
|
|
6
|
-
maxSize?: number;
|
|
7
|
-
/**
|
|
8
|
-
* Optional versioning level for the underlying `entries` state node. Set
|
|
9
|
-
* at construction time; cannot be changed later. Pass `0` for V0 identity
|
|
10
|
-
* + monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
11
|
-
*/
|
|
12
|
-
versioning?: VersioningLevel;
|
|
13
|
-
/**
|
|
14
|
-
* Optional guard policy applied to the `entries` node. Use to deny
|
|
15
|
-
* external `write` while permitting `observe` / `signal` — eliminates the
|
|
16
|
-
* passthrough-derived pattern in CQRS event streams (Audit 1 #7).
|
|
17
|
-
*/
|
|
18
|
-
guard?: NodeGuard;
|
|
19
|
-
/**
|
|
20
|
-
* Storage backend. Defaults to `NativeLogBackend` (ring buffer if `maxSize` is set,
|
|
21
|
-
* flat array otherwise). Users can plug in persistent / RRB-tree backends via
|
|
22
|
-
* the {@link LogBackend} interface.
|
|
23
|
-
*/
|
|
24
|
-
backend?: LogBackend<T>;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Discriminated view spec for {@link ReactiveLogBundle.view}. New `kind`s
|
|
28
|
-
* (e.g. `"filter"`, `"windowByTime"`) layer in without new methods.
|
|
29
|
-
*/
|
|
30
|
-
type ViewSpec<_T = unknown> = {
|
|
31
|
-
kind: "tail";
|
|
32
|
-
n: number;
|
|
33
|
-
} | {
|
|
34
|
-
kind: "slice";
|
|
35
|
-
start: number;
|
|
36
|
-
stop?: number;
|
|
37
|
-
} | {
|
|
38
|
-
kind: "fromCursor";
|
|
39
|
-
cursor: Node<number>;
|
|
40
|
-
};
|
|
41
|
-
type ReactiveLogBundle<T> = {
|
|
42
|
-
/** Emits `readonly T[]` on each append/clear/trim (two-phase). */
|
|
43
|
-
readonly entries: Node<readonly T[]>;
|
|
44
|
-
/** Current entry count (O(1)). */
|
|
45
|
-
readonly size: number;
|
|
46
|
-
/** Positional access (O(1)); returns `undefined` on out-of-range. Supports negative indices. */
|
|
47
|
-
at: (index: number) => T | undefined;
|
|
48
|
-
append: (value: T) => void;
|
|
49
|
-
/** Push all values, emit one snapshot. No-op if `values` is empty. */
|
|
50
|
-
appendMany: (values: readonly T[]) => void;
|
|
51
|
-
clear: () => void;
|
|
52
|
-
/** Remove the first `n` entries (clamped to `size`). */
|
|
53
|
-
trimHead: (n: number) => void;
|
|
54
|
-
/**
|
|
55
|
-
* Activate the {@link ReactiveLogBundle.lastValue} / {@link ReactiveLogBundle.hasLatest}
|
|
56
|
-
* companion nodes (lazy — installed on first call, reused thereafter).
|
|
57
|
-
* Returns `entries` so chaining reads naturally.
|
|
58
|
-
*
|
|
59
|
-
* **Companion-node access is on the bundle** (not `entries.meta`) because
|
|
60
|
-
* `Node.meta` is frozen at construction; bundle-level lazy properties
|
|
61
|
-
* give the same semantics with simpler ergonomics.
|
|
62
|
-
*/
|
|
63
|
-
withLatest: () => Node<readonly T[]>;
|
|
64
|
-
/**
|
|
65
|
-
* Most-recently-appended value, or `undefined` if no entries exist (spec
|
|
66
|
-
* §5.12 SENTINEL alignment). Accessing this property activates the
|
|
67
|
-
* companion lazily — same as calling {@link ReactiveLogBundle.withLatest}.
|
|
68
|
-
*
|
|
69
|
-
* **Empty-log path emits `RESOLVED`, not `DATA(undefined)`.** When the log
|
|
70
|
-
* holds no entries, `lastValue` settles via `[[RESOLVED]]` so the §1.2
|
|
71
|
-
* "DATA(undefined) is not a valid emission" invariant stands.
|
|
72
|
-
*
|
|
73
|
-
* **Caveat when `T` itself includes `undefined`:** if a literal `undefined`
|
|
74
|
-
* value is appended, `lastValue` emits `[[DATA, undefined]]` for that
|
|
75
|
-
* append wave — the per-value semantics are intentionally preserved so
|
|
76
|
-
* subscribers can observe the transition. Use
|
|
77
|
-
* {@link ReactiveLogBundle.hasLatest} to disambiguate "no entries yet"
|
|
78
|
-
* from "an undefined value was appended"; `lastValue.cache` alone cannot
|
|
79
|
-
* tell them apart.
|
|
80
|
-
*/
|
|
81
|
-
readonly lastValue: Node<T | undefined>;
|
|
82
|
-
/** Reactive `true` once at least one entry has been appended. */
|
|
83
|
-
readonly hasLatest: Node<boolean>;
|
|
84
|
-
/**
|
|
85
|
-
* Reactive view per discriminated `ViewSpec`. Memoized per-spec — repeat
|
|
86
|
-
* calls with identical spec return the same node.
|
|
87
|
-
*/
|
|
88
|
-
view: (spec: ViewSpec<T>) => Node<readonly T[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Subscribe to `upstream` and append every DATA into this log. Returns a
|
|
91
|
-
* disposer. ERROR / COMPLETE on `upstream` propagate through the disposer
|
|
92
|
-
* (caller is responsible for terminal handling on the log).
|
|
93
|
-
*/
|
|
94
|
-
attach: (upstream: Node<T>) => () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Wire one or more append-log storage tiers. Each tier receives entries on
|
|
97
|
-
* every append wave; tier-internal flush/rollback honors the wave-as-
|
|
98
|
-
* transaction model (Audit 4). Returns a disposer.
|
|
99
|
-
*/
|
|
100
|
-
attachStorage: (tiers: readonly AppendLogStorageTier<T>[]) => () => void;
|
|
101
|
-
/** Releases all cached views (tail + slice + fromCursor). */
|
|
102
|
-
disposeAllViews: () => void;
|
|
103
|
-
/** Releases all internal keepalives. Idempotent. */
|
|
104
|
-
dispose: () => void;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Storage contract for {@link reactiveLog}. Implementations own the mutable state and
|
|
108
|
-
* expose a monotonic `version` counter that increments on every structural change.
|
|
109
|
-
*
|
|
110
|
-
* **Audit 1:** `snapshot()` returns an immutable readonly view (codec encodes
|
|
111
|
-
* at the storage tier boundary). `restore(values)` replaces backend state on
|
|
112
|
-
* cold-tier startup load — fires one DATA emission for the restored shape.
|
|
113
|
-
*
|
|
114
|
-
* @category extra
|
|
115
|
-
*/
|
|
116
|
-
interface LogBackend<T> {
|
|
117
|
-
readonly version: number;
|
|
118
|
-
readonly size: number;
|
|
119
|
-
at(index: number): T | undefined;
|
|
120
|
-
append(value: T): void;
|
|
121
|
-
appendMany(values: readonly T[]): void;
|
|
122
|
-
clear(): number;
|
|
123
|
-
trimHead(n: number): number;
|
|
124
|
-
slice(start: number, stop?: number): readonly T[];
|
|
125
|
-
tail(n: number): readonly T[];
|
|
126
|
-
toArray(): readonly T[];
|
|
127
|
-
/** Immutable snapshot for codec serialization. Equivalent to `toArray()`. */
|
|
128
|
-
snapshot(): readonly T[];
|
|
129
|
-
/** Replace backend state with `values` (used by cold-tier restore). */
|
|
130
|
-
restore(values: readonly T[]): void;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Default append-only log backend.
|
|
134
|
-
*
|
|
135
|
-
* - When `maxSize` is set: uses a **ring buffer** with `_head` index and circular
|
|
136
|
-
* modular arithmetic. Append and trim become O(1); snapshot is O(size) unrolling.
|
|
137
|
-
* - When `maxSize` is unset: uses a flat array with standard push/splice.
|
|
138
|
-
*
|
|
139
|
-
* @category extra
|
|
140
|
-
*/
|
|
141
|
-
declare class NativeLogBackend<T> implements LogBackend<T> {
|
|
142
|
-
private _version;
|
|
143
|
-
private readonly _maxSize?;
|
|
144
|
-
private readonly _buf;
|
|
145
|
-
private _head;
|
|
146
|
-
private _size;
|
|
147
|
-
constructor(initial?: readonly T[], maxSize?: number);
|
|
148
|
-
get version(): number;
|
|
149
|
-
get size(): number;
|
|
150
|
-
at(index: number): T | undefined;
|
|
151
|
-
append(value: T): void;
|
|
152
|
-
appendMany(values: readonly T[]): void;
|
|
153
|
-
clear(): number;
|
|
154
|
-
trimHead(n: number): number;
|
|
155
|
-
slice(start: number, stop?: number): readonly T[];
|
|
156
|
-
tail(n: number): readonly T[];
|
|
157
|
-
toArray(): readonly T[];
|
|
158
|
-
snapshot(): readonly T[];
|
|
159
|
-
restore(values: readonly T[]): void;
|
|
160
|
-
private _rawAppend;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Creates an append-only reactive log that emits immutable `readonly T[]` snapshots.
|
|
164
|
-
*
|
|
165
|
-
* Each structural mutation (`append`, `appendMany`, `clear`, `trimHead`) triggers
|
|
166
|
-
* a two-phase `[DIRTY, DATA]` emission on the `entries` node so downstream
|
|
167
|
-
* derived nodes update reactively. Views (`tail`, `slice`, `fromCursor`) are
|
|
168
|
-
* memoized derived nodes — subscribe once and they stay live.
|
|
169
|
-
*
|
|
170
|
-
* @param initial - Optional initial entries loaded into the log at construction.
|
|
171
|
-
* @param options - Optional name, max size (ring buffer), versioning level, guard policy, and custom backend.
|
|
172
|
-
* @returns `ReactiveLogBundle<T>` with `entries`, `append`, `appendMany`, `clear`, `trimHead`, `view`, `attach`, `attachStorage`, and disposal methods.
|
|
173
|
-
*
|
|
174
|
-
* @example
|
|
175
|
-
* ```ts
|
|
176
|
-
* import { reactiveLog } from "@graphrefly/graphrefly/extra";
|
|
177
|
-
*
|
|
178
|
-
* const log = reactiveLog<string>([], { name: "messages" });
|
|
179
|
-
* log.entries.subscribe((msgs) => {
|
|
180
|
-
* for (const m of msgs) {
|
|
181
|
-
* if (m[0] === 1) console.log("entries:", m[1]);
|
|
182
|
-
* }
|
|
183
|
-
* });
|
|
184
|
-
* log.append("hello");
|
|
185
|
-
* log.append("world");
|
|
186
|
-
* ```
|
|
187
|
-
*
|
|
188
|
-
* @remarks
|
|
189
|
-
* **Ring buffer:** Pass `maxSize` to cap the log length; older entries are evicted on overflow.
|
|
190
|
-
* **Storage:** Call `attachStorage(tiers)` to wire one or more `AppendLogStorageTier` instances for persistence.
|
|
191
|
-
*
|
|
192
|
-
* @category extra
|
|
193
|
-
*/
|
|
194
|
-
declare function reactiveLog<T>(initial?: readonly T[], options?: ReactiveLogOptions<T>): ReactiveLogBundle<T>;
|
|
195
|
-
/**
|
|
196
|
-
* Bundle returned by {@link mergeReactiveLogs}. `node` is the merged output;
|
|
197
|
-
* `dispose()` releases the internal subscriptions to all input logs and the
|
|
198
|
-
* keepalive on `node`. After dispose the merge stops responding to inputs
|
|
199
|
-
* but `node`'s last cached value remains queryable.
|
|
200
|
-
*
|
|
201
|
-
* @category extra
|
|
202
|
-
*/
|
|
203
|
-
interface MergedReactiveLog<T> {
|
|
204
|
-
readonly node: Node<readonly T[]>;
|
|
205
|
-
dispose(): void;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Fan-in helper that merges N reactive logs into a single time-ordered output
|
|
209
|
-
* by concatenation. Returns `{ node, dispose }`. Producer-pattern: subscribes
|
|
210
|
-
* to each input internally; COMPLETE on an input drops it from the active
|
|
211
|
-
* set; ERROR propagates per spec §2.2. Memoized by reference identity on the
|
|
212
|
-
* `logs` array — repeat calls with the same reference return the same bundle.
|
|
213
|
-
*
|
|
214
|
-
* Internal subscriptions are invisible in `describe()` (sanctioned per §24);
|
|
215
|
-
* `explain()` across the merge surfaces only the merged stream. Caller must
|
|
216
|
-
* `dispose()` when done to release subscriptions to input logs (no auto-GC
|
|
217
|
-
* because of the memoization map).
|
|
218
|
-
*
|
|
219
|
-
* @category extra
|
|
220
|
-
*/
|
|
221
|
-
declare function mergeReactiveLogs<T>(logs: readonly Node<readonly T[]>[]): MergedReactiveLog<T>;
|
|
222
|
-
|
|
223
|
-
export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogOptions as R, type ViewSpec as V, type ReactiveLogBundle as a, mergeReactiveLogs as m, reactiveLog as r };
|