diff --git a/client/src/reducers/continuousSelection.ts b/client/src/reducers/continuousSelection.ts index d80cffe6..7e31b5c8 100644 --- a/client/src/reducers/continuousSelection.ts +++ b/client/src/reducers/continuousSelection.ts @@ -1,7 +1,24 @@ -import { makeContinuousDimensionName } from "../util/nameCreators"; +import { Action } from "redux"; +import type { RootState } from "."; +import { + ContinuousNamespace, + makeContinuousDimensionName, +} from "../util/nameCreators"; -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS. -const ContinuousSelection = (state = {}, action: any) => { +export interface ContinuousSelectionAction extends Action { + continuousNamespace: ContinuousNamespace; + selection: string; + range: [number, number]; +} + +export interface ContinuousSelectionState { + [name: string]: [number, number]; +} + +const ContinuousSelection = ( + state: ContinuousSelectionState = {}, + action: ContinuousSelectionAction +): RootState => { switch (action.type) { case "reset subset": case "subset to selection": @@ -25,7 +42,6 @@ const ContinuousSelection = (state = {}, action: any) => { action.continuousNamespace, action.selection ); - // @ts-expect-error ts-migrate(2537) FIXME: Type '{}' has no matching index signature for type... Remove this comment to see the full error message const { [name]: deletedField, ...newState } = state; return newState; }