import type { Dimension, DesignSlot, LegacyHeaderFooterSlot, ResolvedDesignBoxElement, ResolvedDesignRuleElement, ResolvedDesignSlot, ResolvedDesignTextElement, TextOverflow } from '../types.js'; export type HeaderFooterSlotKind = 'header' | 'footer'; /** Where a design slot is painted (#628): a running head or folio * (`'header'`, `'footer'`, a heading style's own included), a heading * design (`'heading'`: `advancedDesign.slot`, an opener or an in-column * title), a part page and its verso (`'part'`), a part row of the * contents (`'tocRow'`) or a box style's design (`'box'`, #1014). It sets * the default `overflow` of the slot's text elements * ({@link defaultTextOverflow}). */ export type DesignSlotKind = HeaderFooterSlotKind | 'heading' | 'part' | 'tocRow' | 'box'; /** The `overflow` of a text element of a `kind` slot that sets none: a * heading or part title and a box design's text wrap onto more lines, a * running head, a folio and a contents part row (whose height is fixed) * end in `…`. */ export declare function defaultTextOverflow(kind: DesignSlotKind): TextOverflow; export declare const DEFAULT_HEADER_FOOTER_SLOT: ResolvedDesignSlot; /** Reference defaults for a freshly-created text element. Its `overflow` * is a running head's: an element that sets none takes its slot's * ({@link defaultTextOverflow}). */ export declare const DEFAULT_TEXT_ELEMENT: ResolvedDesignTextElement; export declare const DEFAULT_RULE_ELEMENT: ResolvedDesignRuleElement; export declare const DEFAULT_BOX_ELEMENT: ResolvedDesignBoxElement; /** Built-in default header: book title (right, odd) + chapter title (left, * even) + full-width rule. Applied when `config.header` is `undefined`. */ export declare const DEFAULT_HEADER_SLOT: ResolvedDesignSlot; /** Built-in default footer: centered page number on every page. */ export declare const DEFAULT_FOOTER_SLOT: ResolvedDesignSlot; /** Returns true when the slot uses the legacy `align`/`marginFromBody` shape. */ export declare function isLegacyHeaderFooterSlot(slot: unknown): slot is LegacyHeaderFooterSlot; /** Convert a legacy-shaped header/footer slot to a `DesignSlot`. Safe to * call on already-migrated slots (returns them unchanged). */ export declare function migrateLegacyHeaderFooterConfig(slot: unknown, kind: HeaderFooterSlotKind): DesignSlot | undefined; /** A design text's leading as written (`DesignTextElement.lineHeight`: a * multiplier, or a {@link Dimension}) as the resolved element carries it: * a multiplier, plus the absolute length when one was given. A numeric * string counts as the number it spells; anything unusable — not a * positive finite number, a dimension of an unknown unit — is the default * multiplier. Never NaN. */ export declare function resolveDesignLineHeight(value: unknown, fontSize: Dimension | undefined): { lineHeight: number; lineHeightLength?: Dimension; }; /** An element's page-fence condition (#1087) as it is read: `when` and * `unless` kept when they name an attribute (a non-empty string, trimmed), * left out otherwise (the validation reports a value that is not one). */ export declare function fenceConditionOf(el: { when?: unknown; unless?: unknown; }): { when?: string; unless?: string; }; /** Resolve a design slot painted as `kind` (see {@link DesignSlotKind}), * which sets the default `overflow` of its text elements. `undefined` * returns the built-in default for `kind` (empty but for a running head * and a folio). Legacy slots are migrated on the fly. */ export declare function resolveDesignSlot(slot: DesignSlot | undefined, kind?: DesignSlotKind): ResolvedDesignSlot; export declare const resolveHeaderFooterConfig: typeof resolveDesignSlot; /** `slot` as it is stored: one in the pre-placement shape migrated, any * other as given. Nothing is dropped, so it serves where a slot has no * default of its own (a heading style's, which stands for the * document's when unset, #694). */ export declare function migrateDesignSlot(slot: DesignSlot | undefined, kind?: DesignSlotKind): DesignSlot | undefined; export declare function stripDesignSlotDefaults(slot: DesignSlot | undefined, kind?: DesignSlotKind): DesignSlot | undefined; export declare const stripHeaderFooterDefaults: typeof stripDesignSlotDefaults; //# sourceMappingURL=headerFooter.d.ts.map