/** * @purpose XML tree node — tag, attributes, child nodes or text. * @consumer commit-gen, review-verify, cat-gen */ export type XmlNode = { /** @purpose XML tag name (e.g. 'message', 'commit'). */ tag: string; /** @purpose Optional key-value attributes on the tag. */ attrs?: Record; /** @purpose Child content: nested nodes, text, string array, or CDATA. */ children?: XmlNode[] | string | string[] | XmlCdataNode; }; /** * @purpose Represent XML block as CDATA content without escaping special chars. * @consumer xml serializer */ export type XmlCdataNode = { /** @purpose Raw CDATA text content (not escaped). */ cdata: string; }; /** * @purpose Extract \ block from XML string and convert to flat object for commit. * @param xmlString XML string (e.g. command output or file). * @returns Object type, icon, subject, description or null if \ block not found. */ export declare function xmlCommitMessageToJson(xmlString: string): { type: string; icon: string; subject: string | null; description: string | null; } | null; /** * @purpose Escape special characters in string for safe XML insertion. * @param str Source string that may contain \<, \>, &, ', ". * @returns String with replaced entities (<, >, &, ', "). */ export declare function escapeXml(str: string): string; /** * @purpose Serialize XmlNode object to indented XML string. * @param node XmlNode to serialize. * @param [level] Nesting level for indentation (default 0). * @returns Formatted XML string. */ export declare function serializeXmlNode(node: XmlNode, level?: number): string;