/ tutorials / wave-acoustics
Sign in
tutorials / wave-acoustics
wave-acoustics / src / engine / types.ts
15 lines · 638 BBlameHistoryRaw
1// The contract between the app and the MATLAB layer.
2//
3// Every lab writes its controls into params.json and reads back out.json, so
4// the TypeScript side never needs to know more than "some JSON goes in, some
5// JSON comes out". Individual panels narrow the output to their own shape.
7/** NaN and +-Inf all cross the JSON boundary as null. */
8export type Num = number | null
10export type ParamValue = number | string | boolean | ParamValue[]
11export type Params = Record<string, ParamValue>
13export type RunResult<T> =
14 | { ok: true; data: T; output: string; ms: number }
15 | { ok: false; error: string; output: string; ms: number }
↑↓ move↵openescclose