diff --git a/src/types/client_data.d.ts b/src/types/client_data.d.ts new file mode 100644 index 0000000..49d6f5a --- /dev/null +++ b/src/types/client_data.d.ts @@ -0,0 +1,26 @@ +interface response { + success: boolean; + message?: string; +} + +interface HostInformation extends response { + // properties depend on `success` being `true` + game_code?: string; + players?: string[]; +} + +// Event is only emitted when the JoinGame event is successful, so there is no +// success indicator in this response +interface NewPlayer { + player: string; +} + +interface GameJoined extends response { + // properties depend on `success` being `true` + players: string[]; +} + +interface PlayerListResponse extends response { + // properties depend on `success` being `true` + players: string[] +} \ No newline at end of file