/** * Static export: the current view as a standalone SVG file or a PNG raster. * * The exported SVG must survive leaving the page, and on the page its * appearance comes from two different places: marks carry presentation * attributes (`fill` from the colour scale), while everything else is styled by * the injected stylesheet through classes and `--apexmaps-*` custom properties. * A serialized clone keeps the first and silently loses the second, which is * the classic broken map export: right shapes, wrong everything else. * * So the clone gets the *computed* style of every node inlined onto it, for a * whitelist of visual properties. Computed values have custom properties and * dark mode already resolved, so what leaves the page is what was on it, with * no second copy of the stylesheet to keep in sync. * * What this deliberately does not cover in P1: the legend and tooltips are * HTML outside the SVG, so the export is the map plot itself. Fonts are named, * not embedded; a viewer without the page's font falls back. * * @module export/Exporter */ export interface ExportOptions { /** * Painted behind the map. SVG defaults to none (transparent, like the live * chart); PNG defaults to the container's own background so a dark-mode * screenshot does not arrive as text floating on nothing, falling back to * white. */ background?: string; /** PNG pixel-density multiplier. 2 survives print and retina. */ scale?: number; /** Without extension. Defaults to the map id, or `apexmaps`. */ filename?: string; } /** * Serialize the live SVG root into a standalone document. * * Walks the original and the clone in parallel: `querySelectorAll('*')` returns * document order, so index N in one is index N in the other, and an element's * parent has always been visited before it. */ export declare function serializeSvg(root: SVGSVGElement, options?: ExportOptions): string; /** * The first opaque background above (and including) the element, so a PNG of a * dark-mode map arrives dark rather than as pale strokes on transparency. */ export declare function inheritedBackground(element: Element | null): string | null; /** * Rasterize SVG markup through an offscreen image and canvas. * * Everything the markup references must be inline, which `serializeSvg` * guarantees: an SVG loaded as an image fetches nothing. */ export declare function rasterize(markup: string, { width, height, scale }: { width: number; height: number; scale?: number; }): Promise; /** Trigger a client-side download without navigating. */ export declare function download(data: Blob | string, filename: string): void; /** Blob → data URI, for `dataURI()` consumers embedding the image directly. */ export declare function blobToDataUrl(blob: Blob): Promise; //# sourceMappingURL=Exporter.d.ts.map