mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: some more type prefixes
This commit is contained in:
1 parent
0d8cb5c1ae
commit
26304fc281
71 files changed
+411
-409
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { calculateWN8 } from '../calculateWN8';
|
||||
import { calculateWN8 } from "../calculateWN8";
|
||||
import {
|
||||
BlitzkitStats,
|
||||
CompositeStats,
|
||||
type BlitzkitStats,
|
||||
type CompositeStats,
|
||||
compositeStatsFormatting,
|
||||
CompositeStatsKey,
|
||||
} from './constants';
|
||||
type CompositeStatsKey,
|
||||
} from "./constants";
|
||||
|
||||
export function compositeStats(stats: BlitzkitStats, average: BlitzkitStats) {
|
||||
return {
|
||||
@@ -52,9 +52,9 @@ export function compositeStats(stats: BlitzkitStats, average: BlitzkitStats) {
|
||||
export function formatCompositeStat(
|
||||
value: number,
|
||||
key: CompositeStatsKey,
|
||||
composite: CompositeStats,
|
||||
composite: CompositeStats
|
||||
) {
|
||||
if (composite.cumulative_battles === 0) return '--';
|
||||
if (composite.cumulative_battles === 0) return "--";
|
||||
|
||||
const formatting = compositeStatsFormatting[key];
|
||||
const resolvedValue = (formatting.coefficient ?? 1) * value;
|
||||
@@ -62,7 +62,7 @@ export function formatCompositeStat(
|
||||
formatting.localeFormat
|
||||
? Math.round(resolvedValue).toLocaleString()
|
||||
: resolvedValue.toFixed(formatting.fixed)
|
||||
}${formatting.unit ?? ''}`;
|
||||
}${formatting.unit ?? ""}`;
|
||||
}
|
||||
|
||||
export * from './constants';
|
||||
export * from "./constants";
|
||||
@@ -1,8 +1,8 @@
|
||||
import { IndividualTankStats, emptyIndividualTankStats } from '../types';
|
||||
import { type IndividualTankStats, emptyIndividualTankStats } from "../types";
|
||||
|
||||
export function deltaTankStats(
|
||||
tanksA: IndividualTankStats[],
|
||||
tanksB: IndividualTankStats[],
|
||||
tanksB: IndividualTankStats[]
|
||||
) {
|
||||
return tanksB
|
||||
.map((b) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { fetchTankDefinitions } from '../blitzkit';
|
||||
import { BlitzStats } from './compositeStats/constants';
|
||||
import type { BlitzStats } from './compositeStats/constants';
|
||||
|
||||
export async function getTierWeights(
|
||||
stats: Record<number, BlitzStats>,
|
||||
|
||||
Reference in new issue
Block a user