@xcpcio/core 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +410 -223
- package/dist/index.d.ts +55 -38
- package/dist/index.mjs +394 -223
- package/package.json +4 -2
- package/src/award.ts +16 -5
- package/src/contest.ts +12 -0
- package/src/export/cf.ts +120 -0
- package/src/export/general-excel.ts +184 -0
- package/src/export/index.ts +2 -0
- package/src/index.ts +1 -1
- package/src/problem.ts +8 -0
- package/src/team.ts +2 -0
- package/src/export.ts +0 -116
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
|
+
import { SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, Lang, StatusTimeDisplay, Image, ContestState, Contest as Contest$1, Team as Team$1, Teams as Teams$1, ContestIndex as ContestIndex$1 } from '@xcpcio/types';
|
|
1
2
|
import dayjs from 'dayjs';
|
|
2
3
|
export { default as dayjs } from 'dayjs';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
declare enum MedalType {
|
|
6
|
-
UNKNOWN = 0,
|
|
7
|
-
GOLD = 1,
|
|
8
|
-
SILVER = 2,
|
|
9
|
-
BRONZE = 3,
|
|
10
|
-
HONORABLE = 4
|
|
11
|
-
}
|
|
12
|
-
declare class Award {
|
|
13
|
-
medalType: MedalType;
|
|
14
|
-
minRank: number;
|
|
15
|
-
maxRank: number;
|
|
16
|
-
constructor();
|
|
17
|
-
}
|
|
18
|
-
type Awards = Map<string, Award[]>;
|
|
4
|
+
import * as XLSX from 'xlsx-js-style';
|
|
19
5
|
|
|
20
6
|
declare class Submission {
|
|
21
7
|
id: string;
|
|
@@ -84,6 +70,8 @@ declare class TeamProblemStatistics {
|
|
|
84
70
|
get isPending(): boolean;
|
|
85
71
|
get isUnSubmitted(): boolean;
|
|
86
72
|
get penalty(): number;
|
|
73
|
+
get penaltyToMinute(): number;
|
|
74
|
+
get solvedTimestampToMinute(): number;
|
|
87
75
|
}
|
|
88
76
|
|
|
89
77
|
declare function calcDict(attemptedNum: number, solvedNum: number): number;
|
|
@@ -99,6 +87,22 @@ declare class Group {
|
|
|
99
87
|
constructor();
|
|
100
88
|
}
|
|
101
89
|
|
|
90
|
+
declare enum MedalType {
|
|
91
|
+
UNKNOWN = "Unknown",
|
|
92
|
+
GOLD = "Gold",
|
|
93
|
+
SILVER = "Silver",
|
|
94
|
+
BRONZE = "Bronze",
|
|
95
|
+
HONORABLE = "Honorable"
|
|
96
|
+
}
|
|
97
|
+
declare class Award {
|
|
98
|
+
medalType: MedalType;
|
|
99
|
+
minRank: number;
|
|
100
|
+
maxRank: number;
|
|
101
|
+
constructor();
|
|
102
|
+
}
|
|
103
|
+
declare function isValidMedalType(medal: MedalType): boolean;
|
|
104
|
+
type Awards = Map<string, Award[]>;
|
|
105
|
+
|
|
102
106
|
declare class Contest {
|
|
103
107
|
name: string;
|
|
104
108
|
startTime: dayjs.Dayjs;
|
|
@@ -127,29 +131,10 @@ declare class Contest {
|
|
|
127
131
|
getContestElapsedTime(nowTime?: Date): string;
|
|
128
132
|
getContestRemainingTime(nowTime?: Date): string;
|
|
129
133
|
getContestProgressRatio(nowTime?: Date): number;
|
|
134
|
+
isEnableAwards(group: string): boolean;
|
|
130
135
|
}
|
|
131
136
|
declare function createContest(contestJSON: Contest$1): Contest;
|
|
132
137
|
|
|
133
|
-
declare class ContestIndexConfig {
|
|
134
|
-
contestName: string;
|
|
135
|
-
startTime: dayjs.Dayjs;
|
|
136
|
-
endTime: dayjs.Dayjs;
|
|
137
|
-
freezeTime: dayjs.Dayjs;
|
|
138
|
-
totalDurationTimestamp: number;
|
|
139
|
-
freezeDurationTimestamp: number;
|
|
140
|
-
unFreezeDurationTimestamp: number;
|
|
141
|
-
logo?: Image;
|
|
142
|
-
constructor();
|
|
143
|
-
}
|
|
144
|
-
declare class ContestIndex {
|
|
145
|
-
contest: Contest;
|
|
146
|
-
boardLink: string;
|
|
147
|
-
constructor();
|
|
148
|
-
}
|
|
149
|
-
type ContestIndexList = Array<ContestIndex>;
|
|
150
|
-
declare function createContestIndex(contestIndexJSON: ContestIndex$1): ContestIndex;
|
|
151
|
-
declare function createContestIndexList(contestListJSON: any): ContestIndexList;
|
|
152
|
-
|
|
153
138
|
declare class PlaceChartPointData {
|
|
154
139
|
timePoint: number;
|
|
155
140
|
rank: number;
|
|
@@ -242,7 +227,39 @@ declare class Rank {
|
|
|
242
227
|
getSubmissions(): Submissions;
|
|
243
228
|
}
|
|
244
229
|
|
|
245
|
-
declare
|
|
230
|
+
declare class CodeforcesGymGhostDATConverter {
|
|
231
|
+
constructor();
|
|
232
|
+
convert(rank: Rank): string;
|
|
233
|
+
private submissionStatusToCodeforcesGymDatStatus;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
declare class GeneralExcelConverter {
|
|
237
|
+
constructor();
|
|
238
|
+
convert(oriRank: Rank): XLSX.WorkBook;
|
|
239
|
+
convertAndWrite(rank: Rank, filename: string): any;
|
|
240
|
+
private convertToSheet;
|
|
241
|
+
private convertToAoa;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
declare class ContestIndexConfig {
|
|
245
|
+
contestName: string;
|
|
246
|
+
startTime: dayjs.Dayjs;
|
|
247
|
+
endTime: dayjs.Dayjs;
|
|
248
|
+
freezeTime: dayjs.Dayjs;
|
|
249
|
+
totalDurationTimestamp: number;
|
|
250
|
+
freezeDurationTimestamp: number;
|
|
251
|
+
unFreezeDurationTimestamp: number;
|
|
252
|
+
logo?: Image;
|
|
253
|
+
constructor();
|
|
254
|
+
}
|
|
255
|
+
declare class ContestIndex {
|
|
256
|
+
contest: Contest;
|
|
257
|
+
boardLink: string;
|
|
258
|
+
constructor();
|
|
259
|
+
}
|
|
260
|
+
type ContestIndexList = Array<ContestIndex>;
|
|
261
|
+
declare function createContestIndex(contestIndexJSON: ContestIndex$1): ContestIndex;
|
|
262
|
+
declare function createContestIndexList(contestListJSON: any): ContestIndexList;
|
|
246
263
|
|
|
247
264
|
declare function getImageSource(image: Image): string;
|
|
248
265
|
|
|
@@ -270,4 +287,4 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
270
287
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
271
288
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
272
289
|
|
|
273
|
-
export { Award, Awards, Contest, ContestIndex, ContestIndexConfig, ContestIndexList, MedalType, PlaceChartPointData, Problem, ProblemStatistics, Problems, Rank, RankOptions, RankStatistics, Resolver, SelectOptionItem, Submission, Submissions, Team, TeamProblemStatistics, Teams, calcDict, createContest, createContestIndex, createContestIndexList, createDayJS, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected,
|
|
290
|
+
export { Award, Awards, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestIndexList, GeneralExcelConverter, MedalType, PlaceChartPointData, Problem, ProblemStatistics, Problems, Rank, RankOptions, RankStatistics, Resolver, SelectOptionItem, Submission, Submissions, Team, TeamProblemStatistics, Teams, calcDict, createContest, createContestIndex, createContestIndexList, createDayJS, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|