/** * Worksheet column properties (`CT_Cols` / `CT_Col`). * * Citations: * - ECMA-376-1 §18.3.1.17 `cols` / §18.3.1.12 `col` * - transitional sml.xsd `CT_Cols` (~L2233), `CT_Col` (~L2238–2248) * - `CT_Worksheet` sequence: sheetFormatPr → **cols** → sheetData (~L2170–2176) * - docs/requirements/row-column-properties.md * - docs/specs/column-properties.md; docs/ooxml-mapping/column-properties.md * * Sparse grid law: column records never allocate cells. Empty `cols` is omitted. * Unsupported / unmodeled `col` attributes round-trip via `extraAttrsXml`. * * Public authoring uses {@link import('../workbook/worksheet').Worksheet.setColumnWidth} / * {@link import('../workbook/worksheet').Worksheet.getColumnWidth} only. * Enumeration of authored `col` records is internal. * * @private */ /** * Snapshot of one column range record (`CT_Col`). * * `min` / `max` are 1-based inclusive column indexes. `width` is the OOXML * character-width double when present. `customWidth` mirrors * `CT_Col/@customWidth` (schema default `false`). * * @private */ export interface ColumnProperties { /** Inclusive 1-based start column (`CT_Col/@min`). */ readonly min: number; /** Inclusive 1-based end column (`CT_Col/@max`). */ readonly max: number; /** Column width in OOXML character units when set. */ readonly width: number | undefined; /** * Whether the width is custom (`CT_Col/@customWidth`). * Schema default is `false` when the attribute is absent. */ readonly customWidth: boolean; } /** * Collection of worksheet column records for internal parse/mutate/serialize. * * Prefer {@link import('../workbook/worksheet').Worksheet.setColumnWidth} / * {@link import('../workbook/worksheet').Worksheet.getColumnWidth} on the * public surface. * * @private */ export interface Columns { /** Number of `col` records. */ readonly count: number; /** Snapshot of column records in file / author order. */ list(): ReadonlyArray; } /** * Internal column entry with opaque extra attributes for round-trip. * @private */ export interface ColumnEntry { readonly min: number; readonly max: number; readonly width: number | undefined; /** * Modeled customWidth: * - `undefined` — attribute absent (schema default false) * - `true` / `false` — explicit */ readonly customWidth: boolean | undefined; /** Extra attributes excluding min/max/width/customWidth. */ readonly extraAttrsXml: string; } /** * Wire model for `cols` (ordered entries + presence). * @private */ export interface ColumnsModel { readonly entries: ReadonlyArray; } /** * Host notifications for column mutations. * @private */ export interface ColumnsHost { markDirty(): void; } /** * Mutable columns store backed by an ordered entry list. * @private */ export declare class ColumnsImpl implements Columns { private readonly entries; private host; constructor(initial?: ReadonlyArray); /** @private */ bindHost(host: ColumnsHost): void; readonly count: number; list(): ReadonlyArray; /** * Replace contents from parse (does not mark dirty). * @private */ replaceFromParse(model: ColumnsModel | undefined): void; /** * Snapshot for serialize. * @private */ toModel(): ColumnsModel; /** * Effective width for a 1-based column index, or `0` when unset. * Walks entries in file order; last covering range wins. * @private */ getColumnWidth(index: number): number; /** * Set custom width for a single 1-based column. * * Matching policy: * 1. Exact `min === index && max === index` → update in place. * 2. Otherwise if a multi-column range covers `index`, split that range * so only `index` receives the new width (other columns keep prior * width/extras). * 3. Else append `min=max=index`, `customWidth=true`. * * @private */ setColumnWidth(index: number, width: number): void; } /** * CT_Worksheet locals that appear **before** `cols`. * Citation: transitional sml.xsd `CT_Worksheet`. */ export declare const COLS_PREDECESSORS: ReadonlyArray; /** * CT_Worksheet locals after `cols` and before `sheetData` — none in the schema. * Kept for symmetry / future extensions. */ export declare const COLS_SUCCESSORS_BEFORE_SHEET_DATA: ReadonlyArray; /** * Index at which to insert serialized `cols` among before-sheetData siblings. */ export declare function findColsInsertIndex(beforeSheetDataLocals: ReadonlyArray): number; /** * Parse a `cols` element into ordered column entries. * Soft-skips individual `col` children missing required min/max. * * Product rule: `hidden="1"` (xsd true) is modeled as width `0` so hide/show * is expressed only through {@link ColumnsImpl.setColumnWidth} / * {@link ColumnsImpl.getColumnWidth}. `hidden` is consumed here and not kept * in `extraAttrsXml`. * * @private */ export declare function parseColsXml(colsXml: string): ColumnsModel; /** * Serialize column entries to a `cols` element, or `undefined` when empty. * @private */ export declare function serializeColsXml(model: ColumnsModel | undefined): string | undefined;