diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index 8cc997f90..56fd00d8b 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -617,7 +617,7 @@ export async function addWord(): Promise { let wordCount = 0; for (let i = 0; i < section.words.length; i++) { - const word = section.words[i]; + const word = section.words[i] as string; if (wordCount >= Config.words && Config.mode === "words") { break; } diff --git a/frontend/src/ts/types/types.d.ts b/frontend/src/ts/types/types.d.ts index b6bc9b98e..fe64adfae 100644 --- a/frontend/src/ts/types/types.d.ts +++ b/frontend/src/ts/types/types.d.ts @@ -108,6 +108,20 @@ declare namespace MonkeyTypes { | "changesWordsFrequency" | `wordOrder:${FunboxWordOrder}`; + class Wordset { + public words: string[]; + public length: number; + constructor(words: string[]); + randomWord(mode: MonkeyTypes.FunboxWordsFrequency): string; + } + + class Section { + public title: string; + public author: string; + public words: string[]; + constructor(title: string, author: string, words: string[]); + } + type FunboxFunctions = { getWord?: (wordset?: Wordset, wordIndex?: number) => string; punctuateWord?: (word: string) => string;