refactor: eliminate any types across server and TTS worker
- app.ts: type serveFile context parameter as Hono Context - bets.ts: replace catch(err: any) with err: unknown + narrowing - fight-loop.ts: type pickMatchup style as union literal, replace as any casts with proper result type - tts-worker.ts: import KokoroTTS type, use ProgressInfo inference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1ca8a6feb0
commit
010e18fbd3
@@ -78,8 +78,8 @@ export async function startFightLoop(options: FightLoopOptions = {}): Promise<vo
|
||||
onRoundComplete({
|
||||
round: event.data.round as number,
|
||||
hp: event.data.hp as { a: number; b: number },
|
||||
challengeType: (event.data.result as any)?.challengeType || '',
|
||||
winnerId: (event.data.result as any)?.winnerId || null,
|
||||
challengeType: (event.data.result as { challengeType?: string } | undefined)?.challengeType || '',
|
||||
winnerId: (event.data.result as { winnerId?: string | null } | undefined)?.winnerId || null,
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -151,7 +151,7 @@ export async function startFightLoop(options: FightLoopOptions = {}): Promise<vo
|
||||
|
||||
function pickMatchup(
|
||||
bots: { id: string; eloRating: number; name: string; wins: number; losses: number }[],
|
||||
style: string,
|
||||
style: 'elo_close' | 'random' | 'mixed',
|
||||
fightNum: number,
|
||||
): [typeof bots[0], typeof bots[0]] {
|
||||
const sorted = [...bots].sort((a, b) => b.eloRating - a.eloRating)
|
||||
|
||||
Reference in New Issue
Block a user