mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-12-06 12:34:20 +01:00
Mostly, fixing these eslint-plugin-tsdoc style issues involved: - Moving types from JSDoc to TypeScript types - Making sure that all `@param paramName - description` had both a `-` and a description. Occasionally, for some functions, if the JSDoc was completely empty, I just deleted it, since there was no point in keeping it.
19 lines
550 B
TypeScript
19 lines
550 B
TypeScript
// @ts-ignore: TODO Fix ts errors
|
|
export const id = 'example-diagram';
|
|
|
|
/**
|
|
* Detector function that will be called by mermaid to determine if the diagram is this type of diagram.
|
|
*
|
|
* @param txt - The diagram text will be passed to the detector
|
|
* @returns True if the diagram text matches a diagram of this type
|
|
*/
|
|
|
|
export const detector = (txt: string) => {
|
|
return txt.match(/^\s*example-diagram/) !== null;
|
|
};
|
|
|
|
export const loadDiagram = async () => {
|
|
const { diagram } = await import('./diagram-definition');
|
|
return { id, diagram };
|
|
};
|