Skip to content

Commit

Permalink
types: Add type for JOIN_GAME event.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuv2707 committed Jun 12, 2024
1 parent af69bc7 commit a7f8834
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type EventResult = {
message: string;
};

type GameEventType = 'DRAW_CARD' | 'THROW_CARD';
type GameEventType = 'DRAW_CARD' | 'THROW_CARD' | 'JOIN_GAME';

type GameEvent =
| {
Expand All @@ -43,6 +43,11 @@ type GameEvent =
data: {
cardId: string;
};
}
| {
type: 'JOIN_GAME';
playerId: string;
data: null;
};

// Represent all the events that can be sent to the client
Expand Down

0 comments on commit a7f8834

Please sign in to comment.