utils/cell Functions
Functions exported from src/utils/cell.ts
decodeCell
function decodeCell(cstr: string): CellAddressParameters
| Name | Type | Description |
|---|---|---|
| cstr | string | Cell reference string (e.g. |
Returns
CellAddress
Zero-based cell address {c: column, r: row}
decodeCol
function decodeCol(colstr: string): numberParameters
| Name | Type | Description |
|---|---|---|
| colstr | string | Column label string, possibly with "$" prefix |
Returns
number
Zero-based column index (A=0, B=1, ..., Z=25, AA=26, ...)
decodeRange
function decodeRange(range: string): RangeParameters
| Name | Type | Description |
|---|---|---|
| range | string | Range string in A1 notation |
Returns
Range
Range object with start (s) and end (e) addresses
decodeRow
function decodeRow(rowstr: string): numberParameters
| Name | Type | Description |
|---|---|---|
| rowstr | string | Row string, possibly with a "$" absolute marker (e.g. |
Returns
number
Zero-based row index
encodeCell
function encodeCell(cell: CellAddress): stringParameters
| Name | Type | Description |
|---|---|---|
| cell | CellAddress | Zero-based cell address |
Returns
string
A1-style cell reference (e.g. "A1" for {c
, r})encodeCol
function encodeCol(col: number): stringParameters
| Name | Type | Description |
|---|---|---|
| col | number | Zero-based column index |
Returns
string
Column label string
encodeRange
function encodeRange(cs: CellAddress | Range, ce?: CellAddress): stringParameters
| Name | Type | Description |
|---|---|---|
| cs | `CellAddress | Range` |
| ce (optional) | CellAddress | Optional end CellAddress (when cs is a CellAddress) |
Returns
string
Range string in A1 notation (e.g. "A1
" or "A1")encodeRow
function encodeRow(row: number): stringParameters
| Name | Type | Description |
|---|---|---|
| row | number | Zero-based row index |
Returns
string
1-based row string (e.g. "1" for row index 0)