It appears that LngLatLike and LngLatBoundsLike should also be allowed since the convert methods used here accept those types:
https://github.com/mapbox/mapbox-gl-js/blob/master/src/geo/lng_lat_bounds.js#L85-L91
I believe it is just a matter of changing it in the comments and in the type definition:
LngLat | LngLatBounds to LngLat | LngLatBounds | LngLatLike | LngLatBoundsLike, or to just LngLatLike | LngLatBoundsLike - not sure off the top of my head if the instanceof call will need LngLat to be explicitly set as a type (refer to lines 74 and 78).
I haven't created a PR since I don't have the time to test right now....but should be enough info for someone to look into it.
mapbox-gl-js version:
Latest version
Expected Behavior
No type errors
Actual Behavior
Invalid types
Something like this will fail TypeScript type checks:
bounds.extend([number, number]);
It appears that
LngLatLikeandLngLatBoundsLikeshould also be allowed since the convert methods used here accept those types:https://github.com/mapbox/mapbox-gl-js/blob/master/src/geo/lng_lat_bounds.js#L85-L91
I believe it is just a matter of changing it in the comments and in the type definition:
LngLat | LngLatBoundstoLngLat | LngLatBounds | LngLatLike | LngLatBoundsLike, or to justLngLatLike | LngLatBoundsLike- not sure off the top of my head if theinstanceofcall will needLngLatto be explicitly set as a type (refer to lines 74 and 78).I haven't created a PR since I don't have the time to test right now....but should be enough info for someone to look into it.
mapbox-gl-js version:
Latest version
Expected Behavior
No type errors
Actual Behavior
Invalid types
Something like this will fail TypeScript type checks: