This repository has been archived on 2026-07-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
servicepoint-tanks/tank-frontend/src/serverCalls.tsx
2024-04-29 12:51:58 +02:00

16 lines
423 B
TypeScript

export function makeApiUrl(path: string, protocol: 'http' | 'ws' = 'http') {
return new URL(`${protocol}://${window.location.hostname}${path}`);
}
export type Scores = {
readonly kills: number;
readonly deaths: number;
readonly wallsDestroyed: number;
readonly shotsFired: number;
readonly overallScore: number;
};
export type Player = {
readonly name: string;
readonly scores: Scores;
};