mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
chore: Separate types
This commit is contained in:
@@ -12,60 +12,10 @@ import {
|
|||||||
setDiagramTitle,
|
setDiagramTitle,
|
||||||
getDiagramTitle,
|
getDiagramTitle,
|
||||||
} from '../common/commonDb.js';
|
} from '../common/commonDb.js';
|
||||||
|
import type { FlowVertex, FlowClass, FlowSubGraph, FlowText, FlowEdge, FlowLink } from './types.js';
|
||||||
|
|
||||||
const MAX_EDGE_COUNT = 280;
|
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-';
|
const MERMAID_DOM_ID_PREFIX = 'flowchart-';
|
||||||
let vertexCounter = 0;
|
let vertexCounter = 0;
|
||||||
let config = getConfig();
|
let config = getConfig();
|
||||||
|
50
packages/mermaid/src/diagrams/flowchart/types.ts
Normal file
50
packages/mermaid/src/diagrams/flowchart/types.ts
Normal file
@@ -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;
|
||||||
|
}
|
Reference in New Issue
Block a user