Skip to content

Commit

Permalink
chore: Separate types
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Nov 27, 2023
1 parent b5e58f4 commit e7f7b6a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
52 changes: 1 addition & 51 deletions packages/mermaid/src/diagrams/flowchart/flowDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
50 changes: 50 additions & 0 deletions packages/mermaid/src/diagrams/flowchart/types.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit e7f7b6a

Please sign in to comment.