aboutsummaryrefslogtreecommitdiff
path: root/api/api.ts
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-10 14:37:12 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-10 14:37:12 +0100
commit1b8e3e479fb1fcea333571aaa3dd090ec78e346b (patch)
tree81e56c707a284f4e535ce947196dd0e8794924c0 /api/api.ts
parentba0e25a47082ada94565da07b2451ff00d0e2857 (diff)
/user page use /user/games api
Diffstat (limited to 'api/api.ts')
-rw-r--r--api/api.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/api/api.ts b/api/api.ts
index 43d7951..2746238 100644
--- a/api/api.ts
+++ b/api/api.ts
@@ -31,3 +31,30 @@ export interface userPreferences {
userColors?: userColors;
}
+export interface userGameTotals {
+ draw: number;
+ games: number;
+ lose: number;
+ win: number;
+}
+
+export interface userGames {
+ totals: userGameTotals;
+ games: Array<gameInfo>;
+}
+
+export interface gameInfo {
+ created: number;
+ duration: number;
+ id: string;
+ moves: Array<number>;
+ opponent: string;
+ outcome: "w"|"l"|"d";
+ parent?: string;
+ private: boolean;
+ rating?: number;
+ rating_opponent?: number;
+ ruleset: ruleset;
+ started: number;
+ status: "finished"|"in_progress"|"resign"|"wait_for_opponent";
+}