85 lines
1.4 KiB
TypeScript
85 lines
1.4 KiB
TypeScript
export type Role = 'player' | 'gamemaster' | 'admin'
|
|
|
|
export type Player = {
|
|
id: string
|
|
name: string
|
|
isIdle?: boolean
|
|
score: number
|
|
}
|
|
|
|
export type Players = Array<Player>
|
|
|
|
export type PlayerEdit = Player & {
|
|
authcode: string
|
|
}
|
|
|
|
export type PlayerInfo = PlayerEdit & {
|
|
created: number
|
|
lastLoggedIn: number
|
|
isPlaying: boolean
|
|
numQuotes: number
|
|
numQuotesPlayed: number
|
|
role: Role
|
|
}
|
|
|
|
export type Quote = {
|
|
id: string
|
|
quote: string
|
|
isPlayed: boolean
|
|
}
|
|
|
|
export type Quotes = Array<Quote>
|
|
|
|
export type Source = {
|
|
id: string
|
|
name: string
|
|
}
|
|
|
|
export type Sources = Array<Source>
|
|
|
|
export type Selections = {
|
|
[key: string]: boolean
|
|
}
|
|
|
|
export type RevelationVotes = {
|
|
[key: string]: Array<string>
|
|
}
|
|
|
|
export type RevelationSources = {
|
|
[key: string]: boolean
|
|
}
|
|
|
|
export type Revelation = {
|
|
votes: RevelationVotes
|
|
sources: RevelationSources
|
|
}
|
|
|
|
export type Round = {
|
|
quote: string
|
|
sources: Sources
|
|
selections: Selections
|
|
revelation: Revelation
|
|
}
|
|
|
|
export type Lang = 'de' | 'en'
|
|
|
|
export type State = 'idle' | 'collect' | 'ready-set' | 'play' | 'finish' | 'disabled'
|
|
|
|
export type GameInfo = {
|
|
id: string
|
|
name: string
|
|
lang: Lang
|
|
created: number
|
|
state: State
|
|
players: Array<PlayersExtended>
|
|
numQuotesLeft: number
|
|
numQuotesTotal: number
|
|
}
|
|
|
|
export type GameInfos = Array<GameInfo>
|
|
|
|
export type CreateGameStatus = {
|
|
status: string
|
|
authcode: string
|
|
}
|