mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
25 lines
449 B
TypeScript
25 lines
449 B
TypeScript
import type {
|
|
DiagramDetector,
|
|
DiagramLoader,
|
|
ExternalDiagramDefinition,
|
|
} from '../../diagram-api/types.js';
|
|
|
|
const id = 'gantt';
|
|
|
|
const detector: DiagramDetector = (txt) => {
|
|
return /^\s*gantt/.test(txt);
|
|
};
|
|
|
|
const loader: DiagramLoader = async () => {
|
|
const { diagram } = await import('./ganttDiagram.js');
|
|
return { id, diagram };
|
|
};
|
|
|
|
const plugin: ExternalDiagramDefinition = {
|
|
id,
|
|
detector,
|
|
loader,
|
|
};
|
|
|
|
export default plugin;
|