trails/apps/planner/app/components
Ullrich Schäfer 985ec54023
chore(ts): replace 7 \as unknown as\ shims with proper types
Most of the existing coercions are legitimate (Drizzle raw-SQL row
shapes, linkedom DOMParser interop, fit-file-parser's loose \`any\`
callback API) — leaving those is honest. The ones cleaned up here
were shims around APIs that have real types we just hadn't wired:

- **\`window.__leafletMap\`** (4 sites: MapHelpers.tsx, SessionView.tsx ×3)
  Added \`Window\` declaration in \`apps/planner/app/types/global.d.ts\`.
  Callers now use plain \`window.__leafletMap\` typed as
  \`L.Map | undefined\`.

- **\`L.markerClusterGroup\`** (PoiPanel.tsx) — leaflet.markercluster
  augments the global \`L\` namespace at runtime but ships no types.
  Added a \`declare module \"leaflet\"\` block in the same global.d.ts
  with a minimal signature for what we actually use.

- **\`L.DomEvent.preventDefault / .stop\`** taking a Leaflet event
  rather than a native one (PlannerMap.tsx, RouteInteraction.tsx,
  NoGoAreaLayer.tsx). Leaflet events carry the native event under
  \`.originalEvent\`; using that drops the cast entirely.

- **\`_creds as unknown as OAuthCredentials\`** orphan in
  wahoo/webhook.ts — \`_creds\` was unused inside the callback (the
  void-cast was a no-op preserving the type for documentation).
  Replaced with \`async ()\`, dropped the unused import.

Net: 26 \`as unknown as\` / \`as any\` sites → 19, all remaining ones
gated by external lib interop or Drizzle raw-SQL.

Full repo: pnpm typecheck / lint / test all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 01:02:25 +02:00
..
ClientOnly.tsx Fix SSR and automerge timing 2026-03-23 00:49:54 +01:00
ColoredRoute.tsx Extract @trails-cool/map-core package from Planner 2026-04-12 22:28:14 +02:00
DayBreakdown.tsx Fix i18n: use planner namespace in sidebar components 2026-04-10 23:59:27 +02:00
ElevationChart.tsx Split ElevationChart + PlannerMap into deep modules; add visual regression testing 2026-05-10 16:41:23 +02:00
ExportButton.tsx Centralize waypoint Yjs serialization in waypointFromYMap/waypointToYMap 2026-05-18 21:02:27 +02:00
MapHelpers.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
MidpointHandles.tsx Add route interactions: click-to-split, drag-to-reshape, colored route rendering 2026-03-26 21:15:55 +01:00
NearbyPoiMarkers.tsx Add per-waypoint notes and nearby POI snap to Planner 2026-05-17 23:58:21 +02:00
NoGoAreaLayer.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
NotesPanel.tsx Fix notes not loading on session reload 2026-04-11 03:00:51 +02:00
ParticipantList.tsx Fix mobile header layout: hide secondary items on small screens 2026-04-12 19:39:19 +02:00
PlannerMap.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
PoiPanel.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
ProfileSelector.tsx Change default routing profile to fastbike, move hiking to end 2026-04-11 02:17:46 +02:00
RouteInteraction.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
SaveToJournalButton.tsx fix(planner): keep journal callback token off the client (#2 Phase A) 2026-05-26 00:29:24 +02:00
SessionView.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
WaypointContextMenu.tsx Replace right-click behavior with context menu on waypoints 2026-04-11 02:42:43 +02:00
WaypointSidebar.tsx Centralize waypoint Yjs serialization in waypointFromYMap/waypointToYMap 2026-05-18 21:02:27 +02:00
YjsDebugPanel.tsx Session-bind /api/route and /api/overpass 2026-04-21 22:18:45 +02:00