/** * Worksheet freeze panes (`CT_SheetViews` / `CT_SheetView` / `CT_Pane`). * * Citations: * - ECMA-376-1 sheet views / pane * - transitional sml.xsd `CT_SheetViews`, `CT_SheetView`, `CT_Pane`, `ST_PaneState` * - docs/specs/freeze-panes.md; docs/ooxml-mapping/freeze-panes.md * - API-RULES R1.4 (`pane` → `sheet.freeze`) * - XlsIO `FreezePanes` / `RemovePanes` (anchor = first unfrozen cell) * * `sheetViews` is a before-sheetData child. Empty frozen model omits pane; * empty sheetViews omits the parent when never present and not authored. */ /** Pane state values from `ST_PaneState`. */ export declare type PaneState = 'frozen' | 'split' | 'frozenSplit'; /** Active pane corner from `ST_Pane`. */ export declare type ActivePane = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight'; /** * Controls which rows and columns of a worksheet stay visible while * scrolling, letting you freeze or unfreeze panes. */ export interface FreezePanes { /** Whether rows and/or columns are frozen on the sheet. */ readonly isFrozen: boolean; /** * The number of frozen columns; `0` when no columns are frozen. */ readonly columns: number; /** The number of frozen rows; `0` when no rows are frozen. */ readonly rows: number; /** * The first cell that scrolls — the cell just beyond the frozen rows and * columns, like `'C3'` when two columns and two rows are frozen. * `undefined` when nothing is frozen. */ readonly topLeftCell: string | undefined; /** * Freeze everything left of and above a cell by giving that cell's * address. For example, `freezeAt('C3')` keeps columns A–B and rows 1–2 * fixed while the rest of the sheet scrolls. * * @param anchor - The first cell that should scroll, like `'C3'`. */ freezeAt(anchor: string): void; /** * Freeze the first few rows and/or columns of the sheet. At least one of * the counts must be greater than `0`. * * @param options.rows - The number of rows to freeze. * @param options.columns - The number of columns to freeze. * @param options.topLeftCell - The first cell that scrolls; derived from * the counts when omitted. */ freezePanes(options: { rows?: number; columns?: number; topLeftCell?: string; }): void; /** Unfreeze the sheet, letting every row and column scroll again. */ unfreeze(): void; } /** * Wire model for sheetViews (primary view + optional opaque siblings). * @private */ export interface SheetViewsModel { /** Whether a sheetViews element was present or has been authored. */ readonly present: boolean; /** Primary sheetView attributes excluding modeled structure. */ readonly primaryExtraAttrsXml: string; /** `sheetView@workbookViewId` (required by schema; default `"0"`). */ readonly workbookViewId: string; /** * Primary `sheetView@showGridLines` (`CT_SheetView` xsd:boolean, * optional, XSD default `true`). * * - `undefined` — attribute absent (schema default `true` applies). * - `false` — gridlines hidden (emitted as `showGridLines="0"`). * - `true` — explicit setting on a **loaded** view (preserved and * re-emitted as `showGridLines="1"`); authoring never sets `true`, * because resetting to the default means removing the attribute. * * Citation: transitional `sml.xsd` L2341; ECMA-376-1 §18.3.1.87. */ readonly showGridLines?: boolean; /** * Primary `sheetView@showRowColHeaders` (`CT_SheetView` xsd:boolean, * optional, XSD default `true`). * * - `undefined` — attribute absent (schema default `true` applies). * - `false` — row/column headers hidden (emitted as `showRowColHeaders="0"`). * - `true` — explicit setting on a **loaded** view (preserved and * re-emitted as `showRowColHeaders="1"`); authoring never sets `true`, * because resetting to the default means removing the attribute. * * Citation: transitional `sml.xsd` L2342; ECMA-376-1 §18.3.1.87. */ readonly showRowColHeaders?: boolean; /** * Primary `sheetView@showZeros` (`CT_SheetView` xsd:boolean, * optional, XSD default `true`). * * - `undefined` — attribute absent (schema default `true` applies). * - `false` — zero values hidden (emitted as `showZeros="0"`). * - `true` — explicit setting on a **loaded** view (preserved and * re-emitted as `showZeros="1"`); authoring never sets `true`, * because resetting to the default means removing the attribute. * * Citation: transitional `sml.xsd` L2343; ECMA-376-1 §18.3.1.87. */ readonly showZeros?: boolean; /** * Primary `sheetView@rightToLeft` (`CT_SheetView` xsd:boolean, * optional, XSD default `false`). * * - `undefined` — attribute absent (schema default `false` applies). * - `true` — RTL enabled (emitted as `rightToLeft="1"`). * - `false` — explicit setting on a **loaded** view (preserved and * re-emitted as `rightToLeft="0"`); authoring never sets `false`, * because resetting to the default means removing the attribute. * * Citation: transitional `sml.xsd` L2344; ECMA-376-1 §18.3.1.87. */ readonly rightToLeft?: boolean; /** * Primary `sheetView@zoomScale` (`CT_SheetView` xsd:unsignedInt, * optional, XSD default `100`). * * - `undefined` — attribute absent (schema default `100` applies). * - any other non-negative integer — emitted as `zoomScale="N"`. * - Authoring the schema default (`100`) removes the attribute; * a **loaded** explicit `100` is preserved and re-emitted. * * Citation: transitional `sml.xsd` L2353; ECMA-376-1 §18.3.1.87. */ readonly zoomScale?: number; /** * Normalized A1 of the primary `sheetView@topLeftCell` (`ST_CellRef`, * optional, no default). Absent means the attribute was not stored — * `A1` is not invented. Invalid lexical forms stay in * {@link primaryExtraAttrsXml}. * * Citation: transitional sml.xsd `CT_SheetView` L2351; ECMA-376-1 * §18.3.1.87. Not `pane/@topLeftCell`. */ readonly topLeftCell?: string; /** * Normalized A1 `sqref` of the primary sheetView's topLeft selection * (`CT_Selection`, ECMA-376-1 §18.3.1.78; transitional sml.xsd). * Absent means no modeled selection element — the schema default `A1` * is not invented when the element itself is absent. */ readonly selectedRange?: string; /** * Opaque non-pane children of the primary sheetView (extra `selection` * elements, pivotSelection, extLst, …) in stored order. The first * topLeft / pane-default `selection` is lifted into {@link selectedRange} * and is not in this list. */ readonly primaryOtherChildrenXml: ReadonlyArray; /** Full opaque sheetView elements after the primary (file order). */ readonly extraSheetViewsXml: ReadonlyArray; /** Pane model when a pane child exists or was authored. */ readonly pane: PaneModel | undefined; /** Extra attributes on sheetViews root. */ readonly rootExtraAttrsXml: string; } /** * Wire pane fields. * @private */ export interface PaneModel { readonly xSplit: number; readonly ySplit: number; readonly topLeftCell: string | undefined; /** * Raw `pane/@topLeftCell` when it is present but not a valid `ST_CellRef`. * Kept so a no-op save does not repair it. Absent when the attribute was * lifted into {@link topLeftCell} or was not stored. */ readonly topLeftCellRaw?: string; readonly activePane: ActivePane | undefined; readonly state: PaneState | undefined; /** Extra pane attributes. */ readonly extraAttrsXml: string; } /** * Host notifications for freeze mutations. * @private */ export interface FreezePanesHost { markDirty(): void; } /** * CT_Worksheet local names that appear **before** `sheetViews`. * Citation: transitional sml.xsd `CT_Worksheet`. */ export declare const SHEET_VIEWS_PREDECESSORS: ReadonlyArray; /** * CT_Worksheet local names that appear **after** `sheetViews` and before sheetData. */ export declare const SHEET_VIEWS_SUCCESSORS_BEFORE_SHEET_DATA: ReadonlyArray; /** * Index at which to insert serialized `sheetViews` among before-sheetData siblings. */ export declare function findSheetViewsInsertIndex(beforeSheetDataLocals: ReadonlyArray): number; /** * Mutable freeze-panes store bound to a worksheet. * @private */ export declare class FreezePanesImpl implements FreezePanes { private model; private host; constructor(initial?: SheetViewsModel); /** @private */ bindHost(host: FreezePanesHost): void; /** @private */ replaceFromParse(model: SheetViewsModel): void; /** @private */ toModel(): SheetViewsModel; /** * Effective on-screen gridline visibility of the primary view. * Absent `showGridLines` means the XSD default `true` (sml.xsd L2341). * @private */ getGridLinesVisible(): boolean; /** * Author gridline visibility on the primary view. Setting `false` emits * `showGridLines="0"`; setting `true` removes the attribute (schema * default `true`), so only a genuinely hidden view carries it. * @private */ setGridLinesVisible(value: boolean): void; /** * Effective on-screen row/column header visibility of the primary view. * Absent `showRowColHeaders` means the XSD default `true` (sml.xsd L2342). * @private */ getRowColumnHeadersVisible(): boolean; /** * Author row/column header visibility on the primary view. Setting * `false` emits `showRowColHeaders="0"`; setting `true` removes the * attribute (schema default `true`), so only a genuinely hidden-headers * view carries it. * @private */ setRowColumnHeadersVisible(value: boolean): void; /** * Effective on-screen zero-value display of the primary view. * Absent `showZeros` means the XSD default `true` (sml.xsd L2343). * @private */ getDisplayZeros(): boolean; /** * Author zero-value display on the primary view. Setting `false` emits * `showZeros="0"`; setting `true` removes the attribute (schema * default `true`), so only a genuinely hidden-zeros view carries it. * @private */ setDisplayZeros(value: boolean): void; /** * Effective right-to-left layout of the primary view. * Absent `rightToLeft` means the XSD default `false` (sml.xsd L2344). * @private */ getRightToLeft(): boolean; /** * Author right-to-left layout on the primary view. Setting `true` emits * `rightToLeft="1"`; setting `false` removes the attribute (schema * default `false`), so only an enabled view carries it. * @private */ setRightToLeft(value: boolean): void; /** * Effective zoom percentage of the primary view. * Absent `zoomScale` means the XSD default `100` (sml.xsd L2353). * @private */ getZoom(): number; /** * Author zoom percentage on the primary view. Values other than `100` * emit `zoomScale="N"`; setting `100` removes the attribute (schema * default), so only a non-default zoom carries it. A loaded explicit * `100` is preserved when the effective value is unchanged. * @private */ setZoom(value: number): void; /** * Normalized A1 address of the primary view's topLeft selection * (`selection@sqref`). Absent selection element ⇒ `undefined` (the schema * default `A1` is not invented). A loaded element with omitted `sqref` * is `A1` (sml.xsd `CT_Selection/@sqref` default). * @private */ getSelectedRange(): string | undefined; /** * Author or clear the primary view's topLeft selection. `undefined` * removes only that modeled element; sibling selections, pane, and view * flags stay. A value emits `sqref` and `activeCell` (range origin). * `pane` and `activeCellId` stay omitted (schema defaults `topLeft` / `0`). * @private */ setSelectedRange(value: string | undefined): void; /** * Normalized A1 of the primary `sheetView@topLeftCell`. Absent attribute * is `undefined` (no schema default). * @private */ getViewTopLeftCell(): string | undefined; /** * Author or clear the primary view scroll anchor. `undefined` removes * only that attribute. Does not create or edit `pane`. * @private */ setViewTopLeftCell(value: string | undefined): void; /** * Normalized A1 of `pane/@topLeftCell` for any pane state. `undefined` * when there is no pane, the attribute is absent, or the stored lexical * form is not a cell reference (that form stays opaque). * @private */ getPaneTopLeftCell(): string | undefined; /** * Author or clear `pane/@topLeftCell` without changing split, state, or * active pane. Requires an existing pane — this does not invent a split * or a freeze. `undefined` removes only the attribute (including an * opaque invalid lexical form). * @private */ setPaneTopLeftCell(value: string | undefined): void; readonly isFrozen: boolean; readonly columns: number; readonly rows: number; readonly topLeftCell: string | undefined; freezeAt(anchor: string): void; freezePanes(options: { rows?: number; columns?: number; topLeftCell?: string; }): void; unfreeze(): void; private applyFreeze; } /** * Parse a `sheetViews` element into a model. * @private */ export declare function parseSheetViewsXml(xml: string): SheetViewsModel; /** * Serialize sheetViews, or `undefined` when absent and empty. * @private */ export declare function serializeSheetViewsXml(model: SheetViewsModel): string | undefined;