@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,296 +0,0 @@
|
|
|
1
|
-
import { N as Node, V as VersioningLevel, a as NodeOptions } from './node-ClS5yC-B.cjs';
|
|
2
|
-
|
|
3
|
-
type ReactiveMapOptions<K, V> = {
|
|
4
|
-
/** Optional registry name for `describe()` / debugging. */
|
|
5
|
-
name?: string;
|
|
6
|
-
/**
|
|
7
|
-
* LRU cap. When set, evicts least-recently-used keys after inserts that exceed this size.
|
|
8
|
-
* Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
|
|
9
|
-
*
|
|
10
|
-
* **Mutually exclusive with `retention`** — the LRU cap is "youngest-access wins,"
|
|
11
|
-
* score-based retention is "highest-score wins." Configuring both would make
|
|
12
|
-
* eviction nondeterministic; construction throws if both are set.
|
|
13
|
-
*/
|
|
14
|
-
maxSize?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Default TTL in seconds. Used when `set`/`setMany` omits per-call `ttl`.
|
|
17
|
-
* Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
|
|
18
|
-
*/
|
|
19
|
-
defaultTtl?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Storage backend. Defaults to `NativeMapBackend`. Users can plug in persistent
|
|
22
|
-
* (HAMT / Immutable.js) or shared-state backends via the {@link MapBackend} interface.
|
|
23
|
-
*/
|
|
24
|
-
backend?: MapBackend<K, V>;
|
|
25
|
-
/**
|
|
26
|
-
* Optional versioning level for the underlying `entries` state node. Set at
|
|
27
|
-
* construction time; cannot be changed later. Pass `0` for V0 identity +
|
|
28
|
-
* monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
29
|
-
*/
|
|
30
|
-
versioning?: VersioningLevel;
|
|
31
|
-
/**
|
|
32
|
-
* Score-based retention policy. After every mutation, each live entry is
|
|
33
|
-
* scored; entries below `archiveThreshold` and / or over `maxSize` (lowest-
|
|
34
|
-
* scored first) are archived via `onArchive` before being removed.
|
|
35
|
-
*
|
|
36
|
-
* Retention replaces the ad-hoc "tierClassifier effect writing back to its
|
|
37
|
-
* own store dep" pattern — the feedback cycle is gone because archival is
|
|
38
|
-
* part of the atomic mutation, not a second reactive wave.
|
|
39
|
-
*
|
|
40
|
-
* Mutually exclusive with top-level `maxSize` (LRU). Pass one or the other.
|
|
41
|
-
*/
|
|
42
|
-
retention?: ReactiveMapRetention<K, V>;
|
|
43
|
-
} & Omit<NodeOptions, "initial" | "describeKind" | "equals" | "versioning">;
|
|
44
|
-
/**
|
|
45
|
-
* Score-based retention policy for {@link reactiveMap}. Evaluated synchronously
|
|
46
|
-
* on every successful mutation (`set` / `setMany` / `delete` / `clear` /
|
|
47
|
-
* `pruneExpired`). Entries are archived in ascending score order until the
|
|
48
|
-
* map satisfies both constraints:
|
|
49
|
-
*
|
|
50
|
-
* 1. Every remaining entry has `score >= archiveThreshold` (if set).
|
|
51
|
-
* 2. Total entry count `<= maxSize` (if set).
|
|
52
|
-
*
|
|
53
|
-
* At least one of `archiveThreshold` / `maxSize` must be set; otherwise there's
|
|
54
|
-
* no eviction trigger.
|
|
55
|
-
*
|
|
56
|
-
* **Archival order.** When multiple entries are candidates for archival in the
|
|
57
|
-
* same mutation, they are archived in ascending score order (lowest first). On
|
|
58
|
-
* score ties, iteration order (insertion order in the default backend) is the
|
|
59
|
-
* tiebreak.
|
|
60
|
-
*
|
|
61
|
-
* **No recursion.** Archival deletes happen on the backend directly — they do
|
|
62
|
-
* NOT re-enter the retention evaluator. The one-pass scan collects archival
|
|
63
|
-
* candidates against the post-mutation snapshot before removing them.
|
|
64
|
-
*
|
|
65
|
-
* @category extra
|
|
66
|
-
*/
|
|
67
|
-
type ReactiveMapRetention<K, V> = {
|
|
68
|
-
/** Score entry — higher is kept. Should be a pure function of `(key, value)`. */
|
|
69
|
-
score: (key: K, value: V) => number;
|
|
70
|
-
/** Below-threshold entries are archived. Omit for pure `maxSize`-based retention. */
|
|
71
|
-
archiveThreshold?: number;
|
|
72
|
-
/**
|
|
73
|
-
* Cap on live entry count. Over this, the lowest-scored entries are
|
|
74
|
-
* archived until the size fits. Omit for pure threshold-based retention.
|
|
75
|
-
*/
|
|
76
|
-
maxSize?: number;
|
|
77
|
-
/**
|
|
78
|
-
* Synchronous callback fired **before** archival deletion. Receives the
|
|
79
|
-
* key, value, and computed score. Callers typically persist the entry to
|
|
80
|
-
* a cold tier here (`await permanent.set(key, value)` — async is fine but
|
|
81
|
-
* the archival deletion happens synchronously after this callback
|
|
82
|
-
* returns).
|
|
83
|
-
*/
|
|
84
|
-
onArchive?: (key: K, value: V, score: number) => void;
|
|
85
|
-
};
|
|
86
|
-
type ReactiveMapBundle<K, V> = {
|
|
87
|
-
/** Emits `ReadonlyMap<K, V>` on each structural change (two-phase). */
|
|
88
|
-
entries: Node<ReadonlyMap<K, V>>;
|
|
89
|
-
/**
|
|
90
|
-
* Checks existence. O(1) for live keys. If the key is expired, prunes it AND
|
|
91
|
-
* emits a snapshot so the reactive surface stays consistent with the return
|
|
92
|
-
* value. Reads on expired keys are therefore **observable side effects**.
|
|
93
|
-
*
|
|
94
|
-
* **LRU touch (F4):** When `maxSize` is configured, a live-key `has` also
|
|
95
|
-
* marks the entry as most-recently-used — which rearranges internal insertion
|
|
96
|
-
* order without bumping `version` or emitting. If you care about iteration
|
|
97
|
-
* order in a downstream subscriber, rely on the `entries` snapshot (a fresh
|
|
98
|
-
* `ReadonlyMap` per mutation) rather than iterating the backend directly.
|
|
99
|
-
*/
|
|
100
|
-
has: (key: K) => boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Gets value. O(1) for live keys. If the key is expired, prunes it AND emits
|
|
103
|
-
* a snapshot. Reads on expired keys are therefore **observable side effects**.
|
|
104
|
-
*
|
|
105
|
-
* **LRU touch (F4):** When `maxSize` is configured, a live-key `get` also
|
|
106
|
-
* marks the entry as most-recently-used (no version bump, no emission). See
|
|
107
|
-
* `has` for the full note on iteration order.
|
|
108
|
-
*/
|
|
109
|
-
get: (key: K) => V | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Sets value with optional TTL (seconds). Throws on `ttl <= 0`. Applies LRU eviction
|
|
112
|
-
* if `maxSize` is set. Always emits.
|
|
113
|
-
*/
|
|
114
|
-
set: (key: K, value: V, opts?: {
|
|
115
|
-
ttl?: number;
|
|
116
|
-
}) => void;
|
|
117
|
-
/**
|
|
118
|
-
* Bulk set — emits one snapshot for the whole batch. Applies `opts.ttl` (falls back
|
|
119
|
-
* to `defaultTtl`) to every entry. No-op if `entries` is empty.
|
|
120
|
-
*
|
|
121
|
-
* **Iterable consumption:** Consumes `entries` once (single-pass). Pass an array
|
|
122
|
-
* or `Set` for multi-shot consumers. If the iterator throws mid-iteration,
|
|
123
|
-
* entries already applied remain committed and a snapshot IS emitted (via the
|
|
124
|
-
* wrapper's finally-block).
|
|
125
|
-
*/
|
|
126
|
-
setMany: (entries: Iterable<readonly [K, V]>, opts?: {
|
|
127
|
-
ttl?: number;
|
|
128
|
-
}) => void;
|
|
129
|
-
delete: (key: K) => void;
|
|
130
|
-
/**
|
|
131
|
-
* Bulk delete — emits one snapshot. No-op if no keys were present.
|
|
132
|
-
*
|
|
133
|
-
* **Iterable consumption:** Consumes `keys` once (single-pass).
|
|
134
|
-
*/
|
|
135
|
-
deleteMany: (keys: Iterable<K>) => void;
|
|
136
|
-
clear: () => void;
|
|
137
|
-
/**
|
|
138
|
-
* Current entry count — O(1), **pure read** (no emission). May include
|
|
139
|
-
* expired entries on TTL maps until a mutation or explicit
|
|
140
|
-
* `pruneExpired()` / `has(key)` / `get(key)` prunes them. Call
|
|
141
|
-
* `pruneExpired()` first if you need a live count.
|
|
142
|
-
*/
|
|
143
|
-
readonly size: number;
|
|
144
|
-
/** Explicitly prunes all expired entries. Emits if any were removed. */
|
|
145
|
-
pruneExpired: () => void;
|
|
146
|
-
/**
|
|
147
|
-
* Releases any internal keepalive subscriptions so the bundle can be
|
|
148
|
-
* GC'd. `reactiveMap` currently holds none (the `entries` node lives only
|
|
149
|
-
* as long as external subscribers keep it alive), so `dispose()` is a
|
|
150
|
-
* no-op today — exposed for API parity with `reactiveIndex.dispose` /
|
|
151
|
-
* `reactiveList.dispose` / `reactiveLog.dispose`. Idempotent. D6(a).
|
|
152
|
-
*/
|
|
153
|
-
dispose: () => void;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Storage contract for {@link reactiveMap}. Implementations own the mutable state,
|
|
157
|
-
* including optional TTL and LRU semantics, and expose a monotonic `version` counter
|
|
158
|
-
* that increments on every change to visible state.
|
|
159
|
-
*
|
|
160
|
-
* The reactive layer reads `version` before and after each backend call; when it
|
|
161
|
-
* advances, a snapshot is emitted. Reads (`has`, `get`) may internally prune the
|
|
162
|
-
* target key if expired and advance `version` — in which case the layer emits so
|
|
163
|
-
* subscribers see state consistent with the read's return value.
|
|
164
|
-
*
|
|
165
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
166
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
167
|
-
* should treat all methods here as stable.
|
|
168
|
-
*
|
|
169
|
-
* @category extra
|
|
170
|
-
*/
|
|
171
|
-
interface MapBackend<K, V> {
|
|
172
|
-
/** Monotonic mutation counter; increments on every visible state change. */
|
|
173
|
-
readonly version: number;
|
|
174
|
-
/** Raw entry count (may include expired entries until a read / prune removes them). */
|
|
175
|
-
readonly size: number;
|
|
176
|
-
/** Checks existence. May prune target key if expired; advances `version` if pruned. */
|
|
177
|
-
has(key: K): boolean;
|
|
178
|
-
/** Gets value. May prune target key if expired; advances `version` if pruned. */
|
|
179
|
-
get(key: K): V | undefined;
|
|
180
|
-
/**
|
|
181
|
-
* Sets a value with optional TTL (seconds). Throws `RangeError` if `ttl <= 0`.
|
|
182
|
-
* Applies LRU eviction if `maxSize` is configured. Advances `version`.
|
|
183
|
-
*
|
|
184
|
-
* **Atomicity contract:** Either fully succeeds or throws before any state
|
|
185
|
-
* change; `version` advances only on success.
|
|
186
|
-
*/
|
|
187
|
-
set(key: K, value: V, ttl?: number): void;
|
|
188
|
-
/**
|
|
189
|
-
* Atomic bulk set. Pre-validates TTL once, then applies all entries. Advances
|
|
190
|
-
* `version` at most once (even for N entries). No-op if iterable is empty.
|
|
191
|
-
*
|
|
192
|
-
* **Consumes `entries` once** — pass an array if you want repeatability.
|
|
193
|
-
*
|
|
194
|
-
* **Atomicity contract:** TTL validation throws before any mutation. If the
|
|
195
|
-
* iterable itself throws mid-iteration, entries committed before the throw
|
|
196
|
-
* remain persisted AND `version` is bumped once (surfaced via finally) so
|
|
197
|
-
* the reactive wrapper emits a snapshot reflecting the partial state. "At
|
|
198
|
-
* most once" invariant is preserved.
|
|
199
|
-
*/
|
|
200
|
-
setMany(entries: Iterable<readonly [K, V]>, ttl?: number): void;
|
|
201
|
-
/** Removes a key. Returns `true` if the key existed. Advances `version` only if true. */
|
|
202
|
-
delete(key: K): boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Atomic bulk delete. Returns count removed. Advances `version` at most once
|
|
205
|
-
* (even for N keys). No-op if no keys were present. Consumes `keys` once.
|
|
206
|
-
*/
|
|
207
|
-
deleteMany(keys: Iterable<K>): number;
|
|
208
|
-
/** Removes all entries. Returns count removed. Advances `version` only if non-zero. */
|
|
209
|
-
clear(): number;
|
|
210
|
-
/** Removes all expired entries. Returns count removed. Advances `version` only if non-zero. */
|
|
211
|
-
pruneExpired(): number;
|
|
212
|
-
/** Fresh snapshot of non-expired entries (does NOT mutate state). */
|
|
213
|
-
toMap(): ReadonlyMap<K, V>;
|
|
214
|
-
}
|
|
215
|
-
type NativeMapBackendOptions = {
|
|
216
|
-
maxSize?: number;
|
|
217
|
-
/** Default TTL in seconds. */
|
|
218
|
-
defaultTtl?: number;
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Default `Map<K, {value, expiresAt}>` backend with optional per-key TTL and LRU cap.
|
|
222
|
-
*
|
|
223
|
-
* **Complexity:**
|
|
224
|
-
* - `has`, `get`, `delete`, `size`: O(1)
|
|
225
|
-
* - `set`: O(1) amortized (LRU touch + eviction)
|
|
226
|
-
* - `pruneExpired`, `toMap`: O(n)
|
|
227
|
-
*
|
|
228
|
-
* LRU order uses native `Map` insertion order. `get` / `has` on a live key "touches"
|
|
229
|
-
* it by delete-then-reinsert (moving it to the end). This touch does NOT advance
|
|
230
|
-
* `version` — it's an internal optimization; the externally visible snapshot
|
|
231
|
-
* preserves iteration order as of the last mutation. **Note:** because touch
|
|
232
|
-
* reorders the internal `_store` without emitting, an in-process consumer iterating
|
|
233
|
-
* `_store` directly (custom subclasses) could observe changing order; external
|
|
234
|
-
* subscribers only see `toMap()` snapshots which are defensively copied and stable.
|
|
235
|
-
*
|
|
236
|
-
* @category extra
|
|
237
|
-
*/
|
|
238
|
-
declare class NativeMapBackend<K, V> implements MapBackend<K, V> {
|
|
239
|
-
private _version;
|
|
240
|
-
private readonly _store;
|
|
241
|
-
private readonly _maxSize?;
|
|
242
|
-
private readonly _defaultTtl?;
|
|
243
|
-
constructor(options?: NativeMapBackendOptions);
|
|
244
|
-
get version(): number;
|
|
245
|
-
get size(): number;
|
|
246
|
-
has(key: K): boolean;
|
|
247
|
-
get(key: K): V | undefined;
|
|
248
|
-
set(key: K, value: V, ttl?: number): void;
|
|
249
|
-
setMany(entries: Iterable<readonly [K, V]>, ttl?: number): void;
|
|
250
|
-
delete(key: K): boolean;
|
|
251
|
-
deleteMany(keys: Iterable<K>): number;
|
|
252
|
-
clear(): number;
|
|
253
|
-
pruneExpired(): number;
|
|
254
|
-
toMap(): ReadonlyMap<K, V>;
|
|
255
|
-
private _resolveExpiresAt;
|
|
256
|
-
private _isExpired;
|
|
257
|
-
private _touchLru;
|
|
258
|
-
private _evictLruWhileOver;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Creates a reactive `Map` with optional per-key TTL and optional LRU max size.
|
|
262
|
-
*
|
|
263
|
-
* @param options - `name`, `maxSize`, `defaultTtl` (seconds), or custom `backend`.
|
|
264
|
-
* @returns `ReactiveMapBundle` — imperative methods (`has`/`get`/`set`/`setMany`/`delete`/
|
|
265
|
-
* `deleteMany`/`clear`/`pruneExpired`), reactive `entries` node, and O(1)-ish `size`.
|
|
266
|
-
*
|
|
267
|
-
* @remarks
|
|
268
|
-
* **TTL:** Expiry is checked on `get`, `has`, `size`, `pruneExpired`, and before each
|
|
269
|
-
* snapshot emission (expired keys are pruned first). Reads that discover expired keys
|
|
270
|
-
* emit a snapshot so subscribers see state consistent with the read's return value.
|
|
271
|
-
* There is no background timer; monotonic-clock expiry is immune to wall-clock changes.
|
|
272
|
-
*
|
|
273
|
-
* **LRU:** Uses native `Map` insertion order — `get` / `has` refreshes position via
|
|
274
|
-
* delete-then-reinsert; under `maxSize` pressure the first key in iteration order is
|
|
275
|
-
* evicted. LRU touching does NOT trigger emission (internal optimization).
|
|
276
|
-
*
|
|
277
|
-
* **Backend:** The default {@link NativeMapBackend} owns LRU/TTL. For persistent /
|
|
278
|
-
* HAMT / shared-state semantics plug in a custom {@link MapBackend}. `maxSize` and
|
|
279
|
-
* `defaultTtl` on the options object are only applied to the default backend — if
|
|
280
|
-
* you supply `backend`, configure those on your backend directly.
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* ```ts
|
|
284
|
-
* import { reactiveMap } from "@graphrefly/graphrefly-ts";
|
|
285
|
-
*
|
|
286
|
-
* const m = reactiveMap<string, number>({ name: "cache", maxSize: 100, defaultTtl: 60 });
|
|
287
|
-
* m.set("x", 1);
|
|
288
|
-
* m.setMany([["y", 2], ["z", 3]]);
|
|
289
|
-
* m.entries.subscribe((msgs) => { console.log(msgs); });
|
|
290
|
-
* ```
|
|
291
|
-
*
|
|
292
|
-
* @category extra
|
|
293
|
-
*/
|
|
294
|
-
declare function reactiveMap<K, V>(options?: ReactiveMapOptions<K, V>): ReactiveMapBundle<K, V>;
|
|
295
|
-
|
|
296
|
-
export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type NativeMapBackendOptions as a, type ReactiveMapOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import { N as Node, V as VersioningLevel, a as NodeOptions } from './node-ClS5yC-B.js';
|
|
2
|
-
|
|
3
|
-
type ReactiveMapOptions<K, V> = {
|
|
4
|
-
/** Optional registry name for `describe()` / debugging. */
|
|
5
|
-
name?: string;
|
|
6
|
-
/**
|
|
7
|
-
* LRU cap. When set, evicts least-recently-used keys after inserts that exceed this size.
|
|
8
|
-
* Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
|
|
9
|
-
*
|
|
10
|
-
* **Mutually exclusive with `retention`** — the LRU cap is "youngest-access wins,"
|
|
11
|
-
* score-based retention is "highest-score wins." Configuring both would make
|
|
12
|
-
* eviction nondeterministic; construction throws if both are set.
|
|
13
|
-
*/
|
|
14
|
-
maxSize?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Default TTL in seconds. Used when `set`/`setMany` omits per-call `ttl`.
|
|
17
|
-
* Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
|
|
18
|
-
*/
|
|
19
|
-
defaultTtl?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Storage backend. Defaults to `NativeMapBackend`. Users can plug in persistent
|
|
22
|
-
* (HAMT / Immutable.js) or shared-state backends via the {@link MapBackend} interface.
|
|
23
|
-
*/
|
|
24
|
-
backend?: MapBackend<K, V>;
|
|
25
|
-
/**
|
|
26
|
-
* Optional versioning level for the underlying `entries` state node. Set at
|
|
27
|
-
* construction time; cannot be changed later. Pass `0` for V0 identity +
|
|
28
|
-
* monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
29
|
-
*/
|
|
30
|
-
versioning?: VersioningLevel;
|
|
31
|
-
/**
|
|
32
|
-
* Score-based retention policy. After every mutation, each live entry is
|
|
33
|
-
* scored; entries below `archiveThreshold` and / or over `maxSize` (lowest-
|
|
34
|
-
* scored first) are archived via `onArchive` before being removed.
|
|
35
|
-
*
|
|
36
|
-
* Retention replaces the ad-hoc "tierClassifier effect writing back to its
|
|
37
|
-
* own store dep" pattern — the feedback cycle is gone because archival is
|
|
38
|
-
* part of the atomic mutation, not a second reactive wave.
|
|
39
|
-
*
|
|
40
|
-
* Mutually exclusive with top-level `maxSize` (LRU). Pass one or the other.
|
|
41
|
-
*/
|
|
42
|
-
retention?: ReactiveMapRetention<K, V>;
|
|
43
|
-
} & Omit<NodeOptions, "initial" | "describeKind" | "equals" | "versioning">;
|
|
44
|
-
/**
|
|
45
|
-
* Score-based retention policy for {@link reactiveMap}. Evaluated synchronously
|
|
46
|
-
* on every successful mutation (`set` / `setMany` / `delete` / `clear` /
|
|
47
|
-
* `pruneExpired`). Entries are archived in ascending score order until the
|
|
48
|
-
* map satisfies both constraints:
|
|
49
|
-
*
|
|
50
|
-
* 1. Every remaining entry has `score >= archiveThreshold` (if set).
|
|
51
|
-
* 2. Total entry count `<= maxSize` (if set).
|
|
52
|
-
*
|
|
53
|
-
* At least one of `archiveThreshold` / `maxSize` must be set; otherwise there's
|
|
54
|
-
* no eviction trigger.
|
|
55
|
-
*
|
|
56
|
-
* **Archival order.** When multiple entries are candidates for archival in the
|
|
57
|
-
* same mutation, they are archived in ascending score order (lowest first). On
|
|
58
|
-
* score ties, iteration order (insertion order in the default backend) is the
|
|
59
|
-
* tiebreak.
|
|
60
|
-
*
|
|
61
|
-
* **No recursion.** Archival deletes happen on the backend directly — they do
|
|
62
|
-
* NOT re-enter the retention evaluator. The one-pass scan collects archival
|
|
63
|
-
* candidates against the post-mutation snapshot before removing them.
|
|
64
|
-
*
|
|
65
|
-
* @category extra
|
|
66
|
-
*/
|
|
67
|
-
type ReactiveMapRetention<K, V> = {
|
|
68
|
-
/** Score entry — higher is kept. Should be a pure function of `(key, value)`. */
|
|
69
|
-
score: (key: K, value: V) => number;
|
|
70
|
-
/** Below-threshold entries are archived. Omit for pure `maxSize`-based retention. */
|
|
71
|
-
archiveThreshold?: number;
|
|
72
|
-
/**
|
|
73
|
-
* Cap on live entry count. Over this, the lowest-scored entries are
|
|
74
|
-
* archived until the size fits. Omit for pure threshold-based retention.
|
|
75
|
-
*/
|
|
76
|
-
maxSize?: number;
|
|
77
|
-
/**
|
|
78
|
-
* Synchronous callback fired **before** archival deletion. Receives the
|
|
79
|
-
* key, value, and computed score. Callers typically persist the entry to
|
|
80
|
-
* a cold tier here (`await permanent.set(key, value)` — async is fine but
|
|
81
|
-
* the archival deletion happens synchronously after this callback
|
|
82
|
-
* returns).
|
|
83
|
-
*/
|
|
84
|
-
onArchive?: (key: K, value: V, score: number) => void;
|
|
85
|
-
};
|
|
86
|
-
type ReactiveMapBundle<K, V> = {
|
|
87
|
-
/** Emits `ReadonlyMap<K, V>` on each structural change (two-phase). */
|
|
88
|
-
entries: Node<ReadonlyMap<K, V>>;
|
|
89
|
-
/**
|
|
90
|
-
* Checks existence. O(1) for live keys. If the key is expired, prunes it AND
|
|
91
|
-
* emits a snapshot so the reactive surface stays consistent with the return
|
|
92
|
-
* value. Reads on expired keys are therefore **observable side effects**.
|
|
93
|
-
*
|
|
94
|
-
* **LRU touch (F4):** When `maxSize` is configured, a live-key `has` also
|
|
95
|
-
* marks the entry as most-recently-used — which rearranges internal insertion
|
|
96
|
-
* order without bumping `version` or emitting. If you care about iteration
|
|
97
|
-
* order in a downstream subscriber, rely on the `entries` snapshot (a fresh
|
|
98
|
-
* `ReadonlyMap` per mutation) rather than iterating the backend directly.
|
|
99
|
-
*/
|
|
100
|
-
has: (key: K) => boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Gets value. O(1) for live keys. If the key is expired, prunes it AND emits
|
|
103
|
-
* a snapshot. Reads on expired keys are therefore **observable side effects**.
|
|
104
|
-
*
|
|
105
|
-
* **LRU touch (F4):** When `maxSize` is configured, a live-key `get` also
|
|
106
|
-
* marks the entry as most-recently-used (no version bump, no emission). See
|
|
107
|
-
* `has` for the full note on iteration order.
|
|
108
|
-
*/
|
|
109
|
-
get: (key: K) => V | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Sets value with optional TTL (seconds). Throws on `ttl <= 0`. Applies LRU eviction
|
|
112
|
-
* if `maxSize` is set. Always emits.
|
|
113
|
-
*/
|
|
114
|
-
set: (key: K, value: V, opts?: {
|
|
115
|
-
ttl?: number;
|
|
116
|
-
}) => void;
|
|
117
|
-
/**
|
|
118
|
-
* Bulk set — emits one snapshot for the whole batch. Applies `opts.ttl` (falls back
|
|
119
|
-
* to `defaultTtl`) to every entry. No-op if `entries` is empty.
|
|
120
|
-
*
|
|
121
|
-
* **Iterable consumption:** Consumes `entries` once (single-pass). Pass an array
|
|
122
|
-
* or `Set` for multi-shot consumers. If the iterator throws mid-iteration,
|
|
123
|
-
* entries already applied remain committed and a snapshot IS emitted (via the
|
|
124
|
-
* wrapper's finally-block).
|
|
125
|
-
*/
|
|
126
|
-
setMany: (entries: Iterable<readonly [K, V]>, opts?: {
|
|
127
|
-
ttl?: number;
|
|
128
|
-
}) => void;
|
|
129
|
-
delete: (key: K) => void;
|
|
130
|
-
/**
|
|
131
|
-
* Bulk delete — emits one snapshot. No-op if no keys were present.
|
|
132
|
-
*
|
|
133
|
-
* **Iterable consumption:** Consumes `keys` once (single-pass).
|
|
134
|
-
*/
|
|
135
|
-
deleteMany: (keys: Iterable<K>) => void;
|
|
136
|
-
clear: () => void;
|
|
137
|
-
/**
|
|
138
|
-
* Current entry count — O(1), **pure read** (no emission). May include
|
|
139
|
-
* expired entries on TTL maps until a mutation or explicit
|
|
140
|
-
* `pruneExpired()` / `has(key)` / `get(key)` prunes them. Call
|
|
141
|
-
* `pruneExpired()` first if you need a live count.
|
|
142
|
-
*/
|
|
143
|
-
readonly size: number;
|
|
144
|
-
/** Explicitly prunes all expired entries. Emits if any were removed. */
|
|
145
|
-
pruneExpired: () => void;
|
|
146
|
-
/**
|
|
147
|
-
* Releases any internal keepalive subscriptions so the bundle can be
|
|
148
|
-
* GC'd. `reactiveMap` currently holds none (the `entries` node lives only
|
|
149
|
-
* as long as external subscribers keep it alive), so `dispose()` is a
|
|
150
|
-
* no-op today — exposed for API parity with `reactiveIndex.dispose` /
|
|
151
|
-
* `reactiveList.dispose` / `reactiveLog.dispose`. Idempotent. D6(a).
|
|
152
|
-
*/
|
|
153
|
-
dispose: () => void;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Storage contract for {@link reactiveMap}. Implementations own the mutable state,
|
|
157
|
-
* including optional TTL and LRU semantics, and expose a monotonic `version` counter
|
|
158
|
-
* that increments on every change to visible state.
|
|
159
|
-
*
|
|
160
|
-
* The reactive layer reads `version` before and after each backend call; when it
|
|
161
|
-
* advances, a snapshot is emitted. Reads (`has`, `get`) may internally prune the
|
|
162
|
-
* target key if expired and advance `version` — in which case the layer emits so
|
|
163
|
-
* subscribers see state consistent with the read's return value.
|
|
164
|
-
*
|
|
165
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
166
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
167
|
-
* should treat all methods here as stable.
|
|
168
|
-
*
|
|
169
|
-
* @category extra
|
|
170
|
-
*/
|
|
171
|
-
interface MapBackend<K, V> {
|
|
172
|
-
/** Monotonic mutation counter; increments on every visible state change. */
|
|
173
|
-
readonly version: number;
|
|
174
|
-
/** Raw entry count (may include expired entries until a read / prune removes them). */
|
|
175
|
-
readonly size: number;
|
|
176
|
-
/** Checks existence. May prune target key if expired; advances `version` if pruned. */
|
|
177
|
-
has(key: K): boolean;
|
|
178
|
-
/** Gets value. May prune target key if expired; advances `version` if pruned. */
|
|
179
|
-
get(key: K): V | undefined;
|
|
180
|
-
/**
|
|
181
|
-
* Sets a value with optional TTL (seconds). Throws `RangeError` if `ttl <= 0`.
|
|
182
|
-
* Applies LRU eviction if `maxSize` is configured. Advances `version`.
|
|
183
|
-
*
|
|
184
|
-
* **Atomicity contract:** Either fully succeeds or throws before any state
|
|
185
|
-
* change; `version` advances only on success.
|
|
186
|
-
*/
|
|
187
|
-
set(key: K, value: V, ttl?: number): void;
|
|
188
|
-
/**
|
|
189
|
-
* Atomic bulk set. Pre-validates TTL once, then applies all entries. Advances
|
|
190
|
-
* `version` at most once (even for N entries). No-op if iterable is empty.
|
|
191
|
-
*
|
|
192
|
-
* **Consumes `entries` once** — pass an array if you want repeatability.
|
|
193
|
-
*
|
|
194
|
-
* **Atomicity contract:** TTL validation throws before any mutation. If the
|
|
195
|
-
* iterable itself throws mid-iteration, entries committed before the throw
|
|
196
|
-
* remain persisted AND `version` is bumped once (surfaced via finally) so
|
|
197
|
-
* the reactive wrapper emits a snapshot reflecting the partial state. "At
|
|
198
|
-
* most once" invariant is preserved.
|
|
199
|
-
*/
|
|
200
|
-
setMany(entries: Iterable<readonly [K, V]>, ttl?: number): void;
|
|
201
|
-
/** Removes a key. Returns `true` if the key existed. Advances `version` only if true. */
|
|
202
|
-
delete(key: K): boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Atomic bulk delete. Returns count removed. Advances `version` at most once
|
|
205
|
-
* (even for N keys). No-op if no keys were present. Consumes `keys` once.
|
|
206
|
-
*/
|
|
207
|
-
deleteMany(keys: Iterable<K>): number;
|
|
208
|
-
/** Removes all entries. Returns count removed. Advances `version` only if non-zero. */
|
|
209
|
-
clear(): number;
|
|
210
|
-
/** Removes all expired entries. Returns count removed. Advances `version` only if non-zero. */
|
|
211
|
-
pruneExpired(): number;
|
|
212
|
-
/** Fresh snapshot of non-expired entries (does NOT mutate state). */
|
|
213
|
-
toMap(): ReadonlyMap<K, V>;
|
|
214
|
-
}
|
|
215
|
-
type NativeMapBackendOptions = {
|
|
216
|
-
maxSize?: number;
|
|
217
|
-
/** Default TTL in seconds. */
|
|
218
|
-
defaultTtl?: number;
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Default `Map<K, {value, expiresAt}>` backend with optional per-key TTL and LRU cap.
|
|
222
|
-
*
|
|
223
|
-
* **Complexity:**
|
|
224
|
-
* - `has`, `get`, `delete`, `size`: O(1)
|
|
225
|
-
* - `set`: O(1) amortized (LRU touch + eviction)
|
|
226
|
-
* - `pruneExpired`, `toMap`: O(n)
|
|
227
|
-
*
|
|
228
|
-
* LRU order uses native `Map` insertion order. `get` / `has` on a live key "touches"
|
|
229
|
-
* it by delete-then-reinsert (moving it to the end). This touch does NOT advance
|
|
230
|
-
* `version` — it's an internal optimization; the externally visible snapshot
|
|
231
|
-
* preserves iteration order as of the last mutation. **Note:** because touch
|
|
232
|
-
* reorders the internal `_store` without emitting, an in-process consumer iterating
|
|
233
|
-
* `_store` directly (custom subclasses) could observe changing order; external
|
|
234
|
-
* subscribers only see `toMap()` snapshots which are defensively copied and stable.
|
|
235
|
-
*
|
|
236
|
-
* @category extra
|
|
237
|
-
*/
|
|
238
|
-
declare class NativeMapBackend<K, V> implements MapBackend<K, V> {
|
|
239
|
-
private _version;
|
|
240
|
-
private readonly _store;
|
|
241
|
-
private readonly _maxSize?;
|
|
242
|
-
private readonly _defaultTtl?;
|
|
243
|
-
constructor(options?: NativeMapBackendOptions);
|
|
244
|
-
get version(): number;
|
|
245
|
-
get size(): number;
|
|
246
|
-
has(key: K): boolean;
|
|
247
|
-
get(key: K): V | undefined;
|
|
248
|
-
set(key: K, value: V, ttl?: number): void;
|
|
249
|
-
setMany(entries: Iterable<readonly [K, V]>, ttl?: number): void;
|
|
250
|
-
delete(key: K): boolean;
|
|
251
|
-
deleteMany(keys: Iterable<K>): number;
|
|
252
|
-
clear(): number;
|
|
253
|
-
pruneExpired(): number;
|
|
254
|
-
toMap(): ReadonlyMap<K, V>;
|
|
255
|
-
private _resolveExpiresAt;
|
|
256
|
-
private _isExpired;
|
|
257
|
-
private _touchLru;
|
|
258
|
-
private _evictLruWhileOver;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Creates a reactive `Map` with optional per-key TTL and optional LRU max size.
|
|
262
|
-
*
|
|
263
|
-
* @param options - `name`, `maxSize`, `defaultTtl` (seconds), or custom `backend`.
|
|
264
|
-
* @returns `ReactiveMapBundle` — imperative methods (`has`/`get`/`set`/`setMany`/`delete`/
|
|
265
|
-
* `deleteMany`/`clear`/`pruneExpired`), reactive `entries` node, and O(1)-ish `size`.
|
|
266
|
-
*
|
|
267
|
-
* @remarks
|
|
268
|
-
* **TTL:** Expiry is checked on `get`, `has`, `size`, `pruneExpired`, and before each
|
|
269
|
-
* snapshot emission (expired keys are pruned first). Reads that discover expired keys
|
|
270
|
-
* emit a snapshot so subscribers see state consistent with the read's return value.
|
|
271
|
-
* There is no background timer; monotonic-clock expiry is immune to wall-clock changes.
|
|
272
|
-
*
|
|
273
|
-
* **LRU:** Uses native `Map` insertion order — `get` / `has` refreshes position via
|
|
274
|
-
* delete-then-reinsert; under `maxSize` pressure the first key in iteration order is
|
|
275
|
-
* evicted. LRU touching does NOT trigger emission (internal optimization).
|
|
276
|
-
*
|
|
277
|
-
* **Backend:** The default {@link NativeMapBackend} owns LRU/TTL. For persistent /
|
|
278
|
-
* HAMT / shared-state semantics plug in a custom {@link MapBackend}. `maxSize` and
|
|
279
|
-
* `defaultTtl` on the options object are only applied to the default backend — if
|
|
280
|
-
* you supply `backend`, configure those on your backend directly.
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* ```ts
|
|
284
|
-
* import { reactiveMap } from "@graphrefly/graphrefly-ts";
|
|
285
|
-
*
|
|
286
|
-
* const m = reactiveMap<string, number>({ name: "cache", maxSize: 100, defaultTtl: 60 });
|
|
287
|
-
* m.set("x", 1);
|
|
288
|
-
* m.setMany([["y", 2], ["z", 3]]);
|
|
289
|
-
* m.entries.subscribe((msgs) => { console.log(msgs); });
|
|
290
|
-
* ```
|
|
291
|
-
*
|
|
292
|
-
* @category extra
|
|
293
|
-
*/
|
|
294
|
-
declare function reactiveMap<K, V>(options?: ReactiveMapOptions<K, V>): ReactiveMapBundle<K, V>;
|
|
295
|
-
|
|
296
|
-
export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type NativeMapBackendOptions as a, type ReactiveMapOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-VNC3TMVY.js";import"./chunk-L6NSJVJZ.js";import"./chunk-KVV66NN2.js";import"./chunk-3G5U5QNE.js";import"./chunk-C72GO4IZ.js";import"./chunk-626TESAC.js";import"./chunk-ESMPEKEV.js";import"./chunk-VOPGGIL7.js";import"./chunk-4VVTGLXJ.js";import"./chunk-35JTVPOX.js";import"./chunk-V5A7M7RJ.js";import"./chunk-LYCLF26R.js";import"./chunk-CK2E7BTU.js";import"./chunk-QYADASLV.js";export{e as CircuitOpenError,i as RateLimiterOverflowError,b as ResilientPipelineGraph,l as TimeoutError,a as budgetGate,f as circuitBreaker,m as fallback,j as rateLimiter,c as resilientPipeline,d as retry,n as timeout,h as tokenBucket,g as withBreaker,k as withStatus};
|