import type { MathRender } from './types.js'; export declare function isMathReady(): boolean; export declare function onMathReady(fn: () => void): () => void; /** * Load MathJax and start the TeX → SVG converter. Await it before laying * out a document with `$…$` / `$$…$$` on the main thread (the layout worker * calls it itself): until it resolves, every formula is set as a grey * placeholder box. Idempotent; a failed start can be retried. */ export declare function initMathEngine(): Promise; /** * Called when the layout sets a formula with no engine running, so it gets a * grey placeholder box. Warns once, and only when nobody asked for the * engine: a host that lays out now and again from `onMathReady` has * `initMathEngine` in flight and expects the placeholders. */ export declare function noteMathWithoutEngine(): void; export interface RenderOptions { /** Body line-box in px. Inline math is scaled down to fit. Display math * is not clamped. */ lineBoxPx?: number; /** Override the default colour (MathJax emits "currentColor" which is a * CSS construct; we substitute here so the SVG is self-contained). */ color?: string; /** Display math: the width of the measure the formula is set in, in px. * A numbered equation (`\tag{…}`) takes this width, the equation * centred and its number flush right; without it, it takes the least * width that holds both. Other formulas keep their own width. */ containerWidthPx?: number; } /** * Typeset TeX as SVG at `fontSizePx`: one em of the formula is * `fontSizePx` (MathJax sizes in `ex`, the TeX font's x-height, 0.442 em). * Cached; before {@link initMathEngine} resolves it returns a placeholder * box instead (not cached). */ export declare function renderMath(tex: string, displayMode: boolean, fontSizePx: number, options?: RenderOptions): MathRender; export declare function placeholderRender(tex: string, displayMode: boolean, fontSizePx: number): MathRender; export declare function clearMathCache(): void; //# sourceMappingURL=engine.d.ts.map