chore: Separate types

This commit is contained in:
Sidharth Vinod
2023-11-27 14:44:03 +05:30
parent b5e58f4076
commit e7f7b6ad68
2 changed files with 51 additions and 51 deletions

View File

@@ -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();

View 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;
}