/** * Mail Merge API * * Replace MERGEFIELD fields in a document with values from a data map. * Uses the unified walker from core/walker.ts for consistent traversal * across body, headers, footers, footnotes, endnotes, tables, and SDTs. * * Note: This API mutates the document in place for backward compatibility. */ import type { DocxDocument } from "../types.js"; /** * Execute a mail merge: replace all MERGEFIELD fields in the document with values from the data map. * * Fields not found in the data map are left unchanged (or optionally cleared). * Traverses body, headers, footers, footnotes, endnotes, tables, SDTs, and comments. * * @param doc - The document to modify (mutated in place). * @param data - Map of field names to replacement values. * @param options - Optional settings. * @returns The number of fields replaced. */ export declare function mailMerge(doc: DocxDocument, data: Record, options?: { /** If true, remove fields not found in data. Default: false (leave unchanged). */ removeUnmatched?: boolean; }): number;