generated from leafrogers/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.js
47 lines (46 loc) · 1.29 KB
/
types.js
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
/**
* @typedef {number} CellNumber
* @typedef {'X'|'O'|''} CellValue
*
* @typedef PlayerModel
* @property {string} id
* @property {boolean} isTurn
* @property {boolean | null} isWinner
* @property {string} name
* @typedef BoardModel
* @property {[CellValue, CellValue, CellValue,CellValue, CellValue, CellValue,CellValue, CellValue, CellValue]} cells
* @property {CellNumber[]} winningIndexTrio
*
* @typedef GameModel
* @property {BoardModel} board
* @property {boolean} hasEnded
* @property {PlayerModel[]} players
* @property {string} id
*
* @typedef ApiResponse
* @property {GameModel} [game]
* @property {string} message
* @property {number} status
*
* @typedef ApiViewModel
* @property {GameModel} game
* @property {PlayerModel} player
*
* @typedef ViewText
* @property {string} title
*
* @typedef BaseUiViewModel
* @property {string} cspNonce
* @property {ViewText} text
*
* @typedef {BaseUiViewModel & ApiViewModel} GameUiViewModel
*
* @typedef GameOptionsModel
* @property {boolean} shouldAutoRefresh
* @property {boolean} preferenceAutoRefresh
*
* @typedef {import('express').Request} ExpressRequest
* @typedef {import('express').Response} ExpressResponse
* @typedef {import('express').NextFunction} NextFunction
* @typedef {Error & { status: number }} ExpressError
*/