From b4098677c782631169fe6667ee62113ca100f47b Mon Sep 17 00:00:00 2001 From: Benjamin Claassen Date: Tue, 14 Jan 2025 23:03:24 +0100 Subject: [PATCH] Added some missing type info --- reviews/BordedDev/sudoku.rewrite.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reviews/BordedDev/sudoku.rewrite.js b/reviews/BordedDev/sudoku.rewrite.js index a10e17a..f6371c4 100644 --- a/reviews/BordedDev/sudoku.rewrite.js +++ b/reviews/BordedDev/sudoku.rewrite.js @@ -32,6 +32,10 @@ class SudokuPuzzle extends EventTarget { */ #activeState = new Array(9 * 9) + /** + * + * @returns {(number|null|undefined)[]} + */ get grid() { const gridValue = [...this.#activeState] Object.freeze(gridValue) @@ -216,6 +220,10 @@ class SudokuPuzzle extends EventTarget { return newState } + /** + * + * @returns {(number|null|undefined)[]} + */ #generateRandomState() { const newState = Array.from({ length: SUDOKU_GRID_SIZE }) for (let i = 0; i < 17; i++) { @@ -225,6 +233,10 @@ class SudokuPuzzle extends EventTarget { return newState } + /** + * + * @returns {(number|null|undefined)[]} + */ get baseState() { return this.#state[0] } @@ -239,6 +251,10 @@ class SudokuPuzzle extends EventTarget { ) } + /** + * + * @param newState {(number|null|undefined)[]} + */ applyState(newState) { this.#state.push(newState) this.#activeState = SudokuPuzzle.collapseStates(...this.#state)