mirror of
https://github.com/thib8956/tic-tac-toe-ws.git
synced 2024-11-17 01:16:33 +00:00
25 lines
371 B
TypeScript
25 lines
371 B
TypeScript
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[]
|
|
}
|
|
|
|
export interface Hello {
|
|
id: number,
|
|
symbol: "x" | "o"
|
|
}
|
|
|
|
export interface EndGame {
|
|
issue: "win" | "lose" | "draw"
|
|
}
|