import { ColumnLayout } from './index.js'; /** * Resolved geometry for a single column. `x` and `separatorX` are CONTENT-RELATIVE (measured from * the content-area left edge); add the content-left / left margin to get an absolute page x. This * is the single source every column consumer should read for positioning. (SD-2629) */ export type ColumnGeometry = { index: number; x: number; width: number; /** Gap after this column; 0 for the last column. */ gapAfter: number; /** Separator x (content-relative); present only when a separator line is drawn after this column. */ separatorX?: number; }; export type NormalizedColumnLayout = ColumnLayout & { width: number; }; export declare function widthsEqual(a?: number[], b?: number[]): boolean; /** * Resolved column mode. Explicit ONLY when `equalWidth === false` AND at least one usable child * width exists; otherwise equal mode. In equal mode Word ignores any child `w:col/@w` and divides * the content area evenly, so this is the single explicit/equal decision shared by extraction, * normalization, and geometry. (SD-2324 / SD-2629) */ export declare function resolveColumnMode(input: ColumnLayout | undefined): 'explicit' | 'equal'; /** * Resolved column count and the SINGLE authority for "how many columns exist": the raw `w:num` * (default 1, floored, min 1) clamped to the usable explicit-width count in explicit mode (Word * renders min(num, valid-width count)). Both `normalizeColumnLayout` (width math) and the paginator * fill loop read this, so the two tracks cannot disagree: a section that declares more columns * than it supplies widths (e.g. w:num="4" with two ) neither pads surplus columns to ~0px * slivers nor advances the fill into non-existent columns. Content-width-independent. (SD-2324 F8 / * SD-2629) */ export declare function resolveColumnCount(input: ColumnLayout | undefined): number; export declare function cloneColumnLayout(columns?: ColumnLayout): ColumnLayout; /** * Resolve an authored column config to what actually renders: count clamped to resolveColumnCount, * and per-column data reconciled with the mode. In explicit mode widths/gaps are sliced to the * resolved count (drop surplus); in equal mode they are dropped entirely, because Word ignores * child widths/spaces and divides evenly, and consumers like the DOM painter treat any `widths` as * explicit. NOT scaled to a content width; that is normalizeColumnLayout's job. Use for * render-facing metadata (page.columns / layout.columns / columnRegions) so it never advertises * phantom columns or stray explicit widths, e.g. count:4 with two widths becomes count:2. (SD-2629) */ export declare function resolveColumnLayout(input: ColumnLayout): ColumnLayout; export declare function normalizeColumnLayout(input: ColumnLayout | undefined, contentWidth: number, epsilon?: number): NormalizedColumnLayout; /** * Resolve per-column geometry for an already-normalized layout. This is the SD-2629 consumer API: * fill/positioning/separators/hit-testing/footnotes/floating anchors/balancing should read this * single source rather than re-deriving from `widths`/`gap`. Geometry uses the resolved (unscaled) * widths and per-column `gaps`, falling back to the uniform gap when no per-column gaps exist. */ export declare function getColumnGeometry(normalized: NormalizedColumnLayout): ColumnGeometry[]; /** Width of the column at `index` (px). */ export declare function getColumnWidth(geometry: ColumnGeometry[], index: number): number; /** Left edge of the column at `index`, as `originX + content-relative x`. */ export declare function getColumnX(geometry: ColumnGeometry[], index: number, originX?: number): number; /** Gap after the column at `index` (0 for the last column). */ export declare function getColumnGapAfter(geometry: ColumnGeometry[], index: number): number; /** Absolute x of each separator line (only columns that draw one), as `originX + content-relative`. */ export declare function getColumnSeparatorPositions(geometry: ColumnGeometry[], originX?: number): number[]; /** Index of the column containing absolute `x` (clicks in a gap map to the preceding column). */ export declare function getColumnAtX(geometry: ColumnGeometry[], x: number, originX?: number): number; /** Structural equality of two column layouts, including per-column `gaps`. */ export declare function columnLayoutsEqual(a?: ColumnLayout, b?: ColumnLayout): boolean; /** * Render equality: true when two column configs produce the SAME rendered layout even if their raw * fields differ. Compares the canonical render form for today's renderer (resolved mode + count, * scalar gap, withSeparator, and in explicit mode the sliced widths) and deliberately ignores raw * `equalWidth` and the surplus count/widths that resolution discards. Per-column `gaps` are * intentionally ignored until geometry/separators consume them (step 4), so a gaps-only authored * delta does not split regions or invalidate the normalized-columns cache before it becomes * paint-significant. Use for region/cache change detection so e.g. `{num:4, widths:[a,b]}` vs * `{num:2, widths:[a,b]}`, or `equalWidth:true` vs an omitted equalWidth, do not split into * separate regions. (SD-2629) */ export declare function columnRenderLayoutsEqual(a?: ColumnLayout, b?: ColumnLayout): boolean; //# sourceMappingURL=column-layout.d.ts.map