Files
QuizMaster/types.ts
T
Philip 7cdd75ea83 feat: Initialize QuizMaster Live project
This commit sets up the foundational structure for the QuizMaster Live application. It includes:
- Initializing a new Vite project with React and TypeScript.
- Configuring project dependencies and build tools (Vite, TypeScript).
- Defining core application types for game state, players, questions, etc.
- Setting up basic Tailwind CSS for styling and defining custom animations.
- Integrating with the Google Gemini API for AI-powered question generation.
- Configuring environment variables for API keys and defining the application's metadata.
- Adding a README with setup instructions and local development guide.
2026-01-28 17:11:29 -08:00

67 lines
1.3 KiB
TypeScript

export enum GamePhase {
LOBBY = 'LOBBY',
COUNTDOWN = 'COUNTDOWN',
QUESTION_DISPLAY = 'QUESTION_DISPLAY',
BUZZER_OPEN = 'BUZZER_OPEN',
ADJUDICATION = 'ADJUDICATION',
ANSWER_REVEAL = 'ANSWER_REVEAL',
LEADERBOARD = 'LEADERBOARD',
FINAL_STATS = 'FINAL_STATS'
}
export interface PlayerStats {
correctAnswers: number;
totalBuzzes: number;
bestReactionTime: number | null; // in ms
}
export interface Player {
id: string;
name: string;
teamId?: string;
score: number;
isApproved: boolean;
buzzerTimestamp?: number; // MS timestamp of when they buzzed
stats: PlayerStats;
}
export interface Team {
id: string;
name: string;
score: number;
}
export interface Question {
id: string;
text: string;
answer: string;
points: number;
category?: string;
mediaUrl?: string;
mediaType?: 'image' | 'video';
audioUrl?: string;
audioStart?: number;
audioEnd?: number;
}
export interface Game {
id: string;
name: string;
description?: string;
createdAt: number;
questions: Question[];
}
export interface BuzzerLog {
playerId: string;
timestamp: number;
order: number;
status: 'PENDING' | 'CORRECT' | 'WRONG';
}
export interface GameState {
phase: GamePhase;
currentQuestionIndex: number;
countdownValue: number;
buzzerOpenTimestamp: number | null; // To calculate reaction time
}