import { Editor } from '../../core/Editor.js'; import { XmlElement } from './template-xml.js'; interface ConverterForAssets { convertedXml: Record>; parseXmlToJson(xml: string): XmlElement; media?: Record; addedMedia?: Record; headers?: Record; footers?: Record; headerIds?: Record; footerIds?: Record; reimportHeaderFooterPart?: (partId: string) => unknown; } export interface TemplateIdMapping { kind: 'style' | 'numbering' | 'relationship'; from: string; to: string; } export interface TemplateChangedPart { part: string; scope: 'headersFooters' | 'sectionDefaults' | 'package'; change: 'created' | 'replaced' | 'merged' | 'imported'; } export interface TemplateApplyWarning { code: string; message: string; } export interface HeaderFooterImportResult { /** source document-rel id -> new document-rel id (for sectPr ref rewriting). */ relIdRemap: Map; changedParts: TemplateChangedPart[]; mappings: TemplateIdMapping[]; warnings: TemplateApplyWarning[]; /** Whether any header/footer asset was detected in the source. */ detected: boolean; /** Whether the importer actually applied changes (false for dry-run). */ applied: boolean; } /** * Import all source `word/header*.xml` / `word/footer*.xml` parts as reusable * template assets, with their per-part `.rels` and transitive media closure. * Allocates fresh part names / relationship ids / media filenames on collision * and rewrites references consistently (`DA-TEMPLATE-015`/`016`). */ export declare function importHeaderFooterAssets(editor: Editor, converter: ConverterForAssets, byName: Map, dryRun: boolean): HeaderFooterImportResult; export interface SectionDefaultsResult { detected: boolean; applied: boolean; changed: boolean; changedParts: TemplateChangedPart[]; warnings: TemplateApplyWarning[]; } /** * Adopt the source `w:sectPr` that governs page 1 as the active section * defaults (`DA-TEMPLATE-017`), routed through the real section-mutation/sync * path so the current document's final/body section defaults stay consistent. * On multi-section targets, the source's header/footer visibility model * (`headerReference` / `footerReference` / `w:titlePg`) is also projected * across the earlier sections without overwriting their own page geometry. * Header/footer reference relationship ids are rewritten via `relIdRemap`. */ export declare function applyPageOneSectionDefaults(editor: Editor, sourceDocumentXml: string, relIdRemap: Map, parseXml: (xml: string) => XmlElement, dryRun: boolean): SectionDefaultsResult; export {}; //# sourceMappingURL=template-assets.d.ts.map