From 13110c4ed9c431a7dadd82c6179796ee8071eba7 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Thu, 20 Oct 2022 10:53:08 +0100 Subject: [PATCH] docs(mermaid): document initThrowsErrorsAsync Add some basic tsdoc for initThrowsErrorsAsync. --- packages/mermaid/src/mermaid.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index c1b164b67..a49e4b700 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -217,9 +217,20 @@ const loadExternalDiagrams = async (conf: MermaidConfig) => { }; /** - * @deprecated This is an internal function and should not be used. Will be removed in v10. + * Equivalent to {@link init()}, except an error will be thrown on error. + * + * @alpha + * @deprecated This is an internal function and will very likely be modified in v10, or earlier. + * We recommend staying with {@link initThrowsErrors} if you don't need `lazyLoadedDiagrams`. + * + * @param config - **Deprecated** Mermaid sequenceConfig. + * @param nodes - One of: + * - A DOM Node + * - An array of DOM nodes (as would come from a jQuery selector) + * - A W3C selector, a la `.mermaid` (default) + * @param callback - Function that is called with the id of each generated mermaid diagram. + * @returns Resolves on success, otherwise the {@link Promise} will be rejected with an Error. */ - const initThrowsErrorsAsync = async function ( config?: MermaidConfig, // eslint-disable-next-line no-undef