- spreadsheet_types.ts · spreadsheet_view_types.ts — 문서 · 칸 · 서식 · 수식 나무 · 값 · 명령 · 계산 엔진 · 화면 문맥 계약 - 머리 주석에 파일 · 주인(A~F) · 예산 줄 수 · 크기 예산(gzip 54 KB) · 규칙(외부 라이브러리 0 · M02 만 늦게 불러옴) - A · B 엔진 · C 격자 · D 진입 · E 도구 공개 함수 머리(빈 몸) - spreadsheet_sample.json — basis/<열 id>.json 한 벌 견본(병합 · 서식 · 다른 시트 참조 · 숨김 · 계산값) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0168FQuoV7vDh5nhnSowW5cp
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
/* =============================================================================
|
||
* 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();
|
||
}
|