diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.ts b/packages/mermaid/src/diagrams/flowchart/flowDb.ts index 97bf350582..814a1d4313 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.ts +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.ts @@ -12,60 +12,10 @@ import { setDiagramTitle, getDiagramTitle, } from '../common/commonDb.js'; +import type { FlowVertex, FlowClass, FlowSubGraph, FlowText, FlowEdge, FlowLink } from './types.js'; const MAX_EDGE_COUNT = 280; -interface FlowVertex { - id: string; - labelType: 'text'; - dir?: string; - props?: any; - type?: string; - text?: string; - link?: string; - linkTarget?: string; - haveCallback?: boolean; - domId: string; - styles: any[]; - classes: any[]; -} - -interface FlowText { - text: string; - type: 'text'; -} - -interface FlowEdge { - start: string; - end: string; - type?: string; - stroke?: string; - length?: number; - text: string; - labelType: 'text'; -} - -interface FlowClass { - id: string; - styles: string[]; - textStyles: string[]; -} - -interface FlowSubGraph { - id: string; - nodes: string[]; - title: string; - classes: string[]; - dir?: string; - labelType: string; -} - -interface FlowLink { - type: string; - stroke: string; - length?: number; -} - const MERMAID_DOM_ID_PREFIX = 'flowchart-'; let vertexCounter = 0; let config = getConfig(); diff --git a/packages/mermaid/src/diagrams/flowchart/types.ts b/packages/mermaid/src/diagrams/flowchart/types.ts new file mode 100644 index 0000000000..4261f51b93 --- /dev/null +++ b/packages/mermaid/src/diagrams/flowchart/types.ts @@ -0,0 +1,50 @@ +export interface FlowVertex { + id: string; + labelType: 'text'; + dir?: string; + props?: any; + type?: string; + text?: string; + link?: string; + linkTarget?: string; + haveCallback?: boolean; + domId: string; + styles: any[]; + classes: any[]; +} + +export interface FlowText { + text: string; + type: 'text'; +} + +export interface FlowEdge { + start: string; + end: string; + type?: string; + stroke?: string; + length?: number; + text: string; + labelType: 'text'; +} + +export interface FlowClass { + id: string; + styles: string[]; + textStyles: string[]; +} + +export interface FlowSubGraph { + id: string; + nodes: string[]; + title: string; + classes: string[]; + dir?: string; + labelType: string; +} + +export interface FlowLink { + type: string; + stroke: string; + length?: number; +}