1
0
mirror of https://github.com/thib8956/tic-tac-toe-ws.git synced 2024-11-17 01:16:33 +00:00
tic-tac-toe-ws/common.mts

24 lines
351 B
TypeScript
Raw Normal View History

2024-09-09 12:09:00 +00:00
export type MessageKind = "hello" | "update" | "endgame";
export interface Message {
kind: MessageKind,
2024-09-09 12:09:00 +00:00
data: Response | Hello | EndGame,
}
export interface Request {
x: number,
y: number
}
export interface Response {
grid: number[]
}
2024-09-08 10:05:02 +00:00
export interface Hello {
id: number
}
2024-09-09 12:09:00 +00:00
export interface EndGame {
issue: "win" | "lose" | "draw"
}