UNPKG

1.4 kBTypeScriptView Raw
1import { DiagramDefinition, DiagramDetector } from './types.js';
2import * as _commonDb from '../commonDb.js';
3export declare const log: Record<import("../logger.js").LogLevel, {
4 (...data: any[]): void;
5 (message?: any, ...optionalParams: any[]): void;
6}>;
7export declare const setLogLevel: (level?: string | number) => void;
8export declare const getConfig: () => import("../config.type.js").MermaidConfig;
9export declare const sanitizeText: (text: string) => string;
10export declare const setupGraphViewbox: (graph: any, svgElem: any, padding: any, useMaxWidth: any) => void;
11export declare const getCommonDb: () => typeof _commonDb;
12export declare const parseDirective: (p: any, statement: string, context: string, type: string) => void;
13export interface Detectors {
14 [key: string]: DiagramDetector;
15}
16/**
17 * Registers the given diagram with Mermaid.
18 *
19 * Can be used for third-party custom diagrams.
20 *
21 * @param id - A unique ID for the given diagram.
22 * @param diagram - The diagram definition.
23 * @param detector - Function that returns `true` if a given mermaid text is this diagram definition.
24 */
25export declare const registerDiagram: (id: string, diagram: DiagramDefinition, detector?: DiagramDetector) => void;
26export declare const getDiagram: (name: string) => DiagramDefinition;
27export declare class DiagramNotFoundError extends Error {
28 constructor(message: string);
29}