Skip to content

Commit 0152ed7

Browse files
create missing type
1 parent f233bfd commit 0152ed7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/mermaid/src/diagrams/flowchart/flowDb.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
getDiagramTitle,
1616
} from '../common/commonDb.js';
1717
import type { FlowVertex, FlowClass, FlowSubGraph, FlowText, FlowEdge, FlowLink } from './types.js';
18+
import type { NodeMetaData } from '$root/types.js';
1819

1920
const MERMAID_DOM_ID_PREFIX = 'flowchart-';
2021
let vertexCounter = 0;
@@ -135,7 +136,7 @@ export const addVertex = function (
135136
yamlData = yamlData.substring(0, lastPos) + '\n';
136137
}
137138
}
138-
const doc = yaml.load(yamlData, { schema: yaml.JSON_SCHEMA });
139+
const doc = yaml.load(yamlData, { schema: yaml.JSON_SCHEMA }) as NodeMetaData;
139140
// console.log('yamlData doc', doc);
140141
if (doc?.shape) {
141142
vertex.type = doc?.shape;

packages/mermaid/src/types.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
export interface NodeMetaData {
2+
shape?: string;
3+
label?: string;
4+
}
15
export interface Point {
26
x: number;
37
y: number;

0 commit comments

Comments
 (0)