diff --git a/M01_MasterData/LogicBuilder/M01_LB_Api.ts b/M01_MasterData/LogicBuilder/M01_LB_Api.ts new file mode 100644 index 000000000..0095a909a --- /dev/null +++ b/M01_MasterData/LogicBuilder/M01_LB_Api.ts @@ -0,0 +1,46 @@ +/* ============================================================================= + * M01_LB_Api.ts + * 로직 만들기 판 Api — 고친 표로 예시값 계산(0.3초 · 최신만) · 표를 쓰는 로직(사용처) · 표 읽기 + * 서버 = `M01_LB_Calc.py`(`/api/m01/lb/*`) · 모양은 `docs/raw/M01_쉬운단가/로직판_A_정함.md` 「맞출 모양」 + * ========================================================================== */ + +import type { CalcAnswer, LogicRow } from "../M01_MasterData_UI_Logic_Api"; + +/** 표 키 → 표 사본(고친 값 포함 · 표 통째) — 서버가 메모리에서만 바꿔 끼움 */ +export type LbTables = Record; + +/** 표를 쓰는 로직 한 줄 — `via` = 표 「용도」 에 적힘 · 로직 글에 표 키가 있음 · 둘 다 */ +export interface LbTableUser { + key: string; + 이름: string; + via: "용도" | "글" | "둘"; +} + +/** 표 한 벌 — `file` · `version` 은 표가 든 파일 */ +export interface LbTable { + file: string; + version: string; + table: Record & { 줄: Record[] }; +} + +const notReady = (): never => { + throw new Error("준비 중"); +}; + +/** 0.3초 뒤 고친 표로 서버 계산 · 최신 응답만 `onDone` · 멈춤 · 실패는 `plain` 쉬운 말 */ +export function lbCalcLater( + _row: LogicRow, + _inputs: Record, + _tables: LbTables, + _onDone: (ans: CalcAnswer | null, plain: string | null) => void, +): void { + notReady(); +} + +export async function tableUsers(_key: string): Promise { + return notReady(); +} + +export async function fetchLbTable(_key: string): Promise { + return notReady(); +}