From b126957b979c0d7749889fcd0173181a2a5d98e3 Mon Sep 17 00:00:00 2001 From: Deveshi Dwivedi Date: Fri, 21 Jun 2024 20:52:10 +0530 Subject: [PATCH] add more room events --- common/types/global.d.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/common/types/global.d.ts b/common/types/global.d.ts index 2015d20..7d548ab 100644 --- a/common/types/global.d.ts +++ b/common/types/global.d.ts @@ -12,17 +12,23 @@ export declare global { type Room =Map; interface ServerToClientEvents { - joined:(room :string) => void; + room: (room: string)=> void; + created: (roomId: string) => void; + joined:(roomId :string, failed?:boolean) => void; user_draw: (move: Move, userId: string) => void; user_undo(userId: string): void; - mouse_moved: (x:number, y:number, socketId: string) => void; - users_in_room: (socketIds: string[]) => void; - user_disconnected: (socketId: string) => void; + mouse_moved: (x:number, y:number, userId: string) => void; + new_user: (userId: string) => void; + user_disconnected: (userId: string) => void; } interface ClientToServerEvents { draw: (move: Move) => void; mouse_move: (x:number, y:number) => void; undo: () => void; + create_room: () => void; + join_room: (room: string) => void; + joined_room: () => void; + leave_room: () => void; } } \ No newline at end of file