Files
Aislo/A00_Common/spreadsheet/spreadsheet_commands.ts
T
eomsangdonandClaude Opus 5.5 26fd4fb72e feat(spreadsheet): 산출근거 스프레드시트 0 계약 — 타입 · 엔진 머리 · 저장 견본
- 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
2026-09-27 19:48:20 +09:00

36 lines
1.6 KiB
TypeScript

/* =============================================================================
* spreadsheet_commands.ts (주인 A)
* 명령 적용 — 문서를 그 자리에서 바꾸고 되돌림 짝 · 바뀐 칸 · 통째 다시 여부를 돌려줌.
* 병합 규칙(엑셀): 병합 일부를 가르는 칸 쓰기 · 옮기기는 막음(오류 던짐 → 화면이 알림) ·
* 병합 안에 행열을 넣으면 병합이 늘고 지우면 줆 · 병합하면 왼위 칸 값만 남김.
* 서식 표는 같은 서식을 한 번만 둠(칸은 번호) · 안 쓰는 서식 정리는 저장 전에(`compactStyles`).
* 0 계약 머리 — 몸은 A 가 채움.
* ========================================================================== */
import type { Command, CommandEffect, Sheet, Workbook } from "./spreadsheet_types";
const todo = (): never => {
throw new Error("spreadsheet_commands: 아직 없음(A)");
};
/** 막힌 명령(병합 가름 · 마지막 시트 지우기 · 같은 시트 이름 …) — 화면이 `message` 를 알림 */
export class CommandError extends Error {}
export function applyCommand(_book: Workbook, _command: Command): CommandEffect {
return todo();
}
/** 빈 통합문서 — 시트 하나(`s1` · 이름은 부른 쪽) · 서식 [{}] */
export function emptyWorkbook(_column: string, _sheetName: string): Workbook {
return todo();
}
export function emptySheet(_id: string, _name: string): Sheet {
return todo();
}
/** 안 쓰는 서식을 빼고 번호를 다시 매김 — 저장 직전(되돌리기 짝은 안 만듦) */
export function compactStyles(_book: Workbook): void {
return todo();
}