Skip to content

Commit 828e340

Browse files
🤖 Merge PR DefinitelyTyped#74803 [mapbox__mapbox-sdk] Fix GeocodeV6Request.proximity type by @ricardohsweiss
1 parent 5eb97a8 commit 828e340

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

‎types/mapbox__mapbox-sdk/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ declare module "@mapbox/mapbox-sdk/services/geocoding-v6" {
919919
* Bias local results based on a provided coordinate location or a
920920
* user's IP address.
921921
*/
922-
proximity?: Coordinates | "ip";
922+
proximity?: MapiRequestCoordinates | "ip";
923923
/**
924924
* Filter results by feature types.
925925
*/

‎types/mapbox__mapbox-sdk/mapbox__mapbox-sdk-tests.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,22 @@ geocodeServiceV6
301301
});
302302
});
303303

304+
geocodeServiceV6.forwardGeocode({
305+
query: "Berlin",
306+
proximity: [13.405, 52.52],
307+
});
308+
309+
geocodeServiceV6.forwardGeocode({
310+
query: "Berlin",
311+
proximity: "ip",
312+
});
313+
314+
geocodeServiceV6.forwardGeocode({
315+
query: "Berlin",
316+
// @ts-expect-error - object form should not be accepted for request proximity
317+
proximity: { longitude: 13.405, latitude: 52.52 },
318+
});
319+
304320
const optimizationService: OptimizationService = Optimization(config);
305321
optimizationService.getOptimization({
306322
profile: "driving",

0 commit comments

Comments
 (0)