Fix linting and build errors.

This commit is contained in:
Manuel Friedli 2025-01-08 21:30:02 +01:00
parent d8d05589e7
commit 36e1ea45d5
Signed by: manuel
GPG key ID: 41D08ABA75634DA1
9 changed files with 94 additions and 45 deletions

View file

@ -9,6 +9,7 @@ import {
ID_ACTION_STARTED_LOADING,
ID_ACTION_TOGGLED_SHOW_SOLUTION
} from "./action.ts";
import Maze from "@/app/model/maze.ts";
export default function reduce(state: State, action: Action): State {
switch (action.type) {
@ -24,7 +25,7 @@ export default function reduce(state: State, action: Action): State {
return {
...state,
loading: false,
maze: action.maze,
maze: action.maze as Maze,
userPath: []
}
}
@ -38,7 +39,7 @@ export default function reduce(state: State, action: Action): State {
case ID_ACTION_TOGGLED_SHOW_SOLUTION: {
return {
...state,
showSolution: action.value
showSolution: action.value as boolean
}
}
case ID_ACTION_CLOSED_MESSAGE_BANNER: {
@ -49,7 +50,7 @@ export default function reduce(state: State, action: Action): State {
}
case ID_ACTION_CLICKED_CELL: {
// There's so much logic involved, externalize that into its own file.
return handleUserClicked(state, action.x, action.y);
return handleUserClicked(state, action.x as number, action.y as number);
}
default: {
throw new Error(`Unknown action: ${action.type}`);