diff --git a/src/actions/measurements.ts b/src/actions/measurements.ts index e395b1486..a996f84f6 100644 --- a/src/actions/measurements.ts +++ b/src/actions/measurements.ts @@ -37,8 +37,8 @@ interface GroupingValues { const filterQueryPrefix = "mf_"; type MeasurementsFilterQuery = `mf_${string}` -const queryBooleanValues = ["show", "hide"] as const; -type QueryBoolean = (typeof queryBooleanValues)[number] +type QueryBoolean = "show" | "hide" +const queryBooleanValues: QueryBoolean[] = ["show", "hide"]; export const isQueryBoolean = (x: any): x is QueryBoolean => queryBooleanValues.includes(x) /* Measurements query parameters that are constructed and/or parsed here. */ interface MeasurementsQuery { diff --git a/src/reducers/measurements/types.ts b/src/reducers/measurements/types.ts index 9c882ec76..2363ff202 100644 --- a/src/reducers/measurements/types.ts +++ b/src/reducers/measurements/types.ts @@ -1,8 +1,8 @@ import { measurementIdSymbol } from "../../util/globals"; // -- Shared Measurements types -- // -export const measurementsDisplayValues = ["raw", "mean"]; -export type MeasurementsDisplay = (typeof measurementsDisplayValues)[number] +export type MeasurementsDisplay = "raw" | "mean" +export const measurementsDisplayValues: MeasurementsDisplay[] = ["raw", "mean"]; export const isMeasurementsDisplay = (x: any): x is MeasurementsDisplay => measurementsDisplayValues.includes(x); // -- Measurements JSON types -- //