mirror of
https://github.com/sern-handler/tools
synced 2026-06-27 02:02:22 +00:00
20 lines
420 B
TypeScript
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 // ??
|
|
|