@mermaid-editor-sdk/headless / EditorSelection
Type Alias: EditorSelection
EditorSelection = {
diagramType:DiagramType;id:string;kind:"node"; } | {diagramType:DiagramType;kind:"edge";occurrence?:number;source:string;target:string; } | {diagramType:"flowchart";id:string;kind:"subgraph";title?:string; }
Defined in: core/diagram-model.ts:7
Selection reported by an interactive diagram canvas.
Union Members
Type Literal
{ diagramType: DiagramType; id: string; kind: "node"; }
diagramType
diagramType:
DiagramType
Diagram containing the node.
id
id:
string
Selected node identifier.
kind
kind:
"node"
Selection discriminant for a node.
Type Literal
{ diagramType: DiagramType; kind: "edge"; occurrence?: number; source: string; target: string; }
diagramType
diagramType:
DiagramType
Diagram containing the edge.
kind
kind:
"edge"
Selection discriminant for an edge.
occurrence?
optionaloccurrence?:number
Zero-based occurrence among edges with the same endpoints.
source
source:
string
Source node identifier.
target
target:
string
Target node identifier.
Type Literal
{ diagramType: "flowchart"; id: string; kind: "subgraph"; title?: string; }
diagramType
diagramType:
"flowchart"
This selection variant is only used for flowcharts.
id
id:
string
Selected subgraph identifier.
kind
kind:
"subgraph"
Selection discriminant for a flowchart subgraph.
title?
optionaltitle?:string
Selected subgraph title, when available.