import { apiFetch } from './client'; import type { TelemetrySnapshot, CombatStatsMessage, ServerHealth } from '../types'; interface LiveResponse { players: TelemetrySnapshot[]; } interface CombatStatsResponse { stats: CombatStatsMessage[]; } // v1 response shapes: /total-rares → { all_time, today }, /total-kills → { total } interface RaresResponse { all_time: number; today: number; } interface KillsResponse { total: number; } export const getLive = () => apiFetch('/live'); export const getCombatStats = () => apiFetch('/combat-stats'); export const getServerHealth = () => apiFetch('/server-health'); export const getTotalRares = () => apiFetch('/total-rares'); export const getTotalKills = () => apiFetch('/total-kills'); export const getCharacterStats = (name: string) => apiFetch>(`/character-stats/${encodeURIComponent(name)}`);