export type XmlElement = { kind: 'element'; name: string; attributes: Record; content: XmlContent[]; }; export type XmlText = { kind: 'text' | 'cdata' | 'comment'; value: string; }; export type XmlInstruction = { kind: 'processing-instruction'; target: string; value: string; }; export type XmlContent = XmlElement | XmlText | XmlInstruction; export type XmlDocument = { root: XmlElement; prologue: Array; epilogue: Array; }; export declare class XmlDocumentError extends Error { readonly code: 'parser-unavailable' | 'unsupported-declaration' | 'malformed-document' | 'parsing-limit'; constructor(code: 'parser-unavailable' | 'unsupported-declaration' | 'malformed-document' | 'parsing-limit'); } /** No I/O, globals, vendor names, defaults or recovery. Importing this module does not load the grammar. * The XML declaration is a processing instruction in the prologue. A leading BOM is refused. * Raw DOCTYPE/ENTITY markers refuse even inside comments or CDATA: this conservative preflight is linear. */ export declare function parseDocument(source: string): Promise;