From 828e34016b400b7303171580a0dac051c7f416fb Mon Sep 17 00:00:00 2001 From: Ricardo Weiss Date: Tue, 7 Apr 2026 10:01:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74803=20[mapbox=5F?= =?UTF-8?q?=5Fmapbox-sdk]=20Fix=20GeocodeV6Request.proximity=20type=20by?= =?UTF-8?q?=20@ricardohsweiss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/mapbox__mapbox-sdk/index.d.ts | 2 +- .../mapbox__mapbox-sdk-tests.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/mapbox__mapbox-sdk/index.d.ts b/types/mapbox__mapbox-sdk/index.d.ts index b11ee20a101c99..f3e529ea8aad28 100644 --- a/types/mapbox__mapbox-sdk/index.d.ts +++ b/types/mapbox__mapbox-sdk/index.d.ts @@ -919,7 +919,7 @@ declare module "@mapbox/mapbox-sdk/services/geocoding-v6" { * Bias local results based on a provided coordinate location or a * user's IP address. */ - proximity?: Coordinates | "ip"; + proximity?: MapiRequestCoordinates | "ip"; /** * Filter results by feature types. */ diff --git a/types/mapbox__mapbox-sdk/mapbox__mapbox-sdk-tests.ts b/types/mapbox__mapbox-sdk/mapbox__mapbox-sdk-tests.ts index 216d73fccda6e7..81e4d5bd6dcd79 100644 --- a/types/mapbox__mapbox-sdk/mapbox__mapbox-sdk-tests.ts +++ b/types/mapbox__mapbox-sdk/mapbox__mapbox-sdk-tests.ts @@ -301,6 +301,22 @@ geocodeServiceV6 }); }); +geocodeServiceV6.forwardGeocode({ + query: "Berlin", + proximity: [13.405, 52.52], +}); + +geocodeServiceV6.forwardGeocode({ + query: "Berlin", + proximity: "ip", +}); + +geocodeServiceV6.forwardGeocode({ + query: "Berlin", + // @ts-expect-error - object form should not be accepted for request proximity + proximity: { longitude: 13.405, latitude: 52.52 }, +}); + const optimizationService: OptimizationService = Optimization(config); optimizationService.getOptimization({ profile: "driving",