import { Token } from '@lumino/coreutils'; import type MermaidType from 'mermaid'; import type { MermaidConfig } from 'mermaid/dist/config.type'; export declare const MERMAID_MIME_TYPE = "text/vnd.mermaid"; export declare const MERMAID_FILE_EXTENSIONS: string[]; export declare const RE_DEFAULT_RENDERER: RegExp; export declare const MERMAID_DEFAULT_THEME: MermaidConfig['theme']; export declare const MERMAID_DARK_THEME: MermaidConfig['theme']; export declare const MERMAID_CLASS = "jp-RenderedMermaid"; export declare const MERMAID_CODE_CLASS = "mermaid"; export declare const WARNING_CLASS = "jp-mod-warning"; export declare const DETAILS_CLASS = "jp-RenderedMermaid-Details"; export declare const SUMMARY_CLASS = "jp-RenderedMermaid-Summary"; /** * The exported token for a mermaid manager */ export declare const IMermaidManager: Token; /** * A namespace for public mermaid interfaces. */ export interface IMermaidManager { /** * Get the (potentially uninitialized) mermaid module. */ getMermaid(): Promise; /** * Get the version of the currently-loaded mermaid module */ getMermaidVersion(): string | null; /** * Render mermaid source to an SVG string with extracted metadata. */ renderSvg(text: string): Promise; /** * Render and cache mermaid source as a figure of an image, or a unsuccessful parser message. */ renderFigure(text: string): Promise; /** * Get the pre-cached element for a mermaid string, if available. */ getCachedFigure(text: string): HTMLElement | null; } /** * A namespace for the mermaid manager. */ export declare namespace IMermaidManager { /** * The results of a successful rendering of a mermaid text-based diagram. */ interface IRenderInfo { /** the original source of the diagram. */ text: string; /** The raw rendered SVG. */ svg: string; /** The extracted accessible description, if found. */ accessibleDescription?: string | null; /** The extracted accessible title, if found. */ accessibleTitle?: string | null; /** The extracted width of the digaram, if found. */ width?: number | null; } } /** * The exported token for a mermaid manager */ export declare const IMermaidMarkdown: Token; /** * A handler for mermaid fenced code blocks in markdown * * This duplicates the (currently) private `IFencedBlockRenderer` in * `@jupyterlab/markedparser-extension`. */ export interface IMermaidMarkdown { /** * The languages this block accepts. */ languages: string[]; /** * The order in which the block would be processed */ rank: number; /** * Handle up-front loading/parsing mermaid */ walk: (text: string) => Promise; /** * Provide pre-rendered diagram content */ render: (text: string) => string | null; }