(url: string)
| 62 | } |
| 63 | |
| 64 | async function getJson<T>(url: string): Promise<T> { |
| 65 | const res = await fetch(url) |
| 66 | if (!res.ok) throw new Error(`HTTP ${res.status}`) |
| 67 | return res.json() |
| 68 | } |
| 69 | |
| 70 | export const simulatorApi = { |
| 71 | listUtas: () => getJson<{ utas: SimulatorUTAEntry[] }>('/api/simulator/utas'), |