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