diff --git a/src/components/ItineraryBikeLeg.tsx b/src/components/ItineraryBikeLeg.tsx index 25766d12..b73aeb4c 100644 --- a/src/components/ItineraryBikeLeg.tsx +++ b/src/components/ItineraryBikeLeg.tsx @@ -4,7 +4,8 @@ import type { BikeLeg, RouteInstruction } from '../lib/BikeHopperClient'; import { BIKEHOPPER_THEME_COLOR } from '../lib/colors'; import formatDistance from '../lib/formatDistance'; import formatMajorStreets from '../lib/formatMajorStreets'; -import { describeBikeInfra, STEP_ANNOTATIONS } from '../lib/geometry'; +import { describeBikeInfra } from '../lib/geometry'; +import type { StepAnnotation } from '../lib/geometry'; import { formatDurationBetween } from '../lib/time'; import InstructionSigns from '../lib/InstructionSigns'; import useScrollToRef from '../hooks/useScrollToRef'; @@ -14,7 +15,6 @@ import ItinerarySpacer from './ItinerarySpacer'; import BikeIcon from 'iconoir/icons/bicycle.svg?react'; -type StepAnnotation = (typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS]; type StepWithInfra = RouteInstruction & { bikeInfra: StepAnnotation[]; }; diff --git a/src/components/ItineraryBikeStep.tsx b/src/components/ItineraryBikeStep.tsx index 13a01ceb..c46cde3b 100644 --- a/src/components/ItineraryBikeStep.tsx +++ b/src/components/ItineraryBikeStep.tsx @@ -6,6 +6,7 @@ import classnames from 'classnames'; import BorderlessButton from './BorderlessButton'; import { STEP_ANNOTATIONS, describeStepAnnotation } from '../lib/geometry'; +import type { StepAnnotation } from '../lib/geometry'; import InstructionSigns from '../lib/InstructionSigns'; import ItineraryStep from './ItineraryStep'; import type { RouteInstruction } from '../lib/BikeHopperClient'; @@ -21,8 +22,6 @@ import TriangleFlag from 'iconoir/icons/triangle-flag.svg?react'; import QuestionMarkCircle from 'iconoir/icons/help-circle.svg?react'; import ArrowTrCircle from 'iconoir/icons/arrow-up-right-circle.svg?react'; -type StepAnnotation = (typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS]; - let _warnedOfFallback = false; const spacerWithMiddot = ' \u00B7 '; diff --git a/src/lib/geometry.ts b/src/lib/geometry.ts index 4911f818..f66d0e92 100644 --- a/src/lib/geometry.ts +++ b/src/lib/geometry.ts @@ -196,7 +196,8 @@ export const STEP_ANNOTATIONS = { steepHill: 11, verySteepHill: 12, }; -type StepAnnotation = (typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS]; +export type StepAnnotation = + (typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS]; export function describeStepAnnotation( sa: StepAnnotation | null,