Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(tours): name the surface, way and trail classes as types only

Mauricee877d35e0b6b
diff --git a/client/src/components/Tours/bike/routeWays.ts b/client/src/components/Tours/bike/routeWays.ts
index 382848839..59936d5fe 100644
--- a/client/src/components/Tours/bike/routeWays.ts
+++ b/client/src/components/Tours/bike/routeWays.ts
@@ -9,20 +9,17 @@ import { decodePolyline } from '../../Map/transitGeometry';
*/
/** Surfaces from smooth to rough; `unknown` where the data names none. */
-const SURFACE_CLASSES = ['paved', 'rough', 'compacted', 'gravel', 'ground', 'unknown'] as const;
-export type SurfaceClass = (typeof SURFACE_CLASSES)[number];
+export type SurfaceClass = 'paved' | 'rough' | 'compacted' | 'gravel' | 'ground' | 'unknown';
/** Kinds of way, the ones a rider plans by. */
-const WAY_CLASSES = ['cyclePath', 'cycleLane', 'quiet', 'road', 'track', 'path', 'ferry', 'other'] as const;
-export type WayClass = (typeof WAY_CLASSES)[number];
+export type WayClass = 'cyclePath' | 'cycleLane' | 'quiet' | 'road' | 'track' | 'path' | 'ferry' | 'other';
/**
* mtb:scale steps as a rider reads them: S0 to S3 apart, S4 and up together
* (rare, and all of them expert ground); `none` where OpenStreetMap gives the
* way no grade, `unasked` where it could not be asked this time.
*/
-const TRAIL_CLASSES = ['s0', 's1', 's2', 's3', 's4', 'none', 'unasked'] as const;
-export type TrailClass = (typeof TRAIL_CLASSES)[number];
+export type TrailClass = 's0' | 's1' | 's2' | 's3' | 's4' | 'none' | 'unasked';
/** Surfaces a road bike's rider calls unpaved (BIK-02): what is no paving of any kind. */
export const UNPAVED: ReadonlySet<SurfaceClass> = new Set(['compacted', 'gravel', 'ground']);