Skip to content

Commit

Permalink
add more room events
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshidwivedi committed Jun 21, 2024
1 parent 33da425 commit b126957
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions common/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ export declare global {
type Room =Map<string, Move[]>;

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;
}
}

0 comments on commit b126957

Please sign in to comment.