mirror of
https://github.com/thib8956/tic-tac-toe-ws.git
synced 2025-08-24 00:11:56 +00:00
rename mts to ts
This commit is contained in:
25
common.ts
Normal file
25
common.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export type MessageKind = "hello" | "update" | "endgame";
|
||||
|
||||
export interface Message {
|
||||
kind: MessageKind,
|
||||
data: Response | Hello | EndGame,
|
||||
}
|
||||
|
||||
export interface Request {
|
||||
x: number,
|
||||
y: number
|
||||
}
|
||||
|
||||
export interface Response {
|
||||
grid: number[],
|
||||
last: { x: number, y: number, symbol: "x" | "o" }
|
||||
}
|
||||
|
||||
export interface Hello {
|
||||
id: number,
|
||||
symbol: "x" | "o"
|
||||
}
|
||||
|
||||
export interface EndGame {
|
||||
issue: "win" | "lose" | "draw"
|
||||
}
|
Reference in New Issue
Block a user