Field Notes
    Preparing search index...

    Interface ExportSvgOptions

    Export options for embedding the exported elements as a loadable scene.

    interface ExportSvgOptions {
        afterElements?: (
            ctx: CanvasRenderingContext2D,
            width: number,
            height: number,
        ) => void;
        background?: string;
        elementRegistry?: ElementRegistry;
        embedScene?: boolean;
        expectedCanvasTypes?: ReadonlySet<string>;
        filter?: (el: CanvasElement) => boolean;
        fonts?: readonly ExportFontFace[];
        frameId?: string;
        htmlPainters?: HtmlPainterRegistry;
        htmlTimeoutMs?: number;
        imageTimeoutMs?: number;
        maxDimension?: number;
        maxPixels?: number;
        onAssetError?: (error: ExportAssetError) => void;
        onFontError?: (error: ExportFontError) => void;
        onHtmlError?: (error: HtmlExportError) => void;
        onSceneOmitted?: (info: { bytes: number; limit: number }) => void;
        padding?: number;
        rasterScale?: number;
        renderHooks?: RenderHooks;
        renderHtml?: HtmlExportRenderer;
        requiredCapabilities?: readonly string[];
        strictMissingCanvasHtml?: boolean;
        theme?: FixedTheme;
    }

    Hierarchy (View Summary)

    Index
    afterElements?: (
        ctx: CanvasRenderingContext2D,
        width: number,
        height: number,
    ) => void
    background?: string
    elementRegistry?: ElementRegistry

    Element adapters used for extension bounds, rendering, and SVG emission.

    embedScene?: boolean

    Embed the exported elements as a loadable scene. Default false. The scene holds every element inside the export bounds regardless of what paints over it (fog, hooks, full-canvas extensions): never embed in an export meant for viewers who must not see those elements.

    expectedCanvasTypes?: ReadonlySet<string>
    filter?: (el: CanvasElement) => boolean
    fonts?: readonly ExportFontFace[]

    Faces to embed as @font-face; only faces the export uses are loaded.

    frameId?: string
    htmlPainters?: HtmlPainterRegistry
    htmlTimeoutMs?: number

    Maximum wait for each HTML renderer. Defaults to 10 seconds.

    imageTimeoutMs?: number

    Maximum wait for each image asset and font file. Defaults to 10 seconds.

    maxDimension?: number

    Maximum width or height of any allocated export canvas. Defaults to 16,384.

    maxPixels?: number

    Maximum pixel count of any allocated export canvas. Defaults to 67,108,864.

    onAssetError?: (error: ExportAssetError) => void

    Called when an image cannot be loaded or embedded. The export continues.

    onFontError?: (error: ExportFontError) => void

    Called when a face cannot be embedded; without it the failure is logged with console.warn. The export continues with the family name only.

    onHtmlError?: (error: HtmlExportError) => void

    Called when an HTML embed cannot be rendered or encoded. The export continues.

    onSceneOmitted?: (info: { bytes: number; limit: number }) => void

    Called when the scene exceeds 16 MiB and is left out; the export still succeeds.

    padding?: number
    rasterScale?: number
    renderHooks?: RenderHooks

    Per-surface hooks installed by viewport plugins.

    renderHtml?: HtmlExportRenderer

    Converts an application-owned HTML embed into a ready canvas image source.

    requiredCapabilities?: readonly string[]

    Render capabilities the export must satisfy, added to the registry's stored requirement.

    strictMissingCanvasHtml?: boolean
    theme?: FixedTheme

    Theme the export draws with. Direct exports default to light; viewport exports use its theme.