@types/mapbox__mapbox-sdk 0.13.11 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ This package contains type definitions for @mapbox/mapbox-sdk (https://github.co
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-sdk.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 27 Dec 2023 20:07:01 GMT
11
+ * Last updated: Fri, 12 Jul 2024 21:35:59 GMT
12
12
  * Dependencies: [@types/geojson](https://npmjs.com/package/@types/geojson), [@types/mapbox-gl](https://npmjs.com/package/@types/mapbox-gl), [@types/node](https://npmjs.com/package/@types/node)
13
13
 
14
14
  # Credits
@@ -1,5 +1,13 @@
1
1
  /// <reference types="node" />
2
2
 
3
+ // eslint-disable-next-line @definitelytyped/no-declare-current-package
4
+ declare module "@mapbox/mapbox-sdk" {
5
+ // eslint-disable-next-line @definitelytyped/no-self-import
6
+ import MapiClient, { SdkConfig } from "@mapbox/mapbox-sdk/lib/classes/mapi-client";
7
+
8
+ export default function createNodeClient(config: SdkConfig): MapiClient;
9
+ }
10
+
3
11
  // eslint-disable-next-line @definitelytyped/no-declare-current-package
4
12
  declare module "@mapbox/mapbox-sdk/lib/classes/mapi-client" {
5
13
  // eslint-disable-next-line @definitelytyped/no-self-import
@@ -865,6 +873,462 @@ declare module "@mapbox/mapbox-sdk/services/directions" {
865
873
  }
866
874
  }
867
875
 
876
+ // eslint-disable-next-line @definitelytyped/no-declare-current-package
877
+ declare module "@mapbox/mapbox-sdk/services/geocoding-v6" {
878
+ // eslint-disable-next-line @definitelytyped/no-self-import
879
+ import { Coordinates as MapiRequestCoordinates, MapiRequest } from "@mapbox/mapbox-sdk/lib/classes/mapi-request";
880
+ // eslint-disable-next-line @definitelytyped/no-self-import
881
+ import MapiClient, { SdkConfig } from "@mapbox/mapbox-sdk/lib/classes/mapi-client";
882
+
883
+ /*********************************************************************************************************************
884
+ * Geocoder Types for v6 API
885
+ *********************************************************************************************************************/
886
+
887
+ export default function GeocodingV6(config: SdkConfig | MapiClient): GeocodeService;
888
+
889
+ interface GeocodeService {
890
+ forwardGeocode(request: ForwardGeocodeRequest): MapiRequest<GeocodeResponse>;
891
+ reverseGeocode(request: ReverseGeocodeRequest): MapiRequest<GeocodeResponse>;
892
+ }
893
+
894
+ type BoundingBox = [number, number, number, number];
895
+
896
+ type GeocodeMode = "standard" | "structured";
897
+
898
+ type GeocodeQueryType =
899
+ | "address"
900
+ | "country"
901
+ | "district"
902
+ | "locality"
903
+ | "neighborhood"
904
+ | "place"
905
+ | "postcode"
906
+ | "region"
907
+ | "street";
908
+
909
+ interface GeocodeV6Request {
910
+ /**
911
+ * Either `standard` for common forward geocoding, or `structured` for
912
+ * increasing the accuracy of results. To use Structured Input, the
913
+ * query parameter must be dropped in favor of a separate parameter for
914
+ * individual feature components. Defaults to `standard`.
915
+ */
916
+ mode?: GeocodeMode;
917
+ /**
918
+ * Limits results to the specified countries. Each item in the array
919
+ * should be an ISO 3166 alpha 2 country code. [OR] if used with input
920
+ * mode="structured" denotes single country in free form.
921
+ */
922
+ countries?: string[] | string;
923
+ /**
924
+ * Bias local results based on a provided coordinate location or a
925
+ * user's IP address.
926
+ */
927
+ proximity?: Coordinates | "ip";
928
+ /**
929
+ * Filter results by feature types.
930
+ */
931
+ types?: GeocodeQueryType[];
932
+ /**
933
+ * Specify the desired response format of results (geojson, default) or
934
+ * for backwards compatibility (v5).
935
+ */
936
+ format?: "geojson" | "v5";
937
+ /**
938
+ * Specify the language to use for response text and, for forward
939
+ * geocoding, query result weighting.
940
+ */
941
+ language?: string;
942
+ /**
943
+ * Limit the number of results returned. The default is 5 for forward
944
+ */
945
+ limit?: number;
946
+ /**
947
+ * Filter results to geographic features whose characteristics are
948
+ * defined differently by audiences belonging to various regional,
949
+ * cultural, or political groups. Defaults to "us".
950
+ */
951
+ worldview?: string;
952
+ /**
953
+ * Return autocomplete results or not. Defaults to true.
954
+ */
955
+ autocomplete?: boolean;
956
+ /**
957
+ * Specify whether you intend to store the results of the query (true)
958
+ * or not (false, default). Temporary results are not allowed to be
959
+ * cached, while Permanent results are allowed to be cached and stored
960
+ * indefinitely. Defaults to false.
961
+ */
962
+ permanent?: boolean;
963
+ }
964
+
965
+ interface BaseForwardGeocodeRequest extends GeocodeV6Request {
966
+ /**
967
+ * Limit results to a bounding box.
968
+ */
969
+ bbox?: BoundingBox;
970
+ }
971
+
972
+ interface ReverseGeocodeRequest extends GeocodeV6Request {
973
+ /**
974
+ * longitude coordinate at which features will be searched.
975
+ */
976
+ longitude: number;
977
+ /**
978
+ * latitude coordinate at which features will be searched.
979
+ */
980
+ latitude: number;
981
+ countries?: string[];
982
+ }
983
+
984
+ interface StructuredGeocodeRequest extends BaseForwardGeocodeRequest {
985
+ mode: Extract<GeocodeMode, "structured">;
986
+ countries?: string;
987
+ /**
988
+ * A string including address_number and street. These values can
989
+ * alternatively be provided as separate parameters. (Structured Input
990
+ * specific field)
991
+ */
992
+ address_line1?: string;
993
+ /**
994
+ * The number associated with the house (Structured Input specific
995
+ * field)
996
+ */
997
+ address_number?: string;
998
+ /**
999
+ * The name of the street in the address (Structured Input specific
1000
+ * field)
1001
+ */
1002
+ street?: string;
1003
+ /**
1004
+ * In some countries like Japan, the block is a component in the address
1005
+ * (Structured Input specific field)
1006
+ */
1007
+ block?: string;
1008
+ /**
1009
+ * Typically these are cities, villages, municipalities, etc.
1010
+ * (Structured Input specific field)
1011
+ */
1012
+ place?: string;
1013
+ /**
1014
+ * Top-level sub-national administrative features, such as states in the
1015
+ * United States or provinces in Canada or China. (Structured Input
1016
+ * specific field)
1017
+ */
1018
+ region?: string;
1019
+ /**
1020
+ * Colloquial sub-city features often referred to in local parlance
1021
+ * (Structured Input specific field)
1022
+ */
1023
+ neighborhood?: string;
1024
+ /**
1025
+ * Postal codes used in country-specific national addressing systems.
1026
+ * (Structured Input specific field)
1027
+ */
1028
+ postcode?: string;
1029
+ /**
1030
+ * Official sub-city features (Structured Input specific field)
1031
+ */
1032
+ locality?: string;
1033
+ }
1034
+
1035
+ interface StandardGeocodeRequest extends BaseForwardGeocodeRequest {
1036
+ /**
1037
+ * A place name.
1038
+ */
1039
+ query: string;
1040
+ mode?: Extract<GeocodeMode, "standard">;
1041
+ countries?: string[];
1042
+ }
1043
+
1044
+ type ForwardGeocodeRequest = StructuredGeocodeRequest | StandardGeocodeRequest;
1045
+
1046
+ interface GeocodeResponse {
1047
+ /**
1048
+ * "FeatureCollection", a GeoJSON type from the GeoJSON specification.
1049
+ */
1050
+ type: string;
1051
+ /**
1052
+ * An array of feature objects.
1053
+ */
1054
+ features: Feature[];
1055
+ /**
1056
+ * Attributes the results of the Mapbox Geocoding API to Mapbox.
1057
+ */
1058
+ attribution: string;
1059
+ }
1060
+
1061
+ interface Feature {
1062
+ /**
1063
+ * Feature id. This property is named "id" to conform to the GeoJSON
1064
+ * specification, but is the same id referred to as mapbox_id elsewhere
1065
+ * in the response.
1066
+ */
1067
+ id: string;
1068
+ /**
1069
+ * "Feature", a GeoJSON type from the GeoJSON specification.
1070
+ */
1071
+ type: string;
1072
+ /**
1073
+ * An object describing the spatial geometry of the returned feature.
1074
+ */
1075
+ geometry: Geometry;
1076
+ /**
1077
+ * An object containing the resulting feature's details.
1078
+ */
1079
+ properties: Properties;
1080
+ }
1081
+
1082
+ interface Geometry {
1083
+ /**
1084
+ * "Point", a GeoJSON type from the GeoJSON specification.
1085
+ */
1086
+ type: string;
1087
+ /**
1088
+ * An array in the format [longitude,latitude] at the center of the
1089
+ * specified bbox.
1090
+ */
1091
+ coordinates: MapiRequestCoordinates;
1092
+ }
1093
+
1094
+ interface Properties extends NamedLocation {
1095
+ /**
1096
+ * A string describing the type of the feature. Options are country,
1097
+ * region, postcode, district, place, locality, neighborhood, street,
1098
+ * address. Formerly place_type in v5.
1099
+ */
1100
+ feature_type: string;
1101
+ /**
1102
+ * The coordinates of the properties.
1103
+ */
1104
+ coordinates: Coordinates;
1105
+ /**
1106
+ * An array of additional feature types.
1107
+ */
1108
+ additional_feature_types: string[];
1109
+ /**
1110
+ * The bounding box of the feature in minLon,minLat,maxLon,maxLat order.
1111
+ * This property is only provided with features of type country, region,
1112
+ * postcode, district, place, locality, or neighborhood.
1113
+ */
1114
+ bbox: number[];
1115
+ /**
1116
+ * An object representing the hierarchy of encompassing parent features.
1117
+ * This may include a sub-object for any of the following properties:
1118
+ * country, region, postcode, district, place, locality, neighborhood,
1119
+ * street.
1120
+ *
1121
+ * Which sub-objects are included is dependent upon the data coverage
1122
+ * available and applicable to a given country or area.
1123
+ */
1124
+ context: Context;
1125
+ }
1126
+
1127
+ interface Coordinates {
1128
+ /**
1129
+ * The longitude coordinate.
1130
+ */
1131
+ longitude: number;
1132
+ /**
1133
+ * The latitude coordinate.
1134
+ */
1135
+ latitude: number;
1136
+ /**
1137
+ * Accuracy metric for a returned address-type result. See "Point
1138
+ * accuracy for address features" below.
1139
+ */
1140
+ accuracy?: string;
1141
+ }
1142
+
1143
+ interface Context {
1144
+ /**
1145
+ * The region information of the context.
1146
+ */
1147
+ region?: Region;
1148
+ /**
1149
+ * The country information of the context.
1150
+ */
1151
+ country?: Country;
1152
+ /**
1153
+ * The place information of the context.
1154
+ */
1155
+ place?: Place;
1156
+ /**
1157
+ * The locality information of the context.
1158
+ */
1159
+ locality?: Locality;
1160
+ /**
1161
+ * The district information of the context.
1162
+ */
1163
+ district?: District;
1164
+ /**
1165
+ * The postcode information of the context.
1166
+ */
1167
+ postcode?: Postcode;
1168
+ }
1169
+
1170
+ interface Region extends NamedLocation {
1171
+ /**
1172
+ * The full region code of the region.
1173
+ */
1174
+ region_code_full?: string;
1175
+ /**
1176
+ * The region code of the region.
1177
+ */
1178
+ region_code?: string;
1179
+ }
1180
+
1181
+ interface Country extends NamedLocation {
1182
+ /**
1183
+ * The country code of the country.
1184
+ */
1185
+ country_code?: string;
1186
+ /**
1187
+ * The alpha-3 country code of the country.
1188
+ */
1189
+ country_code_alpha_3?: string;
1190
+ }
1191
+
1192
+ interface Place extends IdentifiableLocation {
1193
+ /**
1194
+ * The short code of the place.
1195
+ */
1196
+ short_code?: string;
1197
+ }
1198
+
1199
+ type Locality = IdentifiableLocation;
1200
+
1201
+ type District = IdentifiableLocation;
1202
+
1203
+ interface IdentifiableLocation extends NamedLocation {
1204
+ /**
1205
+ * The Wikidata ID of the identifiable location.
1206
+ */
1207
+ wikidata_id: string;
1208
+ }
1209
+
1210
+ type Postcode = NamedLocation;
1211
+
1212
+ interface NamedLocation {
1213
+ /**
1214
+ * Feature id. The mapbox_id uniquely identifies a place in the Mapbox
1215
+ * search database. Mapbox ID’s are accepted in requests to the
1216
+ * Geocoding API as a forward search, and will return the feature
1217
+ * corresponding to that id.
1218
+ */
1219
+ mapbox_id: string;
1220
+ /**
1221
+ * Formatted string of address_number and street.
1222
+ */
1223
+ name: string;
1224
+ /**
1225
+ * Present when there is a canonical or otherwise more common alias for
1226
+ * the feature name. For example, searching for "America" will return
1227
+ * "America" as the name, and "United States" as name_preferred.
1228
+ */
1229
+ name_preferred?: string;
1230
+ /**
1231
+ * Formatted string of result context: place region country postcode.
1232
+ * The part of the result which comes after name.
1233
+ */
1234
+ place_formatted?: string;
1235
+ }
1236
+ }
1237
+
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
+
868
1332
  // eslint-disable-next-line @definitelytyped/no-declare-current-package
869
1333
  declare module "@mapbox/mapbox-sdk/services/geocoding" {
870
1334
  import { LngLatLike } from "mapbox-gl";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/mapbox__mapbox-sdk",
3
- "version": "0.13.11",
3
+ "version": "0.15.0",
4
4
  "description": "TypeScript definitions for @mapbox/mapbox-sdk",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-sdk",
6
6
  "license": "MIT",
@@ -44,6 +44,6 @@
44
44
  "@types/mapbox-gl": "*",
45
45
  "@types/node": "*"
46
46
  },
47
- "typesPublisherContentHash": "10b6a4596c4d2d9d29b594af14cc4e1c59fc8c08910beeb63a6edea9dad7dc57",
48
- "typeScriptVersion": "4.6"
47
+ "typesPublisherContentHash": "b1738034479cde9f36ebab60d799341c061bf5e9a3b97b1002db17d3ac1dcbac",
48
+ "typeScriptVersion": "4.8"
49
49
  }