/** * DOCX Module - Common Auxiliary Parts Builder * * Shared logic for generating auxiliary XML parts (styles, settings, numbering, * fontTable, theme, core properties, app properties, custom properties). * * Both the buffered packager and streaming writer use this to avoid duplicating * the same rendering logic. */ import type { AbstractNumbering, AppProperties, CoreProperties, CustomProperty, DocDefaults, DocumentSettings, DocumentTheme, EndnoteDef, FontDef, FootnoteDef, NumPicBullet, NumberingInstance, StyleDef } from "../types.js"; import type { RenderHelpers } from "./render-context.js"; /** Input options for building common auxiliary parts. */ export interface AuxiliaryPartsInput { readonly docDefaults?: DocDefaults; readonly styles?: readonly StyleDef[]; readonly settings?: DocumentSettings; readonly fonts?: readonly FontDef[]; readonly theme?: DocumentTheme; readonly abstractNumberings?: readonly AbstractNumbering[]; readonly numberingInstances?: readonly NumberingInstance[]; readonly numPicBullets?: readonly NumPicBullet[]; readonly coreProperties?: CoreProperties; readonly appProperties?: AppProperties; readonly customProperties?: readonly CustomProperty[]; readonly footnotes?: readonly FootnoteDef[]; readonly endnotes?: readonly EndnoteDef[]; /** * Optional render helpers passed to footnote/endnote rendering so in-note * hyperlinks/images resolve to the rIds the caller has registered against * the per-part .rels. Defaults to `{}`, meaning no remap and no * hyperlink rIds — sufficient for documents without notes that contain * external links or remapped images. */ readonly notesHelpers?: RenderHelpers; /** * Raw XML output policy. When `"strip"` or `"reject"`, opaque rawXml * fields on settings/theme/numbering are skipped or cause an error * respectively. Defaults to `"preserve"`. */ readonly rawXmlPolicy?: "preserve" | "strip" | "reject"; } /** A rendered XML part ready to be written to ZIP. */ export interface RenderedPart { readonly path: string; readonly content: string; } /** * Build all common auxiliary XML parts that are shared between * the buffered packager and streaming writer. * * Returns an array of rendered parts (path + XML string). * Does NOT include: document.xml, images, headers/footers, comments, * charts, custom XML, embedded fonts, opaque parts, watermarks. * Those are handled by the respective packager/streaming-writer because * they require relationship ID coordination. */ export declare function buildCommonAuxiliaryParts(input: AuxiliaryPartsInput): RenderedPart[];