feat(m01-lb): 로직 만들기 판 Api 타입 · 함수 머리 올림

- LbTables · LbTableUser · LbTable
- lbCalcLater · tableUsers · fetchLbTable 머리(몸은 다음 커밋)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
This commit is contained in:
2026-10-01 11:40:55 +09:00
co-authored by Claude Opus 5.5
parent d1c99b4794
commit c20db1b64e
+46
View File
@@ -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<string, unknown>;
/** 표를 쓰는 로직 한 줄 — `via` = 표 「용도」 에 적힘 · 로직 글에 표 키가 있음 · 둘 다 */
export interface LbTableUser {
key: string;
이름: string;
via: "용도" | "글" | "둘";
}
/** 표 한 벌 — `file` · `version` 은 표가 든 파일 */
export interface LbTable {
file: string;
version: string;
table: Record<string, unknown> & { 줄: Record<string, unknown>[] };
}
const notReady = (): never => {
throw new Error("준비 중");
};
/** 0.3초 뒤 고친 표로 서버 계산 · 최신 응답만 `onDone` · 멈춤 · 실패는 `plain` 쉬운 말 */
export function lbCalcLater(
_row: LogicRow,
_inputs: Record<string, unknown>,
_tables: LbTables,
_onDone: (ans: CalcAnswer | null, plain: string | null) => void,
): void {
notReady();
}
export async function tableUsers(_key: string): Promise<LbTableUser[]> {
return notReady();
}
export async function fetchLbTable(_key: string): Promise<LbTable> {
return notReady();
}