Introduce interface types for events for lobby creation and joining

pull/9/head
MiguelMLorente 2024-11-17 16:34:21 +01:00
parent dc24f62f64
commit 03c51e1d34
6 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,5 @@
export enum ClientEvent {
CREATE_LOBBY = "create-lobby",
JOIN_LOBBY = "join-lobby",
START_GAME = "start-game"
}

View File

@ -0,0 +1,3 @@
export type CreateLobbyEvent = {
userName: string;
}

View File

@ -0,0 +1,4 @@
export type JoinLobbyEvent = {
userName: string;
lobbyId: string;
}

View File

@ -1 +1,6 @@
export * from "./constants/TrackType" export * from "./constants/TrackType";
export * from "./server-events/ServerError";
export * from "./server-events/ServerEvent";
export * from "./client-events/ClientEvent";
export * from "./client-events/CreateLobbyEvent";
export * from "./client-events/JoinLobbyEvent";

View File

@ -0,0 +1,4 @@
export enum ServerError {
CREATE_LOBBY_ERROR = "create-lobby-error",
JOIN_LOBBY_ERROR = "join-lobby-error"
}

View File

@ -0,0 +1,4 @@
export enum ServerEvent {
LOBBY_UPDATE = "lobby-update",
START_ROUND = "start-round"
}