-
Notifications
You must be signed in to change notification settings - Fork 45
/
lc-dailies-api-client-interface.ts
116 lines (99 loc) 路 2.15 KB
/
lc-dailies-api-client-interface.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copied from:
// https://oss.acmcsuf.com/lc-dailies
/**
* Player is a registered player in the leaderboard.
*/
export interface Player {
/**
* discord_user_id is the Discord user ID of the player.
*/
discord_user_id: string;
/**
* lc_username is the Leetcode username of the player.
*/
lc_username: string;
}
/**
* Submission is a submission in the leaderboard.
*/
export interface Submission {
/**
* id is the ID of the submission.
*/
id: string;
/**
* date is the date of the submission.
*/
date: string;
}
/**
* LCQuestion is a Leetcode question.
*/
export interface LCQuestion {
/**
* name is the name of the daily question.
*/
name: string;
/**
* date is the date the daily question was posted in the format of YYYY-MM-DD.
*/
date: string;
/**
* title is the title of the daily question.
*/
title: string;
/**
* difficulty is the difficulty of the daily question.
*/
difficulty: string;
/**
* url is the link of the daily question.
*/
url: string;
}
/**
* Season is a season of the leaderboard.
*/
export interface Season {
/**
* id is the ID of the season.
*/
id: string;
/**
* start_date is the start date of the season.
*/
start_date: string;
/**
* players is the map of players in the season.
*/
players: { [discord_user_id: string]: Player };
/**
* questions is the map of questions in the season.
*/
questions: { [lc_question_name: string]: LCQuestion };
/**
* submissions is the map of submissions in the season.
*/
submissions: {
[discord_user_id: string]: {
[lc_question_name: string]: Submission;
};
};
}
/**
* LCDailiesAPIClientInterface is the client interface for the LC-Dailies API.
*/
export interface LCDailiesAPIClientInterface {
/**
* getCurrentSeason gets the current season of the leaderboard.
*/
getCurrentSeason(): Promise<Season | null>;
/**
* getSeason gets a season of the leaderboard by ID.
*/
getSeason(season_id: string): Promise<Season | null>;
/**
* listSeasons gets a list of season IDs of the leaderboard.
*/
listSeasons(): Promise<Season[]>;
}