import { CustomElement, BoardElement, BoardScene } from './types.js'; /** * A host-supplied renderer for one custom-node `kind`, producing the SVG body * for that element in a static `.mboard.svg` export. The host owns the safety * of the returned markup (escape/sanitize any user-derived text). When no * renderer is registered for a kind, the core draws a neutral placeholder. */ type CustomRenderer = (el: CustomElement) => string; /** Map of custom-node `kind` → renderer, keyed by the host-namespaced string. */ type CustomRenderers = Record; /** Escape text content / attribute values for safe inclusion in SVG/XML. */ declare function escapeXml(s: string): string; /** perfect-freehand outline points → a closed SVG path `d`. */ declare function strokeOutlineToPath(outline: number[][]): string; /** Render a single element to an SVG fragment string. */ /** * Allow only safe hyperlink schemes. Rejects javascript:/vbscript:/data: and * anything else that could execute on click — defense-in-depth for untrusted * `.boardraw`/SVG files, independent of any host-side sanitization. */ declare function safeUrl(url: string | undefined): string | null; declare function renderElement(el: BoardElement, renderers?: CustomRenderers): string; interface RenderSceneOptions { /** Embed the editable scene JSON in (default true). */ embedScene?: boolean; /** * Per-kind renderers for `custom` nodes. A kind without a renderer falls * back to the neutral placeholder. Absent = all custom nodes use the * placeholder. */ customRenderers?: CustomRenderers; } /** Render a full scene to `.mboard.svg` text. */ declare function renderSceneToSvg(scene: BoardScene, options?: RenderSceneOptions): string; export { type CustomRenderer, type CustomRenderers, type RenderSceneOptions, escapeXml, renderElement, renderSceneToSvg, safeUrl, strokeOutlineToPath };