import { Metadata } from '../types.js'; /** * Rounded-corner radii of a stripped full-canvas clip, as fractions of the * canvas size. The raster pipeline multiplies them by the output dimensions * and re-applies the crop after rendering. */ export type CornerRadius = { rx: number; ry: number; }; /** * One-pass preparation of an SVG for resvg: sets the sanitized * `width`/`height`, mirrors `mask-type` style declarations onto the * presentation attribute, and strips full-canvas clips that the bundled * resvg mishandles (see {@link stripFullCanvasClips}). All edits happen on * the same parsed tree, so each raster conversion parses and re-emits the * SVG exactly once. Passes are skipped when the raw string cannot contain * their target ("clip-path" needs no case folding: XML attribute names are * case-sensitive, so differently-cased occurrences would not be acted on * anyway). * * When a stripped clip had rounded corners, `cornerRadius` carries its radii * as fractions of the canvas size; the caller has to re-apply the rounded * crop to the rendered raster. */ export declare function prepareForResvg(svg: string, size?: number): { svg: string; size: number; cornerRadius?: CornerRadius; }; /** * Brings the `mask-type` presentation attribute in line with a `style` * declaration of the same property. * * Both forms are valid and browsers honor either. resvg reads only the * attribute, and it renders every raster format this package produces. Where * the attribute disagrees with the declaration, or is missing while the * declaration says `alpha`, resvg falls back to the `luminance` default, and * a mask whose shape is drawn in black (luminance 0) then hides everything * it was meant to reveal. Figma writes the CSS form, so avatar styles * exported from it are affected, including official ones. See * {@link normalizeMaskNodes} for the precedence rules. * * Input that needs no change comes back verbatim. That includes input the * XML parser rejects: resvg would reject such a document anyway, so the * function hands it back unchanged instead of throwing. Only a mask that * actually needs fixing triggers a re-emit from the parsed tree, which may * normalize formatting details such as quote style or self-closing tags. The * rendered image stays the same. * * `toPng` and friends apply the same fix during their single parser pass * (see {@link prepareForResvg}). This standalone form is exported, and * documented on the converter page, for callers that drive resvg directly * instead of through this package, so they do not have to rediscover the * same limitation. */ export declare function normalizeMaskType(svg: string): string; /** * Extracts the embedded RDF/Dublin Core metadata block from an avatar SVG * into a flat {@link Metadata} object. Missing fields become `undefined`. */ export declare function getMetadata(svg: string): Metadata;