mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-16 14:16:00 +01:00
equipment data
This commit is contained in:
1 parent
f95a6e3495
commit
c45af8e156
8 files changed
+70
-34
No files matched your search
@@ -2,13 +2,16 @@ import { fetchPB } from "@blitzkit/core";
|
||||
import type { Strings } from "@blitzkit/i18n";
|
||||
import { Avatars } from "@protos/avatars";
|
||||
import { TankUpgradePricePresetComponent } from "@protos/blitz_static_tank_upgrade_price_preset_component";
|
||||
import { Equipment } from "@protos/equipment";
|
||||
import { PopularTanks } from "@protos/popular_tanks";
|
||||
import { TankList } from "@protos/tank_list";
|
||||
import { Tanks } from "@protos/tanks";
|
||||
import { Tiers } from "@protos/tiers";
|
||||
import { AbstractAPI, Cache } from "./abstract";
|
||||
|
||||
const rejected = Promise.reject("Not implemented on client");
|
||||
function rejected() {
|
||||
return Promise.reject("Not implemented on client");
|
||||
}
|
||||
|
||||
export class ClientAPI extends AbstractAPI {
|
||||
get metadata(): never {
|
||||
@@ -49,6 +52,11 @@ export class ClientAPI extends AbstractAPI {
|
||||
return fetchPB("/api/tiers.pb", Tiers);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
equipment() {
|
||||
return fetchPB("/api/equipment.pb", Equipment);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
async strings(locale: string) {
|
||||
const response = await fetch(`/api/strings/${locale}.json`);
|
||||
@@ -59,7 +67,7 @@ export class ClientAPI extends AbstractAPI {
|
||||
|
||||
@UnimplementedOnClient
|
||||
gameStrings() {
|
||||
return rejected;
|
||||
return rejected();
|
||||
}
|
||||
|
||||
@Cache()
|
||||
@@ -72,12 +80,12 @@ export class ClientAPI extends AbstractAPI {
|
||||
|
||||
@UnimplementedOnClient
|
||||
gameStringGroups() {
|
||||
return rejected;
|
||||
return rejected();
|
||||
}
|
||||
|
||||
@UnimplementedOnClient
|
||||
avatar() {
|
||||
return rejected;
|
||||
return rejected();
|
||||
}
|
||||
|
||||
avatars() {
|
||||
@@ -86,17 +94,22 @@ export class ClientAPI extends AbstractAPI {
|
||||
|
||||
@UnimplementedOnClient
|
||||
avatarList() {
|
||||
return rejected;
|
||||
return rejected();
|
||||
}
|
||||
|
||||
@UnimplementedOnClient
|
||||
background() {
|
||||
return rejected;
|
||||
return rejected();
|
||||
}
|
||||
|
||||
@UnimplementedOnClient
|
||||
backgrounds() {
|
||||
return rejected;
|
||||
return rejected();
|
||||
}
|
||||
|
||||
@UnimplementedOnClient
|
||||
currencyIcon() {
|
||||
return rejected();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user