export interface TrackInfo { id: string; track_number?: number; duration?: number; name?: string; album?: string; artist?: string; } export const getTracks = (): Promise => fetch("/api/v1/tracks").then((r) => r.json()); export const playTrack = (id: string): Promise => fetch("/api/v1/play", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ id: id }), });