/* ============================================================================= * M01_SL_Eval.ts * 시트 로직 화면 계산 — 바깥 값 넣기 → 우리 스프레드시트 엔진(브라우저) → 출력 알약 · 결과 읽기 · 검사 * 저장 때는 서버가 같은 엔진을 Node 로(정함 5) · DOM 없음 * ========================================================================== */ import type { SheetLogic, SlOutside } from "./M01_SL_Model"; /** 알약 값 — 수 · 글 · 참거짓 · 빈 칸 */ export type SlValue = number | string | boolean | null; /** 바깥 값 하나 — 표는 칸 덩어리(cell 이 왼위) */ export interface SlOutsideValue { node: string; cell: string; value: SlValue | SlValue[][]; } export interface SlEvalResult { /** 상자 id → 출력 알약 이름 → 값 */ pills: Record>; result: { 노무비: number | null; 재료비: number | null; 경비: number | null; 계: number | null }; /** 쉬운 말 */ errors: string[]; } const notReady = (): never => { throw new Error("준비 중"); }; /** 바깥 값 칸 목록 — 화면 · 서버가 이 칸에 값을 넣음 */ export function outsideCells(_sl: SheetLogic): SlOutside[] { return notReady(); } /** 바깥 값 넣기 — 새 시트 로직(받은 것은 안 바꿈) */ export function applyOutside(_sl: SheetLogic, _values: SlOutsideValue[]): SheetLogic { return notReady(); } /** 화면 계산 */ export function evalLogic(_sl: SheetLogic): SlEvalResult { return notReady(); } /** 검사 — 빈 입력 알약 · 순환 · 오류 칸(쉬운 말 목록) */ export function checkLogic(_sl: SheetLogic): string[] { return notReady(); }