diff --git a/frontend/src/scripts/misc.ts b/frontend/src/scripts/misc.ts index edb7e3c20..83c94fb7b 100644 --- a/frontend/src/scripts/misc.ts +++ b/frontend/src/scripts/misc.ts @@ -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 { +let challengeList: MonkeyTypes.Challenge[] = []; +export async function getChallengeList(): Promise { if (challengeList.length === 0) { return $.getJSON("challenges/_list.json", function (data) { challengeList = data; diff --git a/frontend/src/scripts/types/types.d.ts b/frontend/src/scripts/types/types.d.ts index f65686990..b7ef20061 100644 --- a/frontend/src/scripts/types/types.d.ts +++ b/frontend/src/scripts/types/types.d.ts @@ -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; + }; + }; + } }