/** * Minimal XML helpers for OPC content types and relationships. * * Intentionally small: attribute-oriented element extraction without a full DOM. * Not a general-purpose OOXML parser — higher layers will own SpreadsheetML. * * @private */ /** * Decode UTF-8 (with BOM strip) package part text. */ export declare function decodeUtf8(bytes: Uint8Array): string; /** * Encode text as UTF-8 bytes. */ export declare function encodeUtf8(text: string): Uint8Array; /** * Escape attribute values for XML 1.0 (double-quoted attributes). */ export declare function escapeXml(value: string): string; /** * Escape character data (element text). Does not escape quotes — Excel formula * text (`f`) and similar keep literal `"` as in the original package. */ export declare function escapeXmlText(value: string): string; /** * Unescape common XML attribute / text entities. */ export declare function unescapeXml(value: string): string; /** * Parse attribute text into a map. Prefixed names are stored under the full * name and also under the local name when that slot is free so callers can * look up either form. Local aliases must not be re-emitted on serialize * (see {@link attrsToXmlExcluding}). */ export declare function parseAttrMap(attrText: string): Map; /** * Serialize attributes, skipping exclude keys and parseAttrMap local aliases. * * - Keeps `xmlns:*` declarations (only the exact exclude set drops them). * - Drops unprefixed aliases synthesized for `prefix:local` / `xmlns:prefix`. * - Exclusion matches exact key, or local name for non-namespace attrs * (so `exclude {'id'}` drops both `id` and `r:id`). */ export declare function attrsToXmlExcluding(attrs: Map, exclude: Set): string; /** * One empty-or-simple XML element with attributes (body ignored for OPC CT/rels). */ export interface XmlElementAttrs { readonly localName: string; readonly attrs: ReadonlyMap; } /** * Extract elements by local name with their attributes. * Handles default and prefixed tags; ignores comments and processing instructions. */ export declare function findElementsWithAttrs(xml: string, localName: string): XmlElementAttrs[]; /** * Require a root local name to appear (namespace prefix optional). */ export declare function assertRootLocalName(xml: string, localName: string, partName: string): void;