Skip to content

ViewerUpdate

Defined in: src/types/index.ts:868

Diagram content a running interactive viewer can swap in, without rebuilding the surrounding document. Produced by generateViewerUpdate, and matches the shape ViewerHandle.setContent (in sfn-diagram/renderers) expects.

contentHtml: string;

Defined in: src/types/index.ts:870

Markup for the viewer’s data-sfn="content" node, from buildViewerContent.


edgeData: Record<string, ViewerEdge>;

Defined in: src/types/index.ts:873

Viewer-facing detail for each edge, keyed by edge id.


hasCollapsedView: boolean;

Defined in: src/types/index.ts:876

Whether contentHtml embeds a second, collapsed view behind a toggle.


metadata: object;

Defined in: src/types/index.ts:879

Metadata about the rendered diagram (the expanded view’s, when both are shipped).

edgeCount: number;

Number of edges (transitions) in the diagram

nodeCount: number;

Number of state nodes in the diagram


optional relayoutModel?: RelayoutModel;

Defined in: src/types/index.ts:886

The model for per-container collapse, present when rendered with relayout: true and the diagram has something to collapse. Pass it to ViewerHandle.setContent alongside contentHtml.


stateData: Record<string, AslState>;

Defined in: src/types/index.ts:889

Raw ASL for each state, keyed by state name.