/** * Prepare the XML parser. No-op when a native `DOMParser` global exists (a real * browser); otherwise it lazily loads `linkedom` and caches its `DOMParser` so * the synchronous `parseXML`/`parseDOM` below can run. The IDML constructor * awaits this before parsing, so call sites stay synchronous. */ export declare function preloadDOM(): Promise; /** @deprecated kept for callers migrating from flat-svg; use {@link preloadDOM}. */ export declare const preloadJSDOM: typeof preloadDOM; export declare function parseDOM(str: string, contentType?: string): Document; /** Parse an XML string and return its root element. */ export declare function parseXML(str: string): HTMLElement; export type XMLDocumentExport = { root: ElementNode; src: string; }; export type XMLProcessingInstruction = { name: string; attributes: { [k: string]: string | number | boolean; }; }; export declare const XMLProcessingInstructionXML: XMLProcessingInstruction; export declare const XMLProcessingInstructionAID: XMLProcessingInstruction; export type ElementNode = { type: 'element'; tagName: string; attributes?: { [k: string]: string | number | boolean | undefined; }; children?: XMLNode[]; }; export type TextNode = { type: 'text'; text: string; }; export type CDataNode = { type: 'cdata'; data: string; }; export type CommentNode = { type: 'comment'; comment: string; }; export type XMLNode = ElementNode | TextNode | CDataNode | CommentNode; export declare function makeElementNode(tagName: string, attributes?: { [k: string]: string | number | boolean | undefined; }, children?: XMLNode[]): ElementNode; export declare function makeTextNode(value: string | number | boolean): TextNode; export declare function makeCDataNode(value: string | number | boolean): CDataNode; export declare function stringifyNode(node: XMLNode): string; /** Serialize a node tree with leading processing instructions. `pretty` is a * best-effort hint (currently a no-op; the write path doesn't require it). */ export declare function stringifyXML(node: XMLNode, processingInstructions?: XMLProcessingInstruction[], _pretty?: boolean): string; export declare function getAttributes(element: Element): { [k: string]: string | undefined; }; export declare function nodeToNode(node: Node): XMLNode; export declare function domNodeToXMLNode(node: Node, skipElements: string[]): ElementNode & { children: XMLNode[]; }; export declare function getElementAttributes(element: Element, exclude?: string[]): { [k: string]: string; }; export declare function getUniqueID(prefix?: string): string; //# sourceMappingURL=xml.d.ts.map