2024-09-25 20:15:10 +00:00
|
|
|
export type MessageKind = "hello" | "update" | "endgame" | "reset";
|
2024-09-04 12:25:37 +00:00
|
|
|
|
|
|
|
export interface Message {
|
2024-09-25 11:40:22 +00:00
|
|
|
kind: MessageKind,
|
2024-09-25 20:15:10 +00:00
|
|
|
data: Response | Hello | EndGame | Reset,
|
2024-09-04 12:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Request {
|
2024-09-25 11:40:22 +00:00
|
|
|
x: number,
|
|
|
|
y: number
|
2024-09-04 12:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
2024-09-25 11:40:22 +00:00
|
|
|
last: { x: number, y: number, symbol: "x" | "o" }
|
2024-09-04 12:25:37 +00:00
|
|
|
}
|
|
|
|
|
2024-09-08 10:05:02 +00:00
|
|
|
export interface Hello {
|
2024-09-25 09:58:56 +00:00
|
|
|
id: number,
|
2024-09-25 11:40:22 +00:00
|
|
|
symbol: "x" | "o"
|
2024-09-08 10:05:02 +00:00
|
|
|
}
|
|
|
|
|
2024-09-09 12:09:00 +00:00
|
|
|
export interface EndGame {
|
|
|
|
issue: "win" | "lose" | "draw"
|
|
|
|
}
|
2024-09-25 20:15:10 +00:00
|
|
|
|
|
|
|
type Reset = undefined;
|
|
|
|
|