-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
60 lines (52 loc) · 1.14 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { Server as NetServer, Socket } from "net";
import { NextApiResponse } from "next";
import { Server as SocketIOServer } from "socket.io";
type NextApiResponseServerIO = NextApiResponse & {
socket: Socket & {
server: NetServer & {
io: SocketIOServer;
};
};
};
type dictionaryType = "russian" | "english" | "russian-big";
type Lobby = {
id: string;
name: string;
maxPlayers: number;
players: Player[];
status: "waiting" | "playing";
dictionary: dictionaryType
host: string;
createdAt: string;
isPrivate: boolean;
lastGameStartedAt?: number;
lastGameEndedAt?: number;
currentTurn?: GameTurn;
words?: GameWords;
playersStatistics?: PlayerStatistics[];
gameStartedAt?: number;
};
type Player = {
username: string;
avatar: string;
};
type Message = {
username: string;
type: "text" | "server";
userType?: "default" | "host" | "developer" | "system";
avatar: string;
message: string;
lobbyId: string;
};
type GameTurn = {
username: string;
prompt: string;
};
type GameWords = {
wordsUsed: string[];
};
type PlayerStatistics = {
username: string;
lives: number;
wordsFound: number;
};