-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
57 lines (53 loc) · 1.1 KB
/
Copy pathtypes.ts
File metadata and controls
57 lines (53 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { Color, PieceSymbol, Square } from "chess.js";
export type ChessPage = {
type: 'one',
games: [Game],
} | {
type: 'three',
games: [Game]
| [Game, Game]
| [Game, Game, Game],
} | {
type: 'six',
games: [Game]
| [Game, Game]
| [Game, Game, Game]
| [Game, Game, Game, Game]
| [Game, Game, Game, Game, Game]
| [Game, Game, Game, Game, Game, Game],
}
export type User = {
name: string,
rating: number,
ratingProvisional: boolean
title?: string,
};
export type Game = {
id: string,
white: User,
black: User,
board: {
grid: ({
square: Square;
type: PieceSymbol;
color: Color;
} | null)[][],
ply: number,
turn: Color,
},
moves: string,
movesCount: number,
analysis?: {
eval: number,
type?: 'mistake' /** ? */ | 'blunder' /** ?? */ | 'inaccuracy' /** ?! */
}[]
};
export type Settings = {
pageSize: "A4" | "A5";
color: "all" | "white" | "black";
result: "all" | "wins" | "draws" | "losses";
gameType: string;
rated: "all" | "rated" | "unrated";
analysed: "all" | "only";
dateRange: "all" | "last-month" | "last-year";
};