api strings

This commit is contained in:
tresabhi committed 2026-09-22 16:38:30 -05:00
1 parent 99317c2075
commit 5f24887535
23 files changed
+132 -118

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
export async function fetchJSON<Type>(url: string) {
const response = await fetch(url);
const json = await response.json();
return json as Type;
}
+8
View File
@@ -0,0 +1,8 @@
import type { MessageFns } from "@blitzkit/protos/src/blitzkit";
export async function fetchPB<Type>(url: string, message: MessageFns<Type>) {
const response = await fetch(url);
const buffer = await response.arrayBuffer();
const array = new Uint8Array(buffer);
return message.decode(array);
}
+2
View File
@@ -0,0 +1,2 @@
export * from './fetchPB';
export * from './pbMap';