Files
Aislo/M01_MasterData/SheetLogic/M01_SL_Eval.ts
T
eomsangdonandClaude Opus 5.5 ddaff8a6b8 feat(m01-sl): 시트 로직 Model · Eval 타입 · 함수 머리 올림
SheetLogic · SlNode · SlPill · SlEdge · SlOutside · SlKind · SlEnd · SlUserTable · SlValue · SlOutsideValue · SlEvalResult
newLogic · addNode · removeNode · connect · disconnect · setPill · removePill · outsideCells · applyOutside · evalLogic · checkLogic (속은 준비 중)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBToTCGk5dqDKeXCEP3vhk
2026-10-01 12:59:19 +09:00

50 lines
1.7 KiB
TypeScript

/* =============================================================================
* 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<string, Record<string, SlValue>>;
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();
}