Introduce interface types for events for lobby creation and joining
parent
dc24f62f64
commit
03c51e1d34
|
|
@ -0,0 +1,5 @@
|
||||||
|
export enum ClientEvent {
|
||||||
|
CREATE_LOBBY = "create-lobby",
|
||||||
|
JOIN_LOBBY = "join-lobby",
|
||||||
|
START_GAME = "start-game"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export type CreateLobbyEvent = {
|
||||||
|
userName: string;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export type JoinLobbyEvent = {
|
||||||
|
userName: string;
|
||||||
|
lobbyId: string;
|
||||||
|
}
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export enum ServerError {
|
||||||
|
CREATE_LOBBY_ERROR = "create-lobby-error",
|
||||||
|
JOIN_LOBBY_ERROR = "join-lobby-error"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export enum ServerEvent {
|
||||||
|
LOBBY_UPDATE = "lobby-update",
|
||||||
|
START_ROUND = "start-round"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue