Files
tools/packages/poster/test/spec.ts
Jacob Nguyen ea95995857 MORE
2023-12-13 14:23:17 -06:00

20 lines
420 B
TypeScript

import poster from '../dist/index.js';
import type { GlobalGetAll, GlobalPut, TypedResponse } from '../dts/index.js';
const send = poster.client("token", "appid");
const req = await send("global/get-all", {
}) as TypedResponse<GlobalPut>; //cast for full typed safety
if(poster.isOk<GlobalPut>(req)) {
req.json().then(s => s?.map(v => v.name))
}
const unhandled = await req.json();
unhandled // ??