diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index daa5a009f..6febfdb2b 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -30,7 +30,7 @@ export type { MermaidConfig, ParseErrorFunction, ParseOptions, - ParseResultWithConfigs as ParseResult, + ParseResult, RenderOptions, RenderResult, SVG, @@ -321,12 +321,6 @@ const executeQueue = async () => { executionQueueRunning = false; }; -interface ParseResultWithConfigs extends Omit { - /** Config the user has defined in the text as frontmatter or directives */ - userConfig: MermaidConfig; - defaultConfig: MermaidConfig; - config: MermaidConfig; -} /** * Parse the text and validate the syntax. * @param text - The mermaid diagram definition. @@ -349,20 +343,14 @@ interface ParseResultWithConfigs extends Omit { const parse = async ( text: string, parseOptions?: ParseOptions -): Promise => { +): Promise => { return new Promise((resolve, reject) => { // This promise will resolve when the render call is done. // It will be queued first and will be executed when it is first in line const performCall = () => new Promise((res, rej) => { mermaidAPI.parse(text, parseOptions).then( - (r) => { - const result = { - diagram: r.diagram, - userConfig: r.config, - defaultConfig: mermaidAPI.defaultConfig, - config: mermaidAPI.getConfig(), - } satisfies ParseResultWithConfigs; + (result) => { // This resolves for the promise for the queue handling res(result); // This fulfills the promise sent to the value back to the original caller