/** * Rectangular range view on a worksheet (`ST_Ref`). * * L1 authoring surface for merges and intersecting hyperlinks — prefer over * sheet collections when working a single range. Storage still lives on the * worksheet. * * Citations: * - ECMA-376-1 §18.3.1.55 `mergeCells` / §18.3.1.56 `mergeCell` * - ECMA-376-1 §18.3.1.47 `hyperlink` / §18.3.1.48 `hyperlinks` * - transitional sml.xsd `CT_MergeCells` / `CT_MergeCell` / `ST_Ref` * - docs/specs/merged-cells.md; docs/specs/hyperlinks.md; docs/api/API-RULES.md * * Meaningful cell content for a merge lives in the **top-left** cell. * {@link Range.merge} does not move or clear covered cell values. */ import { CellRange } from '../address/cell-address'; import { WorksheetImpl } from '../workbook/worksheet'; import { Hyperlinks } from './hyperlinks'; /** * View over a single A1 range on a worksheet. * * Obtained via {@link Worksheet.range}. Coordinates are 1-based inclusive. */ export declare class Range { private readonly sheet; private readonly range; private readonly addressKey; /** * @private Prefer {@link createRangeFromRef} / {@link Worksheet.range}. */ constructor(sheet: WorksheetImpl, range: CellRange); /** * Normalized compact A1 address for this range (`A1` or `A1:B2`). */ readonly address: string; /** * Inclusive 1-based corners. * * @private Prefer {@link firstRow}, {@link lastRow}, {@link firstColumn}, * and {@link lastColumn} on the public surface. */ readonly bounds: CellRange; /** * First (top) 1-based row index of this range. */ readonly firstRow: number; /** * Last (bottom) 1-based row index of this range. */ readonly lastRow: number; /** * First (left) 1-based column index of this range. */ readonly firstColumn: number; /** * Last (right) 1-based column index of this range. */ readonly lastColumn: number; /** * True when this exact normalized address is present in {@link Worksheet.merges}. */ readonly isMerged: boolean; /** * Hyperlinks whose ref intersects this range (XlsIO `Range.HyperLinks` parity). * * View is live against the sheet collection: `add` defaults `ref` to this * range address when omitted; `remove` / `clear` / `removeAt` only affect * intersecting entries. `findByCell` remains sheet-wide (same as sheet API). */ readonly hyperlinks: Hyperlinks; /** * Add this range to the sheet merge collection. * * Idempotent for the exact same normalized address. Overlaps throw * {@link MergeOverlapError} via {@link MergedCells.add}. * * Content rule: keep visible values/styles on the **top-left** cell; * this method does not move or clear covered cells. * * @throws InvalidArgumentError | InvalidMergeRefError | MergeOverlapError */ merge(): void; /** * Remove this exact normalized address from the sheet merge collection. * No-op when absent. */ unmerge(): void; } /** * Build a {@link Range} from an A1 ref on `sheet`. * * @throws InvalidMergeRefError when the ref is empty, malformed, inverted, or OOB * @private */ export declare function createRangeFromRef(sheet: WorksheetImpl, ref: string): Range;