/** * Framework-agnostic SVG rendering shared by the React, Vue and Web Component * packages (and by the code generator), so every renderer produces identical markup. * * @module @iso-safety-signs/core/render */ /** An SVG split into the pieces a renderer needs. */ export interface ParsedSvg { /** Root `` attributes except `width`/`height`, always including `xmlns` and `viewBox` when derivable. */ attrs: string; /** Inner markup of the root ``. */ body: string; /** Default width, unitless when the source used pixels. */ width: string; /** Default height, unitless when the source used pixels. */ height: string; } /** Per-render options for {@link renderSvg}. */ export interface RenderSvgOptions { /** Accessible title, rendered as ``. */ title: string; /** Accessible description, rendered as ``. */ description: string; /** When set, labels the `` directly instead of via `aria-labelledby`. */ ariaLabel?: string; /** Overrides the default width. */ width?: number | string; /** Overrides the default height. */ height?: number | string; /** * Unique per rendered instance. Prefixes every id in the output so that the * same sign can appear several times on one page without id collisions. */ instanceId: string; } /** Escapes a string for use in HTML text or a double/single-quoted attribute. */ export declare const escapeHtml: (s: string) => string; /** Splits a complete `` document into {@link ParsedSvg} parts. Cached per input. */ export declare const parseSvg: (svg: string) => ParsedSvg; /** Prefixes every internal id in an SVG body with `prefix`. */ export declare const scopeIds: (body: string, prefix: string) => string; /** Renders a sign as an accessible inline `` string. */ export declare const renderSvg: (svg: ParsedSvg, options: RenderSvgOptions) => string; /** Returns a new page-unique id prefix, for renderers without a framework-provided id. */ export declare const createInstanceId: () => string; /** * Turns a framework-generated id (e.g. React's `:r0:` or `«r0»`) into a prefix * that is safe inside `id` attributes and unquoted CSS `url(#…)` references. */ export declare const toInstanceId: (raw: string) => string; //# sourceMappingURL=render.d.ts.map