import type MermaidType from 'mermaid'; import { LruCache } from '@jupyterlab/coreutils'; import type { IThemeManager } from '@jupyterlab/apputils'; import type { IMermaidManager } from './tokens'; /** * A mermaid diagram manager with cache. */ export declare class MermaidManager implements IMermaidManager { protected _diagrams: LruCache; protected _themes: IThemeManager | null; constructor(options?: MermaidManager.IOptions); /** * Post-process to ensure mermaid diagrams contain only valid SVG and XHTML. */ static cleanMermaidSvg(svg: string): string; /** * Handle (re)-initializing mermaid based on external values. */ initialize(): void; /** * Get the underlying, potentially un-initialized mermaid module. */ getMermaid(): Promise; /** * Get the version of the currently-loaded mermaid module */ getMermaidVersion(): string | null; /** * Get a pre-cached mermaid figure. * * This primarily exists for the needs of `marked`, which supports async node * visitors, but not async rendering. */ getCachedFigure(text: string): HTMLElement | null; /** * Attempt a raw rendering of mermaid to an SVG string, extracting some metadata. */ renderSvg(text: string): Promise; /** * Provide and cache a fully-rendered element, checking the cache first. */ renderFigure(text: string): Promise; /** * Provide a code block with the mermaid source. */ makeMermaidCode(text: string): HTMLElement; /** * Get the parser message element from a failed parse. * * This doesn't do much of anything if the text is successfully parsed. */ makeMermaidError(text: string): Promise; /** * Extract extra attributes to add to a generated figure. */ makeMermaidFigure(info: IMermaidManager.IRenderInfo): HTMLElement; } /** * A namespace for implementation-specific details of this mermaid manager. */ export declare namespace MermaidManager { /** * Initialization options for the mermaid manager. */ interface IOptions { maxCacheSize?: number | null; themes?: IThemeManager | null; } }