/** * DOCX Module - Flat OPC Format Support * * Implements reading and writing of Flat OPC (Office Open XML Package) format, * which represents an entire DOCX package as a single XML file. * This is useful for debugging, XML transformations, and enterprise integration scenarios. * * Flat OPC uses the `pkg:` namespace to wrap all package parts in a single XML document. * Each part is represented as a `` element with its content either as XML or base64. * * References: * - [MS-OFFCRYPTO] §2.1.5 (pkgStart namespace) * - ECMA-376 Part 2 (OPC) Annex C (non-normative) */ /** A part extracted from Flat OPC XML. */ export interface FlatOpcPart { /** Part name (e.g. "/word/document.xml"). */ readonly name: string; /** Content type of the part. */ readonly contentType: string; /** Raw data (decoded from base64 for binary, or UTF-8 encoded XML). */ readonly data: Uint8Array; } /** * Parse a Flat OPC XML document into individual package parts. * Returns a Map keyed by part path (without leading slash) to binary data, * compatible with the archive entry format used by `readDocx`. * * @param xmlContent - The Flat OPC XML string or UTF-8 bytes. * @returns A map of part paths to their binary content. */ export declare function parseFlatOpc(xmlContent: string | Uint8Array): Map; /** * Check if content appears to be a Flat OPC XML document. */ export declare function isFlatOpc(content: string | Uint8Array): boolean; /** * Convert a ZIP archive's entries (as a map of path → data) to Flat OPC XML string. * * @param entries - Map of part paths to their binary content. * @param contentTypes - Map of part paths to content types (from [Content_Types].xml). * @returns The Flat OPC XML string. */ export declare function toFlatOpc(entries: Map, contentTypes?: Map): string;