1 | import { MermaidConfig } from '../config.type.js';
|
2 | export interface InjectUtils {
|
3 | _log: any;
|
4 | _setLogLevel: any;
|
5 | _getConfig: any;
|
6 | _sanitizeText: any;
|
7 | _setupGraphViewbox: any;
|
8 | _commonDb: any;
|
9 | _parseDirective: any;
|
10 | }
|
11 |
|
12 |
|
13 |
|
14 | export interface DiagramDb {
|
15 | clear?: () => void;
|
16 | setDiagramTitle?: (title: string) => void;
|
17 | setDisplayMode?: (title: string) => void;
|
18 | getAccTitle?: () => string;
|
19 | getAccDescription?: () => string;
|
20 | bindFunctions?: (element: Element) => void;
|
21 | }
|
22 | export interface DiagramDefinition {
|
23 | db: DiagramDb;
|
24 | renderer: any;
|
25 | parser: any;
|
26 | styles: any;
|
27 | init?: (config: MermaidConfig) => void;
|
28 | injectUtils?: (_log: InjectUtils['_log'], _setLogLevel: InjectUtils['_setLogLevel'], _getConfig: InjectUtils['_getConfig'], _sanitizeText: InjectUtils['_sanitizeText'], _setupGraphViewbox: InjectUtils['_setupGraphViewbox'], _commonDb: InjectUtils['_commonDb'], _parseDirective: InjectUtils['_parseDirective']) => void;
|
29 | }
|
30 | export interface DetectorRecord {
|
31 | detector: DiagramDetector;
|
32 | loader?: DiagramLoader;
|
33 | }
|
34 | export interface ExternalDiagramDefinition {
|
35 | id: string;
|
36 | detector: DiagramDetector;
|
37 | loader: DiagramLoader;
|
38 | }
|
39 | export type DiagramDetector = (text: string, config?: MermaidConfig) => boolean;
|
40 | export type DiagramLoader = () => Promise<{
|
41 | id: string;
|
42 | diagram: DiagramDefinition;
|
43 | }>;
|