/** An element, or a run of text. Attribute values and text are as written (escaped); `attr` and `textOf` read them. */ export interface SvgNode { name: string; attrs: Record; children: (SvgNode | string)[]; /** Written as `` rather than ``. */ empty: boolean; } /** Text with its entities read: the five of XML and numeric ones. */ export declare function decode(text: string): string; /** Text made safe for an attribute or a run of text, the way `esc` in format.ts does it. */ export declare const encode: (text: string) => string; /** * Read an SVG string into a tree. Anything that is not the markup this package writes (an unclosed tag, an unquoted attribute) is an error that says where. * @example * ```ts * import { parseSvg } from "@johnmorrisdotca/kyogijo-stadiums/scene"; * const tree = parseSvg(''); * console.log(tree.name, tree.attrs.viewBox, tree.children.length); * // svg 0 0 10 5 1 * ``` */ export declare function parseSvg(text: string): SvgNode; /** An SVG tree as text: the string `parseSvg` was given, exactly. */ export declare function writeSvg(node: SvgNode): string; /** The value of an attribute with its entities read. */ export declare const attr: (node: SvgNode, name: string) => string | undefined; /** The text inside an element and its elements, with its entities read. */ export declare const textOf: (node: SvgNode) => string; /** The elements inside an element, in order. */ export declare const elements: (node: SvgNode) => SvgNode[];