export type XmlParserOptions = { /** * Returns false to exclude a node. Default is true. */ filter?: (node: XmlParserNode) => boolean | any; /** * True to throw an error when parsing XML document with invalid content like mismatched closing tags. */ strictMode?: boolean; }; export type XmlParserNodeType = 'Comment' | 'Text' | 'ProcessingInstruction' | 'Element' | 'DocumentType' | 'CDATA'; export type XmlParserNodeWrapper = { excluded: boolean; node: T; }; export type XmlParserNode = { type: XmlParserNodeType; }; export type XmlParserAttribute = { name: string; value: string; }; export type XmlParserElementChildNode = XmlParserTextNode | XmlParserElementNode | XmlParserCDATANode | XmlParserCommentNode | XmlParserProcessingInstructionNode; export type XmlParserDocumentChildNode = XmlParserDocumentTypeNode | XmlParserProcessingInstructionNode | XmlParserElementChildNode; export type XmlParserProcessingInstructionNode = { type: 'ProcessingInstruction'; name: string; content: string; }; export type XmlParserElementNode = { type: 'Element'; name: string; attributes: Record; children: XmlParserElementChildNode[] | null; }; export type XmlParserTextNode = { type: 'Text'; content: string; }; export type XmlParserCDATANode = { type: 'CDATA'; content: string; }; export type XmlParserCommentNode = { type: 'Comment'; content: string; }; export type XmlParserDocumentTypeNode = { type: 'DocumentType'; content: string; }; export type XmlParserResult = { declaration?: XmlParserProcessingInstructionNode | null; root: XmlParserElementNode; children: XmlParserDocumentChildNode[]; }; export declare class ParsingError extends Error { readonly cause: string; constructor(message: string, cause: string); } /** * Parse the given XML string into an object. */ declare function parseXml(xml: string, options?: XmlParserOptions): XmlParserResult; export default parseXml; //# sourceMappingURL=index.d.ts.map