/** * A1-style cell reference encode/decode (sheet-local). * * Excel grid limits: columns A–XFD (1–16384), rows 1–1048576. * Absolute markers (`$`) are accepted on parse and stripped for storage keys; * {@link formatA1} always emits relative form. * * Citations: ECMA-376-1 cell reference conventions; `ST_CellRef` / `ST_Ref` * in transitional sml.xsd. */ /** Maximum 1-based column index (XFD). */ export declare const MAX_COLUMN = 16384; /** Maximum 1-based row index. */ export declare const MAX_ROW = 1048576; /** * Zero-cost coordinate pair (1-based row and column). * @private */ export interface CellCoord { readonly row: number; readonly col: number; } /** * Inclusive rectangular range in 1-based row/column coordinates. * Used for `ST_Ref` merge ranges and similar sheet-local refs. * @private */ export interface CellRange { readonly startRow: number; readonly startCol: number; readonly endRow: number; readonly endCol: number; } /** @private * Parse an A1 token into 1-based row/column. * @throws InvalidAddressError when the token is not a single cell reference */ export declare function parseA1(address: string): CellCoord; /** @private * Format 1-based row/column as relative A1 (e.g. `A1`, `XFD1048576`). * @throws InvalidAddressError when coordinates are out of range */ export declare function formatA1(row: number, col: number): string; /** @private * Parse a sheet-local `ST_Ref` (single cell or `A1:B2` range). * * Absolute `$` markers are accepted and stripped. Inverted ranges * (end before start on either axis) are rejected — they are not swapped. * Single-cell refs become a degenerate range with equal corners. * * @throws InvalidMergeRefError when the ref is empty, malformed, inverted, or OOB */ export declare function parseA1Range(ref: string): CellRange; /** @private * Format a {@link CellRange} as compact relative A1 `ST_Ref`. * * Single-cell ranges emit `A1` (not `A1:A1`). Multi-cell emit `A1:B2`. * * @throws InvalidAddressError when coordinates are out of range */ export declare function formatA1Range(range: CellRange): string; /** * Convert 1-based column index to letters (`1` → `A`, `16384` → `XFD`). */ export declare function columnIndexToLetters(col: number): string; /** * Convert column letters to 1-based index (`A` → `1`, `XFD` → `16384`). */ export declare function columnLettersToIndex(letters: string): number;