@graphrefly/graphrefly 0.44.0 → 0.46.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 +22 -19
- package/dist/_internal-B23BagFd.d.cts +33 -0
- package/dist/_internal-B23BagFd.d.ts +33 -0
- package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
- package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
- package/dist/agents-C0Ji9ldU.d.cts +629 -0
- package/dist/agents-C9zexT7I.d.ts +629 -0
- package/dist/audit-BAXb3VOg.d.ts +246 -0
- package/dist/audit-C_bPfkqS.d.cts +246 -0
- package/dist/backoff-7KIK3WQW.js +24 -0
- package/dist/backoff-7KIK3WQW.js.map +1 -0
- package/dist/backoff-Bnb9OoPh.d.cts +6 -0
- package/dist/backoff-Bnb9OoPh.d.ts +6 -0
- package/dist/base/composition/index.cjs +811 -0
- package/dist/base/composition/index.cjs.map +1 -0
- package/dist/base/composition/index.d.cts +469 -0
- package/dist/base/composition/index.d.ts +469 -0
- package/dist/base/composition/index.js +40 -0
- package/dist/base/composition/index.js.map +1 -0
- package/dist/base/index.cjs +6336 -0
- package/dist/base/index.cjs.map +1 -0
- package/dist/base/index.d.cts +22 -0
- package/dist/base/index.d.ts +22 -0
- package/dist/base/index.js +259 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/io/index.cjs +3270 -0
- package/dist/base/io/index.cjs.map +1 -0
- package/dist/base/io/index.d.cts +2245 -0
- package/dist/base/io/index.d.ts +2245 -0
- package/dist/base/io/index.js +117 -0
- package/dist/base/io/index.js.map +1 -0
- package/dist/base/meta/index.cjs +43 -0
- package/dist/base/meta/index.cjs.map +1 -0
- package/dist/base/meta/index.d.cts +45 -0
- package/dist/base/meta/index.d.ts +45 -0
- package/dist/base/meta/index.js +13 -0
- package/dist/base/meta/index.js.map +1 -0
- package/dist/base/mutation/index.cjs +200 -0
- package/dist/base/mutation/index.cjs.map +1 -0
- package/dist/base/mutation/index.d.cts +177 -0
- package/dist/base/mutation/index.d.ts +177 -0
- package/dist/base/mutation/index.js +22 -0
- package/dist/base/mutation/index.js.map +1 -0
- package/dist/base/render/index.cjs +1120 -0
- package/dist/base/render/index.cjs.map +1 -0
- package/dist/{extra/render/index.d.ts → base/render/index.d.cts} +75 -31
- package/dist/{extra/render/index.d.cts → base/render/index.d.ts} +75 -31
- package/dist/base/render/index.js +24 -0
- package/dist/base/render/index.js.map +1 -0
- package/dist/base/sources/browser/index.cjs +172 -0
- package/dist/base/sources/browser/index.cjs.map +1 -0
- package/dist/base/sources/browser/index.d.cts +84 -0
- package/dist/base/sources/browser/index.d.ts +84 -0
- package/dist/base/sources/browser/index.js +151 -0
- package/dist/base/sources/browser/index.js.map +1 -0
- package/dist/base/sources/event/index.cjs +98 -0
- package/dist/base/sources/event/index.cjs.map +1 -0
- package/dist/base/sources/event/index.d.cts +91 -0
- package/dist/base/sources/event/index.d.ts +91 -0
- package/dist/base/sources/event/index.js +13 -0
- package/dist/base/sources/event/index.js.map +1 -0
- package/dist/base/sources/index.cjs +755 -0
- package/dist/base/sources/index.cjs.map +1 -0
- package/dist/{extra/sources.d.ts → base/sources/index.d.cts} +74 -301
- package/dist/{extra/sources.d.cts → base/sources/index.d.ts} +74 -301
- package/dist/base/sources/index.js +42 -0
- package/dist/base/sources/index.js.map +1 -0
- package/dist/base/sources/node/index.cjs +320 -0
- package/dist/base/sources/node/index.cjs.map +1 -0
- package/dist/{extra/node.d.ts → base/sources/node/index.d.cts} +35 -37
- package/dist/{extra/node.d.cts → base/sources/node/index.d.ts} +35 -37
- package/dist/base/sources/node/index.js +306 -0
- package/dist/base/sources/node/index.js.map +1 -0
- package/dist/base/utils/index.cjs +37 -0
- package/dist/base/utils/index.cjs.map +1 -0
- package/dist/base/utils/index.d.cts +37 -0
- package/dist/base/utils/index.d.ts +37 -0
- package/dist/base/utils/index.js +11 -0
- package/dist/base/utils/index.js.map +1 -0
- package/dist/base/worker/index.cjs +548 -0
- package/dist/base/worker/index.cjs.map +1 -0
- package/dist/base/worker/index.d.cts +207 -0
- package/dist/base/worker/index.d.ts +207 -0
- package/dist/base/worker/index.js +20 -0
- package/dist/base/worker/index.js.map +1 -0
- package/dist/breaker-C9skL3d8.d.ts +175 -0
- package/dist/breaker-ugSdq54q.d.cts +175 -0
- package/dist/{cascading-BglDkMdX.d.cts → cascading-CSSbKGrJ.d.ts} +3 -3
- package/dist/{cascading-MFgxu7Yo.d.ts → cascading-baGkiihI.d.cts} +3 -3
- package/dist/chunk-255UCBG4.js +58 -0
- package/dist/chunk-255UCBG4.js.map +1 -0
- package/dist/chunk-2LO3EL4W.js +1 -0
- package/dist/chunk-2LO3EL4W.js.map +1 -0
- package/dist/chunk-2OB3CEJS.js +1065 -0
- package/dist/chunk-2OB3CEJS.js.map +1 -0
- package/dist/chunk-36NMM65U.js +144 -0
- package/dist/chunk-36NMM65U.js.map +1 -0
- package/dist/chunk-3CEXCBN6.js +1 -0
- package/dist/chunk-3CEXCBN6.js.map +1 -0
- package/dist/chunk-3MUSLI6E.js +105 -0
- package/dist/chunk-3MUSLI6E.js.map +1 -0
- package/dist/chunk-3PSLNJDU.js +884 -0
- package/dist/chunk-3PSLNJDU.js.map +1 -0
- package/dist/chunk-3QZY5BI7.js +92 -0
- package/dist/chunk-3QZY5BI7.js.map +1 -0
- package/dist/chunk-42FQ27MQ.js +594 -0
- package/dist/chunk-42FQ27MQ.js.map +1 -0
- package/dist/chunk-4GYMCUDZ.js +1085 -0
- package/dist/chunk-4GYMCUDZ.js.map +1 -0
- package/dist/chunk-4S53H2KR.js +382 -0
- package/dist/chunk-4S53H2KR.js.map +1 -0
- package/dist/chunk-4XCHZRUJ.js +128 -0
- package/dist/chunk-4XCHZRUJ.js.map +1 -0
- package/dist/chunk-5THCXDWY.js +725 -0
- package/dist/chunk-5THCXDWY.js.map +1 -0
- package/dist/chunk-6XZYT4SW.js +256 -0
- package/dist/chunk-6XZYT4SW.js.map +1 -0
- package/dist/chunk-7EGRP2VX.js +76 -0
- package/dist/chunk-7EGRP2VX.js.map +1 -0
- package/dist/chunk-A7KV5UK4.js +150 -0
- package/dist/chunk-A7KV5UK4.js.map +1 -0
- package/dist/chunk-APY2SS5X.js +156 -0
- package/dist/chunk-APY2SS5X.js.map +1 -0
- package/dist/chunk-AZDQPQ3V.js +66 -0
- package/dist/chunk-AZDQPQ3V.js.map +1 -0
- package/dist/chunk-BU3SEFA5.js +90 -0
- package/dist/chunk-BU3SEFA5.js.map +1 -0
- package/dist/chunk-BXGZFGZ4.js +189 -0
- package/dist/chunk-BXGZFGZ4.js.map +1 -0
- package/dist/chunk-CGHORL6G.js +579 -0
- package/dist/chunk-CGHORL6G.js.map +1 -0
- package/dist/chunk-CXANAIZU.js +530 -0
- package/dist/chunk-CXANAIZU.js.map +1 -0
- package/dist/chunk-CZQHCKKG.js +1 -0
- package/dist/chunk-CZQHCKKG.js.map +1 -0
- package/dist/chunk-DKNHAICT.js +133 -0
- package/dist/chunk-DKNHAICT.js.map +1 -0
- package/dist/chunk-DM4OMPWK.js +584 -0
- package/dist/chunk-DM4OMPWK.js.map +1 -0
- package/dist/chunk-DMSNO6ZB.js +452 -0
- package/dist/chunk-DMSNO6ZB.js.map +1 -0
- package/dist/chunk-E5OZPDIW.js +229 -0
- package/dist/chunk-E5OZPDIW.js.map +1 -0
- package/dist/chunk-EVYY4X5A.js +509 -0
- package/dist/chunk-EVYY4X5A.js.map +1 -0
- package/dist/chunk-FDFD67UO.js +1 -0
- package/dist/chunk-FDFD67UO.js.map +1 -0
- package/dist/chunk-FMPF42Q4.js +13 -0
- package/dist/chunk-FMPF42Q4.js.map +1 -0
- package/dist/chunk-FR6RGA3B.js +1277 -0
- package/dist/chunk-FR6RGA3B.js.map +1 -0
- package/dist/chunk-FW23JYNQ.js +454 -0
- package/dist/chunk-FW23JYNQ.js.map +1 -0
- package/dist/chunk-GBCENOLN.js +1575 -0
- package/dist/chunk-GBCENOLN.js.map +1 -0
- package/dist/chunk-HL7HUJIX.js +1 -0
- package/dist/chunk-HL7HUJIX.js.map +1 -0
- package/dist/chunk-HULCUY35.js +2508 -0
- package/dist/chunk-HULCUY35.js.map +1 -0
- package/dist/chunk-IHTWQEDR.js +169 -0
- package/dist/chunk-IHTWQEDR.js.map +1 -0
- package/dist/chunk-IJRR6YAI.js +128 -0
- package/dist/chunk-IJRR6YAI.js.map +1 -0
- package/dist/chunk-JGFRAFDL.js +221 -0
- package/dist/chunk-JGFRAFDL.js.map +1 -0
- package/dist/chunk-KIIXR252.js +211 -0
- package/dist/chunk-KIIXR252.js.map +1 -0
- package/dist/chunk-KN3H5CNT.js +11 -0
- package/dist/chunk-KN3H5CNT.js.map +1 -0
- package/dist/chunk-KPG3DGLA.js +1 -0
- package/dist/chunk-KPG3DGLA.js.map +1 -0
- package/dist/chunk-KRNQ6RGQ.js +1 -0
- package/dist/chunk-KRNQ6RGQ.js.map +1 -0
- package/dist/chunk-LBAJK24K.js +1071 -0
- package/dist/chunk-LBAJK24K.js.map +1 -0
- package/dist/chunk-MLTPJMH6.js +417 -0
- package/dist/chunk-MLTPJMH6.js.map +1 -0
- package/dist/chunk-N3SZ7BMH.js +95 -0
- package/dist/chunk-N3SZ7BMH.js.map +1 -0
- package/dist/chunk-NDUD3IMO.js +540 -0
- package/dist/chunk-NDUD3IMO.js.map +1 -0
- package/dist/chunk-NY2PYHNC.js +873 -0
- package/dist/chunk-NY2PYHNC.js.map +1 -0
- package/dist/chunk-O3MT7DYI.js +225 -0
- package/dist/chunk-O3MT7DYI.js.map +1 -0
- package/dist/chunk-OCUDSN63.js +2386 -0
- package/dist/chunk-OCUDSN63.js.map +1 -0
- package/dist/chunk-OIWU3NYV.js +199 -0
- package/dist/chunk-OIWU3NYV.js.map +1 -0
- package/dist/chunk-OO5BM6CJ.js +1153 -0
- package/dist/chunk-OO5BM6CJ.js.map +1 -0
- package/dist/chunk-OQUIJT7A.js +1 -0
- package/dist/chunk-OQUIJT7A.js.map +1 -0
- package/dist/chunk-P5LBT622.js +105 -0
- package/dist/chunk-P5LBT622.js.map +1 -0
- package/dist/chunk-PKGQG5QQ.js +519 -0
- package/dist/chunk-PKGQG5QQ.js.map +1 -0
- package/dist/chunk-PKPO3JTZ.js +561 -0
- package/dist/chunk-PKPO3JTZ.js.map +1 -0
- package/dist/chunk-PL5UDIQ5.js +118 -0
- package/dist/chunk-PL5UDIQ5.js.map +1 -0
- package/dist/chunk-PZWISPIQ.js +432 -0
- package/dist/chunk-PZWISPIQ.js.map +1 -0
- package/dist/chunk-Q3EYOCZB.js +510 -0
- package/dist/chunk-Q3EYOCZB.js.map +1 -0
- package/dist/chunk-QMBYUVRL.js +15 -0
- package/dist/chunk-QMBYUVRL.js.map +1 -0
- package/dist/chunk-RAGGHLCV.js +200 -0
- package/dist/chunk-RAGGHLCV.js.map +1 -0
- package/dist/chunk-RGL53X5G.js +574 -0
- package/dist/chunk-RGL53X5G.js.map +1 -0
- package/dist/chunk-RJOG4IJU.js +1039 -0
- package/dist/chunk-RJOG4IJU.js.map +1 -0
- package/dist/chunk-SOOKUYVM.js +403 -0
- package/dist/chunk-SOOKUYVM.js.map +1 -0
- package/dist/chunk-T5BN5KG7.js +1 -0
- package/dist/chunk-T5BN5KG7.js.map +1 -0
- package/dist/chunk-TP7244Y6.js +207 -0
- package/dist/chunk-TP7244Y6.js.map +1 -0
- package/dist/chunk-TSBFTJKM.js +57 -0
- package/dist/chunk-TSBFTJKM.js.map +1 -0
- package/dist/chunk-URQ2CBBF.js +143 -0
- package/dist/chunk-URQ2CBBF.js.map +1 -0
- package/dist/chunk-W2BOPXTI.js +1 -0
- package/dist/chunk-W2BOPXTI.js.map +1 -0
- package/dist/chunk-WKSWLSCX.js +207 -0
- package/dist/chunk-WKSWLSCX.js.map +1 -0
- package/dist/chunk-Y52CS6YA.js +88 -0
- package/dist/chunk-Y52CS6YA.js.map +1 -0
- package/dist/chunk-YCBUWK77.js +92 -0
- package/dist/chunk-YCBUWK77.js.map +1 -0
- package/dist/chunk-YJ4U2D2C.js +314 -0
- package/dist/chunk-YJ4U2D2C.js.map +1 -0
- package/dist/chunk-Z4YXAUDN.js +239 -0
- package/dist/chunk-Z4YXAUDN.js.map +1 -0
- package/dist/chunk-Z6EGP5D7.js +92 -0
- package/dist/chunk-Z6EGP5D7.js.map +1 -0
- package/dist/compat/index.cjs +3100 -9
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +112 -18
- package/dist/compat/index.d.ts +112 -18
- package/dist/compat/index.js +176 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +149 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +8 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +205 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +22 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +2241 -9
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +7 -10
- package/dist/compat/nestjs/index.d.ts +7 -10
- package/dist/compat/nestjs/index.js +78 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +114 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/react/index.js +12 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +101 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/solid/index.js +12 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +104 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/svelte/index.js +12 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +119 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/vue/index.js +12 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +69 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +2 -6
- package/dist/compat/zustand/index.d.ts +2 -6
- package/dist/compat/zustand/index.js +8 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/distill-De6Rnn15.d.cts +48 -0
- package/dist/distill-De6Rnn15.d.ts +48 -0
- package/dist/external-register-CWyroXb_.d.cts +138 -0
- package/dist/external-register-CWyroXb_.d.ts +138 -0
- package/dist/{fallback-74oxi34l.d.cts → fallback-Bx46zqky.d.cts} +3 -10
- package/dist/{fallback-DUyyBTBK.d.ts → fallback-pIWW8A2d.d.ts} +3 -10
- package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
- package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
- package/dist/{index-CBGUK09R.d.ts → index-5SU_O78r.d.cts} +5 -5
- package/dist/{index-BmZXHqkE.d.ts → index-B6pxYJzO.d.cts} +1 -1
- package/dist/{index-hcDJ8PSI.d.cts → index-B6pxYJzO.d.ts} +1 -1
- package/dist/{index-C5stwKcw.d.cts → index-BFsng6v1.d.cts} +1 -1
- package/dist/{index-CdAlHFEt.d.ts → index-BFsng6v1.d.ts} +1 -1
- package/dist/{index-_6ODbuOu.d.cts → index-Bg-LwEt-.d.cts} +1 -1
- package/dist/{index-CviRnE4K.d.ts → index-Bg-LwEt-.d.ts} +1 -1
- package/dist/{index-CBBLl_rc.d.ts → index-Brp888t0.d.cts} +1 -1
- package/dist/{index-BQSKmbuG.d.cts → index-Brp888t0.d.ts} +1 -1
- package/dist/{index-sqkqlb1p.d.ts → index-CDfk6jHN.d.cts} +1 -1
- package/dist/{index-ZVQhLa2i.d.cts → index-CDfk6jHN.d.ts} +1 -1
- package/dist/{index-Climxqsu.d.cts → index-CEXCtYYJ.d.ts} +5 -5
- package/dist/index-DLAxYaN5.d.cts +169 -0
- package/dist/index-DLAxYaN5.d.ts +169 -0
- package/dist/{index-CK29LV56.d.cts → index-DeWbQzMe.d.cts} +1 -1
- package/dist/{index-CPQlGA29.d.ts → index-DeWbQzMe.d.ts} +1 -1
- package/dist/{index-BrPrLl4e.d.cts → index-dX9IzPqj.d.cts} +1 -1
- package/dist/{index-Dgl1HpPn.d.ts → index-dX9IzPqj.d.ts} +1 -1
- package/dist/index.cjs +25934 -191
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +58 -94
- package/dist/index.d.ts +58 -94
- package/dist/index.js +852 -1
- package/dist/index.js.map +1 -0
- package/dist/layout-types-B5aiHYgk.d.cts +72 -0
- package/dist/layout-types-B5aiHYgk.d.ts +72 -0
- package/dist/memory-composers-BryDrRBX.d.cts +529 -0
- package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
- package/dist/{observable-DWjNfLvC.d.ts → observable-BXQoW1P-.d.cts} +1 -1
- package/dist/{observable-e3eiPPFy.d.cts → observable-BXQoW1P-.d.ts} +1 -1
- package/dist/{pipeline-graph-Sgj0gCwn.d.ts → pipeline-graph-Ce47CB6Y.d.cts} +13 -10
- package/dist/{pipeline-graph-CIKhynsF.d.cts → pipeline-graph-DXCwY9vG.d.ts} +13 -10
- package/dist/presets/ai/index.cjs +4377 -0
- package/dist/presets/ai/index.cjs.map +1 -0
- package/dist/presets/ai/index.d.cts +98 -0
- package/dist/presets/ai/index.d.ts +98 -0
- package/dist/presets/ai/index.js +54 -0
- package/dist/presets/ai/index.js.map +1 -0
- package/dist/presets/harness/index.cjs +5929 -0
- package/dist/presets/harness/index.cjs.map +1 -0
- package/dist/presets/harness/index.d.cts +566 -0
- package/dist/presets/harness/index.d.ts +566 -0
- package/dist/presets/harness/index.js +71 -0
- package/dist/presets/harness/index.js.map +1 -0
- package/dist/presets/index.cjs +9782 -0
- package/dist/presets/index.cjs.map +1 -0
- package/dist/presets/index.d.cts +28 -0
- package/dist/presets/index.d.ts +28 -0
- package/dist/presets/index.js +129 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/inspect/index.cjs +1087 -0
- package/dist/presets/inspect/index.cjs.map +1 -0
- package/dist/presets/inspect/index.d.cts +172 -0
- package/dist/presets/inspect/index.d.ts +172 -0
- package/dist/presets/inspect/index.js +21 -0
- package/dist/presets/inspect/index.js.map +1 -0
- package/dist/presets/resilience/index.cjs +1593 -0
- package/dist/presets/resilience/index.cjs.map +1 -0
- package/dist/presets/resilience/index.d.cts +205 -0
- package/dist/presets/resilience/index.d.ts +205 -0
- package/dist/presets/resilience/index.js +18 -0
- package/dist/presets/resilience/index.js.map +1 -0
- package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
- package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
- package/dist/{reactive-layout-DOTs9P3X.d.ts → reactive-layout-fswlBUvX.d.cts} +19 -7
- package/dist/{reactive-layout-DgctbqZo.d.cts → reactive-layout-fswlBUvX.d.ts} +19 -7
- package/dist/retry-BDbRZ_gx.d.ts +125 -0
- package/dist/retry-DWuhjvsA.d.cts +125 -0
- package/dist/solutions/index.cjs +8200 -0
- package/dist/solutions/index.cjs.map +1 -0
- package/dist/solutions/index.d.cts +23 -0
- package/dist/solutions/index.d.ts +23 -0
- package/dist/solutions/index.js +55 -0
- package/dist/solutions/index.js.map +1 -0
- package/dist/spawnable-5mDY501F.d.cts +746 -0
- package/dist/spawnable-D3lR0oQu.d.ts +746 -0
- package/dist/status-U-rUI79b.d.cts +84 -0
- package/dist/status-U-rUI79b.d.ts +84 -0
- package/dist/timeout-U5O4ESK3.js +12 -0
- package/dist/timeout-U5O4ESK3.js.map +1 -0
- package/dist/{types-CWFysE9E.d.ts → types-BB5Lw-pB.d.cts} +3 -3
- package/dist/{types-C0_yquda.d.cts → types-BB5Lw-pB.d.ts} +3 -3
- package/dist/types-CJWIMJiZ.d.ts +548 -0
- package/dist/types-vCq7ShIm.d.cts +548 -0
- package/dist/utils/ai/browser.cjs +2169 -0
- package/dist/utils/ai/browser.cjs.map +1 -0
- package/dist/{patterns → utils}/ai/browser.d.cts +7 -5
- package/dist/{patterns → utils}/ai/browser.d.ts +7 -5
- package/dist/utils/ai/browser.js +255 -0
- package/dist/utils/ai/browser.js.map +1 -0
- package/dist/utils/ai/index.cjs +8468 -0
- package/dist/utils/ai/index.cjs.map +1 -0
- package/dist/{index-CR8QpwX8.d.ts → utils/ai/index.d.cts} +73 -976
- package/dist/{index-UPSiS-X7.d.cts → utils/ai/index.d.ts} +73 -976
- package/dist/utils/ai/index.js +173 -0
- package/dist/utils/ai/index.js.map +1 -0
- package/dist/utils/ai/node.cjs +648 -0
- package/dist/utils/ai/node.cjs.map +1 -0
- package/dist/{patterns → utils}/ai/node.d.cts +5 -7
- package/dist/{patterns → utils}/ai/node.d.ts +5 -7
- package/dist/utils/ai/node.js +84 -0
- package/dist/utils/ai/node.js.map +1 -0
- package/dist/utils/cqrs/index.cjs +1036 -0
- package/dist/utils/cqrs/index.cjs.map +1 -0
- package/dist/{index-CeFiHtAg.d.ts → utils/cqrs/index.d.cts} +7 -37
- package/dist/{index-B-_tFaqV.d.cts → utils/cqrs/index.d.ts} +7 -37
- package/dist/utils/cqrs/index.js +18 -0
- package/dist/utils/cqrs/index.js.map +1 -0
- package/dist/utils/demo-shell/index.cjs +865 -0
- package/dist/utils/demo-shell/index.cjs.map +1 -0
- package/dist/{index-B8YnZpIR.d.ts → utils/demo-shell/index.d.cts} +4 -16
- package/dist/{index-Cwv0KWcU.d.cts → utils/demo-shell/index.d.ts} +4 -16
- package/dist/utils/demo-shell/index.js +13 -0
- package/dist/utils/demo-shell/index.js.map +1 -0
- package/dist/utils/domain-templates/index.cjs +732 -0
- package/dist/utils/domain-templates/index.cjs.map +1 -0
- package/dist/{index-CzLVrjxn.d.ts → utils/domain-templates/index.d.cts} +3 -20
- package/dist/{index-BaQaY_IQ.d.cts → utils/domain-templates/index.d.ts} +3 -20
- package/dist/utils/domain-templates/index.js +17 -0
- package/dist/utils/domain-templates/index.js.map +1 -0
- package/dist/utils/graphspec/index.cjs +1174 -0
- package/dist/utils/graphspec/index.cjs.map +1 -0
- package/dist/{index-CMh5Rz1y.d.ts → utils/graphspec/index.d.cts} +106 -42
- package/dist/{index-CS0LTlB8.d.cts → utils/graphspec/index.d.ts} +106 -42
- package/dist/utils/graphspec/index.js +35 -0
- package/dist/utils/graphspec/index.js.map +1 -0
- package/dist/utils/harness/index.cjs +656 -0
- package/dist/utils/harness/index.cjs.map +1 -0
- package/dist/utils/harness/index.d.cts +542 -0
- package/dist/utils/harness/index.d.ts +542 -0
- package/dist/utils/harness/index.js +56 -0
- package/dist/utils/harness/index.js.map +1 -0
- package/dist/utils/index.cjs +17609 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +96 -0
- package/dist/utils/index.d.ts +96 -0
- package/dist/utils/index.js +514 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/inspect/index.cjs +807 -0
- package/dist/utils/inspect/index.cjs.map +1 -0
- package/dist/utils/inspect/index.d.cts +123 -0
- package/dist/utils/inspect/index.d.ts +123 -0
- package/dist/utils/inspect/index.js +30 -0
- package/dist/utils/inspect/index.js.map +1 -0
- package/dist/utils/job-queue/index.cjs +717 -0
- package/dist/utils/job-queue/index.cjs.map +1 -0
- package/dist/{index-DisjX8a-.d.ts → utils/job-queue/index.d.cts} +5 -26
- package/dist/{index-DV_1YuVk.d.cts → utils/job-queue/index.d.ts} +5 -26
- package/dist/utils/job-queue/index.js +18 -0
- package/dist/utils/job-queue/index.js.map +1 -0
- package/dist/utils/memory/index.cjs +1451 -0
- package/dist/utils/memory/index.cjs.map +1 -0
- package/dist/{index-CZ3r5Rxp.d.ts → utils/memory/index.d.cts} +242 -34
- package/dist/{index-B17QddL1.d.cts → utils/memory/index.d.ts} +242 -34
- package/dist/utils/memory/index.js +19 -0
- package/dist/utils/memory/index.js.map +1 -0
- package/dist/utils/messaging/index.cjs +666 -0
- package/dist/utils/messaging/index.cjs.map +1 -0
- package/dist/utils/messaging/index.d.cts +562 -0
- package/dist/utils/messaging/index.d.ts +562 -0
- package/dist/utils/messaging/index.js +50 -0
- package/dist/utils/messaging/index.js.map +1 -0
- package/dist/utils/orchestration/index.cjs +876 -0
- package/dist/utils/orchestration/index.cjs.map +1 -0
- package/dist/utils/orchestration/index.d.cts +233 -0
- package/dist/utils/orchestration/index.d.ts +233 -0
- package/dist/utils/orchestration/index.js +19 -0
- package/dist/utils/orchestration/index.js.map +1 -0
- package/dist/utils/process/index.cjs +743 -0
- package/dist/utils/process/index.cjs.map +1 -0
- package/dist/{index-p09KSrTN.d.ts → utils/process/index.d.cts} +97 -44
- package/dist/{index-CasX6Pfq.d.cts → utils/process/index.d.ts} +97 -44
- package/dist/utils/process/index.js +14 -0
- package/dist/utils/process/index.js.map +1 -0
- package/dist/utils/reactive-layout/index.cjs +1607 -0
- package/dist/utils/reactive-layout/index.cjs.map +1 -0
- package/dist/{index-B5S8ULbU.d.ts → utils/reactive-layout/index.d.cts} +58 -81
- package/dist/{index-Dc4AYqrJ.d.cts → utils/reactive-layout/index.d.ts} +58 -81
- package/dist/utils/reactive-layout/index.js +52 -0
- package/dist/utils/reactive-layout/index.js.map +1 -0
- package/dist/utils/reduction/index.cjs +203 -0
- package/dist/utils/reduction/index.cjs.map +1 -0
- package/dist/{index-Byu-OpX_.d.ts → utils/reduction/index.d.cts} +6 -17
- package/dist/{index-tRCxuAXF.d.cts → utils/reduction/index.d.ts} +6 -17
- package/dist/utils/reduction/index.js +14 -0
- package/dist/utils/reduction/index.js.map +1 -0
- package/dist/utils/resilience/index.cjs +1617 -0
- package/dist/utils/resilience/index.cjs.map +1 -0
- package/dist/utils/resilience/index.d.cts +9 -0
- package/dist/utils/resilience/index.d.ts +9 -0
- package/dist/utils/resilience/index.js +44 -0
- package/dist/utils/resilience/index.js.map +1 -0
- package/dist/utils/surface/index.cjs +1070 -0
- package/dist/utils/surface/index.cjs.map +1 -0
- package/dist/{index-CYq8vAyV.d.ts → utils/surface/index.d.cts} +7 -58
- package/dist/{index-CSOmP7xT.d.cts → utils/surface/index.d.ts} +7 -58
- package/dist/utils/surface/index.js +30 -0
- package/dist/utils/surface/index.js.map +1 -0
- package/dist/utils/topology-view/index.cjs +620 -0
- package/dist/utils/topology-view/index.cjs.map +1 -0
- package/dist/utils/topology-view/index.d.cts +68 -0
- package/dist/utils/topology-view/index.d.ts +68 -0
- package/dist/utils/topology-view/index.js +11 -0
- package/dist/utils/topology-view/index.js.map +1 -0
- package/package.json +664 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/chunk-2T7U5EU6.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-5M4CCMMD.js +0 -45
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-5XJ6B66J.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-6X7AFUJV.js +0 -9
- package/dist/chunk-7K6PWTDQ.js +0 -1
- package/dist/chunk-7LIAPXJB.js +0 -1
- package/dist/chunk-7WPU3UHQ.js +0 -1
- package/dist/chunk-A5WCQ5NO.js +0 -1
- package/dist/chunk-APPIWSGD.js +0 -84
- package/dist/chunk-BEZWM2SY.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CB676TKJ.js +0 -1
- package/dist/chunk-CE6TI2TL.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLVB32RD.js +0 -1
- package/dist/chunk-CRVT7D2P.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-D7GPHKFH.js +0 -1
- package/dist/chunk-DHRX7JX4.js +0 -2
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FZMYDOWV.js +0 -1
- package/dist/chunk-GHBWHMRZ.js +0 -1
- package/dist/chunk-GLERH466.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-HIDYF36O.js +0 -1
- package/dist/chunk-HITNVN6B.js +0 -3
- package/dist/chunk-HY4DJBA7.js +0 -5
- package/dist/chunk-KZIEYVXN.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-N4MQX6JU.js +0 -18
- package/dist/chunk-N7FHEL4D.js +0 -1
- package/dist/chunk-NTEURFZH.js +0 -1
- package/dist/chunk-OIVP6KFV.js +0 -1
- package/dist/chunk-OPHBU3LG.js +0 -1
- package/dist/chunk-OYQOZP2F.js +0 -5
- package/dist/chunk-PTZK576G.js +0 -1
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-ST7UXLWR.js +0 -1
- package/dist/chunk-SVY7VUYU.js +0 -1
- package/dist/chunk-TK3NWWD4.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-UNGSTR4X.js +0 -61
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VV4N5P64.js +0 -1
- package/dist/chunk-W3I423PS.js +0 -1
- package/dist/chunk-WJR24TAG.js +0 -1
- package/dist/chunk-XTGKMHSW.js +0 -1
- package/dist/chunk-YBB7ZGTY.js +0 -1
- package/dist/chunk-Z4NPUARF.js +0 -1
- package/dist/chunk-ZGNQRPDT.js +0 -1
- package/dist/chunk-ZKPSFFKU.js +0 -1
- package/dist/chunk-ZLV5SQSX.js +0 -1
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/core/index.cjs +0 -1
- package/dist/core/index.d.cts +0 -3
- package/dist/core/index.d.ts +0 -3
- package/dist/core/index.js +0 -1
- package/dist/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/extra/browser.cjs +0 -1
- package/dist/extra/browser.d.cts +0 -4
- package/dist/extra/browser.d.ts +0 -4
- package/dist/extra/browser.js +0 -1
- package/dist/extra/index.cjs +0 -20
- package/dist/extra/index.d.cts +0 -17
- package/dist/extra/index.d.ts +0 -17
- package/dist/extra/index.js +0 -1
- package/dist/extra/node.cjs +0 -2
- package/dist/extra/node.js +0 -2
- package/dist/extra/operators.cjs +0 -1
- package/dist/extra/operators.d.cts +0 -958
- package/dist/extra/operators.d.ts +0 -958
- package/dist/extra/operators.js +0 -1
- package/dist/extra/reactive.cjs +0 -1
- package/dist/extra/reactive.d.cts +0 -353
- package/dist/extra/reactive.d.ts +0 -353
- package/dist/extra/reactive.js +0 -1
- package/dist/extra/render/index.cjs +0 -5
- package/dist/extra/render/index.js +0 -1
- package/dist/extra/sources.cjs +0 -3
- package/dist/extra/sources.js +0 -1
- package/dist/extra/storage-browser.cjs +0 -1
- package/dist/extra/storage-browser.d.cts +0 -37
- package/dist/extra/storage-browser.d.ts +0 -37
- package/dist/extra/storage-browser.js +0 -1
- package/dist/extra/storage-core.cjs +0 -1
- package/dist/extra/storage-core.d.cts +0 -28
- package/dist/extra/storage-core.d.ts +0 -28
- package/dist/extra/storage-core.js +0 -1
- package/dist/extra/storage-node.cjs +0 -1
- package/dist/extra/storage-node.d.cts +0 -2
- package/dist/extra/storage-node.d.ts +0 -2
- package/dist/extra/storage-node.js +0 -0
- package/dist/extra/storage-tiers-browser.cjs +0 -1
- package/dist/extra/storage-tiers-browser.d.cts +0 -120
- package/dist/extra/storage-tiers-browser.d.ts +0 -120
- package/dist/extra/storage-tiers-browser.js +0 -1
- package/dist/extra/storage-tiers-node.cjs +0 -1
- package/dist/extra/storage-tiers-node.d.cts +0 -210
- package/dist/extra/storage-tiers-node.d.ts +0 -210
- package/dist/extra/storage-tiers-node.js +0 -1
- package/dist/extra/storage-tiers.cjs +0 -1
- package/dist/extra/storage-tiers.d.cts +0 -412
- package/dist/extra/storage-tiers.d.ts +0 -412
- package/dist/extra/storage-tiers.js +0 -1
- package/dist/graph/index.cjs +0 -7
- package/dist/graph/index.d.cts +0 -7
- package/dist/graph/index.d.ts +0 -7
- package/dist/graph/index.js +0 -1
- package/dist/graph-CWvEUQAq.d.cts +0 -1861
- package/dist/graph-D9LFnda9.d.ts +0 -1861
- package/dist/index-5k1T6jl0.d.cts +0 -121
- package/dist/index-9770hRuQ.d.cts +0 -779
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/patterns/ai/browser.cjs +0 -8
- package/dist/patterns/ai/browser.js +0 -3
- package/dist/patterns/ai/index.cjs +0 -74
- package/dist/patterns/ai/index.d.cts +0 -20
- package/dist/patterns/ai/index.d.ts +0 -20
- package/dist/patterns/ai/index.js +0 -1
- package/dist/patterns/ai/node.cjs +0 -1
- package/dist/patterns/ai/node.js +0 -1
- package/dist/patterns/cqrs/index.cjs +0 -3
- package/dist/patterns/cqrs/index.d.cts +0 -8
- package/dist/patterns/cqrs/index.d.ts +0 -8
- package/dist/patterns/cqrs/index.js +0 -1
- package/dist/patterns/demo-shell/index.cjs +0 -5
- package/dist/patterns/demo-shell/index.d.cts +0 -7
- package/dist/patterns/demo-shell/index.d.ts +0 -7
- package/dist/patterns/demo-shell/index.js +0 -1
- package/dist/patterns/domain-templates/index.cjs +0 -3
- package/dist/patterns/domain-templates/index.d.cts +0 -6
- package/dist/patterns/domain-templates/index.d.ts +0 -6
- package/dist/patterns/domain-templates/index.js +0 -1
- package/dist/patterns/graphspec/index.cjs +0 -86
- package/dist/patterns/graphspec/index.d.cts +0 -8
- package/dist/patterns/graphspec/index.d.ts +0 -8
- package/dist/patterns/graphspec/index.js +0 -1
- package/dist/patterns/harness/index.cjs +0 -48
- package/dist/patterns/harness/index.d.cts +0 -13
- package/dist/patterns/harness/index.d.ts +0 -13
- package/dist/patterns/harness/index.js +0 -1
- package/dist/patterns/inspect/index.cjs +0 -3
- package/dist/patterns/inspect/index.d.cts +0 -9
- package/dist/patterns/inspect/index.d.ts +0 -9
- package/dist/patterns/inspect/index.js +0 -1
- package/dist/patterns/job-queue/index.cjs +0 -3
- package/dist/patterns/job-queue/index.d.cts +0 -9
- package/dist/patterns/job-queue/index.d.ts +0 -9
- package/dist/patterns/job-queue/index.js +0 -1
- package/dist/patterns/memory/index.cjs +0 -3
- package/dist/patterns/memory/index.d.cts +0 -8
- package/dist/patterns/memory/index.d.ts +0 -8
- package/dist/patterns/memory/index.js +0 -1
- package/dist/patterns/messaging/index.cjs +0 -3
- package/dist/patterns/messaging/index.d.cts +0 -7
- package/dist/patterns/messaging/index.d.ts +0 -7
- package/dist/patterns/messaging/index.js +0 -1
- package/dist/patterns/orchestration/index.cjs +0 -3
- package/dist/patterns/orchestration/index.d.cts +0 -8
- package/dist/patterns/orchestration/index.d.ts +0 -8
- package/dist/patterns/orchestration/index.js +0 -1
- package/dist/patterns/process/index.cjs +0 -3
- package/dist/patterns/process/index.d.cts +0 -10
- package/dist/patterns/process/index.d.ts +0 -10
- package/dist/patterns/process/index.js +0 -1
- package/dist/patterns/reactive-layout/index.cjs +0 -4
- package/dist/patterns/reactive-layout/index.d.cts +0 -7
- package/dist/patterns/reactive-layout/index.d.ts +0 -7
- package/dist/patterns/reactive-layout/index.js +0 -1
- package/dist/patterns/reduction/index.cjs +0 -3
- package/dist/patterns/reduction/index.d.cts +0 -6
- package/dist/patterns/reduction/index.d.ts +0 -6
- package/dist/patterns/reduction/index.js +0 -1
- package/dist/patterns/surface/index.cjs +0 -13
- package/dist/patterns/surface/index.d.cts +0 -9
- package/dist/patterns/surface/index.d.ts +0 -9
- package/dist/patterns/surface/index.js +0 -1
- package/dist/reactive-log-BKALbfal.d.ts +0 -223
- package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
- package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
- package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
- package/dist/resilience-6LYQJAC5.js +0 -1
- package/dist/sugar-DQjFmVqb.d.cts +0 -399
- package/dist/sugar-fhLIE7TT.d.ts +0 -399
- package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
- package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { V as VersioningLevel, b as NodeGuard, N as Node } from './node-kK3CvTrR.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,296 +0,0 @@
|
|
|
1
|
-
import { N as Node, V as VersioningLevel, a as NodeOptions } from './node-kK3CvTrR.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 };
|