export interface TimeControl { type: 'untimed' | 'correspondence' | 'clock'; initialSeconds?: number; incrementSeconds?: number; moveTimeLimitSeconds?: number; } export interface GameRecord { [key: string]: unknown; $type: 'blue.checkmate.game'; pgn: string; createdAt: string; white?: string; black?: string; status: 'waiting' | 'active' | 'completed' | 'abandoned'; result?: '1-0' | '0-1' | '1/2-1/2'; resultReason?: 'checkmate' | 'resignation' | 'agreement' | 'stalemate' | 'insufficient' | 'repetition' | 'fifty_moves' | 'abandonment'; lastMoveAt?: string; parentGameUri?: string; drawOffered?: boolean; variant?: 'standard' | 'really-bad-chess' | 'chess960'; timeControl?: TimeControl; moveTimes?: number[]; } export interface ChallengeRecord { [key: string]: unknown; $type: 'blue.checkmate.challenge'; createdAt: string; opponent?: string; gameUri?: string; status: 'open' | 'accepted' | 'expired' | 'cancelled'; variant?: 'standard' | 'really-bad-chess' | 'chess960'; } export interface ChallengeStatusRecord { [key: string]: unknown; $type: 'blue.checkmate.challenge.status'; game: string; challenge?: string; status: 'declined'; createdAt: string; } export type PlayerColor = 'white' | 'black'; export type ApplyMoveResult = 'applied' | 'stale' | 'invalid' | 'mismatch'; export type GameResult = NonNullable; export type ResultReason = NonNullable;