add some type magic

This commit is contained in:
undefined committed 2021-03-08 14:32:11 +08:00
1 parent 2344a41816
commit a4d7dc4b04
6 files changed
+23 -23

No files matched your search

+6 -6
View File
@@ -269,9 +269,9 @@ export interface TrainingNode {
pids: number[],
}
export interface Tdoc extends Document {
export interface Tdoc<docType = document['TYPE_CONTEST'] | document['TYPE_HOMEWORK'] | document['TYPE_TRAINING']> extends Document {
docId: ObjectID,
docType: document['TYPE_CONTEST'] | document['TYPE_HOMEWORK'] | document['TYPE_TRAINING'],
docType: docType & number,
beginAt: Date,
endAt: Date,
attend: number,
@@ -399,12 +399,12 @@ export interface ContestRule {
TEXT: string,
check: (args: any) => any,
statusSort: any,
showScoreboard: (tdoc: Tdoc, now: Date) => boolean,
showRecord: (tdoc: Tdoc, now: Date) => boolean,
stat: (tdoc: Tdoc, journal: any[]) => ContestStat,
showScoreboard: (tdoc: Tdoc<30 | 60>, now: Date) => boolean,
showRecord: (tdoc: Tdoc<30 | 60>, now: Date) => boolean,
stat: (tdoc: Tdoc<30 | 60>, journal: any[]) => ContestStat,
scoreboard: (
isExport: boolean, _: (s: string) => string,
tdoc: Tdoc, rankedTsdocs: any[], udict: Udict, pdict: Pdict
tdoc: Tdoc<30 | 60>, rankedTsdocs: any[], udict: Udict, pdict: Pdict
) => ScoreboardRow[],
rank: (tsdocs: any[]) => any[],
}