dataType.ts
782 Bytes
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
import {
Boolean,
Number,
String,
Literal,
Array,
Tuple,
Record,
Union,
Static,
} from "runtypes";
export const UserDataRecord = Record({
username: String,
});
export type UserData = Static<typeof UserDataRecord>;
/**
* 방 리스트에서 사용됩니다.
*/
export const RoomDescriptionRecord = Record({
uuid: String,
name: String,
currentUsers: Number,
maxUsers: Number,
});
export type RoomDescription = Static<typeof RoomDescriptionRecord>;
/**
* 방에 접속했을 때 사용됩니다.
*/
export const RoomInfoRecord = Record({
uuid: String,
name: String,
maxUsers: Number,
users: Array(UserDataRecord),
});
export type RoomInfo = Static<typeof RoomInfoRecord>;
export type Role = "drawer" | "guesser" | "winner" | "spectator";