mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-18 11:36:13 +08:00
moved challenge type to MonkeyTypes, fixed challenge type
This commit is contained in:
parent
99b92ea947
commit
1bca0a3734
2 changed files with 16 additions and 12 deletions
|
@ -322,18 +322,8 @@ export async function findCurrentGroup(
|
|||
return retgroup;
|
||||
}
|
||||
|
||||
type Challenge = {
|
||||
name: string;
|
||||
display: string;
|
||||
autoRole: boolean;
|
||||
type: string;
|
||||
parameters: string | number[];
|
||||
message: string;
|
||||
requirements: object;
|
||||
};
|
||||
|
||||
let challengeList: Challenge[] = [];
|
||||
export async function getChallengeList(): Promise<Challenge[]> {
|
||||
let challengeList: MonkeyTypes.Challenge[] = [];
|
||||
export async function getChallengeList(): Promise<MonkeyTypes.Challenge[]> {
|
||||
if (challengeList.length === 0) {
|
||||
return $.getJSON("challenges/_list.json", function (data) {
|
||||
challengeList = data;
|
||||
|
|
14
frontend/src/scripts/types/types.d.ts
vendored
14
frontend/src/scripts/types/types.d.ts
vendored
|
@ -572,4 +572,18 @@ declare namespace MonkeyTypes {
|
|||
[row4: string]: string[];
|
||||
[row5: string]: string[];
|
||||
}
|
||||
|
||||
interface Challenge {
|
||||
name: string;
|
||||
display: string;
|
||||
autoRole: boolean;
|
||||
type: string;
|
||||
parameters: (string | number | boolean)[];
|
||||
message: string;
|
||||
requirements: {
|
||||
[requirement: string]: {
|
||||
[parameter: string]: string | number | boolean;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue