mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
update (2)
This commit is contained in:
1 parent
32a7db238b
commit
d41d45abae
14 files changed
+19
-120
No files matched your search
@@ -1,7 +0,0 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { ConsumableDefinitions } from '../protos';
|
||||
import { asset } from './asset';
|
||||
|
||||
export function fetchConsumableDefinitions() {
|
||||
return fetchPB(asset('definitions/consumables.pb'), ConsumableDefinitions);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { asset } from './asset';
|
||||
import { staticAsset } from "@blitzkit/core";
|
||||
|
||||
export interface DiscoveredIdsDefinitions {
|
||||
time: number;
|
||||
@@ -7,6 +7,6 @@ export interface DiscoveredIdsDefinitions {
|
||||
}
|
||||
|
||||
export async function fetchDiscoveredIdsDefinitions() {
|
||||
const response = await fetch(asset('ids/manifest.json'));
|
||||
const response = await fetch(staticAsset("ids/manifest.json"));
|
||||
return response.json() as Promise<DiscoveredIdsDefinitions>;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { EquipmentDefinitions } from '../protos';
|
||||
import { asset } from './asset';
|
||||
|
||||
export function fetchEquipmentDefinitions() {
|
||||
return fetchPB(asset('definitions/equipment.pb'), EquipmentDefinitions);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { Gallery } from '../protos';
|
||||
import { asset } from './asset';
|
||||
|
||||
export function fetchGallery() {
|
||||
return fetchPB(asset('definitions/gallery.pb'), Gallery);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import type { Region } from "../blitz/regions";
|
||||
import { RatingLeaderboard } from "../protos";
|
||||
import { asset } from "./asset";
|
||||
|
||||
const cache: Record<Region, Record<number, RatingLeaderboard>> = {
|
||||
asia: {},
|
||||
eu: {},
|
||||
com: {},
|
||||
};
|
||||
|
||||
export async function getArchivedRatingLeaderboard(
|
||||
region: Region,
|
||||
season: number
|
||||
) {
|
||||
if (!cache[region][season]) {
|
||||
const info = await fetch(asset(`regions/${region}/rating/${season}.pb`))
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) => RatingLeaderboard.decode(new Uint8Array(buffer)));
|
||||
cache[region][season] = info;
|
||||
}
|
||||
|
||||
return cache[region][season];
|
||||
}
|
||||
@@ -1,51 +1,33 @@
|
||||
export * from "./api";
|
||||
export * from "./assertSecret";
|
||||
export * from "./availableProvisions";
|
||||
export * from "./averageDefinitions";
|
||||
// export * from './camouflageDefinitions';
|
||||
// export * from './checkConsumableProvisionInclusivity';
|
||||
export * from "./coefficient";
|
||||
export * from "./consumableDefinitions";
|
||||
// export * from './context';
|
||||
export * from "./api";
|
||||
export * from "./createDefaultProvisions";
|
||||
export * from "./createDefaultSkills";
|
||||
export * from "./degressiveStat";
|
||||
export * from "./discoveredIdDefinitions";
|
||||
export * from "./emblemURL";
|
||||
export * from "./equipmentDefinitions";
|
||||
export * from "./eventManager";
|
||||
export * from "./getArchivedLatestSeasonNumber";
|
||||
export * from "./sluggify";
|
||||
export * from "./staticAsset";
|
||||
export * from "./vfs";
|
||||
// export * from './getArchivedRatingInfo';
|
||||
export * from "./getArchivedRatingLeaderboard";
|
||||
// export * from './getArchivedRatingMidnightLeaderboard';
|
||||
export * from "./getTimeDaysAgo";
|
||||
export * from "./isExplosive";
|
||||
export * from "./mapDefinitions";
|
||||
export * from "./modelDefinitions";
|
||||
export * from "./metaSortTank";
|
||||
export * from "./normalizeBoundingBox";
|
||||
// export * from './parseBkni';
|
||||
// export * from './patientFetch';
|
||||
export * from "./patientFetchJSON";
|
||||
export * from "./popularTanks";
|
||||
export * from "./progressiveStat";
|
||||
export * from "./provisionDefinitions";
|
||||
export * from "./resolveDpm";
|
||||
export * from "./resolvePenetrationCoefficient";
|
||||
export * from "./reviews";
|
||||
export * from "./skillDefinitions";
|
||||
export * from "./romanize";
|
||||
export * from "./sluggify";
|
||||
export * from "./staticAsset";
|
||||
export * from "./sum";
|
||||
export * from "./tankDefinitions";
|
||||
export * from "./tankIcon";
|
||||
export * from "./tankNames";
|
||||
export * from "./unionBoundingBox";
|
||||
export * from "./uniqueGuns";
|
||||
export * from "./unwrapBlitzkitResponse";
|
||||
export * from "./vfs";
|
||||
export * from "./votes";
|
||||
// export * from './withCORSProxy';
|
||||
export * from "./createDefaultProvisions";
|
||||
export * from "./gallery";
|
||||
export * from "./metaSortTank";
|
||||
export * from "./popularTanks";
|
||||
export * from "./romanize";
|
||||
export * from "./youtubers";
|
||||
@@ -1,7 +0,0 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { MapDefinitions } from '../protos';
|
||||
import { asset } from './asset';
|
||||
|
||||
export function fetchMapDefinitions() {
|
||||
return fetchPB(asset('definitions/maps.pb'), MapDefinitions);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { ModelDefinitions } from '../protos';
|
||||
import { asset } from './asset';
|
||||
|
||||
export function fetchModelDefinitions() {
|
||||
return fetchPB(asset('definitions/models.pb'), ModelDefinitions);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { PopularTanks } from '../protos';
|
||||
import { asset } from './asset';
|
||||
import { staticAsset } from "@blitzkit/core";
|
||||
import { fetchPB } from "../protobuf";
|
||||
import { PopularTanks } from "../protos";
|
||||
|
||||
export function fetchPopularTanks() {
|
||||
return fetchPB(asset('definitions/popular-tanks.pb'), PopularTanks);
|
||||
return fetchPB(staticAsset("definitions/popular-tanks.pb"), PopularTanks);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { ProvisionDefinitions } from '../protos';
|
||||
import { asset } from './asset';
|
||||
|
||||
export function fetchProvisionDefinitions() {
|
||||
return fetchPB(asset('definitions/provisions.pb'), ProvisionDefinitions);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { Reviews } from '../protos';
|
||||
import { asset } from './asset';
|
||||
import { staticAsset } from "@blitzkit/core";
|
||||
import { fetchPB } from "../protobuf";
|
||||
import { Reviews } from "../protos";
|
||||
|
||||
export function fetchReviews() {
|
||||
return fetchPB(asset('definitions/reviews.pb'), Reviews);
|
||||
return fetchPB(staticAsset("definitions/reviews.pb"), Reviews);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { fetchPB } from '../protobuf';
|
||||
import { SkillDefinitions } from '../protos';
|
||||
import { asset } from './asset';
|
||||
|
||||
export function fetchSkillDefinitions() {
|
||||
return fetchPB(asset('definitions/skills.pb'), SkillDefinitions);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { fetchPB } from '../../protobuf';
|
||||
import { TankDefinitions } from '../../protos';
|
||||
import { asset } from '../asset';
|
||||
|
||||
export function fetchTankDefinitions() {
|
||||
return fetchPB(asset('definitions/tanks.pb'), TankDefinitions);
|
||||
}
|
||||
|
||||
export * from './constants';
|
||||
@@ -1,7 +1,5 @@
|
||||
import { asset } from "./asset";
|
||||
|
||||
export const BLITZKIT_TANK_ICON_SIZE = { width: 40 * 16, height: 30 * 16 };
|
||||
|
||||
export function tankIcon(id: number, size: "big" | "small" = "big") {
|
||||
return asset(`icons/tanks/${size}/${id}.webp`);
|
||||
return `/api/tanks/${id}/icons/${size}.webp`;
|
||||
}
|
||||
Reference in new issue
Block a user