import { fetchPB } from "@blitzkit/core"; import type { Strings } from "@blitzkit/i18n"; import { Avatars } from "../../protos/avatars"; import { AbstractAPI } from "./abstract"; //@ts-expect-error export class ClientAPI extends AbstractAPI { protected _avatars() { return fetchPB("/api/avatars/all.pb", Avatars); } protected _gameStrings(): Promise> { throw new Error("Cannot fetch full game strings on client"); } protected async _groupedGameStrings(locale: string, group: string) { const response = await fetch(`/api/game-strings/${locale}/${group}.json`); const json = (await response.json()) as Record; return json; } protected async _strings(locale: string) { const response = await fetch(`/api/strings/${locale}.json`); const json = (await response.json()) as Strings; return json; } }