export interface MathSpan { tex: string; display: boolean; } export interface ExtractedMath { text: string; spans: MathSpan[]; /** Nonce the placeholders in ``text`` were built with. */ token: string; } /** Whether the text is worth scanning at all. Answers with no math at all are * the common case and skipping them keeps streaming flushes cheap. */ export declare function hasMathDelimiters(text: string): boolean; /** * Replace every complete math span in ``source`` with a placeholder token, * returning the rewritten Markdown plus the spans in placeholder order. * * Only closed spans are extracted. A `$$` still waiting for its closing * delimiter mid-stream stays literal text and becomes math on a later flush, * once the rest of it has arrived. */ export declare function extractMath(source: string): ExtractedMath; /** * Put the extracted spans back into sanitized HTML as elements. * Runs after DOMPurify because custom elements do not survive sanitizing, and * the TeX itself is carried in an attribute the component only ever reads as * text — it is never parsed as HTML. */ export declare function restoreMath(html: string, math: ExtractedMath, mathjaxUrl?: string): string;