typescript on both client and server with communication via socket.io
This commit is contained in:
19
types/index.ts
Normal file
19
types/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export interface CardImage {
|
||||
id: string;
|
||||
back: boolean;
|
||||
face: boolean;
|
||||
joker: boolean;
|
||||
suit: 'Clubs' | 'Diamonds' | 'Hearts' | 'Spades' | null;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface GameCard extends CardImage {
|
||||
flipped: boolean;
|
||||
}
|
||||
|
||||
export interface GameState {
|
||||
id: string;
|
||||
players: Set<string>;
|
||||
cards: GameCard[];
|
||||
lastUpdated: number;
|
||||
}
|
||||
Reference in New Issue
Block a user