@@ -1235,6 +1235,100 @@ declare module "@mapbox/mapbox-sdk/services/geocoding-v6" {
12351235 }
12361236}
12371237
1238+ // eslint-disable-next-line @definitelytyped/no-declare-current-package
1239+ declare module "@mapbox/mapbox-sdk/services/isochrone" {
1240+ import * as GeoJSON from "geojson" ;
1241+ // eslint-disable-next-line @definitelytyped/no-self-import
1242+ import MapiClient , { SdkConfig } from "@mapbox/mapbox-sdk/lib/classes/mapi-client" ;
1243+ // eslint-disable-next-line @definitelytyped/no-self-import
1244+ import { MapiRequest } from "@mapbox/mapbox-sdk/lib/classes/mapi-request" ;
1245+
1246+ export default function Isochrone ( config : SdkConfig | MapiClient ) : IsochroneService ;
1247+
1248+ interface IsochroneService {
1249+ getContours (
1250+ request : IsochroneRequest < false | undefined > ,
1251+ ) : MapiRequest < GeoJSON . FeatureCollection < GeoJSON . LineString > > ;
1252+ getContours (
1253+ request : IsochroneRequest < true > ,
1254+ ) : MapiRequest < GeoJSON . FeatureCollection < GeoJSON . Polygon > > ;
1255+ }
1256+
1257+ interface IsochroneDistance {
1258+ /**
1259+ * The times in minutes to use for each isochrone contour. You can specify up to four contours.
1260+ * Times must be in increasing order. The maximum time that can be specified is 60 minutes.
1261+ * Setting minutes and meters in the same time is an error.
1262+ */
1263+ minutes ?: never ;
1264+ /**
1265+ * The distances in meters to use for each isochrone contour. You can specify up to four contours.
1266+ * Distances must be in increasing order. The maximum distance that can be specified is
1267+ * 100000 meters. Setting minutes and meters in the same time is an error.
1268+ */
1269+ meters : [ number , number ?, number ?, number ?] ;
1270+ }
1271+
1272+ interface IsochroneTime {
1273+ /**
1274+ * The times in minutes to use for each isochrone contour. You can specify up to four contours.
1275+ * Times must be in increasing order. The maximum time that can be specified is 60 minutes.
1276+ * Setting minutes and meters in the same time is an error.
1277+ */
1278+ minutes : [ number , number ?, number ?, number ?] ;
1279+ /**
1280+ * The distances in meters to use for each isochrone contour. You can specify up to four contours.
1281+ * Distances must be in increasing order. The maximum distance that can be specified is
1282+ * 100000 meters. Setting minutes and meters in the same time is an error.
1283+ */
1284+ meters ?: never ;
1285+ }
1286+
1287+ type IsochroneRequest < T extends boolean | undefined = false > = ( IsochroneDistance | IsochroneTime ) & {
1288+ /**
1289+ * The colors to use for each isochrone contour, specified as hex values without a leading
1290+ * `#`(for example, `ff0000` for red). If this parameter is used, there must be the same
1291+ * number of colors as there are entries in contours_minutes or contours_meters. If no
1292+ * colors are specified, the Isochrone API will assign a default rainbow color scheme to
1293+ * the output.
1294+ */
1295+ colors ?: [ string ?, string ?, string ?, string ?] ;
1296+ /** A {longitude,latitude} coordinate pair around which to center the isochrone lines. */
1297+ coordinates : [ number , number ] ;
1298+ /**
1299+ * A floating point value from 0.0 to 1.0 that can be used to remove smaller contours. The
1300+ * default is 1.0. A value of 1.0 will only return the largest contour for a given time
1301+ * value. A value of 0.5 drops any contours that are less than half the area of the largest
1302+ * contour in the set of contours for that same time value.
1303+ *
1304+ * @default 1.0
1305+ */
1306+ denoise ?: number ;
1307+ /**
1308+ * A positive floating point value in meters used as the tolerance for Douglas-Peucker
1309+ * generalization. There is no upper bound. If no value is specified in the request, the
1310+ * Isochrone API will choose the most optimized generalization to use for the request.
1311+ * Note that the generalization of contours can lead to self-intersections, as well as
1312+ * intersections of adjacent contours.
1313+ */
1314+ generalize ?: number ;
1315+ /**
1316+ * Specify whether to return the contours as GeoJSON polygons (`true`) or linestrings
1317+ * (`false`, default). When polygons=`true`, any contour that forms a ring is returned as a
1318+ * polygon.
1319+ *
1320+ * @default false
1321+ */
1322+ polygons ?: T ;
1323+ /**
1324+ * A Mapbox Directions routing profile ID.
1325+ *
1326+ * @default 'driving'
1327+ */
1328+ profile ?: "driving" | "driving-traffic" | "walking" | "cycling" ;
1329+ } ;
1330+ }
1331+
12381332// eslint-disable-next-line @definitelytyped/no-declare-current-package
12391333declare module "@mapbox/mapbox-sdk/services/geocoding" {
12401334 import { LngLatLike } from "mapbox-gl" ;
0 commit comments