From 7de503a48705133409e102db766242c2a141adba Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 8 Mar 2026 21:48:22 +0000 Subject: [PATCH] refactor: explicit return types on all public functions Co-Authored-By: Claude Opus 4.6 --- server/src/engine/queue.ts | 2 +- server/src/engine/ranked-queue.ts | 2 +- server/src/engine/tournaments.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/engine/queue.ts b/server/src/engine/queue.ts index 2b72021..fe9d537 100644 --- a/server/src/engine/queue.ts +++ b/server/src/engine/queue.ts @@ -25,7 +25,7 @@ const QUEUE_TIMEOUT_MS = Number(process.env.QUEUE_TIMEOUT_MS) || (process.env.NO const fightCooldowns = new Map() const COOLDOWN_MS = 15_000 -export function setCooldown(botId: string) { +export function setCooldown(botId: string): void { fightCooldowns.set(botId, Date.now() + COOLDOWN_MS) } diff --git a/server/src/engine/ranked-queue.ts b/server/src/engine/ranked-queue.ts index 18eba33..f76031c 100644 --- a/server/src/engine/ranked-queue.ts +++ b/server/src/engine/ranked-queue.ts @@ -22,7 +22,7 @@ const RANKED_TIMEOUT_MS = 60_000 const rankedCooldowns = new Map() const COOLDOWN_MS = 15_000 -export function setRankedCooldown(botId: string) { +export function setRankedCooldown(botId: string): void { rankedCooldowns.set(botId, Date.now() + COOLDOWN_MS) } diff --git a/server/src/engine/tournaments.ts b/server/src/engine/tournaments.ts index c82ba73..2adca31 100644 --- a/server/src/engine/tournaments.ts +++ b/server/src/engine/tournaments.ts @@ -348,7 +348,7 @@ export function getTournamentBracket(tournamentId: string): TournamentBracket | } /** List tournaments with optional status filter */ -export function listTournaments(status?: 'open' | 'active' | 'finished') { +export function listTournaments(status?: 'open' | 'active' | 'finished'): typeof schema.tournaments.$inferSelect[] { if (status) { return db.select().from(schema.tournaments) .where(eq(schema.tournaments.status, status)) @@ -358,7 +358,7 @@ export function listTournaments(status?: 'open' | 'active' | 'finished') { } /** Get pending tournament matches that need fights scheduled */ -export function getPendingMatches(tournamentId: string) { +export function getPendingMatches(tournamentId: string): typeof schema.tournamentMatches.$inferSelect[] { return db.select().from(schema.tournamentMatches) .where(and( eq(schema.tournamentMatches.tournamentId, tournamentId),