Apply suggestions from code review

Co-authored-by: Alois Klink <alois@aloisklink.com>
This commit is contained in:
Sidharth Vinod 2022-11-09 09:54:06 +05:30 committed by GitHub
parent c7f7ff39ce
commit 89da6ea31a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,24 +27,9 @@ export interface Detectors {
*
* Can be used for third-party custom diagrams.
*
* For third-party diagrams that are rarely used, we recommend instead setting
* the `lazyLoadedDiagrams` param in the Mermaid config, as that will instead
* only load the diagram when needed.
*
* @param id - A unique ID for the given diagram.
* @param diagram - The diagram definition.
* @param detector - Function that returns `true` if a given mermaid text is this diagram definition.
*
* @example How to add `@mermaid-js/mermaid-mindmap` to mermaid
*
* ```js
* import {
* diagram as mindmap, detector as mindmapDetector, id as mindmapId
* } from "@mermaid-js/mermaid-mindmap";
* import mermaid from "mermaid";
*
* mermaid.mermaidAPI.registerDiagram(mindmapId, mindmap, mindmapDetector);
* ```
*/
export const registerDiagram = (
id: string,