@graphrefly/graphrefly 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -17
- package/dist/compat/index.cjs +20 -10
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +1 -22
- package/dist/compat/index.d.ts +1 -22
- package/dist/compat/index.js +3 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +21 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +1 -2
- package/dist/compat/jotai/index.d.ts +1 -2
- package/dist/compat/jotai/index.js +3 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +21 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +1 -2
- package/dist/compat/nanostores/index.d.ts +1 -2
- package/dist/compat/nanostores/index.js +3 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +20 -10
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +1 -13
- package/dist/compat/nestjs/index.d.ts +1 -13
- package/dist/compat/nestjs/index.js +3 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +21 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +1 -2
- package/dist/compat/react/index.d.ts +1 -2
- package/dist/compat/react/index.js +3 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +21 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +1 -2
- package/dist/compat/solid/index.d.ts +1 -2
- package/dist/compat/solid/index.js +3 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +21 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +1 -2
- package/dist/compat/svelte/index.d.ts +1 -2
- package/dist/compat/svelte/index.js +3 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +21 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +1 -3
- package/dist/compat/vue/index.d.ts +1 -3
- package/dist/compat/vue/index.js +3 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +21 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +1 -6
- package/dist/compat/zustand/index.d.ts +1 -6
- package/dist/compat/zustand/index.js +3 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +21 -1
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1 -3
- package/dist/core/index.d.ts +1 -3
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -0
- package/dist/extra/browser.cjs +21 -1
- package/dist/extra/browser.cjs.map +1 -0
- package/dist/extra/browser.d.cts +1 -4
- package/dist/extra/browser.d.ts +1 -4
- package/dist/extra/browser.js +3 -1
- package/dist/extra/browser.js.map +1 -0
- package/dist/extra/index.cjs +20 -19
- package/dist/extra/index.cjs.map +1 -0
- package/dist/extra/index.d.cts +1 -17
- package/dist/extra/index.d.ts +1 -17
- package/dist/extra/index.js +3 -1
- package/dist/extra/index.js.map +1 -0
- package/dist/extra/node.cjs +21 -2
- package/dist/extra/node.cjs.map +1 -0
- package/dist/extra/node.d.cts +1 -187
- package/dist/extra/node.d.ts +1 -187
- package/dist/extra/node.js +3 -2
- package/dist/extra/node.js.map +1 -0
- package/dist/extra/operators.cjs +21 -1
- package/dist/extra/operators.cjs.map +1 -0
- package/dist/extra/operators.d.cts +1 -958
- package/dist/extra/operators.d.ts +1 -958
- package/dist/extra/operators.js +3 -1
- package/dist/extra/operators.js.map +1 -0
- package/dist/extra/reactive.cjs +21 -1
- package/dist/extra/reactive.cjs.map +1 -0
- package/dist/extra/reactive.d.cts +1 -353
- package/dist/extra/reactive.d.ts +1 -353
- package/dist/extra/reactive.js +3 -1
- package/dist/extra/reactive.js.map +1 -0
- package/dist/extra/render/index.cjs +21 -5
- package/dist/extra/render/index.cjs.map +1 -0
- package/dist/extra/render/index.d.cts +1 -183
- package/dist/extra/render/index.d.ts +1 -183
- package/dist/extra/render/index.js +3 -1
- package/dist/extra/render/index.js.map +1 -0
- package/dist/extra/sources.cjs +21 -3
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +1 -584
- package/dist/extra/sources.d.ts +1 -584
- package/dist/extra/sources.js +3 -1
- package/dist/extra/sources.js.map +1 -0
- package/dist/extra/storage-browser.cjs +21 -1
- package/dist/extra/storage-browser.cjs.map +1 -0
- package/dist/extra/storage-browser.d.cts +1 -37
- package/dist/extra/storage-browser.d.ts +1 -37
- package/dist/extra/storage-browser.js +3 -1
- package/dist/extra/storage-browser.js.map +1 -0
- package/dist/extra/storage-core.cjs +21 -1
- package/dist/extra/storage-core.cjs.map +1 -0
- package/dist/extra/storage-core.d.cts +1 -28
- package/dist/extra/storage-core.d.ts +1 -28
- package/dist/extra/storage-core.js +3 -1
- package/dist/extra/storage-core.js.map +1 -0
- package/dist/extra/storage-node.cjs +20 -0
- package/dist/extra/storage-node.cjs.map +1 -0
- package/dist/extra/storage-node.d.cts +1 -2
- package/dist/extra/storage-node.d.ts +1 -2
- package/dist/extra/storage-node.js +3 -0
- package/dist/extra/storage-node.js.map +1 -0
- package/dist/extra/storage-tiers-browser.cjs +21 -1
- package/dist/extra/storage-tiers-browser.cjs.map +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +1 -120
- package/dist/extra/storage-tiers-browser.d.ts +1 -120
- package/dist/extra/storage-tiers-browser.js +3 -1
- package/dist/extra/storage-tiers-browser.js.map +1 -0
- package/dist/extra/storage-tiers-node.cjs +21 -1
- package/dist/extra/storage-tiers-node.cjs.map +1 -0
- package/dist/extra/storage-tiers-node.d.cts +1 -210
- package/dist/extra/storage-tiers-node.d.ts +1 -210
- package/dist/extra/storage-tiers-node.js +3 -1
- package/dist/extra/storage-tiers-node.js.map +1 -0
- package/dist/extra/storage-tiers.cjs +21 -1
- package/dist/extra/storage-tiers.cjs.map +1 -0
- package/dist/extra/storage-tiers.d.cts +1 -412
- package/dist/extra/storage-tiers.d.ts +1 -412
- package/dist/extra/storage-tiers.js +3 -1
- package/dist/extra/storage-tiers.js.map +1 -0
- package/dist/extra/storage-wal.cjs +21 -0
- package/dist/extra/storage-wal.cjs.map +1 -0
- package/dist/extra/storage-wal.d.cts +1 -0
- package/dist/extra/storage-wal.d.ts +1 -0
- package/dist/extra/storage-wal.js +3 -0
- package/dist/extra/storage-wal.js.map +1 -0
- package/dist/graph/index.cjs +21 -7
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +1 -7
- package/dist/graph/index.d.ts +1 -7
- package/dist/graph/index.js +3 -1
- package/dist/graph/index.js.map +1 -0
- package/dist/index.cjs +20 -227
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -95
- package/dist/index.d.ts +45 -95
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -0
- package/dist/patterns/ai/browser.cjs +20 -7
- package/dist/patterns/ai/browser.cjs.map +1 -0
- package/dist/patterns/ai/browser.d.cts +1 -127
- package/dist/patterns/ai/browser.d.ts +1 -127
- package/dist/patterns/ai/browser.js +3 -3
- package/dist/patterns/ai/browser.js.map +1 -0
- package/dist/patterns/ai/index.cjs +20 -73
- package/dist/patterns/ai/index.cjs.map +1 -0
- package/dist/patterns/ai/index.d.cts +1 -20
- package/dist/patterns/ai/index.d.ts +1 -20
- package/dist/patterns/ai/index.js +3 -1
- package/dist/patterns/ai/index.js.map +1 -0
- package/dist/patterns/ai/node.cjs +21 -1
- package/dist/patterns/ai/node.cjs.map +1 -0
- package/dist/patterns/ai/node.d.cts +1 -59
- package/dist/patterns/ai/node.d.ts +1 -59
- package/dist/patterns/ai/node.js +3 -1
- package/dist/patterns/ai/node.js.map +1 -0
- package/dist/patterns/cqrs/index.cjs +21 -3
- package/dist/patterns/cqrs/index.cjs.map +1 -0
- package/dist/patterns/cqrs/index.d.cts +1 -8
- package/dist/patterns/cqrs/index.d.ts +1 -8
- package/dist/patterns/cqrs/index.js +3 -1
- package/dist/patterns/cqrs/index.js.map +1 -0
- package/dist/patterns/demo-shell/index.cjs +21 -5
- package/dist/patterns/demo-shell/index.cjs.map +1 -0
- package/dist/patterns/demo-shell/index.d.cts +1 -7
- package/dist/patterns/demo-shell/index.d.ts +1 -7
- package/dist/patterns/demo-shell/index.js +3 -1
- package/dist/patterns/demo-shell/index.js.map +1 -0
- package/dist/patterns/domain-templates/index.cjs +21 -3
- package/dist/patterns/domain-templates/index.cjs.map +1 -0
- package/dist/patterns/domain-templates/index.d.cts +1 -6
- package/dist/patterns/domain-templates/index.d.ts +1 -6
- package/dist/patterns/domain-templates/index.js +3 -1
- package/dist/patterns/domain-templates/index.js.map +1 -0
- package/dist/patterns/graphspec/index.cjs +21 -86
- package/dist/patterns/graphspec/index.cjs.map +1 -0
- package/dist/patterns/graphspec/index.d.cts +1 -8
- package/dist/patterns/graphspec/index.d.ts +1 -8
- package/dist/patterns/graphspec/index.js +3 -1
- package/dist/patterns/graphspec/index.js.map +1 -0
- package/dist/patterns/harness/index.cjs +21 -48
- package/dist/patterns/harness/index.cjs.map +1 -0
- package/dist/patterns/harness/index.d.cts +1 -13
- package/dist/patterns/harness/index.d.ts +1 -13
- package/dist/patterns/harness/index.js +3 -1
- package/dist/patterns/harness/index.js.map +1 -0
- package/dist/patterns/inspect/index.cjs +21 -3
- package/dist/patterns/inspect/index.cjs.map +1 -0
- package/dist/patterns/inspect/index.d.cts +1 -9
- package/dist/patterns/inspect/index.d.ts +1 -9
- package/dist/patterns/inspect/index.js +3 -1
- package/dist/patterns/inspect/index.js.map +1 -0
- package/dist/patterns/job-queue/index.cjs +21 -3
- package/dist/patterns/job-queue/index.cjs.map +1 -0
- package/dist/patterns/job-queue/index.d.cts +1 -9
- package/dist/patterns/job-queue/index.d.ts +1 -9
- package/dist/patterns/job-queue/index.js +3 -1
- package/dist/patterns/job-queue/index.js.map +1 -0
- package/dist/patterns/memory/index.cjs +21 -3
- package/dist/patterns/memory/index.cjs.map +1 -0
- package/dist/patterns/memory/index.d.cts +1 -8
- package/dist/patterns/memory/index.d.ts +1 -8
- package/dist/patterns/memory/index.js +3 -1
- package/dist/patterns/memory/index.js.map +1 -0
- package/dist/patterns/messaging/index.cjs +21 -3
- package/dist/patterns/messaging/index.cjs.map +1 -0
- package/dist/patterns/messaging/index.d.cts +1 -7
- package/dist/patterns/messaging/index.d.ts +1 -7
- package/dist/patterns/messaging/index.js +3 -1
- package/dist/patterns/messaging/index.js.map +1 -0
- package/dist/patterns/orchestration/index.cjs +21 -3
- package/dist/patterns/orchestration/index.cjs.map +1 -0
- package/dist/patterns/orchestration/index.d.cts +1 -8
- package/dist/patterns/orchestration/index.d.ts +1 -8
- package/dist/patterns/orchestration/index.js +3 -1
- package/dist/patterns/orchestration/index.js.map +1 -0
- package/dist/patterns/process/index.cjs +21 -3
- package/dist/patterns/process/index.cjs.map +1 -0
- package/dist/patterns/process/index.d.cts +1 -10
- package/dist/patterns/process/index.d.ts +1 -10
- package/dist/patterns/process/index.js +3 -1
- package/dist/patterns/process/index.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +21 -4
- package/dist/patterns/reactive-layout/index.cjs.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +1 -7
- package/dist/patterns/reactive-layout/index.d.ts +1 -7
- package/dist/patterns/reactive-layout/index.js +3 -1
- package/dist/patterns/reactive-layout/index.js.map +1 -0
- package/dist/patterns/reduction/index.cjs +21 -3
- package/dist/patterns/reduction/index.cjs.map +1 -0
- package/dist/patterns/reduction/index.d.cts +1 -6
- package/dist/patterns/reduction/index.d.ts +1 -6
- package/dist/patterns/reduction/index.js +3 -1
- package/dist/patterns/reduction/index.js.map +1 -0
- package/dist/patterns/surface/index.cjs +21 -13
- package/dist/patterns/surface/index.cjs.map +1 -0
- package/dist/patterns/surface/index.d.cts +1 -9
- package/dist/patterns/surface/index.d.ts +1 -9
- package/dist/patterns/surface/index.js +3 -1
- package/dist/patterns/surface/index.js.map +1 -0
- package/dist/patterns/topology-view/index.cjs +21 -0
- package/dist/patterns/topology-view/index.cjs.map +1 -0
- package/dist/patterns/topology-view/index.d.cts +1 -0
- package/dist/patterns/topology-view/index.d.ts +1 -0
- package/dist/patterns/topology-view/index.js +3 -0
- package/dist/patterns/topology-view/index.js.map +1 -0
- package/dist/testing/index.cjs +21 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +608 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/cascading-BglDkMdX.d.cts +0 -199
- package/dist/cascading-MFgxu7Yo.d.ts +0 -199
- package/dist/chunk-2T7U5EU6.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-5M4CCMMD.js +0 -45
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-5XJ6B66J.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-6X7AFUJV.js +0 -9
- package/dist/chunk-7K6PWTDQ.js +0 -1
- package/dist/chunk-7LIAPXJB.js +0 -1
- package/dist/chunk-7WPU3UHQ.js +0 -1
- package/dist/chunk-A5WCQ5NO.js +0 -1
- package/dist/chunk-APPIWSGD.js +0 -84
- package/dist/chunk-BEZWM2SY.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CB676TKJ.js +0 -1
- package/dist/chunk-CE6TI2TL.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLVB32RD.js +0 -1
- package/dist/chunk-CRVT7D2P.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-D7GPHKFH.js +0 -1
- package/dist/chunk-DHRX7JX4.js +0 -2
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FZMYDOWV.js +0 -1
- package/dist/chunk-GHBWHMRZ.js +0 -1
- package/dist/chunk-GLERH466.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-HIDYF36O.js +0 -1
- package/dist/chunk-HITNVN6B.js +0 -3
- package/dist/chunk-HY4DJBA7.js +0 -5
- package/dist/chunk-KZIEYVXN.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-N4MQX6JU.js +0 -18
- package/dist/chunk-N7FHEL4D.js +0 -1
- package/dist/chunk-NTEURFZH.js +0 -1
- package/dist/chunk-OIVP6KFV.js +0 -1
- package/dist/chunk-OPHBU3LG.js +0 -1
- package/dist/chunk-OYQOZP2F.js +0 -5
- package/dist/chunk-PTZK576G.js +0 -1
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-ST7UXLWR.js +0 -1
- package/dist/chunk-SVY7VUYU.js +0 -1
- package/dist/chunk-TK3NWWD4.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-UNGSTR4X.js +0 -61
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VV4N5P64.js +0 -1
- package/dist/chunk-W3I423PS.js +0 -1
- package/dist/chunk-WJR24TAG.js +0 -1
- package/dist/chunk-XTGKMHSW.js +0 -1
- package/dist/chunk-YBB7ZGTY.js +0 -1
- package/dist/chunk-Z4NPUARF.js +0 -1
- package/dist/chunk-ZGNQRPDT.js +0 -1
- package/dist/chunk-ZKPSFFKU.js +0 -1
- package/dist/chunk-ZLV5SQSX.js +0 -1
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/fallback-74oxi34l.d.cts +0 -250
- package/dist/fallback-DUyyBTBK.d.ts +0 -250
- package/dist/graph-CWvEUQAq.d.cts +0 -1861
- package/dist/graph-D9LFnda9.d.ts +0 -1861
- package/dist/index-5k1T6jl0.d.cts +0 -121
- package/dist/index-9770hRuQ.d.cts +0 -779
- package/dist/index-B-_tFaqV.d.cts +0 -468
- package/dist/index-B17QddL1.d.cts +0 -374
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-B5S8ULbU.d.ts +0 -515
- package/dist/index-B8YnZpIR.d.ts +0 -102
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BQSKmbuG.d.cts +0 -127
- package/dist/index-BaQaY_IQ.d.cts +0 -231
- package/dist/index-BmZXHqkE.d.ts +0 -36
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BrPrLl4e.d.cts +0 -86
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-Byu-OpX_.d.ts +0 -113
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C5stwKcw.d.cts +0 -44
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CBBLl_rc.d.ts +0 -127
- package/dist/index-CBGUK09R.d.ts +0 -754
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CK29LV56.d.cts +0 -34
- package/dist/index-CMh5Rz1y.d.ts +0 -385
- package/dist/index-CPQlGA29.d.ts +0 -34
- package/dist/index-CR8QpwX8.d.ts +0 -2680
- package/dist/index-CS0LTlB8.d.cts +0 -385
- package/dist/index-CSOmP7xT.d.cts +0 -291
- package/dist/index-CYq8vAyV.d.ts +0 -291
- package/dist/index-CZ3r5Rxp.d.ts +0 -374
- package/dist/index-CasX6Pfq.d.cts +0 -358
- package/dist/index-CdAlHFEt.d.ts +0 -44
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-CeFiHtAg.d.ts +0 -468
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Climxqsu.d.cts +0 -754
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-CviRnE4K.d.ts +0 -45
- package/dist/index-Cwv0KWcU.d.cts +0 -102
- package/dist/index-CzLVrjxn.d.ts +0 -231
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-DV_1YuVk.d.cts +0 -221
- package/dist/index-Dc4AYqrJ.d.cts +0 -515
- package/dist/index-Dgl1HpPn.d.ts +0 -86
- package/dist/index-DisjX8a-.d.ts +0 -221
- package/dist/index-UPSiS-X7.d.cts +0 -2680
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-ZVQhLa2i.d.cts +0 -37
- package/dist/index-_6ODbuOu.d.cts +0 -45
- package/dist/index-hcDJ8PSI.d.cts +0 -36
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/index-p09KSrTN.d.ts +0 -358
- package/dist/index-sqkqlb1p.d.ts +0 -37
- package/dist/index-tRCxuAXF.d.cts +0 -113
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/observable-DWjNfLvC.d.ts +0 -36
- package/dist/observable-e3eiPPFy.d.cts +0 -36
- package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
- package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
- package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
- package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
- package/dist/reactive-log-BKALbfal.d.ts +0 -223
- package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
- package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
- package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
- package/dist/resilience-6LYQJAC5.js +0 -1
- package/dist/sugar-DQjFmVqb.d.cts +0 -399
- package/dist/sugar-fhLIE7TT.d.ts +0 -399
- package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
- package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
- package/dist/types-C0_yquda.d.cts +0 -442
- package/dist/types-CWFysE9E.d.ts +0 -442
package/dist/extra/reactive.d.ts
CHANGED
|
@@ -1,353 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, a as ReactiveLogBundle, R as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from '../reactive-log-BKALbfal.js';
|
|
3
|
-
export { M as MapBackend, N as NativeMapBackend, a as NativeMapBackendOptions, R as ReactiveMapBundle, b as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from '../reactive-map-DS_SIAxv.js';
|
|
4
|
-
import './storage-tiers.js';
|
|
5
|
-
|
|
6
|
-
type IndexRow<K, V = unknown> = {
|
|
7
|
-
readonly primary: K;
|
|
8
|
-
readonly secondary: unknown;
|
|
9
|
-
readonly value: V;
|
|
10
|
-
};
|
|
11
|
-
type ReactiveIndexOptions<K, V = unknown> = {
|
|
12
|
-
/** Optional registry name for `describe()` / debugging. */
|
|
13
|
-
name?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Storage backend. Defaults to `NativeIndexBackend` (flat array + parallel `Map<K,IndexRow>`).
|
|
16
|
-
* Users can plug in persistent / B-tree backends via the {@link IndexBackend} interface.
|
|
17
|
-
*/
|
|
18
|
-
backend?: IndexBackend<K, V>;
|
|
19
|
-
/**
|
|
20
|
-
* Optional versioning level for the underlying `ordered` state node. Set at
|
|
21
|
-
* construction time; cannot be changed later. Pass `0` for V0 identity +
|
|
22
|
-
* monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
23
|
-
* (The `byPrimary` derived node inherits through the dep graph.)
|
|
24
|
-
*/
|
|
25
|
-
versioning?: VersioningLevel;
|
|
26
|
-
/**
|
|
27
|
-
* Default row-equality used to short-circuit idempotent upserts. When
|
|
28
|
-
* provided, every `upsert` / `upsertMany` that finds an existing primary
|
|
29
|
-
* compares the stored and candidate rows via `equals(existing, next)` —
|
|
30
|
-
* on `true` the call is a no-op (no version bump, no emission). Per-call
|
|
31
|
-
* `UpsertOptions.equals` overrides this default. Analogous to
|
|
32
|
-
* `NodeOptions.equals` on the core `node()` primitive.
|
|
33
|
-
*/
|
|
34
|
-
equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
|
|
35
|
-
};
|
|
36
|
-
type ReactiveIndexBundle<K, V = unknown> = {
|
|
37
|
-
/** Rows sorted by `(secondary, primary)`. */
|
|
38
|
-
readonly ordered: Node<readonly IndexRow<K, V>[]>;
|
|
39
|
-
/** Map from primary key to stored value. */
|
|
40
|
-
readonly byPrimary: Node<ReadonlyMap<K, V>>;
|
|
41
|
-
/** O(1) primary-key existence check. */
|
|
42
|
-
has: (primary: K) => boolean;
|
|
43
|
-
/** O(1) value lookup by primary key. */
|
|
44
|
-
get: (primary: K) => V | undefined;
|
|
45
|
-
/** Number of rows currently in the index (O(1)). */
|
|
46
|
-
readonly size: number;
|
|
47
|
-
/**
|
|
48
|
-
* Upserts a row. When `opts.equals(existing, next)` returns `true` for an
|
|
49
|
-
* existing primary key, the upsert is a no-op (no version bump, no emission).
|
|
50
|
-
* Useful for idempotent writes.
|
|
51
|
-
*
|
|
52
|
-
* @returns `true` if a new row was inserted (primary key was absent),
|
|
53
|
-
* `false` if the primary key was already present (updated in place OR
|
|
54
|
-
* skipped idempotently via `opts.equals`). D5(a).
|
|
55
|
-
*/
|
|
56
|
-
upsert: (primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>) => boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Bulk upsert — emits one snapshot for the whole batch. `opts.equals` applied
|
|
59
|
-
* per-row. No-op if empty or all rows skipped.
|
|
60
|
-
*
|
|
61
|
-
* **Iterable consumption:** Consumes `rows` once (single-pass).
|
|
62
|
-
*/
|
|
63
|
-
upsertMany: (rows: Iterable<{
|
|
64
|
-
primary: K;
|
|
65
|
-
secondary: unknown;
|
|
66
|
-
value: V;
|
|
67
|
-
}>, opts?: UpsertOptions<K, V>) => void;
|
|
68
|
-
delete: (primary: K) => void;
|
|
69
|
-
/**
|
|
70
|
-
* Bulk delete — emits one snapshot for the whole batch. No-op if nothing was removed.
|
|
71
|
-
*
|
|
72
|
-
* **Iterable consumption:** Consumes `primaries` once (single-pass).
|
|
73
|
-
*/
|
|
74
|
-
deleteMany: (primaries: Iterable<K>) => void;
|
|
75
|
-
clear: () => void;
|
|
76
|
-
/**
|
|
77
|
-
* Releases internal keepalive subscriptions (on `byPrimary`) so the bundle
|
|
78
|
-
* can be GC'd. Safe to call more than once (subsequent calls are no-ops).
|
|
79
|
-
* Subsequent mutations after `dispose()` still execute on the backend but
|
|
80
|
-
* `byPrimary` may stop updating if no external subscriber is attached.
|
|
81
|
-
* D6(a).
|
|
82
|
-
*/
|
|
83
|
-
dispose: () => void;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Storage contract for {@link reactiveIndex}. Implementations own the mutable state and
|
|
87
|
-
* expose a monotonic `version` counter that increments on every structural change.
|
|
88
|
-
*
|
|
89
|
-
* The reactive layer reads `version` to decide when to emit; it does not inspect
|
|
90
|
-
* internal representation. Users can plug in B-tree / skip-list / persistent backends
|
|
91
|
-
* without touching the reactive emission logic.
|
|
92
|
-
*
|
|
93
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
94
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
95
|
-
* should treat all methods here as stable.
|
|
96
|
-
*
|
|
97
|
-
* @category extra
|
|
98
|
-
*/
|
|
99
|
-
/**
|
|
100
|
-
* Optional per-call options for {@link IndexBackend.upsert} and bulk upsert.
|
|
101
|
-
*
|
|
102
|
-
* @category extra
|
|
103
|
-
*/
|
|
104
|
-
type UpsertOptions<K, V> = {
|
|
105
|
-
/**
|
|
106
|
-
* Skip the upsert if an existing row is considered equal to the proposed row.
|
|
107
|
-
* Default: no skip — every upsert advances `version`. Provide for idempotent
|
|
108
|
-
* keys (e.g., `(a, b) => a.secondary === b.secondary && a.value === b.value`).
|
|
109
|
-
*/
|
|
110
|
-
equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
|
|
111
|
-
};
|
|
112
|
-
interface IndexBackend<K, V = unknown> {
|
|
113
|
-
/** Monotonic mutation counter; increments on every upsert/delete/clear that changes state. */
|
|
114
|
-
readonly version: number;
|
|
115
|
-
/** Number of rows currently stored. */
|
|
116
|
-
readonly size: number;
|
|
117
|
-
/** O(1) primary-key existence check. */
|
|
118
|
-
has(primary: K): boolean;
|
|
119
|
-
/** Value lookup by primary key. */
|
|
120
|
-
get(primary: K): V | undefined;
|
|
121
|
-
/**
|
|
122
|
-
* Insert or replace a row. Returns `true` if a row was inserted (primary
|
|
123
|
-
* didn't exist), `false` otherwise (updated OR skipped via `opts.equals`).
|
|
124
|
-
*
|
|
125
|
-
* **Atomicity contract:** Either fully succeeds or throws before any state
|
|
126
|
-
* change; `version` advances only on state change.
|
|
127
|
-
*/
|
|
128
|
-
upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Atomic bulk upsert. Returns the number of rows that caused a state change
|
|
131
|
-
* (inserts + non-skipped updates). Advances `version` at most once.
|
|
132
|
-
* No-op if iterable is empty or all rows skipped by `opts.equals`.
|
|
133
|
-
*
|
|
134
|
-
* **Consumes `rows` once** — pass an array for multi-shot consumers.
|
|
135
|
-
*/
|
|
136
|
-
upsertMany(rows: Iterable<{
|
|
137
|
-
primary: K;
|
|
138
|
-
secondary: unknown;
|
|
139
|
-
value: V;
|
|
140
|
-
}>, opts?: UpsertOptions<K, V>): number;
|
|
141
|
-
/** Remove a row by primary key. Returns `true` if the row existed. Advances `version` only if true. */
|
|
142
|
-
delete(primary: K): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Atomic bulk delete. Returns count removed. Advances `version` at most once.
|
|
145
|
-
* No-op if no keys were present. Consumes `primaries` once.
|
|
146
|
-
*/
|
|
147
|
-
deleteMany(primaries: Iterable<K>): number;
|
|
148
|
-
/** Remove all rows. Returns the number removed. Advances `version` only if non-zero. */
|
|
149
|
-
clear(): number;
|
|
150
|
-
/** Rows in sorted `(secondary, primary)` order — fresh snapshot suitable for emission. */
|
|
151
|
-
toArray(): readonly IndexRow<K, V>[];
|
|
152
|
-
/** Primary-key → value map — fresh snapshot. */
|
|
153
|
-
toPrimaryMap(): ReadonlyMap<K, V>;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Default flat-array backend. Maintains `buf: IndexRow[]` sorted by `(secondary, primary)`
|
|
157
|
-
* and a parallel `Map<K, IndexRow>` for O(1) primary-key lookup.
|
|
158
|
-
*
|
|
159
|
-
* **Complexity:**
|
|
160
|
-
* - `has`, `get`: O(1)
|
|
161
|
-
* - `upsert`: up to 2× O(log n) bisect (locate old + locate new) + up to 2× O(n) splice (remove-old + insert-new) = O(n)
|
|
162
|
-
* - `upsertMany(k rows)`: O(k log n) bisect + O(k·n) splice worst case; single version bump
|
|
163
|
-
* - `delete`: O(log n) bisect + O(n) splice = O(n)
|
|
164
|
-
* - `deleteMany(k keys)`: O(k log n) + O(k·n) splice worst case; single version bump
|
|
165
|
-
* - `clear`: O(1)
|
|
166
|
-
* - `toArray`, `toPrimaryMap`: O(n)
|
|
167
|
-
*
|
|
168
|
-
* @category extra
|
|
169
|
-
*/
|
|
170
|
-
declare class NativeIndexBackend<K, V = unknown> implements IndexBackend<K, V> {
|
|
171
|
-
private _version;
|
|
172
|
-
private readonly _buf;
|
|
173
|
-
private readonly _byPrimary;
|
|
174
|
-
get version(): number;
|
|
175
|
-
get size(): number;
|
|
176
|
-
has(primary: K): boolean;
|
|
177
|
-
get(primary: K): V | undefined;
|
|
178
|
-
upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
|
|
179
|
-
upsertMany(rows: Iterable<{
|
|
180
|
-
primary: K;
|
|
181
|
-
secondary: unknown;
|
|
182
|
-
value: V;
|
|
183
|
-
}>, opts?: UpsertOptions<K, V>): number;
|
|
184
|
-
delete(primary: K): boolean;
|
|
185
|
-
deleteMany(primaries: Iterable<K>): number;
|
|
186
|
-
clear(): number;
|
|
187
|
-
toArray(): readonly IndexRow<K, V>[];
|
|
188
|
-
toPrimaryMap(): ReadonlyMap<K, V>;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Creates a reactive index: unique primary key per row, rows sorted by `(secondary, primary)` for ordered scans.
|
|
192
|
-
*
|
|
193
|
-
* @param options - Optional `name` for `describe()` / debugging, and optional `backend` (see {@link IndexBackend}).
|
|
194
|
-
* @returns Bundle with `ordered` (sorted rows), `byPrimary` (map), O(1) `has` / `get` / `size`,
|
|
195
|
-
* imperative `upsert` / `upsertMany` / `delete` / `deleteMany` / `clear`.
|
|
196
|
-
*
|
|
197
|
-
* @remarks
|
|
198
|
-
* **Ordering:** `secondary` and `primary` are compared via a small total order: same primitive `typeof` uses
|
|
199
|
-
* numeric/string/boolean/bigint comparison; mixed or object keys fall back to `String(a).localeCompare(String(b))`
|
|
200
|
-
* (not identical to Python's rich comparison for exotic types).
|
|
201
|
-
*
|
|
202
|
-
* **Backend:** The default {@link NativeIndexBackend} offers O(1) primary-key lookups and O(n) upserts.
|
|
203
|
-
* For scale beyond a few thousand rows, supply a user-pluggable persistent/B-tree backend via the
|
|
204
|
-
* `backend` option — reactive emission semantics are unchanged.
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* ```ts
|
|
208
|
-
* import { reactiveIndex } from "@graphrefly/graphrefly-ts";
|
|
209
|
-
*
|
|
210
|
-
* const idx = reactiveIndex<string, string>();
|
|
211
|
-
* idx.upsert("id1", 10, "row-a");
|
|
212
|
-
* idx.upsert("id2", 5, "row-b");
|
|
213
|
-
* ```
|
|
214
|
-
*
|
|
215
|
-
* @category extra
|
|
216
|
-
*/
|
|
217
|
-
declare function reactiveIndex<K, V = unknown>(options?: ReactiveIndexOptions<K, V>): ReactiveIndexBundle<K, V>;
|
|
218
|
-
|
|
219
|
-
type ReactiveListOptions<T> = {
|
|
220
|
-
name?: string;
|
|
221
|
-
/**
|
|
222
|
-
* Storage backend. Defaults to `NativeListBackend` (flat mutable array).
|
|
223
|
-
* Users can plug in persistent / RRB-tree backends via the {@link ListBackend} interface.
|
|
224
|
-
*/
|
|
225
|
-
backend?: ListBackend<T>;
|
|
226
|
-
/**
|
|
227
|
-
* Optional versioning level for the underlying `items` state node. Set at
|
|
228
|
-
* construction time; cannot be changed later. Pass `0` for V0 identity +
|
|
229
|
-
* monotonic version counter, or `1` for V1 + content-addressed cid.
|
|
230
|
-
*/
|
|
231
|
-
versioning?: VersioningLevel;
|
|
232
|
-
};
|
|
233
|
-
type ReactiveListBundle<T> = {
|
|
234
|
-
/** Emits `readonly T[]` on each structural change (two-phase). */
|
|
235
|
-
readonly items: Node<readonly T[]>;
|
|
236
|
-
/** Current entry count (O(1)). */
|
|
237
|
-
readonly size: number;
|
|
238
|
-
/** Positional access (O(1)); supports negative indices (Python-style). Returns `undefined` on out-of-range. */
|
|
239
|
-
at: (index: number) => T | undefined;
|
|
240
|
-
append: (value: T) => void;
|
|
241
|
-
/** Push all values, emit one snapshot. No-op if `values` is empty. */
|
|
242
|
-
appendMany: (values: readonly T[]) => void;
|
|
243
|
-
/** Insert a value at `index`. Throws `RangeError` on out-of-range. */
|
|
244
|
-
insert: (index: number, value: T) => void;
|
|
245
|
-
/** Insert all values at `index` as one bulk op; emits one snapshot. No-op if `values` is empty. */
|
|
246
|
-
insertMany: (index: number, values: readonly T[]) => void;
|
|
247
|
-
/** Remove and return the value at `index` (default: last). Negative indices Python-style. Throws on empty / out-of-range. */
|
|
248
|
-
pop: (index?: number) => T;
|
|
249
|
-
clear: () => void;
|
|
250
|
-
/**
|
|
251
|
-
* Releases any internal keepalive subscriptions so the bundle can be
|
|
252
|
-
* GC'd. `reactiveList` currently holds none (no internal derived nodes),
|
|
253
|
-
* so `dispose()` is a no-op today — exposed for API parity with
|
|
254
|
-
* `reactiveIndex.dispose` / `reactiveMap.dispose` / `reactiveLog.dispose`.
|
|
255
|
-
* Idempotent. D6(a).
|
|
256
|
-
*/
|
|
257
|
-
dispose: () => void;
|
|
258
|
-
};
|
|
259
|
-
/**
|
|
260
|
-
* Storage contract for {@link reactiveList}. Implementations own the mutable state
|
|
261
|
-
* and expose a monotonic `version` counter that increments on every structural change.
|
|
262
|
-
*
|
|
263
|
-
* The reactive layer reads `version` before and after each backend call; when it
|
|
264
|
-
* advances, a snapshot is emitted.
|
|
265
|
-
*
|
|
266
|
-
* @remarks Post-1.0 op-log changesets will extend this interface with a
|
|
267
|
-
* `changesSince(version: number): Iterable<Change>` method. Current consumers
|
|
268
|
-
* should treat all methods here as stable.
|
|
269
|
-
*
|
|
270
|
-
* @category extra
|
|
271
|
-
*/
|
|
272
|
-
interface ListBackend<T> {
|
|
273
|
-
/** Monotonic mutation counter; increments on every structural change. */
|
|
274
|
-
readonly version: number;
|
|
275
|
-
/** Number of items currently stored. */
|
|
276
|
-
readonly size: number;
|
|
277
|
-
/** Positional access; `undefined` on out-of-range. */
|
|
278
|
-
at(index: number): T | undefined;
|
|
279
|
-
/** Append a single value. Advances `version`. */
|
|
280
|
-
append(value: T): void;
|
|
281
|
-
/** Append a batch. Advances `version` once. No-op if empty. */
|
|
282
|
-
appendMany(values: readonly T[]): void;
|
|
283
|
-
/** Insert at index; throws `RangeError` on out-of-range `0 <= index <= size`. Advances `version`. */
|
|
284
|
-
insert(index: number, value: T): void;
|
|
285
|
-
/** Bulk insert at index; throws on out-of-range. Advances `version` once. No-op if `values` empty. */
|
|
286
|
-
insertMany(index: number, values: readonly T[]): void;
|
|
287
|
-
/** Remove and return value at index; throws on empty / out-of-range. Advances `version`. */
|
|
288
|
-
pop(index: number): T;
|
|
289
|
-
/** Clear all entries. Returns count removed. Advances `version` only if non-zero. */
|
|
290
|
-
clear(): number;
|
|
291
|
-
/** Full snapshot as a fresh array. */
|
|
292
|
-
toArray(): readonly T[];
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Default mutable-array backend.
|
|
296
|
-
*
|
|
297
|
-
* **Complexity:**
|
|
298
|
-
* - `at`, `size`: O(1)
|
|
299
|
-
* - `append`: O(1) amortized
|
|
300
|
-
* - `appendMany(values)`, `insertMany(index, values)`: O(n + k) where k = values.length
|
|
301
|
-
* - `insert`, `pop` (middle): O(n) due to splice
|
|
302
|
-
* - `pop` (last): O(1)
|
|
303
|
-
* - `clear`: O(1)
|
|
304
|
-
* - `toArray`: O(n)
|
|
305
|
-
*
|
|
306
|
-
* @category extra
|
|
307
|
-
*/
|
|
308
|
-
declare class NativeListBackend<T> implements ListBackend<T> {
|
|
309
|
-
private _version;
|
|
310
|
-
private readonly _buf;
|
|
311
|
-
constructor(initial?: readonly T[]);
|
|
312
|
-
get version(): number;
|
|
313
|
-
get size(): number;
|
|
314
|
-
at(index: number): T | undefined;
|
|
315
|
-
append(value: T): void;
|
|
316
|
-
appendMany(values: readonly T[]): void;
|
|
317
|
-
insert(index: number, value: T): void;
|
|
318
|
-
insertMany(index: number, values: readonly T[]): void;
|
|
319
|
-
pop(index: number): T;
|
|
320
|
-
clear(): number;
|
|
321
|
-
toArray(): readonly T[];
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Creates a reactive list with immutable array snapshots.
|
|
325
|
-
*
|
|
326
|
-
* @param initial - Optional initial items (copied).
|
|
327
|
-
* @param options - Optional `name` for `describe()` / debugging, or pluggable `backend`.
|
|
328
|
-
* @returns Bundle with `items` (state node), `size` / `at`, `append` / `appendMany` / `insert` /
|
|
329
|
-
* `insertMany` / `pop` / `clear`.
|
|
330
|
-
*
|
|
331
|
-
* @remarks
|
|
332
|
-
* **No `maxSize`:** insert/pop-anywhere semantics make eviction-under-cap ambiguous.
|
|
333
|
-
* For bounded append-heavy workloads use `reactiveLog` (head-trim is well-defined for
|
|
334
|
-
* append-only).
|
|
335
|
-
*
|
|
336
|
-
* **Backend:** Default {@link NativeListBackend}. For persistent / RRB-tree semantics
|
|
337
|
-
* supply a custom {@link ListBackend}. If you provide a `backend`, `initial` is ignored
|
|
338
|
-
* — seed the backend directly.
|
|
339
|
-
*
|
|
340
|
-
* @example
|
|
341
|
-
* ```ts
|
|
342
|
-
* import { reactiveList } from "@graphrefly/graphrefly-ts";
|
|
343
|
-
*
|
|
344
|
-
* const list = reactiveList<string>(["a"], { name: "queue" });
|
|
345
|
-
* list.append("b");
|
|
346
|
-
* list.insertMany(1, ["x", "y"]);
|
|
347
|
-
* ```
|
|
348
|
-
*
|
|
349
|
-
* @category extra
|
|
350
|
-
*/
|
|
351
|
-
declare function reactiveList<T>(initial?: readonly T[], options?: ReactiveListOptions<T>): ReactiveListBundle<T>;
|
|
352
|
-
|
|
353
|
-
export { type IndexBackend, type IndexRow, type ListBackend, NativeIndexBackend, NativeListBackend, type ReactiveIndexBundle, type ReactiveIndexOptions, type ReactiveListBundle, type ReactiveListOptions, type UpsertOptions, reactiveIndex, reactiveList };
|
|
1
|
+
export * from '@graphrefly/pure-ts/extra/reactive';
|
package/dist/extra/reactive.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/extra/reactive.ts
|
|
2
|
+
export * from "@graphrefly/pure-ts/extra/reactive";
|
|
3
|
+
//# sourceMappingURL=reactive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/extra/reactive.ts"],"sourcesContent":["// Phase 13.9.A shim — re-export from pure-TS sibling until\n// @graphrefly/native (napi binding) and per-milestone swap-overs land.\nexport * from \"@graphrefly/pure-ts/extra/reactive\";\n"],"mappings":";AAEA,cAAc;","names":[]}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
`)}function bn(n,e,s,i,r){let{x:t,y:o,w:a,h:l}=i;if(a<2||l<2){l>0&&F(n,e,t,o,a,r);return}w(n,e,t,o,s.boxTL);for(let u=t+1;u<t+a-1;u+=1)w(n,e,u,o,s.boxH);w(n,e,t+a-1,o,s.boxTR);for(let u=o+1;u<o+l-1;u+=1){w(n,e,t,u,s.boxV);for(let c=t+1;c<t+a-1;c+=1)Y(n,e,c,u," ","empty");w(n,e,t+a-1,u,s.boxV)}w(n,e,t,o+l-1,s.boxBL);for(let u=t+1;u<t+a-1;u+=1)w(n,e,u,o+l-1,s.boxH);w(n,e,t+a-1,o+l-1,s.boxBR);let f=o+Math.floor(l/2);F(n,e,t+1,f,a-2,r)}function w(n,e,s,i,r){Y(n,e,s,i,r,r===" "?"empty":r==="\u2500"||r==="-"?"boxH":r==="\u2502"||r==="|"?"boxV":"boxCorner")}function Y(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=n[i];s<0||s>=o.length||(o[s]=r,e[i][s]=t)}function F(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=s,a=r;for(let l of t){let f=S(l);if(f!==0){if(a<f)break;o>=0&&o<n[i].length&&(n[i][o]=l,e[i][o]="label",f===2&&o+1<n[i].length&&(n[i][o+1]="",e[i][o+1]="label")),o+=f,a-=f}}for(;a>0;)o>=0&&o<n[i].length&&(n[i][o]=" ",e[i][o]="empty"),o+=1,a-=1}function Ln(n,e,s,i){let r=i.points;if(r.length<2)return;for(let l=0;l+1<r.length;l+=1)wn(n,e,s,r[l],r[l+1]);for(let l=1;l+1<r.length;l+=1){let f=r[l-1],u=r[l],c=r[l+1],x=Dn(f,u,c,s);x&&J(n,e,u.x,u.y,x,"edgeCorner")}let t=r[r.length-1],o=r[r.length-2],a=In(o,t,s);a&&J(n,e,t.x,t.y,a,"arrow")}function wn(n,e,s,i,r){if(!(i.x===r.x&&i.y===r.y)){if(i.y===r.y){let t=i.y,o=Math.min(i.x,r.x),a=Math.max(i.x,r.x);for(let l=o;l<=a;l+=1)k(n,e,l,t,s,"h")}else if(i.x===r.x){let t=i.x,o=Math.min(i.y,r.y),a=Math.max(i.y,r.y);for(let l=o;l<=a;l+=1)k(n,e,t,l,s,"v")}}}function k(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=n[i];if(s<0||s>=o.length)return;let a=e[i][s];if(!(a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label")){if(a==="empty"){o[s]=t==="h"?r.horizontal:r.vertical,e[i][s]=t==="h"?"edgeH":"edgeV";return}if(a==="edgeH"&&t==="v"){o[s]=r.cross,e[i][s]="edgeCorner";return}if(a==="edgeV"&&t==="h"){o[s]=r.cross,e[i][s]="edgeCorner";return}}}function J(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=n[i];if(s<0||s>=o.length)return;let a=e[i][s];a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label"||(o[s]=r,e[i][s]=t)}function Dn(n,e,s,i){let r=n.y===e.y,t=e.y===s.y;if(r===t)return;if(r){let l=n.x<e.x,f=s.y>e.y;return l&&f?i.cornerTR:l&&!f?i.cornerBR:!l&&f?i.cornerTL:i.cornerBL}let o=n.y<e.y,a=s.x>e.x;return o&&a?i.cornerBL:o&&!a?i.cornerBR:!o&&a?i.cornerTL:i.cornerTR}function In(n,e,s){if(e.x>n.x)return s.arrowRight;if(e.x<n.x)return s.arrowLeft;if(e.y>n.y)return s.arrowDown;if(e.y<n.y)return s.arrowUp}function Tn(n){let e=n.length;for(;e>0&&n.charCodeAt(e-1)===32;)e-=1;return n.slice(0,e)}function Q(n){let e=Mn(n);On(e),Cn(e),Rn(e),Sn(e,n);let s=En(e,n),{width:i,height:r}=Pn(e),t=[];for(let o of e.layers)for(let a of o)a.isVirtual||t.push({id:a.id,layer:a.layer,order:a.order,x:a.x,y:a.y,w:a.w,h:a.h});return{boxes:t,edges:s,width:i,height:r}}function Mn(n){let e=new Map;for(let r of n.nodes)e.set(r,{id:r,isVirtual:!1,layer:-1,order:0,x:0,y:0,w:n.widthCells(r),h:n.heightCells(r),in:[],out:[]});let s=[],i=0;for(let r of n.edges){if(r.from===r.to)continue;let t=e.get(r.from),o=e.get(r.to);if(!t||!o)continue;let a={chainId:i++,chainFrom:r.from,chainTo:r.to,fromId:r.from,toId:r.to,hopIndex:0,chainLen:1};t.out.push(a),o.in.push(a),s.push(a)}return{nodes:e,layers:[],hops:s}}function On(n){let e=new Map;for(let t of n.nodes.values())e.set(t.id,t.in.length);let s=[];for(let t of n.nodes.values())(e.get(t.id)??0)===0&&(t.layer=0,s.push(t));let i=new Set,r=0;for(;r<s.length;){let t=s[r++];if(!i.has(t.id)){i.add(t.id);for(let o of t.out){let a=n.nodes.get(o.toId);a.layer=Math.max(a.layer,t.layer+1);let l=(e.get(a.id)??0)-1;e.set(a.id,l),l<=0&&s.push(a)}}}for(let t of n.nodes.values())t.layer<0&&(t.layer=0)}function Cn(n){let e=Math.max(0,...Array.from(n.nodes.values(),t=>t.layer)),s=Array.from({length:e+1},()=>[]);for(let t of n.nodes.values())s[t.layer].push(t);let i=[],r=0;for(let t of n.hops){let o=n.nodes.get(t.fromId),a=n.nodes.get(t.toId),l=a.layer-o.layer;if(l<=0){o.out=o.out.filter(c=>c!==t),a.in=a.in.filter(c=>c!==t);continue}if(l===1){t.hopIndex=0,t.chainLen=1,i.push(t);continue}o.out=o.out.filter(c=>c!==t),a.in=a.in.filter(c=>c!==t);let f=o;for(let c=1;c<l;c+=1){let x=`__virt_${r++}__`,h={id:x,isVirtual:!0,layer:o.layer+c,order:0,x:0,y:0,w:0,h:1,in:[],out:[]};n.nodes.set(x,h),s[h.layer].push(h);let p={chainId:t.chainId,chainFrom:t.chainFrom,chainTo:t.chainTo,fromId:f.id,toId:x,hopIndex:c-1,chainLen:l};f.out.push(p),h.in.push(p),i.push(p),f=h}let u={chainId:t.chainId,chainFrom:t.chainFrom,chainTo:t.chainTo,fromId:f.id,toId:a.id,hopIndex:l-1,chainLen:l};f.out.push(u),a.in.push(u),i.push(u)}for(let t of s)for(let o=0;o<t.length;o+=1)t[o].order=o;n.layers=s,n.hops=i}function Rn(n){for(let s=0;s<4;s+=1){for(let i=1;i<n.layers.length;i+=1)X(n,n.layers[i],"in"),G(n.layers[i]);for(let i=n.layers.length-2;i>=0;i-=1)X(n,n.layers[i],"out"),G(n.layers[i])}for(let s=0;s<2;s+=1){let i=!1;for(let r=1;r<n.layers.length;r+=1){let t=n.layers[r];for(let o=0;o+1<t.length;o+=1){let a=q(n,t[o],t[o+1],"in");[t[o],t[o+1]]=[t[o+1],t[o]],G(t),q(n,t[o],t[o+1],"in")<a?i=!0:([t[o],t[o+1]]=[t[o+1],t[o]],G(t))}}if(!i)break}}function X(n,e,s){let i=new Map;for(let r of e){let t=s==="in"?r.in:r.out;if(t.length===0){i.set(r.id,r.order);continue}let o=0,a=0;for(let l of t){let f=n.nodes.get(s==="in"?l.fromId:l.toId);f&&(o+=f.order,a+=1)}i.set(r.id,a===0?r.order:o/a)}e.sort((r,t)=>{let o=i.get(r.id),a=i.get(t.id);return o!==a?o-a:r.order-t.order})}function G(n){for(let e=0;e<n.length;e+=1)n[e].order=e}function q(n,e,s,i){let r=i==="in"?e.in:e.out,t=i==="in"?s.in:s.out,o=0;for(let a of r)for(let l of t){let f=n.nodes.get(i==="in"?a.fromId:a.toId)?.order??0,u=n.nodes.get(i==="in"?l.fromId:l.toId)?.order??0;(e.order<s.order&&f>u||e.order>s.order&&f<u)&&(o+=1)}return o}function Sn(n,e){e.direction==="LR"?Gn(n,e):vn(n,e)}function Gn(n,e){let s=[],i=0;for(let r=0;r<n.layers.length;r+=1){s.push(i);let t=0;for(let o of n.layers[r])t=Math.max(t,o.w);i+=t+e.layerGap}for(let r=0;r<n.layers.length;r+=1)for(let t of n.layers[r])t.x=s[r];for(let r of n.layers){let t=0;for(let o of r)o.y=t,t+=o.h+e.nodeGap}Z(n,e,"y")}function vn(n,e){let s=[],i=0;for(let r=0;r<n.layers.length;r+=1){s.push(i);let t=0;for(let o of n.layers[r])t=Math.max(t,o.h);i+=t+e.layerGap}for(let r=0;r<n.layers.length;r+=1)for(let t of n.layers[r])t.y=s[r];for(let r of n.layers){let t=0;for(let o of r)o.x=t,t+=o.w+e.nodeGap}Z(n,e,"x")}function Z(n,e,s){let i=t=>s==="y"?t.h:t.w,r=e.nodeGap;for(let t=0;t<2;t+=1){let o=t===0?n.layers.slice(1):n.layers.slice(0,-1).reverse();for(let a of o){let l=new Map;for(let u of a){let c=t===0?u.in:u.out;if(c.length===0)continue;let x=[];for(let p of c){let y=n.nodes.get(t===0?p.fromId:p.toId);if(!y)continue;let m=s==="y"?y.y:y.x;x.push(m+Math.floor(i(y)/2))}if(x.length===0)continue;x.sort((p,y)=>p-y);let h=x[Math.floor(x.length/2)];l.set(u.id,h-Math.floor(i(u)/2))}let f=0;for(let u of a){let c=l.get(u.id),x=s==="y"?u.y:u.x,p=Math.max(c??x,f);s==="y"?u.y=p:u.x=p,f=p+i(u)+r}}}}function En(n,e){let s=new Map;for(let f of n.hops){let u=s.get(f.chainId);u?u.push(f):s.set(f.chainId,[f])}for(let f of s.values())f.sort((u,c)=>u.hopIndex-c.hopIndex);let i=e.direction==="LR",r=f=>i?f.x:f.y,t=f=>i?f.w:f.h,o=f=>i?f.y+Math.floor(f.h/2):f.x+Math.floor(f.w/2),a=new Map;for(let f=0;f+1<n.layers.length;f+=1){let u=n.layers[f],c=n.layers[f+1],x=0;for(let g of u)x=Math.max(x,r(g)+t(g));let h=Number.POSITIVE_INFINITY;for(let g of c)h=Math.min(h,r(g));let p=Number.isFinite(h)?h-1:x,y=Math.max(1,p-x+1),m=[];for(let g of u)for(let d of g.out)m.push(d);m.sort((g,d)=>{let b=o(n.nodes.get(g.fromId)),L=o(n.nodes.get(d.fromId));if(b!==L)return b-L;let O=o(n.nodes.get(g.toId)),M=o(n.nodes.get(d.toId));return O-M});let D=[],C=new Map;for(let g of m){let d=o(n.nodes.get(g.fromId)),b=o(n.nodes.get(g.toId)),L=Math.min(d,b),O=Math.max(d,b),M=-1;for(let R=0;R<D.length;R+=1){let _=D[R],U=!0;for(let z of _)if(z.lo<=O&&L<=z.hi){U=!1;break}if(U){_.push({lo:L,hi:O}),M=R;break}}M<0&&(D.push([{lo:L,hi:O}]),M=D.length-1),C.set(g,M)}let I=D.length,T=y>=Math.max(3,I+2),H=T?x+1:x,un=T?p-1:p,V=Math.max(1,un-H+1);for(let g of m){let d=C.get(g),b;if(I<=1)b=H+Math.floor(V/2);else{let L=(V-1)/(I-1);b=H+Math.floor(d*L)}a.set(g,Math.max(x,Math.min(p,b)))}}let l=[];for(let[,f]of s){let u=[];for(let x=0;x<f.length;x+=1){let h=f[x],p=n.nodes.get(h.fromId),y=n.nodes.get(h.toId),m=a.get(h),D=p.isVirtual?r(p):r(p)+t(p),C=y.isVirtual?r(y):r(y)-1,I=o(p),T=o(y);x===0&&v(u,i,D,I),I!==T&&(v(u,i,m,I),v(u,i,m,T)),v(u,i,C,T)}let c=f[0];l.push({from:c.chainFrom,to:c.chainTo,points:An(u)})}return l}function v(n,e,s,i){n.push(e?{x:s,y:i}:{x:i,y:s})}function An(n){let e=[];for(let s of n){let i=e[e.length-1];(!i||i.x!==s.x||i.y!==s.y)&&e.push(s)}return e}function Pn(n){let e=0,s=0;for(let i of n.layers)for(let r of i)e=Math.max(e,r.x+r.w),s=Math.max(s,r.y+r.h);return{width:e,height:s}}var Bn=24,Hn=4,$n=1,jn=3;function nn(n,e){let s=Nn(e?.direction),i=Math.max(3,e?.maxLabelWidth??Bn),r=e?.asciiCharset??"unicode",t=Object.keys(n.nodes).sort(),o=new Set(t),a=n.edges.filter(x=>o.has(x.from)&&o.has(x.to)),l=new Map,f=new Map;for(let x of t){let h=K(x,i);l.set(x,h),f.set(x,S(h)+4)}let u=Q({nodes:t,edges:a,widthCells:x=>f.get(x)??3,heightCells:()=>jn,layerGap:Hn,nodeGap:$n,direction:s}),c=W(u,{charset:r,labelOf:x=>l.get(x)??x});return e?.logger?.(c),c}function Nn(n){if(n===void 0||n==="LR")return"LR";if(n==="TD")return"TD";throw new Error(`ascii describe supports direction "LR" or "TD" only; got ${String(n)}`)}function E(n){if(n===null||typeof n!="object")return n;if(Array.isArray(n))return n.map(E);let e=n,s=Object.keys(e).sort(),i={};for(let r of s)i[r]=E(e[r]);return i}function tn(n){return n.replaceAll("\\","\\\\").replaceAll('"','\\"')}function rn(n){return n.replaceAll("\\","\\\\").replaceAll('"','\\"')}function en(n){return n==="TD"?"down":n==="BT"?"up":n==="RL"?"left":"right"}function A(n){let e=new Set,s=[];function i(r,t){let o=`${r}\0${t}`;e.has(o)||(e.add(o),s.push([r,t]))}for(let[r,t]of Object.entries(n.nodes)){let o=t.deps;if(o)for(let a of o)i(a,r)}for(let r of n.edges)i(r.from,r.to);return s}function P(n){if(n===void 0)return"LR";if(n==="TD"||n==="LR"||n==="BT"||n==="RL")return n;throw new Error(`invalid diagram direction ${String(n)}; expected one of: TD, LR, BT, RL`)}function on(n){if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean"||n==null)return String(n);try{return JSON.stringify(n)}catch{return"[unserializable]"}}function sn(n,e){let s=P(e?.direction),i=Object.keys(n.nodes).sort(),r=new Map;for(let o=0;o<i.length;o+=1)r.set(i[o],`n${o}`);let t=[`direction: ${en(s)}`];for(let o of i){let a=r.get(o);t.push(`${a}: "${rn(o)}"`)}for(let[o,a]of A(n)){let l=r.get(o),f=r.get(a);!l||!f||t.push(`${l} -> ${f}`)}return t.join(`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/extra/render/index.ts
|
|
18
|
+
var render_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(render_exports);
|
|
20
|
+
__reExport(render_exports, require("@graphrefly/pure-ts/extra/render"), module.exports);
|
|
21
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/extra/render/index.ts"],"sourcesContent":["// Phase 13.9.A shim — re-export from pure-TS sibling until\n// @graphrefly/native (napi binding) and per-milestone swap-overs land.\nexport * from \"@graphrefly/pure-ts/extra/render\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,2BAAc,6CAFd;","names":[]}
|
|
@@ -1,183 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import '../../node-kK3CvTrR.cjs';
|
|
3
|
-
import '../../sugar-DQjFmVqb.cjs';
|
|
4
|
-
import '../storage-core.cjs';
|
|
5
|
-
import '../storage-tiers.cjs';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal helpers shared across renderers in `extra/render/`.
|
|
9
|
-
*
|
|
10
|
-
* These are pure functions over `GraphDescribeOutput` — no Graph instance
|
|
11
|
-
* dependency. Extracted from `src/graph/graph.ts` (the consolidated
|
|
12
|
-
* ex-dumpGraph / ex-toMermaid / ex-toD2 renderers) per Tier 2.1 A2.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/** Direction options for diagram exports. */
|
|
16
|
-
type DiagramDirection = "TD" | "LR" | "BT" | "RL";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Sugiyama-style layered DAG layout on an integer grid.
|
|
20
|
-
*
|
|
21
|
-
* Pipeline:
|
|
22
|
-
* 1. Longest-path layer assignment (sources at layer 0).
|
|
23
|
-
* 2. Virtual-node splitting — every edge spanning more than one layer
|
|
24
|
-
* becomes a chain of synthetic nodes on intermediate layers. Downstream
|
|
25
|
-
* passes treat real and virtual nodes identically; crossing
|
|
26
|
-
* minimization therefore works on wide + deep DAGs, not only
|
|
27
|
-
* adjacent-layer cases.
|
|
28
|
-
* 3. Crossing minimization — barycenter heuristic with alternating up /
|
|
29
|
-
* down sweeps plus an adjacent-transposition polish pass.
|
|
30
|
-
* 4. Coordinate assignment — greedy median-aligned packing with collision
|
|
31
|
-
* resolution. Straightens vertical runs of virtual nodes so long edges
|
|
32
|
-
* become straight lines where topology allows.
|
|
33
|
-
* 5. Orthogonal edge routing — per-gutter x-track assignment; horizontal
|
|
34
|
-
* segments sit at endpoint centerlines, vertical segments pack into the
|
|
35
|
-
* gutter column range without overlap. Remaining crossings are
|
|
36
|
-
* topologically unavoidable and will render as `┼` at draw time.
|
|
37
|
-
*
|
|
38
|
-
* Output coordinates are cell-grid integers (LR direction). TD rendering
|
|
39
|
-
* swaps axes at draw time — the layout is direction-agnostic by
|
|
40
|
-
* construction.
|
|
41
|
-
*
|
|
42
|
-
* Used only by [to-ascii.ts](./to-ascii.ts); not part of the public
|
|
43
|
-
* `extra/render/index.ts` surface (underscore-prefixed).
|
|
44
|
-
*/
|
|
45
|
-
type LayoutDirection = "LR" | "TD";
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* `toAscii(g, opts?)` — stdout-native DAG flowchart renderer for a
|
|
49
|
-
* {@link GraphDescribeOutput}.
|
|
50
|
-
*
|
|
51
|
-
* Zero external dependencies, graph-size independent via proper Sugiyama
|
|
52
|
-
* (layer assignment → virtual-node splitting → barycenter crossing
|
|
53
|
-
* minimization → median-aligned coordinate assignment → per-gutter
|
|
54
|
-
* track-assigned orthogonal routing). See
|
|
55
|
-
* [_layout-sugiyama.ts](./_layout-sugiyama.ts) for the layout pipeline and
|
|
56
|
-
* [_ascii-grid.ts](./_ascii-grid.ts) for the character blitter.
|
|
57
|
-
*
|
|
58
|
-
* Pure function over the describe snapshot; no Graph instance dependency.
|
|
59
|
-
*
|
|
60
|
-
* @category extra
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
type ToAsciiOptions = {
|
|
64
|
-
/**
|
|
65
|
-
* ASCII layout direction. ASCII grid semantics are meaningful only for
|
|
66
|
-
* `"LR"` (default) and `"TD"`.
|
|
67
|
-
*/
|
|
68
|
-
direction?: LayoutDirection;
|
|
69
|
-
/** Per-box label cell cap; longer labels are truncated with `…`. Default `24`. */
|
|
70
|
-
maxLabelWidth?: number;
|
|
71
|
-
/** Glyph set: `"unicode"` (default, box-drawing) or `"ascii"` (`-|+<>v`). */
|
|
72
|
-
asciiCharset?: "unicode" | "ascii";
|
|
73
|
-
/** Optional logger hook; fires with the rendered text before return. */
|
|
74
|
-
logger?: (text: string) => void;
|
|
75
|
-
};
|
|
76
|
-
declare function toAscii(g: GraphDescribeOutput, opts?: ToAsciiOptions): string;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* `toD2(g, opts?)` — render a {@link GraphDescribeOutput} as D2 diagram text.
|
|
80
|
-
*
|
|
81
|
-
* Pure function over the describe snapshot; no Graph instance dependency.
|
|
82
|
-
*
|
|
83
|
-
* @category extra
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
type ToD2Options = {
|
|
87
|
-
/** Diagram direction; default `"LR"`. */
|
|
88
|
-
direction?: DiagramDirection;
|
|
89
|
-
};
|
|
90
|
-
declare function toD2(g: GraphDescribeOutput, opts?: ToD2Options): string;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* `toJson(g, opts?)` — render a {@link GraphDescribeOutput} as deterministic
|
|
94
|
-
* JSON text with sorted keys.
|
|
95
|
-
*
|
|
96
|
-
* Pure function over the describe snapshot; no Graph instance dependency.
|
|
97
|
-
*
|
|
98
|
-
* @category extra
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
type ToJsonOptions = {
|
|
102
|
-
/** Include the Edges section (default `true`). */
|
|
103
|
-
includeEdges?: boolean;
|
|
104
|
-
/** Include the Subgraphs section (default `true`). */
|
|
105
|
-
includeSubgraphs?: boolean;
|
|
106
|
-
/** JSON indent (default `2`). */
|
|
107
|
-
indent?: number;
|
|
108
|
-
/** Optional logger hook; fires with the rendered text before return. */
|
|
109
|
-
logger?: (text: string) => void;
|
|
110
|
-
};
|
|
111
|
-
declare function toJson(g: GraphDescribeOutput, opts?: ToJsonOptions): string;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* `toMermaid(g, opts?)` — render a {@link GraphDescribeOutput} as Mermaid
|
|
115
|
-
* flowchart text.
|
|
116
|
-
*
|
|
117
|
-
* Pure function over the describe snapshot; no Graph instance dependency.
|
|
118
|
-
* Compose with `derived` for live formatted output:
|
|
119
|
-
*
|
|
120
|
-
* ```ts
|
|
121
|
-
* import { toMermaid } from "@graphrefly/graphrefly/extra/render";
|
|
122
|
-
* import { derived } from "@graphrefly/graphrefly";
|
|
123
|
-
*
|
|
124
|
-
* const live = derived([graph.describe({ reactive: true }).node], ([g]) => toMermaid(g));
|
|
125
|
-
* ```
|
|
126
|
-
*
|
|
127
|
-
* @category extra
|
|
128
|
-
*/
|
|
129
|
-
|
|
130
|
-
type ToMermaidOptions = {
|
|
131
|
-
/** Diagram direction; default `"LR"`. */
|
|
132
|
-
direction?: DiagramDirection;
|
|
133
|
-
};
|
|
134
|
-
declare function toMermaid(g: GraphDescribeOutput, opts?: ToMermaidOptions): string;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* `toMermaidUrl(g, opts?)` — encode a {@link GraphDescribeOutput} as a
|
|
138
|
-
* `https://mermaid.live/edit#base64:…` deep link.
|
|
139
|
-
*
|
|
140
|
-
* Round-trip with the mermaid.live editor's `/edit#base64:` share format —
|
|
141
|
-
* payload is `base64url(JSON({code, mermaid: {theme}, ...}))`. No network
|
|
142
|
-
* calls; the payload is encoded into the URL fragment.
|
|
143
|
-
*
|
|
144
|
-
* @category extra
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
type MermaidLiveTheme = "default" | "dark" | "forest" | "neutral" | "base";
|
|
148
|
-
type ToMermaidUrlOptions = ToMermaidOptions & {
|
|
149
|
-
theme?: MermaidLiveTheme;
|
|
150
|
-
autoSync?: boolean;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Encode an arbitrary mermaid source string to a `mermaid.live` deep link.
|
|
154
|
-
* Exported separately so callers that already rendered mermaid text can
|
|
155
|
-
* upgrade to a live-editor URL without re-rendering.
|
|
156
|
-
*/
|
|
157
|
-
declare function mermaidLiveUrl(mermaidSrc: string, opts?: {
|
|
158
|
-
theme?: MermaidLiveTheme;
|
|
159
|
-
autoSync?: boolean;
|
|
160
|
-
}): string;
|
|
161
|
-
declare function toMermaidUrl(g: GraphDescribeOutput, opts?: ToMermaidUrlOptions): string;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* `toPretty(g, opts?)` — render a {@link GraphDescribeOutput} as
|
|
165
|
-
* human-readable plaintext (Node list with values, plus optional Edges and
|
|
166
|
-
* Subgraphs sections).
|
|
167
|
-
*
|
|
168
|
-
* Pure function over the describe snapshot; no Graph instance dependency.
|
|
169
|
-
*
|
|
170
|
-
* @category extra
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
type ToPrettyOptions = {
|
|
174
|
-
/** Include the Edges section (default `true`). */
|
|
175
|
-
includeEdges?: boolean;
|
|
176
|
-
/** Include the Subgraphs section (default `true`). */
|
|
177
|
-
includeSubgraphs?: boolean;
|
|
178
|
-
/** Optional logger hook; fires with the rendered text before return. */
|
|
179
|
-
logger?: (text: string) => void;
|
|
180
|
-
};
|
|
181
|
-
declare function toPretty(g: GraphDescribeOutput, opts?: ToPrettyOptions): string;
|
|
182
|
-
|
|
183
|
-
export { type DiagramDirection, type LayoutDirection, type MermaidLiveTheme, type ToAsciiOptions, type ToD2Options, type ToJsonOptions, type ToMermaidOptions, type ToMermaidUrlOptions, type ToPrettyOptions, mermaidLiveUrl, toAscii, toD2, toJson, toMermaid, toMermaidUrl, toPretty };
|
|
1
|
+
export * from '@graphrefly/pure-ts/extra/render';
|