import { XmlElement } from './helpers/sections-xml.js'; import { DocumentProtectionState, EditingRestrictionMode } from '@superdoc/document-api'; 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; 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