/** * XML utility functions extracted from HwpxDocument.ts. * Pure functions with no external state dependencies. */ /** * Escape special XML characters in text content. */ export declare function escapeXml(text: string): string; /** * Escape special regex characters in a string for use in RegExp constructor. */ export declare function escapeRegex(str: string): string; /** * Reset lineseg values to defaults so Hancom Word recalculates line layout. * When text content changes, old lineseg values no longer match the new text, * causing rendering issues like overlapping text. */ export declare function resetLinesegInXml(xml: string): string; export interface TopLevelElement { start: number; tagLength: number; content: string; type: 'p' | 'tbl'; } /** * Find all top-level paragraph and table elements in section XML. * Uses depth tracking to skip nested elements inside tables, subLists, etc. */ export declare function findTopLevelElements(sectionXml: string): TopLevelElement[]; export interface ElementWithPosition { xml: string; startIndex: number; endIndex: number; } /** * Find all elements of a given type using depth tracking. * Correctly handles nested elements (e.g., nested tables). * @param xml The XML string to search in * @param elementName The element name without namespace prefix (e.g., 'tr', 'tc') */ export declare function findAllElementsWithDepth(xml: string, elementName: string): ElementWithPosition[];