mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 14:59:53 +02:00
chore: Fix tsdoc
This commit is contained in:
@@ -217,7 +217,7 @@ const loadExternalDiagrams = async (diagrams: ExternalDiagramDefinition[]) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent to {@link init()}, except an error will be thrown on error.
|
* Equivalent to {@link init}, except an error will be thrown on error.
|
||||||
*
|
*
|
||||||
* @alpha
|
* @alpha
|
||||||
* @deprecated This is an internal function and will very likely be modified in v10, or earlier.
|
* @deprecated This is an internal function and will very likely be modified in v10, or earlier.
|
||||||
@@ -306,7 +306,9 @@ const initThrowsErrorsAsync = async function (
|
|||||||
if (typeof callback !== 'undefined') {
|
if (typeof callback !== 'undefined') {
|
||||||
callback(id);
|
callback(id);
|
||||||
}
|
}
|
||||||
if (bindFunctions) bindFunctions(element);
|
if (bindFunctions) {
|
||||||
|
bindFunctions(element);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
element
|
element
|
||||||
);
|
);
|
||||||
@@ -327,8 +329,7 @@ const initialize = function (config: MermaidConfig) {
|
|||||||
/**
|
/**
|
||||||
* Used to register external diagram types.
|
* Used to register external diagram types.
|
||||||
* @param diagrams - Array of {@link ExternalDiagramDefinition}.
|
* @param diagrams - Array of {@link ExternalDiagramDefinition}.
|
||||||
* @param opts
|
* @param opts - If opts.lazyLoad is true, the diagram will be loaded on demand.
|
||||||
* @param opts.lazyLoad - If true, the diagram will be loaded on demand.
|
|
||||||
*/
|
*/
|
||||||
const registerExternalDiagrams = async (
|
const registerExternalDiagrams = async (
|
||||||
diagrams: ExternalDiagramDefinition[],
|
diagrams: ExternalDiagramDefinition[],
|
||||||
@@ -379,7 +380,7 @@ if (typeof document !== 'undefined') {
|
|||||||
* This is provided for environments where the mermaid object can't directly have a new member added
|
* This is provided for environments where the mermaid object can't directly have a new member added
|
||||||
* to it (eg. dart interop wrapper). (Initially there is no parseError member of mermaid).
|
* to it (eg. dart interop wrapper). (Initially there is no parseError member of mermaid).
|
||||||
*
|
*
|
||||||
* @param newParseErrorHandler New parseError() callback.
|
* @param newParseErrorHandler - New parseError() callback.
|
||||||
*/
|
*/
|
||||||
const setParseErrorHandler = function (newParseErrorHandler: (err: any, hash: any) => void) {
|
const setParseErrorHandler = function (newParseErrorHandler: (err: any, hash: any) => void) {
|
||||||
mermaid.parseError = newParseErrorHandler;
|
mermaid.parseError = newParseErrorHandler;
|
||||||
@@ -410,7 +411,7 @@ const executeQueue = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param txt
|
* @param txt - The mermaid code to be parsed.
|
||||||
* @deprecated This is an internal function and should not be used. Will be removed in v10.
|
* @deprecated This is an internal function and should not be used. Will be removed in v10.
|
||||||
*/
|
*/
|
||||||
const parseAsync = (txt: string): Promise<boolean> => {
|
const parseAsync = (txt: string): Promise<boolean> => {
|
||||||
@@ -438,44 +439,7 @@ const parseAsync = (txt: string): Promise<boolean> => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// const asynco = (id: string, delay: number) =>
|
|
||||||
// new Promise((res) => {
|
|
||||||
// setTimeout(() => {
|
|
||||||
// // This resolves for the promise for the queue handling
|
|
||||||
// res(id);
|
|
||||||
// }, delay);
|
|
||||||
// });
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param txt
|
|
||||||
* @param id
|
|
||||||
* @param delay
|
|
||||||
* @deprecated This is an internal function and should not be used. Will be removed in v10.
|
|
||||||
*/
|
|
||||||
// const test1 = (id: string, delay: number) => {
|
|
||||||
// const p = new Promise((resolve, reject) => {
|
|
||||||
// // This promise will resolve when the mermaidAPI.render call is done.
|
|
||||||
// // It will be queued first and will be executed when it is first in line
|
|
||||||
// const performCall = () =>
|
|
||||||
// new Promise((res) => {
|
|
||||||
// asynco(id, delay).then((r) => {
|
|
||||||
// // This resolves for the promise for the queue handling
|
|
||||||
// res(r);
|
|
||||||
// // This fullfills the promise sent to the value back to the original caller
|
|
||||||
// resolve(r + ' result to caller');
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// executionQueue.push(performCall);
|
|
||||||
// });
|
|
||||||
// return p;
|
|
||||||
// };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param txt
|
|
||||||
* @param id
|
|
||||||
* @param text
|
|
||||||
* @param cb
|
|
||||||
* @param container
|
|
||||||
* @deprecated This is an internal function and should not be used. Will be removed in v10.
|
* @deprecated This is an internal function and should not be used. Will be removed in v10.
|
||||||
*/
|
*/
|
||||||
const renderAsync = (
|
const renderAsync = (
|
||||||
@@ -493,7 +457,7 @@ const renderAsync = (
|
|||||||
(r) => {
|
(r) => {
|
||||||
// This resolves for the promise for the queue handling
|
// This resolves for the promise for the queue handling
|
||||||
res(r);
|
res(r);
|
||||||
// This fullfills the promise sent to the value back to the original caller
|
// This fulfills the promise sent to the value back to the original caller
|
||||||
resolve(r);
|
resolve(r);
|
||||||
},
|
},
|
||||||
(e) => {
|
(e) => {
|
||||||
|
@@ -83,9 +83,8 @@ function parse(text: string, parseError?: ParseErrorFunction): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param text - The mermaid diagram definition.
|
||||||
* @param text
|
* @param parseError - If set, handles errors.
|
||||||
* @param parseError
|
|
||||||
*/
|
*/
|
||||||
async function parseAsync(text: string, parseError?: ParseErrorFunction): Promise<boolean> {
|
async function parseAsync(text: string, parseError?: ParseErrorFunction): Promise<boolean> {
|
||||||
addDiagrams();
|
addDiagrams();
|
||||||
|
Reference in New Issue
Block a user