- 재료 요소 mode(fixed · choice · rule) · scope · rule{field · op · from} · default · slot
- 입력 갈래 logic + CfLogicRef{key · name · outputs · designs}
- 선 규칙 CfLink.rule — lookup · gate · scale · round · CfRound(func.output.round · output.round)
- 흐름 CfStep · CfDesign · traceBack · traceForward · designInputs · Eval CfBreak · breaks
- M02_DF_Rule.ts — ruleLabel · applyRule · applyRound (속은 준비 중)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBToTCGk5dqDKeXCEP3vhk
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
/* =============================================================================
|
|
* M02_DF_Rule.ts
|
|
* 선 규칙 · 끝수 → 엑셀 수식 — 우리 스프레드시트 엔진 한 벌로 셈 · 선 위 규칙 글(쉬운 말) · DOM 없음
|
|
* ========================================================================== */
|
|
|
|
import type { CfRound, CfRule } from "./M02_DF_Model";
|
|
|
|
/** 규칙을 지난 값 — 통과 안 됨 · 표에 없는 조건 · 둘 이상 맞음은 value null + why */
|
|
export interface CfRuleResult {
|
|
value: number | string | boolean | null;
|
|
why: "통과 안 됨" | "표에 없는 조건" | "표에 여럿 맞음" | "오류" | null;
|
|
/** 받는 칸에 들어갈 엑셀 수식(보이기 · 시험) */
|
|
formula: string;
|
|
}
|
|
|
|
/** 선 위에 늘 보일 규칙 글 */
|
|
export function ruleLabel(_rule: CfRule): string {
|
|
throw new Error("준비 중");
|
|
}
|
|
|
|
/** 규칙 적용 — value = 보낸 알약 값(표면 머리 줄 포함 칸 덩어리) · conds = 조건 알약 값(lookup · gate) */
|
|
export function applyRule(
|
|
_rule: CfRule,
|
|
_value: unknown,
|
|
_conds: Record<string, unknown> = {},
|
|
): CfRuleResult {
|
|
throw new Error("준비 중");
|
|
}
|
|
|
|
/** 끝수 적용 — 엔진 ROUND · ROUNDUP · ROUNDDOWN */
|
|
export function applyRound(_round: CfRound, _value: number): number {
|
|
throw new Error("준비 중");
|
|
}
|