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