servicepoint-tanks/tank-frontend/src/serverCalls.tsx

17 lines
423 B
TypeScript
Raw Normal View History

2024-04-21 14:34:45 +02:00
export function makeApiUrl(path: string, protocol: 'http' | 'ws' = 'http') {
2024-04-22 21:26:46 +02:00
return new URL(`${protocol}://${window.location.hostname}${path}`);
2024-04-21 14:34:45 +02:00
}
2024-04-22 19:03:07 +02:00
export type Scores = {
readonly kills: number;
readonly deaths: number;
readonly wallsDestroyed: number;
2024-04-22 21:26:46 +02:00
readonly shotsFired: number;
readonly overallScore: number;
2024-04-22 19:03:07 +02:00
};
export type Player = {
2024-04-13 17:56:33 +02:00
readonly name: string;
2024-04-22 19:03:07 +02:00
readonly scores: Scores;
};