-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
74 lines (65 loc) · 1.58 KB
/
types.d.ts
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
declare type Player = 'player1' | 'player2';
declare type Point = {
x: number;
y: number;
player?: Player;
};
declare type Play = {
x: number;
y: number;
player: Player;
};
declare type App = {
debug: boolean;
board: HTMLElement;
columns: HTMLElement;
size: HTMLElement;
gameOver: HTMLElement;
gameTie: HTMLElement;
gameStart: HTMLElement;
restartButtons: HTMLButtonElement[];
startButtons: HTMLButtonElement[];
buttons: HTMLButtonElement[];
spacesWrapper: HTMLElement[];
winMessage: HTMLElement;
nextChecker: HTMLElement;
column: HTMLElement[];
};
declare type State = {
setAiPlayers(...players: Player[]): void;
get debug(): boolean;
setDebug(): void;
get isPlayerAi(): boolean;
get plays(): Play[];
dropping(is: boolean): void;
get isDropping(): boolean;
get player(): Player;
togglePlayer(): void;
get playsLength(): number;
addPlay(play: Play): void;
at(index: number): Play;
getPlay(x: number, y: number): Play | null;
availableY(x: number): number | null;
reset(): void;
};
declare module globalThis {
var app: App;
var state: State;
var aiLog: any[];
var loadGame: Play[];
}
declare type MoveMatch = 'match4' | 'match3' | 'match2' | 'match4Next' | 'match3Next' | 'match2Next';
declare type MoveType = 'offensive' | 'defensive';
declare type GoodMove = {
value: number;
x: number;
name: string;
type: MoveType;
extra: any;
};
declare type BadMove = {
x: number;
name: string;
type: MoveType;
extra: any;
};