import type { BlockConfig, BlockFromConfigNoChildren, Exporter } from "@blocknote/core"; import { ReactEmailImageDelivery } from "@blocknote/xl-email-exporter"; import { RasterizeSVG } from "../exporterHelpers/renderMathToImage.js"; type MathBlock = BlockFromConfigNoChildren, any, any>; type InlineMath = { type: "math"; content: string; }; export { latexToMathSVG, rasterizeSVGInBrowser, } from "../exporterHelpers/renderMathToImage.js"; export type { RasterizeSVG, SVGExportImage, } from "../exporterHelpers/renderMathToImage.js"; type MathImageOptions = { /** * Rasterizes the formula SVG to a raster image. Defaults to the built-in * canvas rasterizer in the browser; elsewhere (e.g. server-side email * rendering), the formula is embedded as an SVG instead - pass a * rasterizer (e.g. backed by `@resvg/resvg-js` or `sharp`) to get PNGs * there, which more email clients display. */ rasterize?: RasterizeSVG; /** * How generated images get into the email: embedded as data URLs * (default), or e.g. as inline `cid:` attachments via * `createCIDImageDelivery` from `@blocknote/xl-email-exporter` - the most * widely supported option (Gmail and Outlook block data URLs). */ imageDelivery?: ReactEmailImageDelivery; }; /** * Creates an email block mapping for `@blocknote/math-block` that renders * math blocks as images, with the LaTeX source as the alt text. Invalid * LaTeX renders an error placeholder (mirroring the editor). See * {@link MathImageOptions} for how images are generated and delivered: * * ```ts * import { createMathBlockMapping } from "@blocknote/math-block/email-exporter"; * * new ReactEmailExporter(schema, { * ...reactEmailDefaultSchemaMappings, * blockMapping: { * ...reactEmailDefaultSchemaMappings.blockMapping, * mathBlock: createMathBlockMapping({ imageDelivery }), * }, * }); * ``` */ export declare function createMathBlockMapping(options?: MathImageOptions): (block: MathBlock, exporter: Exporter) => Promise; /** * Creates an email inline content mapping for `@blocknote/math-block` that * renders inline math as images flowing with the text, with the LaTeX * source as the alt text. Inline content renders synchronously, so the * formula is always embedded as an SVG (never rasterized) - email clients * that don't render SVG show the alt text. Invalid LaTeX renders an error * placeholder (mirroring the editor): * * ```ts * import { createInlineMathMapping } from "@blocknote/math-block/email-exporter"; * * new ReactEmailExporter(schema, { * ...reactEmailDefaultSchemaMappings, * inlineContentMapping: { * ...reactEmailDefaultSchemaMappings.inlineContentMapping, * math: createInlineMathMapping({ imageDelivery }), * }, * }); * ``` */ export declare function createInlineMathMapping(options?: Pick): (inlineContent: InlineMath, exporter: Exporter) => import("react/jsx-runtime").JSX.Element; /** * Email block mapping for `@blocknote/math-block` with the default options - * see {@link createMathBlockMapping}. */ export declare const mathBlockMapping: (block: MathBlock, exporter: Exporter) => Promise; /** * Email inline content mapping for `@blocknote/math-block` with the default * options - see {@link createInlineMathMapping}. */ export declare const inlineMathMapping: (inlineContent: InlineMath, exporter: Exporter) => import("react/jsx-runtime").JSX.Element;