import { XmlElement } from './helpers/sections-xml.js'; import { DocumentProtectionState, EditingRestrictionMode } from '../../../../../document-api/src/index.js'; export declare const SETTINGS_PART_PATH = "word/settings.xml"; export interface ConverterWithDocumentSettings { convertedXml?: Record; pageStyles?: { alternateHeaders?: boolean; }; } /** * Read-only lookup: returns the existing settings root without creating parts. * Returns null when word/settings.xml is absent. */ export declare function readSettingsRoot(converter: ConverterWithDocumentSettings): XmlElement | null; /** * Navigate to the `w:settings` root element inside the given part XML. * * Must be called from inside a `mutatePart` callback where the part is * guaranteed to exist (via `settingsPartDescriptor.ensurePart`). If the * `w:settings` element is missing, a fallback root is created in place. */ export declare function ensureSettingsRoot(part: XmlElement): XmlElement; /** * Reads `w:defaultTableStyle` from settings.xml. * Returns the style ID (`w:val`) or null if not present. */ export declare function readDefaultTableStyle(settingsRoot: XmlElement): string | null; /** * Sets `w:defaultTableStyle` in settings.xml to the given style ID. * Creates the element if absent, replaces it if already present. */ export declare function setDefaultTableStyle(settingsRoot: XmlElement, styleId: string): void; /** * Removes `w:defaultTableStyle` from settings.xml. */ export declare function removeDefaultTableStyle(settingsRoot: XmlElement): void; /** * Reads the document-wide footnote number format from * `w:settings/w:footnotePr/w:numFmt[@val]`. Returns the OOXML format * string (e.g., "decimal", "upperRoman") or null if not present. * * Section-level overrides (`w:sectPr/w:footnotePr/w:numFmt`) are not yet * honored — they require per-page numbering context which is tracked in * SD-2986/B2. */ export declare function readFootnoteNumberFormat(settingsRoot: XmlElement): string | null; /** * Reads the document-wide endnote number format from * `w:settings/w:endnotePr/w:numFmt[@val]`. Returns the OOXML format * string or null if not present. */ export declare function readEndnoteNumberFormat(settingsRoot: XmlElement): string | null; /** * SD-2986/B2: Reads `w:settings/w:footnotePr/w:numStart[@val]`. Returns the * starting cardinal (1-based) or null if not specified. Word's default is 1. */ export declare function readFootnoteNumberStart(settingsRoot: XmlElement): number | null; /** * SD-2986/B2: Reads `w:settings/w:endnotePr/w:numStart[@val]`. Returns the * starting cardinal or null. Word's endnote default is 1 (not the lowerRoman * default that endnotes typically use for *format*). */ export declare function readEndnoteNumberStart(settingsRoot: XmlElement): number | null; export type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd'; export declare function readFootnotePosition(settingsRoot: XmlElement): FootnotePosition | null; export declare function readEndnotePosition(settingsRoot: XmlElement): FootnotePosition | null; export type NoteNumberRestart = 'continuous' | 'eachPage' | 'eachSect'; export declare function readFootnoteNumberRestart(settingsRoot: XmlElement): NoteNumberRestart | null; export declare function readEndnoteNumberRestart(settingsRoot: XmlElement): NoteNumberRestart | null; export type SectionNoteConfig = { numFmt?: string; numStart?: number; numRestart?: NoteNumberRestart; }; /** * Walks `word/document.xml` for `w:sectPr` blocks (both standalone at body level * and inside `w:p/w:pPr`), extracts their `w:footnotePr` / `w:endnotePr` * children, and returns the per-section override config keyed by 0-based * section index. Sections without overrides are absent from the map. * * Per §17.11.11: each property is an override of the document-wide value. Per * §17.11.21: section-level `w:pos` is ignored at render time (we omit it here). */ export declare function readSectionNoteConfigs(documentRoot: XmlElement | undefined, containerName: 'w:footnotePr' | 'w:endnotePr'): Map; export declare function hasOddEvenHeadersFooters(settingsRoot: XmlElement): boolean; export declare function setOddEvenHeadersFooters(settingsRoot: XmlElement, enabled: boolean): boolean; /** * Reads the `w:updateFields` flag from settings.xml. * Returns true when the element is present with `w:val="true"` (or `"1"`). */ export declare function hasUpdateFields(settingsRoot: XmlElement): boolean; /** * Sets the `w:updateFields` flag in settings.xml. * Creates the element if absent, updates its value if present. * Only upserts the targeted element — all other settings are preserved. */ export declare function setUpdateFields(settingsRoot: XmlElement, enabled: boolean): void; /** * Parse `w:documentProtection` and `w:writeProtection` from settings root * into a normalized `DocumentProtectionState`. */ export declare function parseProtectionState(settingsRoot: XmlElement | null): DocumentProtectionState; /** * Write or replace `w:documentProtection` in settings.xml. * Creates the element if absent, updates attributes if present. * Preserves verifier/hash fields from the existing element. */ export declare function setDocumentProtection(settingsRoot: XmlElement, opts: { mode: EditingRestrictionMode; enforced: boolean; formattingRestricted?: boolean; }): void; /** * Disable enforcement on `w:documentProtection` while preserving the element * and its metadata (mode, formatting, verifier fields) for round-trip fidelity. */ export declare function clearDocumentProtectionEnforcement(settingsRoot: XmlElement): void; //# sourceMappingURL=document-settings.d.ts.map