(event: VDomEvent)
| 281 | } |
| 282 | |
| 283 | async function sendTermInputEvent(event: VDomEvent) { |
| 284 | const response = await fetch("/api/terminput", { |
| 285 | method: "POST", |
| 286 | headers: { |
| 287 | "Content-Type": "application/json", |
| 288 | }, |
| 289 | body: JSON.stringify(event), |
| 290 | }); |
| 291 | if (!response.ok) { |
| 292 | throw new Error(`terminal input request failed: ${response.status} ${response.statusText}`); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | function WaveTerm({ elem, model }: { elem: VDomElem; model: TsunamiModel }) { |
| 297 | const props = useVDom(model, elem); |