/* ============================================================================= * 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(); }