@genome-spy/core 0.67.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/index.es.js +15884 -13130
- package/dist/bundle/index.js +130 -149
- package/dist/schema.json +6498 -6191
- package/dist/src/data/collector.d.ts +20 -0
- package/dist/src/data/collector.d.ts.map +1 -1
- package/dist/src/data/collector.js +148 -0
- package/dist/src/data/dataFlow.d.ts +6 -0
- package/dist/src/data/dataFlow.d.ts.map +1 -1
- package/dist/src/data/dataFlow.js +20 -0
- package/dist/src/data/flowInit.d.ts.map +1 -1
- package/dist/src/data/flowInit.js +2 -3
- package/dist/src/data/flowNode.d.ts +33 -10
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +84 -13
- package/dist/src/data/flowTestUtils.d.ts +2 -2
- package/dist/src/data/flowTestUtils.d.ts.map +1 -1
- package/dist/src/data/flowTestUtils.js +5 -4
- package/dist/src/data/keyIndex.d.ts +18 -0
- package/dist/src/data/keyIndex.d.ts.map +1 -0
- package/dist/src/data/keyIndex.js +241 -0
- package/dist/src/data/keyIndex.test.d.ts +2 -0
- package/dist/src/data/keyIndex.test.d.ts.map +1 -0
- package/dist/src/data/sources/dataSource.d.ts.map +1 -1
- package/dist/src/data/sources/dataSource.js +7 -3
- package/dist/src/data/sources/dataSourceFactory.d.ts +14 -12
- package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
- package/dist/src/data/sources/dataSourceFactory.js +52 -16
- package/dist/src/data/sources/lazy/bigBedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigBedSource.js +11 -10
- package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +11 -10
- package/dist/src/data/sources/lazy/mockLazySource.d.ts +29 -0
- package/dist/src/data/sources/lazy/mockLazySource.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/mockLazySource.js +44 -0
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts +22 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.js +34 -2
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +16 -1
- package/dist/src/data/sources/lazy/tabixSource.d.ts +0 -1
- package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/tabixSource.js +56 -16
- package/dist/src/data/sources/sequenceSource.d.ts.map +1 -1
- package/dist/src/data/sources/sequenceSource.js +5 -3
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +7 -3
- package/dist/src/data/transforms/filter.d.ts +4 -4
- package/dist/src/data/transforms/filter.d.ts.map +1 -1
- package/dist/src/data/transforms/filter.js +13 -7
- package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
- package/dist/src/data/transforms/filterScoredLabels.js +11 -6
- package/dist/src/data/transforms/filterScoredLabels.test.d.ts +2 -0
- package/dist/src/data/transforms/filterScoredLabels.test.d.ts.map +1 -0
- package/dist/src/data/transforms/formula.d.ts +4 -4
- package/dist/src/data/transforms/formula.d.ts.map +1 -1
- package/dist/src/data/transforms/formula.js +12 -6
- package/dist/src/data/transforms/measureText.d.ts +2 -2
- package/dist/src/data/transforms/measureText.d.ts.map +1 -1
- package/dist/src/data/transforms/measureText.js +16 -12
- package/dist/src/data/transforms/stack.d.ts.map +1 -1
- package/dist/src/data/transforms/stack.js +1 -0
- package/dist/src/data/transforms/transform.d.ts +2 -2
- package/dist/src/data/transforms/transform.d.ts.map +1 -1
- package/dist/src/data/transforms/transform.js +3 -3
- package/dist/src/encoder/accessor.d.ts +51 -4
- package/dist/src/encoder/accessor.d.ts.map +1 -1
- package/dist/src/encoder/accessor.js +174 -10
- package/dist/src/encoder/encoder.d.ts +11 -2
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +29 -9
- package/dist/src/encoder/metadataChannels.d.ts +15 -0
- package/dist/src/encoder/metadataChannels.d.ts.map +1 -0
- package/dist/src/encoder/metadataChannels.js +65 -0
- package/dist/src/encoder/metadataChannels.test.d.ts +2 -0
- package/dist/src/encoder/metadataChannels.test.d.ts.map +1 -0
- package/dist/src/genome/genome.d.ts +8 -0
- package/dist/src/genome/genome.d.ts.map +1 -1
- package/dist/src/genome/genome.js +16 -1
- package/dist/src/genome/scaleLocus.d.ts.map +1 -1
- package/dist/src/genome/scaleLocus.js +14 -1
- package/dist/src/genomeSpy/containerUi.d.ts +0 -1
- package/dist/src/genomeSpy/containerUi.d.ts.map +1 -1
- package/dist/src/genomeSpy/containerUi.js +0 -14
- package/dist/src/genomeSpy/inputBindingManager.js +1 -1
- package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
- package/dist/src/genomeSpy/interactionController.js +7 -1
- package/dist/src/genomeSpy/loadingIndicatorManager.d.ts +3 -7
- package/dist/src/genomeSpy/loadingIndicatorManager.d.ts.map +1 -1
- package/dist/src/genomeSpy/loadingIndicatorManager.js +68 -20
- package/dist/src/genomeSpy/loadingStatusRegistry.d.ts +52 -0
- package/dist/src/genomeSpy/loadingStatusRegistry.d.ts.map +1 -0
- package/dist/src/genomeSpy/loadingStatusRegistry.js +86 -0
- package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewContextFactory.js +0 -1
- package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewDataInit.js +56 -11
- package/dist/src/genomeSpy.d.ts +0 -2
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +47 -27
- package/dist/src/gl/glslScaleGenerator.js +1 -1
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +40 -41
- package/dist/src/marks/markUtils.js +1 -1
- package/dist/src/marks/point.d.ts.map +1 -1
- package/dist/src/marks/point.js +4 -6
- package/dist/src/paramRuntime/expressionCompiler.d.ts +7 -0
- package/dist/src/paramRuntime/expressionCompiler.d.ts.map +1 -0
- package/dist/src/paramRuntime/expressionCompiler.js +10 -0
- package/dist/src/paramRuntime/expressionRef.d.ts +20 -0
- package/dist/src/paramRuntime/expressionRef.d.ts.map +1 -0
- package/dist/src/paramRuntime/expressionRef.js +95 -0
- package/dist/src/paramRuntime/expressionRef.test.d.ts +2 -0
- package/dist/src/paramRuntime/expressionRef.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/graphRuntime.d.ts +176 -0
- package/dist/src/paramRuntime/graphRuntime.d.ts.map +1 -0
- package/dist/src/paramRuntime/graphRuntime.js +628 -0
- package/dist/src/paramRuntime/graphRuntime.test.d.ts +2 -0
- package/dist/src/paramRuntime/graphRuntime.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/index.d.ts +9 -0
- package/dist/src/paramRuntime/index.d.ts.map +1 -0
- package/dist/src/paramRuntime/index.js +8 -0
- package/dist/src/paramRuntime/lifecycleRegistry.d.ts +27 -0
- package/dist/src/paramRuntime/lifecycleRegistry.d.ts.map +1 -0
- package/dist/src/paramRuntime/lifecycleRegistry.js +54 -0
- package/dist/src/paramRuntime/paramRuntime.d.ts +165 -0
- package/dist/src/paramRuntime/paramRuntime.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramRuntime.js +222 -0
- package/dist/src/paramRuntime/paramRuntime.test.d.ts +2 -0
- package/dist/src/paramRuntime/paramRuntime.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramStore.d.ts +68 -0
- package/dist/src/paramRuntime/paramStore.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramStore.js +148 -0
- package/dist/src/paramRuntime/paramStore.test.d.ts +2 -0
- package/dist/src/paramRuntime/paramStore.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramUtils.d.ts +86 -0
- package/dist/src/paramRuntime/paramUtils.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramUtils.js +272 -0
- package/dist/src/paramRuntime/selectionStore.d.ts +6 -0
- package/dist/src/paramRuntime/selectionStore.d.ts.map +1 -0
- package/dist/src/paramRuntime/selectionStore.js +13 -0
- package/dist/src/paramRuntime/types.d.ts +16 -0
- package/dist/src/paramRuntime/types.d.ts.map +1 -0
- package/dist/src/paramRuntime/types.js +25 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts +164 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -0
- package/dist/src/paramRuntime/viewParamRuntime.js +443 -0
- package/dist/src/scale/scale.d.ts +6 -1
- package/dist/src/scale/scale.d.ts.map +1 -1
- package/dist/src/scale/scale.js +83 -23
- package/dist/src/scales/axisResolution.d.ts.map +1 -1
- package/dist/src/scales/axisResolution.js +10 -0
- package/dist/src/scales/{scaleDomainAggregator.d.ts → domainPlanner.d.ts} +6 -3
- package/dist/src/scales/domainPlanner.d.ts.map +1 -0
- package/dist/src/scales/{scaleDomainAggregator.js → domainPlanner.js} +128 -10
- package/dist/src/scales/domainPlanner.test.d.ts +2 -0
- package/dist/src/scales/domainPlanner.test.d.ts.map +1 -0
- package/dist/src/scales/scaleInstanceManager.d.ts +6 -3
- package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
- package/dist/src/scales/scaleInstanceManager.js +17 -11
- package/dist/src/scales/scaleInteractionController.d.ts +6 -0
- package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
- package/dist/src/scales/scaleInteractionController.js +41 -3
- package/dist/src/scales/scaleResolution.d.ts +20 -17
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +188 -71
- package/dist/src/scales/scaleResolution.test.d.ts.map +1 -1
- package/dist/src/selection/selection.d.ts +21 -0
- package/dist/src/selection/selection.d.ts.map +1 -1
- package/dist/src/selection/selection.js +83 -1
- package/dist/src/spec/channel.d.ts +52 -15
- package/dist/src/spec/coreSchemaRoot.d.ts +53 -0
- package/dist/src/spec/data.d.ts +4 -0
- package/dist/src/spec/parameter.d.ts +16 -11
- package/dist/src/spec/root.d.ts +1 -1
- package/dist/src/spec/testing.d.ts +12 -0
- package/dist/src/spec/testing.d.ts.map +1 -0
- package/dist/src/spec/testing.js +20 -0
- package/dist/src/spec/view.d.ts +157 -41
- package/dist/src/styles/genome-spy.css +3 -31
- package/dist/src/styles/genome-spy.css.d.ts +1 -1
- package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
- package/dist/src/styles/genome-spy.css.js +0 -29
- package/dist/src/tooltip/dataTooltipHandler.d.ts +1 -1
- package/dist/src/tooltip/dataTooltipHandler.js +23 -32
- package/dist/src/tooltip/dataTooltipHandler.test.d.ts +2 -0
- package/dist/src/tooltip/dataTooltipHandler.test.d.ts.map +1 -0
- package/dist/src/tooltip/flattenDatumRows.d.ts +13 -0
- package/dist/src/tooltip/flattenDatumRows.d.ts.map +1 -0
- package/dist/src/tooltip/flattenDatumRows.js +47 -0
- package/dist/src/tooltip/flattenDatumRows.test.d.ts +2 -0
- package/dist/src/tooltip/flattenDatumRows.test.d.ts.map +1 -0
- package/dist/src/tooltip/refseqGeneTooltipHandler.d.ts +1 -1
- package/dist/src/tooltip/refseqGeneTooltipHandler.js +7 -1
- package/dist/src/tooltip/tooltipContext.d.ts +13 -0
- package/dist/src/tooltip/tooltipContext.d.ts.map +1 -0
- package/dist/src/tooltip/tooltipContext.js +543 -0
- package/dist/src/tooltip/tooltipContext.test.d.ts +2 -0
- package/dist/src/tooltip/tooltipContext.test.d.ts.map +1 -0
- package/dist/src/tooltip/tooltipHandler.d.ts +40 -1
- package/dist/src/tooltip/tooltipHandler.d.ts.map +1 -1
- package/dist/src/tooltip/tooltipHandler.ts +62 -1
- package/dist/src/types/encoder.d.ts +38 -3
- package/dist/src/types/rendering.d.ts +4 -3
- package/dist/src/types/viewContext.d.ts +0 -14
- package/dist/src/utils/inputBinding.d.ts +10 -2
- package/dist/src/utils/inputBinding.d.ts.map +1 -1
- package/dist/src/utils/inputBinding.js +12 -3
- package/dist/src/utils/throttle.d.ts +4 -1
- package/dist/src/utils/throttle.d.ts.map +1 -1
- package/dist/src/utils/throttle.js +54 -23
- package/dist/src/utils/throttle.test.d.ts +2 -0
- package/dist/src/utils/throttle.test.d.ts.map +1 -0
- package/dist/src/utils/transition.d.ts +21 -0
- package/dist/src/utils/transition.d.ts.map +1 -1
- package/dist/src/utils/transition.js +28 -0
- package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
- package/dist/src/utils/ui/tooltip.js +7 -1
- package/dist/src/utils/ui/tooltip.test.d.ts +2 -0
- package/dist/src/utils/ui/tooltip.test.d.ts.map +1 -0
- package/dist/src/view/axisGridView.d.ts.map +1 -1
- package/dist/src/view/axisGridView.js +22 -5
- package/dist/src/view/axisView.d.ts.map +1 -1
- package/dist/src/view/axisView.js +20 -5
- package/dist/src/view/concatView.js +3 -3
- package/dist/src/view/containerMutationHelper.js +1 -1
- package/dist/src/view/containerView.d.ts +9 -5
- package/dist/src/view/containerView.d.ts.map +1 -1
- package/dist/src/view/containerView.js +34 -9
- package/dist/src/view/dataReadiness.d.ts +46 -0
- package/dist/src/view/dataReadiness.d.ts.map +1 -0
- package/dist/src/view/dataReadiness.js +267 -0
- package/dist/src/view/dataReadiness.test.d.ts +2 -0
- package/dist/src/view/dataReadiness.test.d.ts.map +1 -0
- package/dist/src/view/facetView.d.ts.map +1 -1
- package/dist/src/view/facetView.js +7 -5
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +17 -4
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +16 -3
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +119 -2
- package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
- package/dist/src/view/gridView/scrollbar.js +3 -0
- package/dist/src/view/gridView/selectionRect.d.ts +6 -10
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +22 -24
- package/dist/src/view/gridView/separatorView.d.ts +51 -0
- package/dist/src/view/gridView/separatorView.d.ts.map +1 -0
- package/dist/src/view/gridView/separatorView.js +275 -0
- package/dist/src/view/layerView.d.ts.map +1 -1
- package/dist/src/view/layerView.js +7 -5
- package/dist/src/view/layout/flexLayout.d.ts +0 -30
- package/dist/src/view/layout/flexLayout.d.ts.map +1 -1
- package/dist/src/view/layout/flexLayout.js +0 -86
- package/dist/src/view/multiscale.d.ts +35 -0
- package/dist/src/view/multiscale.d.ts.map +1 -0
- package/dist/src/view/multiscale.js +233 -0
- package/dist/src/view/multiscale.test.d.ts +2 -0
- package/dist/src/view/multiscale.test.d.ts.map +1 -0
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +6 -1
- package/dist/src/view/unitView.d.ts +8 -13
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +120 -45
- package/dist/src/view/view.d.ts +27 -18
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +298 -37
- package/dist/src/view/viewFactory.d.ts +0 -12
- package/dist/src/view/viewFactory.d.ts.map +1 -1
- package/dist/src/view/viewFactory.js +55 -25
- package/dist/src/view/viewParamRuntime.test.d.ts +2 -0
- package/dist/src/view/viewParamRuntime.test.d.ts.map +1 -0
- package/dist/src/view/viewSelectors.d.ts +148 -0
- package/dist/src/view/viewSelectors.d.ts.map +1 -0
- package/dist/src/view/viewSelectors.js +776 -0
- package/dist/src/view/viewSelectors.test.d.ts +2 -0
- package/dist/src/view/viewSelectors.test.d.ts.map +1 -0
- package/dist/src/view/viewUtils.d.ts +0 -8
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +1 -21
- package/package.json +4 -4
- package/dist/src/scales/scaleDomainAggregator.d.ts.map +0 -1
- package/dist/src/scales/scaleDomainAggregator.test.d.ts +0 -2
- package/dist/src/scales/scaleDomainAggregator.test.d.ts.map +0 -1
- package/dist/src/spec/sampleView.d.ts +0 -197
- package/dist/src/view/paramMediator.d.ts +0 -149
- package/dist/src/view/paramMediator.d.ts.map +0 -1
- package/dist/src/view/paramMediator.js +0 -478
- package/dist/src/view/paramMediator.test.d.ts +0 -2
- package/dist/src/view/paramMediator.test.d.ts.map +0 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Low-level reactive DAG runtime for parameter propagation.
|
|
3
|
+
*
|
|
4
|
+
* `GraphRuntime` is the scheduling engine behind `ParamRuntime`. It owns:
|
|
5
|
+
* 1. Writable source nodes (`base` and `selection`).
|
|
6
|
+
* 2. Derived/computed nodes with explicit dependencies.
|
|
7
|
+
* 3. Side-effect nodes that run after computed stabilization.
|
|
8
|
+
* 4. Transaction-aware batching and deterministic topological flushing.
|
|
9
|
+
*
|
|
10
|
+
* Typical usage:
|
|
11
|
+
* 1. Create writable refs using `createWritable(...)`.
|
|
12
|
+
* 2. Build derived refs with `computed(...)` from existing refs.
|
|
13
|
+
* 3. Attach side effects with `effect(...)` when external work is needed.
|
|
14
|
+
* 4. Batch writes with `runInTransaction(...)` when multiple updates belong to
|
|
15
|
+
* one logical state transition.
|
|
16
|
+
* 5. Await `whenPropagated(...)` when callers need a "graph is settled" barrier.
|
|
17
|
+
*
|
|
18
|
+
* Notes:
|
|
19
|
+
* 1. This class is intended for runtime internals; most call sites should use
|
|
20
|
+
* `ParamRuntime` / `ViewParamRuntime`.
|
|
21
|
+
* 2. Equality is referential (`!==`), so object writes must use new identities
|
|
22
|
+
* to trigger propagation.
|
|
23
|
+
*/
|
|
24
|
+
export default class GraphRuntime {
|
|
25
|
+
/**
|
|
26
|
+
* Creates a graph runtime.
|
|
27
|
+
*
|
|
28
|
+
* @param {object} [options]
|
|
29
|
+
* @param {import("./lifecycleRegistry.js").default} [options.lifecycleRegistry]
|
|
30
|
+
* Optional lifecycle owner registry. When provided, all created nodes
|
|
31
|
+
* are bound to owners and disposed automatically on owner disposal.
|
|
32
|
+
*/
|
|
33
|
+
constructor(options?: {
|
|
34
|
+
lifecycleRegistry?: import("./lifecycleRegistry.js").default;
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Registers a writable source node and returns a writable param ref.
|
|
38
|
+
*
|
|
39
|
+
* Write semantics:
|
|
40
|
+
* 1. A write triggers propagation only when `value !== currentValue`.
|
|
41
|
+
* 2. If `options.notify` is `false`, local listeners are not notified and
|
|
42
|
+
* downstream scheduling is skipped for writes to this ref.
|
|
43
|
+
* 3. Writing to a disposed ref throws.
|
|
44
|
+
*
|
|
45
|
+
* Lifecycle:
|
|
46
|
+
* 1. The node is owner-bound via `ownerId`.
|
|
47
|
+
* 2. Owner disposal marks the node disposed and clears listeners.
|
|
48
|
+
*
|
|
49
|
+
* @template T
|
|
50
|
+
* @param {string} ownerId
|
|
51
|
+
* @param {string} name
|
|
52
|
+
* @param {"base" | "selection"} kind
|
|
53
|
+
* @param {T} initialValue
|
|
54
|
+
* @param {{ notify?: boolean }} [options]
|
|
55
|
+
* @returns {import("./types.js").WritableParamRef<T>}
|
|
56
|
+
*/
|
|
57
|
+
createWritable<T>(ownerId: string, name: string, kind: "base" | "selection", initialValue: T, options?: {
|
|
58
|
+
notify?: boolean;
|
|
59
|
+
}): import("./types.js").WritableParamRef<T>;
|
|
60
|
+
/**
|
|
61
|
+
* Registers a derived node whose value is computed from dependencies.
|
|
62
|
+
*
|
|
63
|
+
* Compute semantics:
|
|
64
|
+
* 1. Initial value is computed eagerly at registration time.
|
|
65
|
+
* 2. On dependency changes, recomputation is queued (deduplicated per flush).
|
|
66
|
+
* 3. Downstream listeners are notified only if computed value identity changes.
|
|
67
|
+
*
|
|
68
|
+
* Lifecycle:
|
|
69
|
+
* 1. Dependency subscriptions are created immediately.
|
|
70
|
+
* 2. Owner disposal unsubscribes dependencies and detaches the node.
|
|
71
|
+
*
|
|
72
|
+
* @template T
|
|
73
|
+
* @param {string} ownerId
|
|
74
|
+
* @param {string} name
|
|
75
|
+
* @param {import("./types.js").ParamRef<any>[]} deps
|
|
76
|
+
* @param {() => T} fn
|
|
77
|
+
* @returns {import("./types.js").ParamRef<T>}
|
|
78
|
+
*/
|
|
79
|
+
computed<T>(ownerId: string, name: string, deps: import("./types.js").ParamRef<any>[], fn: () => T): import("./types.js").ParamRef<T>;
|
|
80
|
+
/**
|
|
81
|
+
* Registers an effect node that runs after computed propagation.
|
|
82
|
+
*
|
|
83
|
+
* Effect semantics:
|
|
84
|
+
* 1. Effect callbacks are queued on dependency changes.
|
|
85
|
+
* 2. Effects run after computed nodes for the same flush epoch.
|
|
86
|
+
* 3. Multiple dependency changes before a flush coalesce to one queued run.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} ownerId
|
|
89
|
+
* @param {import("./types.js").ParamRef<any>[]} deps
|
|
90
|
+
* @param {() => void} fn
|
|
91
|
+
* @returns {() => void} explicit disposer for manual teardown
|
|
92
|
+
*/
|
|
93
|
+
effect(ownerId: string, deps: import("./types.js").ParamRef<any>[], fn: () => void): () => void;
|
|
94
|
+
/**
|
|
95
|
+
* Runs `fn` as an atomic update transaction for this runtime graph.
|
|
96
|
+
*
|
|
97
|
+
* Transaction intent:
|
|
98
|
+
* 1. Batch multiple source writes so downstream computeds/effects observe
|
|
99
|
+
* the final state for the batch, not each intermediate write.
|
|
100
|
+
* 2. Defer scheduling/flush until the outermost transaction exits.
|
|
101
|
+
* 3. Preserve deterministic propagation order by running one flush pass
|
|
102
|
+
* after the transaction boundary.
|
|
103
|
+
*
|
|
104
|
+
* Semantics:
|
|
105
|
+
* 1. Nested transactions are supported via depth counting.
|
|
106
|
+
* 2. Only the outermost transaction exit triggers scheduling.
|
|
107
|
+
* 3. If `fn` throws, the error is rethrown after transaction depth is
|
|
108
|
+
* restored; pending propagation is still scheduled from `finally`.
|
|
109
|
+
* 4. The scheduled flush runs in a microtask (`queueMicrotask`) after the
|
|
110
|
+
* outermost transaction exits.
|
|
111
|
+
* 5. This method does not force immediate synchronous propagation. Use
|
|
112
|
+
* `flushNow()` when the caller explicitly requires immediate flushing.
|
|
113
|
+
*
|
|
114
|
+
* @template T
|
|
115
|
+
* @param {() => T} fn
|
|
116
|
+
* @returns {T}
|
|
117
|
+
*/
|
|
118
|
+
runInTransaction<T>(fn: () => T): T;
|
|
119
|
+
/**
|
|
120
|
+
* Flushes currently queued computed/effect work immediately.
|
|
121
|
+
*
|
|
122
|
+
* Behavior:
|
|
123
|
+
* 1. No-op if called while a transaction is open.
|
|
124
|
+
* 2. No-op during re-entrant flush calls.
|
|
125
|
+
* 3. Runs computeds first, then effects, until the graph reaches a fixed
|
|
126
|
+
* point for the current queued work.
|
|
127
|
+
*/
|
|
128
|
+
flushNow(): void;
|
|
129
|
+
/**
|
|
130
|
+
* Returns a promise that resolves when currently pending graph propagation
|
|
131
|
+
* has completed (computed queue and effect queue are settled).
|
|
132
|
+
*
|
|
133
|
+
* This is a synchronization barrier for reactive propagation only. It does
|
|
134
|
+
* not include animation/time-based convergence semantics.
|
|
135
|
+
*
|
|
136
|
+
* @param {{ signal?: AbortSignal, timeoutMs?: number }} [options]
|
|
137
|
+
* Optional cancellation/timeout controls for waiting callers.
|
|
138
|
+
* @returns {Promise<void>}
|
|
139
|
+
*/
|
|
140
|
+
whenPropagated(options?: {
|
|
141
|
+
signal?: AbortSignal;
|
|
142
|
+
timeoutMs?: number;
|
|
143
|
+
}): Promise<void>;
|
|
144
|
+
#private;
|
|
145
|
+
}
|
|
146
|
+
export type SubscribeFn = (listener: () => void) => () => void;
|
|
147
|
+
export type RuntimeNodeBase = {
|
|
148
|
+
id: string;
|
|
149
|
+
rank: number;
|
|
150
|
+
disposed: boolean;
|
|
151
|
+
listeners: Set<() => void>;
|
|
152
|
+
subscribe: SubscribeFn;
|
|
153
|
+
};
|
|
154
|
+
export type WritableNode<T> = RuntimeNodeBase & {
|
|
155
|
+
value: T;
|
|
156
|
+
kind: "base" | "selection";
|
|
157
|
+
name: string;
|
|
158
|
+
};
|
|
159
|
+
export type ComputedNode<T> = RuntimeNodeBase & {
|
|
160
|
+
value: T;
|
|
161
|
+
kind: "derived";
|
|
162
|
+
name: string;
|
|
163
|
+
fn: () => T;
|
|
164
|
+
};
|
|
165
|
+
export type EffectNode = {
|
|
166
|
+
id: string;
|
|
167
|
+
rank: number;
|
|
168
|
+
disposed: boolean;
|
|
169
|
+
fn: () => void;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* @param {import("./types.js").ParamRef<any>} ref
|
|
173
|
+
* @returns {RuntimeNodeBase}
|
|
174
|
+
*/
|
|
175
|
+
export function getNode(ref: import("./types.js").ParamRef<any>): RuntimeNodeBase;
|
|
176
|
+
//# sourceMappingURL=graphRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphRuntime.d.ts","sourceRoot":"","sources":["../../../src/paramRuntime/graphRuntime.js"],"names":[],"mappings":"AAoIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IA6BI;;;;;;;OAOG;IACH,sBAJG;QAA2D,iBAAiB,GAApE,OAAO,wBAAwB,EAAE,OAAO;KAGlD,EAGA;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,eARa,CAAC,WACH,MAAM,QACN,MAAM,QACN,MAAM,GAAG,WAAW,gBACpB,CAAC,YACD;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAClB,OAAO,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAwDpD;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,SAPa,CAAC,WACH,MAAM,QACN,MAAM,QACN,OAAO,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MACpC,MAAM,CAAC,GACL,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAuD5C;IAED;;;;;;;;;;;;OAYG;IACH,gBALW,MAAM,QACN,OAAO,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MACpC,MAAM,IAAI,GACR,MAAM,IAAI,CAwCtB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,iBAJa,CAAC,MACH,MAAM,CAAC,GACL,CAAC,CAYb;IAED;;;;;;;;OAQG;IACH,iBA8CC;IAED;;;;;;;;;;OAUG;IACH,yBAJW;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAE1C,OAAO,CAAC,IAAI,CAAC,CAgDzB;;CA2EJ;0BA3mBY,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI;8BAEpC;IACR,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAC3B,SAAS,EAAE,WAAW,CAAA;CACvB;yBAIS,CAAC,IACD,eAAe,GAAG;IAC1B,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb;yBAIS,CAAC,IACD,eAAe,GAAG;IAC1B,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC,CAAA;CACZ;yBAIS;IACR,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,EAAE,EAAE,MAAM,IAAI,CAAA;CACf;AAgEJ;;;GAGG;AACH,6BAHW,OAAO,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAChC,eAAe,CAa3B"}
|