mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
refactor(client): type both trip map renderers against one MapViewProps contract
MapViewAuto took props: any and the Leaflet MapView destructured any, so a prop one renderer learned and the other never heard of went unnoticed. components/Map/mapViewContract.ts holds MapViewProps, derived from the GL renderer's props and what the callers pass; MapView and the GL bindings in glLazy declare satisfies ComponentType against it, and the GL renderer extends it with its engine. The file imports types only, so check:gl-split is not affected. Types only, no runtime change. The types show two known gaps, recorded in the contract rather than papered over: onMapReady is called by the GL renderer only, and callers pass pins without trip_id (assignment and collection places) while both renderers type their pins as Place; MapViewAuto bridges the latter with one commented cast.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"src": {
|
||||
"@typescript-eslint/no-explicit-any": 155,
|
||||
"@typescript-eslint/no-explicit-any": 154,
|
||||
"@typescript-eslint/no-unused-expressions": 2,
|
||||
"@typescript-eslint/no-unused-vars": 155,
|
||||
"no-empty": 19,
|
||||
@@ -12,14 +12,14 @@
|
||||
"unused-disable-directive": 6
|
||||
},
|
||||
"suppressed": {
|
||||
"@typescript-eslint/no-explicit-any": 44,
|
||||
"@typescript-eslint/no-explicit-any": 40,
|
||||
"react-hooks/exhaustive-deps": 46
|
||||
},
|
||||
"tests": {
|
||||
"@typescript-eslint/no-explicit-any": 492,
|
||||
"@typescript-eslint/no-explicit-any": 491,
|
||||
"@typescript-eslint/no-this-alias": 1,
|
||||
"@typescript-eslint/no-unsafe-function-type": 2,
|
||||
"@typescript-eslint/no-unused-vars": 53,
|
||||
"@typescript-eslint/no-unused-vars": 52,
|
||||
"react-refresh/only-export-components": 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user