/* ============================================================================= * spreadsheet_address.ts (주인 A) * 주소 — A1 ↔ 행열(0 부터) · 범위 글 · 열 글자 · 시트 이름 따옴표 · Map 열쇠. * 0 계약 머리 — 몸은 A 가 채움. 계약은 `spreadsheet_types.ts`. * ========================================================================== */ import type { CellAddress, CellRange } from "./spreadsheet_types"; const todo = (): never => { throw new Error("spreadsheet_address: 아직 없음(A)"); }; /** 0 → `A` · 27 → `AB` */ export function colName(_c: number): string { return todo(); } /** `AB` → 27 · 못 읽으면 -1 (대소문자 가리지 않음) */ export function colIndex(_letters: string): number { return todo(); } /** (30, 4) → `E31` */ export function toA1(_r: number, _c: number): string { return todo(); } /** `E31` · `$E$31` → {r:30, c:4} · 못 읽으면 null */ export function parseA1(_text: string): CellAddress | null { return todo(); } /** 칸 하나면 `E31` · 아니면 `C3:AD3` · 행 전체 `3:3` · 열 전체 `A:A` */ export function rangeToA1(_range: CellRange): string { return todo(); } /** `C3:AD3` · `E31` · `A:A` · `3:5` → 범위(뒤집힌 글은 바로 세움) · 못 읽으면 null */ export function parseRange(_text: string): CellRange | null { return todo(); } /** 식에 넣을 시트 이름 — 글자 · 숫자 · _ 밖이 있으면 `'…'`(안의 `'` 는 `''`) */ export function quoteSheet(_name: string): string { return todo(); } /** Map 열쇠 — r × MAX_COLS + c */ export function cellId(_r: number, _c: number): number { return todo(); } export function fromCellId(_id: number): CellAddress { return todo(); }