fix: apply new types to the Mermaid API

This commit is contained in:
Basti Ortiz 2022-10-12 01:07:17 +08:00
parent 17ff584d15
commit 4b31112bcb
No known key found for this signature in database
GPG Key ID: 1402D5CB17F48E1B

View File

@ -8,6 +8,7 @@ import utils from './utils';
import { mermaidAPI } from './mermaidAPI'; import { mermaidAPI } from './mermaidAPI';
import { addDetector } from './diagram-api/detectType'; import { addDetector } from './diagram-api/detectType';
import { isDetailedError } from './utils'; import { isDetailedError } from './utils';
import { ParseErrorFunction } from './Diagram';
/** /**
* ## init * ## init
@ -62,7 +63,7 @@ const init = async function (
log.warn(e.str); log.warn(e.str);
} }
if (mermaid.parseError) { if (mermaid.parseError) {
mermaid.parseError(e); mermaid.parseError(e as string);
} }
} }
}; };
@ -212,8 +213,7 @@ const parse = (txt: string) => {
const mermaid: { const mermaid: {
startOnLoad: boolean; startOnLoad: boolean;
diagrams: any; diagrams: any;
// eslint-disable-next-line @typescript-eslint/ban-types parseError?: ParseErrorFunction;
parseError?: Function;
mermaidAPI: typeof mermaidAPI; mermaidAPI: typeof mermaidAPI;
parse: typeof parse; parse: typeof parse;
render: typeof mermaidAPI.render; render: typeof mermaidAPI.render;