@tomtom-org/maps-sdk 0.55.1 → 0.57.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.
- package/CHANGELOG.md +55 -1
- package/README.md +2 -2
- package/core/dist/core.es.js +1 -1
- package/core/dist/core.es.js.map +1 -1
- package/core/dist/index.d.ts +18 -2
- package/map/dist/index.d.ts +1080 -416
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/package.json +9 -4
- package/services/dist/index.d.ts +156 -503
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
package/services/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZodError, ZodIssue, ZodObject } from "zod";
|
|
2
|
-
import { AddressProperties, AreaAnalyticsMetricKey, Avoidable,
|
|
2
|
+
import { AddressProperties, AreaAnalyticsMetricKey, Avoidable, ChargingPark, ChargingParkWithAvailability, ChargingStation, ChargingStationsAccessType, ChargingStationsAvailability, ChargingStopProps, CommonPlaceProps, Connector, ConnectorType, CurrentType, EVChargingStationWithAvailabilityPlaceProps, EntryPoint, Fuel, GeographyType, GetPositionEntryPointOption, GlobalConfig, HasBBox, HasLngLat, MapcodeType, OpeningHours, OpeningHoursMode, POICategory, Place, PlaceType, Places, PlugType, PolygonFeature, PolygonFeatures, RevGeoAddressProps, RoadShieldReference, Route, RoutePlanningLocation, Routes, SearchPlaceProps, TimeZone, TomTomAPIHeaders, TomTomHeaders, TrafficAreaAnalytics, TrafficIncidentDetails, TrafficIncidentRequestCategory, TrafficIncidentTEC, TrafficIncidentTimeValidity, TravelMode, View, inputSectionTypes } from "@tomtom-org/maps-sdk/core";
|
|
3
3
|
//#region src/shared/types/apiResponseErrorTypes.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
@@ -796,6 +796,10 @@ export type CommonPlacesParams<ApiRequest, ApiResponse> = CommonServiceParams<Ap
|
|
|
796
796
|
* - `RU`: Russia's perspective
|
|
797
797
|
* - `TR`: Turkey's perspective
|
|
798
798
|
* - `CN`: China's perspective
|
|
799
|
+
* - `TW`: Taiwan's perspective
|
|
800
|
+
* - `RS`: Serbia's perspective
|
|
801
|
+
*
|
|
802
|
+
* `MA` is accepted by this type but is not supported by the current backend.
|
|
799
803
|
*
|
|
800
804
|
* **Affected Elements:**
|
|
801
805
|
* - Border lines on maps
|
|
@@ -1881,9 +1885,11 @@ export type GenericVehicleParams = {
|
|
|
1881
1885
|
* Model (static properties) of the vehicle with generic/unspecified engine type.
|
|
1882
1886
|
*
|
|
1883
1887
|
* @remarks
|
|
1884
|
-
* Includes dimensions and other characteristics that don't change during travel.
|
|
1888
|
+
* Includes dimensions and other characteristics that don't change during travel. A predefined
|
|
1889
|
+
* `variantId` is not accepted here — only the charging-stops endpoint understands one, and that
|
|
1890
|
+
* endpoint is reached with an electric vehicle carrying charging preferences.
|
|
1885
1891
|
*/
|
|
1886
|
-
model?:
|
|
1892
|
+
model?: ExplicitVehicleModel<undefined>;
|
|
1887
1893
|
/**
|
|
1888
1894
|
* State of the vehicle with generic/unspecified engine type.
|
|
1889
1895
|
*
|
|
@@ -1945,9 +1951,10 @@ export type CombustionVehicleParams = {
|
|
|
1945
1951
|
* Model (static properties) specifically for combustion engine vehicles.
|
|
1946
1952
|
*
|
|
1947
1953
|
* @remarks
|
|
1948
|
-
* Can include fuel consumption curves and efficiency parameters.
|
|
1954
|
+
* Can include fuel consumption curves and efficiency parameters. A predefined `variantId` is not
|
|
1955
|
+
* accepted here — only the charging-stops endpoint understands one.
|
|
1949
1956
|
*/
|
|
1950
|
-
model?:
|
|
1957
|
+
model?: ExplicitVehicleModel<'combustion'>;
|
|
1951
1958
|
/**
|
|
1952
1959
|
* State specifically for combustion engine vehicles.
|
|
1953
1960
|
*
|
|
@@ -2053,7 +2060,9 @@ export type ElectricVehicleParams = {
|
|
|
2053
2060
|
* Model (static properties) specifically for electric vehicles.
|
|
2054
2061
|
*
|
|
2055
2062
|
* @remarks
|
|
2056
|
-
* Should include battery capacity, charging curve, and consumption profiles.
|
|
2063
|
+
* Should include battery capacity, charging curve, and consumption profiles. A predefined
|
|
2064
|
+
* `variantId` is accepted here, but only `calculateRoute` with charging preferences understands
|
|
2065
|
+
* one — a range or a matrix has no charging stops to plan for.
|
|
2057
2066
|
*/
|
|
2058
2067
|
model?: VehicleModel<'electric'>;
|
|
2059
2068
|
/**
|
|
@@ -2153,6 +2162,23 @@ export type ElectricVehicleParams = {
|
|
|
2153
2162
|
* @group Vehicle
|
|
2154
2163
|
*/
|
|
2155
2164
|
export type VehicleParameters = (GenericVehicleParams | CombustionVehicleParams | ElectricVehicleParams) & VehicleRestrictions;
|
|
2165
|
+
/**
|
|
2166
|
+
* An electric vehicle that has asked for charging stops.
|
|
2167
|
+
*
|
|
2168
|
+
* @remarks
|
|
2169
|
+
* Charging preferences are what select the charging-stops endpoint, so `chargingStopsStrategy` —
|
|
2170
|
+
* which no other endpoint accepts — requires this shape rather than plain
|
|
2171
|
+
* {@link ElectricVehicleParams}.
|
|
2172
|
+
*
|
|
2173
|
+
* A predefined `model.variantId` is bound to the same endpoint, but the rule cannot ride on the
|
|
2174
|
+
* vehicle type: `calculateReachableRange` takes the same vehicle and accepts a variant on its own.
|
|
2175
|
+
* `calculateRoute` validates that pairing instead.
|
|
2176
|
+
*
|
|
2177
|
+
* @group Routing
|
|
2178
|
+
*/
|
|
2179
|
+
export type ElectricVehicleParamsWithChargingStops = ElectricVehicleParams & {
|
|
2180
|
+
preferences: Required<ElectricVehiclePreferences>;
|
|
2181
|
+
} & VehicleRestrictions;
|
|
2156
2182
|
//#endregion
|
|
2157
2183
|
//#region src/shared/types/commonRoutingParams.d.ts
|
|
2158
2184
|
/**
|
|
@@ -2958,7 +2984,7 @@ type GeoJsonTypes = GeoJSON["type"];
|
|
|
2958
2984
|
* Bounding box
|
|
2959
2985
|
* https://tools.ietf.org/html/rfc7946#section-5
|
|
2960
2986
|
*/
|
|
2961
|
-
type BBox
|
|
2987
|
+
type BBox = [number, number, number, number] | [number, number, number, number, number, number];
|
|
2962
2988
|
/**
|
|
2963
2989
|
* A Position is an array of coordinates.
|
|
2964
2990
|
* https://tools.ietf.org/html/rfc7946#section-3.1.1
|
|
@@ -3025,7 +3051,7 @@ interface GeoJsonObject {
|
|
|
3025
3051
|
* The axes order of a bbox follows the axes order of geometries.
|
|
3026
3052
|
* https://tools.ietf.org/html/rfc7946#section-5
|
|
3027
3053
|
*/
|
|
3028
|
-
bbox?: BBox
|
|
3054
|
+
bbox?: BBox | undefined;
|
|
3029
3055
|
}
|
|
3030
3056
|
/**
|
|
3031
3057
|
* Union of GeoJSON objects.
|
|
@@ -3160,7 +3186,7 @@ type SummaryQueryType = 'NEARBY' | 'NON_NEAR';
|
|
|
3160
3186
|
* });
|
|
3161
3187
|
*
|
|
3162
3188
|
* const summary = results.summary;
|
|
3163
|
-
* console.log(`Found ${summary.totalResults} total results`);
|
|
3189
|
+
* console.log(`Found ${summary.totalResults ?? 'an unknown number of'} total results`);
|
|
3164
3190
|
* console.log(`Showing ${summary.numResults} results`);
|
|
3165
3191
|
* console.log(`Query type: ${summary.queryType}`); // 'NEARBY'
|
|
3166
3192
|
* console.log(`Search took ${summary.queryTime}ms`);
|
|
@@ -3207,7 +3233,8 @@ export type SearchSummary = {
|
|
|
3207
3233
|
* Number of results included in this response.
|
|
3208
3234
|
*
|
|
3209
3235
|
* This is the actual count of features in the results array,
|
|
3210
|
-
* which may be less than `totalResults` due to pagination limits.
|
|
3236
|
+
* which may be less than `totalResults` due to pagination limits. Unlike `totalResults` this
|
|
3237
|
+
* is always present — it is the length of the array you were given.
|
|
3211
3238
|
*
|
|
3212
3239
|
* @remarks
|
|
3213
3240
|
* Controlled by the `limit` parameter in the search request.
|
|
@@ -3249,10 +3276,11 @@ export type SearchSummary = {
|
|
|
3249
3276
|
* regardless of pagination limits.
|
|
3250
3277
|
*
|
|
3251
3278
|
* @remarks
|
|
3252
|
-
*
|
|
3279
|
+
* Optional — a total is not guaranteed, so guard it rather than assuming a number. Where it
|
|
3280
|
+
* is present, use it with `offset` and `numResults` to paginate:
|
|
3253
3281
|
* - Current page: `offset / limit + 1`
|
|
3254
|
-
* - Total pages: `Math.ceil(totalResults / limit)`
|
|
3255
|
-
* - Has more results: `offset + numResults < totalResults`
|
|
3282
|
+
* - Total pages: `totalResults === undefined ? undefined : Math.ceil(totalResults / limit)`
|
|
3283
|
+
* - Has more results: `totalResults !== undefined && offset + numResults < totalResults`
|
|
3256
3284
|
*
|
|
3257
3285
|
* @example
|
|
3258
3286
|
* ```typescript
|
|
@@ -3263,7 +3291,7 @@ export type SearchSummary = {
|
|
|
3263
3291
|
* // Can fetch more with offset: 10, 20, 30, 40
|
|
3264
3292
|
* ```
|
|
3265
3293
|
*/
|
|
3266
|
-
totalResults
|
|
3294
|
+
totalResults?: number;
|
|
3267
3295
|
/**
|
|
3268
3296
|
* Maximum fuzzy matching level used to find results.
|
|
3269
3297
|
*
|
|
@@ -3280,6 +3308,9 @@ export type SearchSummary = {
|
|
|
3280
3308
|
* If results are found with exact or near-exact matching, this will be low.
|
|
3281
3309
|
* If the query has typos, this increases to find matches.
|
|
3282
3310
|
*
|
|
3311
|
+
* Optional — where match strictness is not reported the field is absent rather than `0`, so
|
|
3312
|
+
* read a missing value as "not reported" rather than as an exact match.
|
|
3313
|
+
*
|
|
3283
3314
|
* @example
|
|
3284
3315
|
* ```typescript
|
|
3285
3316
|
* // Query: "amstrdam" (typo)
|
|
@@ -3289,7 +3320,7 @@ export type SearchSummary = {
|
|
|
3289
3320
|
* fuzzyLevel: 0 // Exact match, no fuzzy matching needed
|
|
3290
3321
|
* ```
|
|
3291
3322
|
*/
|
|
3292
|
-
fuzzyLevel
|
|
3323
|
+
fuzzyLevel?: number;
|
|
3293
3324
|
/**
|
|
3294
3325
|
* Geographic position used to bias search results.
|
|
3295
3326
|
*
|
|
@@ -3410,9 +3441,17 @@ type AddressRangesAPI = {
|
|
|
3410
3441
|
to: LatLonAPI;
|
|
3411
3442
|
};
|
|
3412
3443
|
/**
|
|
3444
|
+
* The summary envelope as the places endpoints send it.
|
|
3445
|
+
*
|
|
3446
|
+
* @remarks
|
|
3447
|
+
* Derived from {@link SearchSummary}, but `totalResults` and `fuzzyLevel` are pinned back to
|
|
3448
|
+
* required here. They are optional on the public type so that consumers guard them; the endpoints
|
|
3449
|
+
* we call always send them, and this type is what asserts that. Relaxing it would let a parser
|
|
3450
|
+
* silently stop populating them.
|
|
3451
|
+
*
|
|
3413
3452
|
* @ignore
|
|
3414
3453
|
*/
|
|
3415
|
-
type SummaryAPI$1 = Omit<SearchSummary, 'geoBias'> & {
|
|
3454
|
+
type SummaryAPI$1 = Omit<SearchSummary, 'geoBias'> & Required<Pick<SearchSummary, 'totalResults' | 'fuzzyLevel'>> & {
|
|
3416
3455
|
geoBias?: LatLonAPI;
|
|
3417
3456
|
};
|
|
3418
3457
|
/**
|
|
@@ -3520,6 +3559,10 @@ type AlongRouteSearchResponseAPI = {
|
|
|
3520
3559
|
* Controls how the returned POIs are ordered relative to the route.
|
|
3521
3560
|
*
|
|
3522
3561
|
* @remarks
|
|
3562
|
+
* Pass these to {@link search}, which selects the request variant from the params it is given:
|
|
3563
|
+
* a `route` property dispatches to along-route search, a `geometries` property to geometry search,
|
|
3564
|
+
* and neither to fuzzy search. {@link alongRouteSearch} is also exported directly.
|
|
3565
|
+
*
|
|
3523
3566
|
* - `detourTime`: Sort by additional travel time required to visit the POI (default)
|
|
3524
3567
|
* - `detourOffset`: Sort by how far along the route the detour point falls
|
|
3525
3568
|
*
|
|
@@ -4003,7 +4046,7 @@ type AutocompleteSearchSegmentType = 'brand' | 'category' | 'plaintext';
|
|
|
4003
4046
|
*
|
|
4004
4047
|
* @group Autocomplete Search
|
|
4005
4048
|
*/
|
|
4006
|
-
type AutocompleteSearchParams = CommonServiceParams<
|
|
4049
|
+
type AutocompleteSearchParams = CommonServiceParams<GetObject, AutocompleteSearchResponseAPI> & {
|
|
4007
4050
|
/**
|
|
4008
4051
|
* Search query string (partial user input).
|
|
4009
4052
|
*
|
|
@@ -4101,7 +4144,7 @@ type AutocompleteSearchParams = CommonServiceParams<URL, AutocompleteSearchRespo
|
|
|
4101
4144
|
* Autocomplete service template type.
|
|
4102
4145
|
* @ignore
|
|
4103
4146
|
*/
|
|
4104
|
-
type AutocompleteSearchTemplate = ServiceTemplate<AutocompleteSearchParams,
|
|
4147
|
+
type AutocompleteSearchTemplate = ServiceTemplate<AutocompleteSearchParams, GetObject, AutocompleteSearchResponseAPI, AutocompleteSearchResponse>;
|
|
4105
4148
|
//#endregion
|
|
4106
4149
|
//#region src/autocomplete-search/autocompleteSearch.d.ts
|
|
4107
4150
|
/**
|
|
@@ -4190,7 +4233,7 @@ declare const customize$11: {
|
|
|
4190
4233
|
* Default function for building autocomplete request from {@link AutocompleteSearchParams}
|
|
4191
4234
|
* @param params The autocomplete parameters, with global configuration already merged into them.
|
|
4192
4235
|
*/
|
|
4193
|
-
declare const buildAutocompleteSearchRequest: (params: AutocompleteSearchParams) =>
|
|
4236
|
+
declare const buildAutocompleteSearchRequest: (params: AutocompleteSearchParams) => GetObject;
|
|
4194
4237
|
//#endregion
|
|
4195
4238
|
//#region src/autocomplete-search/responseParser.d.ts
|
|
4196
4239
|
/**
|
|
@@ -4303,6 +4346,13 @@ type EVChargingStationsAvailabilityTemplate = ServiceTemplate<ChargingStationsAv
|
|
|
4303
4346
|
/**
|
|
4304
4347
|
* Default method for building ev charging stations availability request from {@link ChargingStationsAvailabilityParams}
|
|
4305
4348
|
* @param params The charging availability parameters, with global configuration already merged into them.
|
|
4349
|
+
*
|
|
4350
|
+
* @remarks
|
|
4351
|
+
* Unlike the other places services, this one keeps `key=` and `apiVersion=` in the query string.
|
|
4352
|
+
* `/maps/orbis/places/ev/id` answers 401 to a header-only credential, while `search`,
|
|
4353
|
+
* `poiCategories`, `geocode`, `place` and `additionalData` all accept one — probed against
|
|
4354
|
+
* production. Moving this one to headers breaks it outright rather than subtly, so it stays until
|
|
4355
|
+
* the endpoint catches up.
|
|
4306
4356
|
*/
|
|
4307
4357
|
declare const buildEVChargingStationsAvailabilityRequest: (params: ChargingStationsAvailabilityParams) => URL;
|
|
4308
4358
|
//#endregion
|
|
@@ -4432,7 +4482,7 @@ type GeocodingIndexTypesAbbreviation = Exclude<SearchIndexType, 'POI'>;
|
|
|
4432
4482
|
*
|
|
4433
4483
|
* @group Geocoding
|
|
4434
4484
|
*/
|
|
4435
|
-
type GeocodingParams = Omit<CommonPlacesParams<
|
|
4485
|
+
type GeocodingParams = Omit<CommonPlacesParams<GetObject, GeocodingResponseAPI> & CommonGeocodeAndFuzzySearchParams, 'extendedPostalCodesFor'> & {
|
|
4436
4486
|
/**
|
|
4437
4487
|
* Address or location query to geocode.
|
|
4438
4488
|
*
|
|
@@ -4492,14 +4542,14 @@ type GeocodingParams = Omit<CommonPlacesParams<URL, GeocodingResponseAPI> & Comm
|
|
|
4492
4542
|
* Geocoding service template type.
|
|
4493
4543
|
* @ignore
|
|
4494
4544
|
*/
|
|
4495
|
-
type GeocodingTemplate = ServiceTemplate<GeocodingParams,
|
|
4545
|
+
type GeocodingTemplate = ServiceTemplate<GeocodingParams, GetObject, GeocodingResponseAPI, GeocodingResponse>;
|
|
4496
4546
|
//#endregion
|
|
4497
4547
|
//#region src/geocode/requestBuilder.d.ts
|
|
4498
4548
|
/**
|
|
4499
4549
|
* Default method for building geocoding request from {@link GeocodingParams}
|
|
4500
4550
|
* @param params The geocoding parameters, with global configuration already merged into them.
|
|
4501
4551
|
*/
|
|
4502
|
-
declare const buildGeocodingRequest: (params: GeocodingParams) =>
|
|
4552
|
+
declare const buildGeocodingRequest: (params: GeocodingParams) => GetObject;
|
|
4503
4553
|
//#endregion
|
|
4504
4554
|
//#region src/geocode/responseParser.d.ts
|
|
4505
4555
|
/**
|
|
@@ -4554,7 +4604,7 @@ type GeometriesInput = string[];
|
|
|
4554
4604
|
*
|
|
4555
4605
|
* @group Geometry
|
|
4556
4606
|
*/
|
|
4557
|
-
type CommonServiceParamsWithZoom = CommonServiceParams<
|
|
4607
|
+
type CommonServiceParamsWithZoom = CommonServiceParams<GetObject, GeometryDataResponseAPI> & {
|
|
4558
4608
|
/**
|
|
4559
4609
|
* Optional zoom level for geometry detail.
|
|
4560
4610
|
*
|
|
@@ -4708,14 +4758,14 @@ type GeometryParams = GeometryDataParams | GeometryPlaceParams;
|
|
|
4708
4758
|
/**
|
|
4709
4759
|
* @ignore
|
|
4710
4760
|
*/
|
|
4711
|
-
type GeometryDataTemplate = ServiceTemplate<GeometryParams,
|
|
4761
|
+
type GeometryDataTemplate = ServiceTemplate<GeometryParams, GetObject, GeometryDataResponseAPI, PolygonFeatures>;
|
|
4712
4762
|
//#endregion
|
|
4713
4763
|
//#region src/geometry-data/requestBuilder.d.ts
|
|
4714
4764
|
/**
|
|
4715
4765
|
* Default function for building a geometry data request from {@link GeometryDataParams}
|
|
4716
4766
|
* @param params The geometry data parameters, with global configuration already merged into them.
|
|
4717
4767
|
*/
|
|
4718
|
-
declare const buildGeometryDataRequest: (params: GeometryParams) =>
|
|
4768
|
+
declare const buildGeometryDataRequest: (params: GeometryParams) => GetObject;
|
|
4719
4769
|
//#endregion
|
|
4720
4770
|
//#region src/geometry-data/responseParser.d.ts
|
|
4721
4771
|
/**
|
|
@@ -4794,6 +4844,10 @@ type GeometrySearchResponseAPI = {
|
|
|
4794
4844
|
* like "restaurants in this neighborhood" or "hotels within these city boundaries".
|
|
4795
4845
|
*
|
|
4796
4846
|
* @remarks
|
|
4847
|
+
* Pass these to {@link search}, which selects the request variant from the params it is given:
|
|
4848
|
+
* a `route` property dispatches to along-route search, a `geometries` property to geometry search,
|
|
4849
|
+
* and neither to fuzzy search. There is no separate exported function for geometry search.
|
|
4850
|
+
*
|
|
4797
4851
|
* **Key Features:**
|
|
4798
4852
|
* - Search within multiple geometries simultaneously
|
|
4799
4853
|
* - Supports polygons, multipolygons, and circles
|
|
@@ -5189,6 +5243,10 @@ type PlaceByIdOptionalParams = {
|
|
|
5189
5243
|
* - `RU`: Russia
|
|
5190
5244
|
* - `TR`: Turkey
|
|
5191
5245
|
* - `CN`: China
|
|
5246
|
+
* - `TW`: Taiwan
|
|
5247
|
+
* - `RS`: Serbia
|
|
5248
|
+
*
|
|
5249
|
+
* `MA` is accepted by this type but is not supported by the current backend.
|
|
5192
5250
|
*
|
|
5193
5251
|
* @default 'Unified'
|
|
5194
5252
|
*
|
|
@@ -5301,7 +5359,7 @@ type PlaceByIdMandatoryParams = {
|
|
|
5301
5359
|
*
|
|
5302
5360
|
* @group Place
|
|
5303
5361
|
*/
|
|
5304
|
-
type PlaceByIdParams = CommonServiceParams<
|
|
5362
|
+
type PlaceByIdParams = CommonServiceParams<GetObject, PlaceByIdResponseAPI> & PlaceByIdMandatoryParams & PlaceByIdOptionalParams;
|
|
5305
5363
|
//#endregion
|
|
5306
5364
|
//#region src/place-by-id/types/placeByIdResponse.d.ts
|
|
5307
5365
|
/**
|
|
@@ -5323,14 +5381,14 @@ type PlaceByIdResponse = Place<SearchPlaceProps> | undefined;
|
|
|
5323
5381
|
* Place By Is template type.
|
|
5324
5382
|
* @ignore
|
|
5325
5383
|
*/
|
|
5326
|
-
type PlaceByIdTemplate = ServiceTemplate<PlaceByIdParams,
|
|
5384
|
+
type PlaceByIdTemplate = ServiceTemplate<PlaceByIdParams, GetObject, PlaceByIdResponseAPI, PlaceByIdResponse>;
|
|
5327
5385
|
//#endregion
|
|
5328
5386
|
//#region src/place-by-id/requestBuilder.d.ts
|
|
5329
5387
|
/**
|
|
5330
5388
|
* Default method for building place by id request from {@link PlaceByIdParams}
|
|
5331
5389
|
* @param params The place by id parameters, with global configuration already merged into them.
|
|
5332
5390
|
*/
|
|
5333
|
-
declare const buildPlaceByIdRequest: (params: PlaceByIdParams) =>
|
|
5391
|
+
declare const buildPlaceByIdRequest: (params: PlaceByIdParams) => GetObject;
|
|
5334
5392
|
//#endregion
|
|
5335
5393
|
//#region src/place-by-id/responseParser.d.ts
|
|
5336
5394
|
/**
|
|
@@ -5416,7 +5474,7 @@ type SummaryAPI = {
|
|
|
5416
5474
|
arrivalDateTime: string;
|
|
5417
5475
|
deviationDistanceInMeters?: number;
|
|
5418
5476
|
deviationDurationInSeconds?: number;
|
|
5419
|
-
deviationPoint?:
|
|
5477
|
+
deviationPoint?: RoutePointAPI$1;
|
|
5420
5478
|
originalWaypointIndexAtEndOfLeg?: number;
|
|
5421
5479
|
historicTrafficTravelTimeInSeconds?: number;
|
|
5422
5480
|
liveTrafficIncidentsTravelTimeInSeconds?: number;
|
|
@@ -5533,19 +5591,20 @@ type SectionsAPI = {
|
|
|
5533
5591
|
importantRoadStretch?: ImportantRoadStretchSectionAPI[];
|
|
5534
5592
|
};
|
|
5535
5593
|
/**
|
|
5536
|
-
*
|
|
5594
|
+
* Every point in a routing response — `deviationPoint`, a route-path point, an instruction's
|
|
5595
|
+
* `maneuverPoint` — is a two-dimensional GeoJSON `Point`, so its coordinates are already
|
|
5596
|
+
* `[longitude, latitude]` and the parser needs no narrowing of its own.
|
|
5537
5597
|
* @ignore
|
|
5538
5598
|
*/
|
|
5539
|
-
type
|
|
5540
|
-
|
|
5541
|
-
longitude: number;
|
|
5599
|
+
type RoutePointAPI$1 = Omit<Point, 'coordinates'> & {
|
|
5600
|
+
coordinates: [number, number];
|
|
5542
5601
|
};
|
|
5543
5602
|
/**
|
|
5544
5603
|
* A point on the route path.
|
|
5545
5604
|
* @ignore
|
|
5546
5605
|
*/
|
|
5547
5606
|
type RoutePathPointAPI = {
|
|
5548
|
-
point:
|
|
5607
|
+
point: RoutePointAPI$1;
|
|
5549
5608
|
distanceFromRouteStartInMeters: number;
|
|
5550
5609
|
travelTimeFromRouteStartInSeconds: number;
|
|
5551
5610
|
};
|
|
@@ -5631,7 +5690,7 @@ type SignpostAPI = {
|
|
|
5631
5690
|
type InstructionAPI = {
|
|
5632
5691
|
routeOffsetInMeters: number;
|
|
5633
5692
|
maneuver?: string;
|
|
5634
|
-
maneuverPoint:
|
|
5693
|
+
maneuverPoint: RoutePointAPI$1;
|
|
5635
5694
|
routePath?: RoutePathPointAPI[];
|
|
5636
5695
|
nextRoadInformation?: InstructionRoadInformationAPI;
|
|
5637
5696
|
previousRoadInformation?: InstructionRoadInformationAPI;
|
|
@@ -5830,18 +5889,23 @@ export type ReachableRangeCostModel = Omit<CostModel, 'avoid' | 'avoidAreas'> &
|
|
|
5830
5889
|
* Vehicle parameters accepted by `calculateReachableRange`.
|
|
5831
5890
|
*
|
|
5832
5891
|
* @remarks
|
|
5833
|
-
* {@link VehicleParameters} without
|
|
5834
|
-
*
|
|
5835
|
-
*
|
|
5892
|
+
* {@link VehicleParameters} without the two things this endpoint has no parameter for:
|
|
5893
|
+
*
|
|
5894
|
+
* - `state.heading`, which it rejects with *"parameter [vehicleHeading] not supported"*. The
|
|
5895
|
+
* routing API takes it as `vehicleHeadingInDegrees`.
|
|
5896
|
+
* - `preferences`, whose only member is `chargingPreferences`. Those belong to the charging-stops
|
|
5897
|
+
* endpoint, and a range has no stops to plan. A predefined `model.variantId` therefore needs
|
|
5898
|
+
* nothing beside it here, unlike on `calculateRoute`.
|
|
5836
5899
|
*
|
|
5837
|
-
* Everything else is unchanged, including the
|
|
5838
|
-
* vehicle still picks between the percentage and
|
|
5900
|
+
* Both stay available on `calculateRoute`. Everything else is unchanged, including the
|
|
5901
|
+
* engine-specific `state` variants -- an electric vehicle still picks between the percentage and
|
|
5902
|
+
* kWh forms.
|
|
5839
5903
|
*
|
|
5840
5904
|
* @group Reachable Range
|
|
5841
5905
|
*/
|
|
5842
|
-
export type ReachableRangeVehicleParameters = (Omit<GenericVehicleParams, 'state'> | (Omit<CombustionVehicleParams, 'state'> & {
|
|
5906
|
+
export type ReachableRangeVehicleParameters = (Omit<GenericVehicleParams, 'state' | 'preferences'> | (Omit<CombustionVehicleParams, 'state' | 'preferences'> & {
|
|
5843
5907
|
state?: CombustionVehicleState;
|
|
5844
|
-
}) | (Omit<ElectricVehicleParams, 'state'> & {
|
|
5908
|
+
}) | (Omit<ElectricVehicleParams, 'state' | 'preferences'> & {
|
|
5845
5909
|
state?: ElectricVehicleState;
|
|
5846
5910
|
})) & VehicleRestrictions;
|
|
5847
5911
|
/**
|
|
@@ -6210,6 +6274,8 @@ type ReverseGeocodingOptionalParams = {
|
|
|
6210
6274
|
* - `TR` - Turkey
|
|
6211
6275
|
* - `TW` - Taiwan
|
|
6212
6276
|
*
|
|
6277
|
+
* `MA` is accepted by this type but is not supported by the current backend.
|
|
6278
|
+
*
|
|
6213
6279
|
* @defaultValue `"Unified"`
|
|
6214
6280
|
*/
|
|
6215
6281
|
view?: View;
|
|
@@ -6676,7 +6742,28 @@ type MaxNumberOfAlternatives = 0 | 1 | 2 | 3 | 4 | 5;
|
|
|
6676
6742
|
*
|
|
6677
6743
|
* @group Routing
|
|
6678
6744
|
*/
|
|
6679
|
-
type CalculateRouteParams =
|
|
6745
|
+
type CalculateRouteParams = ({
|
|
6746
|
+
chargingStopsStrategy?: never;
|
|
6747
|
+
} | {
|
|
6748
|
+
/**
|
|
6749
|
+
* How the service should plan charging stops on an electric route.
|
|
6750
|
+
*
|
|
6751
|
+
* Only the charging-stops endpoint understands it, and
|
|
6752
|
+
* `vehicle.preferences.chargingPreferences` is what selects that endpoint — hence the
|
|
6753
|
+
* vehicle this variant requires.
|
|
6754
|
+
*
|
|
6755
|
+
* @default 'automaticFastest' (the service's own default when unset)
|
|
6756
|
+
*
|
|
6757
|
+
* @example
|
|
6758
|
+
* ```typescript
|
|
6759
|
+
* // Plan the fastest journey, choosing charging stops along the way
|
|
6760
|
+
* chargingStopsStrategy: 'automaticFastest'
|
|
6761
|
+
* ```
|
|
6762
|
+
*/
|
|
6763
|
+
chargingStopsStrategy: ChargingStopsStrategy;
|
|
6764
|
+
/** An electric vehicle whose charging preferences ask the service to plan stops. */
|
|
6765
|
+
vehicle: ElectricVehicleParamsWithChargingStops;
|
|
6766
|
+
}) & CommonServiceParams<CalculateRouteRequestAPI, CalculateRouteResponseAPI> & CommonRoutingParams & {
|
|
6680
6767
|
/**
|
|
6681
6768
|
* Ordered list of locations (waypoints) and/or path points for route calculation.
|
|
6682
6769
|
*
|
|
@@ -6774,21 +6861,6 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
|
|
|
6774
6861
|
* ```
|
|
6775
6862
|
*/
|
|
6776
6863
|
computeTravelTimeFor?: ComputeTravelTimeFor;
|
|
6777
|
-
/**
|
|
6778
|
-
* How the service should plan charging stops on an electric route.
|
|
6779
|
-
*
|
|
6780
|
-
* Only applies to electric routes, so `vehicle.preferences.chargingPreferences` must be set
|
|
6781
|
-
* too — validation says so before the request is sent.
|
|
6782
|
-
*
|
|
6783
|
-
* @default 'automaticFastest' (the service's own default when unset)
|
|
6784
|
-
*
|
|
6785
|
-
* @example
|
|
6786
|
-
* ```typescript
|
|
6787
|
-
* // Plan the fastest journey, choosing charging stops along the way
|
|
6788
|
-
* chargingStopsStrategy: 'automaticFastest'
|
|
6789
|
-
* ```
|
|
6790
|
-
*/
|
|
6791
|
-
chargingStopsStrategy?: ChargingStopsStrategy;
|
|
6792
6864
|
/**
|
|
6793
6865
|
* Request extended progress information at route polyline points.
|
|
6794
6866
|
*
|
|
@@ -7500,16 +7572,23 @@ declare const customize: {
|
|
|
7500
7572
|
*
|
|
7501
7573
|
* @example
|
|
7502
7574
|
* ```typescript
|
|
7503
|
-
* import { mergeFromGlobal } from '@tomtom-org/maps-sdk/core';
|
|
7575
|
+
* import { isProxyCredentialsMode, mergeFromGlobal } from '@tomtom-org/maps-sdk/core';
|
|
7504
7576
|
* import { customizeService } from '@tomtom-org/maps-sdk/services';
|
|
7505
7577
|
*
|
|
7506
7578
|
* const { buildGeocodingRequest, parseGeocodingResponse } = customizeService.geocode;
|
|
7507
7579
|
*
|
|
7508
7580
|
* // Request builders expect the global configuration to be merged in already
|
|
7509
|
-
* const
|
|
7510
|
-
*
|
|
7511
|
-
*
|
|
7512
|
-
*
|
|
7581
|
+
* const config = mergeFromGlobal({ query: 'Amsterdam' });
|
|
7582
|
+
* const { url, headers } = buildGeocodingRequest(config);
|
|
7583
|
+
*
|
|
7584
|
+
* // Send the request yourself, then parse the raw API payload. The credential travels in
|
|
7585
|
+
* // `headers` — pass them on, or the request is unauthenticated. With a credentials proxy
|
|
7586
|
+
* // (no `apiKey`, custom `commonBaseURL`) the proxy's session cookie has to travel instead,
|
|
7587
|
+
* // so send `credentials: 'include'` the way the SDK's own fetch does.
|
|
7588
|
+
* const apiResponse = await fetch(url, {
|
|
7589
|
+
* headers,
|
|
7590
|
+
* ...(isProxyCredentialsMode(config) && { credentials: 'include' }),
|
|
7591
|
+
* });
|
|
7513
7592
|
* const places = parseGeocodingResponse(await apiResponse.json());
|
|
7514
7593
|
* ```
|
|
7515
7594
|
*
|
|
@@ -7662,440 +7741,6 @@ export declare function getPlacesWithEVAvailability<P extends CommonPlaceProps =
|
|
|
7662
7741
|
*/
|
|
7663
7742
|
export declare const hasChargingAvailability: (chargingPark: ChargingPark | ChargingParkWithAvailability | undefined) => chargingPark is ChargingParkWithAvailability;
|
|
7664
7743
|
//#endregion
|
|
7665
|
-
//#region src/exploration-search/types/areaTags.d.ts
|
|
7666
|
-
/**
|
|
7667
|
-
* Canonical area-tag vocabulary used by the places-api. Tokens are
|
|
7668
|
-
* lowercase `snake_case` and describe the character of the municipality
|
|
7669
|
-
* polygon a hit sits in (currently populated for `DE` / `NL` / `FR`).
|
|
7670
|
-
*
|
|
7671
|
-
* Two groups are exposed below:
|
|
7672
|
-
*
|
|
7673
|
-
* - **Populated tokens** — the 46 tokens the current pipeline run actually
|
|
7674
|
-
* emits, grouped by classification axis (settlement scale, density,
|
|
7675
|
-
* terrain, tourism, etc.). These are what every live `area_tags` value
|
|
7676
|
-
* will be drawn from today.
|
|
7677
|
-
* - **Reserved tokens** — vocabulary tokens that exist canonically but
|
|
7678
|
-
* are not populated by the current pipeline run. They may appear in
|
|
7679
|
-
* future runs without an API change, so callers should treat them as
|
|
7680
|
-
* valid even though no hit returns them today.
|
|
7681
|
-
*
|
|
7682
|
-
* The schema doc warns the vocabulary may shift between pipeline
|
|
7683
|
-
* iterations, so SDK consumers should code defensively. The
|
|
7684
|
-
* {@link AreaTag} alias falls back to `string` to keep arbitrary
|
|
7685
|
-
* (yet-to-be-added) tokens type-compatible without losing IDE
|
|
7686
|
-
* autocompletion on the known set.
|
|
7687
|
-
*
|
|
7688
|
-
* @ignore
|
|
7689
|
-
* @experimental
|
|
7690
|
-
*/
|
|
7691
|
-
export declare const POPULATED_AREA_TAGS: readonly ["village", "small_town", "mid_town", "suburban", "rural", "semi_rural", "residential", "inland", "coastal", "atlantic_coast", "alpine", "mountain", "foothills", "forest", "plains", "farmland", "agricultural", "no_tourism", "low_tourism", "moderate_tourism", "tourism_economy", "eco_tourism", "heritage_tourism", "watersports", "hiking", "cycling", "industrial", "logistics_hub", "retail_hub", "shopping_district", "hospital_town", "dining_scene", "car_oriented", "walkable", "transit_connected", "transit_sparse", "highway_corridor", "commuter_town", "low_traffic", "moderate_traffic", "sparse_commercial", "western_europe", "central_europe", "southern_europe", "north_american", "iberian"];
|
|
7692
|
-
/**
|
|
7693
|
-
* Vocabulary tokens that exist canonically in the area-tag taxonomy but
|
|
7694
|
-
* aren't emitted by the current pipeline run (per the schema doc's
|
|
7695
|
-
* "tokens that exist… but are not populated" list). Filtering on these
|
|
7696
|
-
* today returns zero hits, but a future pipeline run may activate them
|
|
7697
|
-
* without a wire-protocol change.
|
|
7698
|
-
*
|
|
7699
|
-
* @ignore
|
|
7700
|
-
* @experimental
|
|
7701
|
-
*/
|
|
7702
|
-
export declare const RESERVED_AREA_TAGS: readonly ["lakefront", "riverine", "wetland", "marina", "harbor", "beach", "mediterranean", "ski_destination", "beach_destination", "wine_tourism", "vineyard", "university_town", "medieval_old_town", "unesco_site", "midwest_us", "rust_belt"];
|
|
7703
|
-
/**
|
|
7704
|
-
* Union of every populated area-tag token currently emitted by the
|
|
7705
|
-
* places-api pipeline.
|
|
7706
|
-
*
|
|
7707
|
-
* @ignore
|
|
7708
|
-
* @experimental
|
|
7709
|
-
*/
|
|
7710
|
-
type PopulatedAreaTag = (typeof POPULATED_AREA_TAGS)[number];
|
|
7711
|
-
/**
|
|
7712
|
-
* Union of every canonical (populated + reserved) area-tag token. Reserved
|
|
7713
|
-
* tokens may begin appearing as the pipeline evolves.
|
|
7714
|
-
*
|
|
7715
|
-
* @ignore
|
|
7716
|
-
* @experimental
|
|
7717
|
-
*/
|
|
7718
|
-
type CanonicalAreaTag = PopulatedAreaTag | (typeof RESERVED_AREA_TAGS)[number];
|
|
7719
|
-
/**
|
|
7720
|
-
* Area-tag token accepted by the places-api `area_tags` filter and
|
|
7721
|
-
* returned on each hit's `areaTags` property.
|
|
7722
|
-
*
|
|
7723
|
-
* Resolves to the canonical {@link CanonicalAreaTag} union for editor
|
|
7724
|
-
* autocompletion, but tolerates any other string so the SDK doesn't
|
|
7725
|
-
* hard-error on tokens added in a future pipeline run. To strictly
|
|
7726
|
-
* constrain inputs to the currently-known vocabulary, use
|
|
7727
|
-
* {@link CanonicalAreaTag} (or {@link PopulatedAreaTag}) directly.
|
|
7728
|
-
*
|
|
7729
|
-
* @example
|
|
7730
|
-
* ```typescript
|
|
7731
|
-
* // Autocomplete on the canonical vocabulary, but new tokens still type-check.
|
|
7732
|
-
* const tags: AreaTag[] = ['walkable', 'transit_connected'];
|
|
7733
|
-
* ```
|
|
7734
|
-
*
|
|
7735
|
-
* @ignore
|
|
7736
|
-
* @experimental
|
|
7737
|
-
*/
|
|
7738
|
-
type AreaTag = CanonicalAreaTag | string;
|
|
7739
|
-
//#endregion
|
|
7740
|
-
//#region src/exploration-search/types/explorationSearchRequestAPI.d.ts
|
|
7741
|
-
/**
|
|
7742
|
-
* @ignore
|
|
7743
|
-
*/
|
|
7744
|
-
type NearAPI = {
|
|
7745
|
-
coordinates: Position;
|
|
7746
|
-
radius_km: number;
|
|
7747
|
-
};
|
|
7748
|
-
/**
|
|
7749
|
-
* @ignore
|
|
7750
|
-
*/
|
|
7751
|
-
type ExplorationSearchPayloadAPI = {
|
|
7752
|
-
q?: string;
|
|
7753
|
-
country?: string;
|
|
7754
|
-
municipalities?: string[];
|
|
7755
|
-
brand?: string;
|
|
7756
|
-
categories?: string[];
|
|
7757
|
-
types?: ExplorationRecordType[];
|
|
7758
|
-
area_id?: string;
|
|
7759
|
-
area_tags?: AreaTag[];
|
|
7760
|
-
near?: NearAPI;
|
|
7761
|
-
bboxes?: BBox[];
|
|
7762
|
-
geometries?: (Polygon | MultiPolygon)[];
|
|
7763
|
-
from?: number;
|
|
7764
|
-
size?: number;
|
|
7765
|
-
};
|
|
7766
|
-
/**
|
|
7767
|
-
* Exploration search request type.
|
|
7768
|
-
* @ignore
|
|
7769
|
-
*/
|
|
7770
|
-
type ExplorationSearchRequestAPI = PostObject<ExplorationSearchPayloadAPI>;
|
|
7771
|
-
//#endregion
|
|
7772
|
-
//#region src/exploration-search/types/explorationSearchResponseAPI.d.ts
|
|
7773
|
-
/**
|
|
7774
|
-
* @ignore
|
|
7775
|
-
*/
|
|
7776
|
-
type ExplorationClassificationAPI = {
|
|
7777
|
-
code: string;
|
|
7778
|
-
name: string;
|
|
7779
|
-
};
|
|
7780
|
-
/**
|
|
7781
|
-
* @ignore
|
|
7782
|
-
*/
|
|
7783
|
-
type ExplorationBrandAPI = {
|
|
7784
|
-
id?: string;
|
|
7785
|
-
name: string;
|
|
7786
|
-
};
|
|
7787
|
-
/**
|
|
7788
|
-
* @ignore
|
|
7789
|
-
* A single open interval inside {@link ExplorationOpeningHoursAPI.intervals}.
|
|
7790
|
-
*
|
|
7791
|
-
* - `days` — ISO day-of-week numbers `1` (Monday) through `7` (Sunday) the
|
|
7792
|
-
* interval applies to.
|
|
7793
|
-
* - `open` / `close` — `HH:MM` strings. `"24:00"` denotes end-of-day so that
|
|
7794
|
-
* round-the-clock intervals can be expressed as `00:00` → `24:00`.
|
|
7795
|
-
*/
|
|
7796
|
-
type ExplorationOpeningIntervalAPI = {
|
|
7797
|
-
days: number[];
|
|
7798
|
-
open: string;
|
|
7799
|
-
close: string;
|
|
7800
|
-
};
|
|
7801
|
-
/**
|
|
7802
|
-
* @ignore
|
|
7803
|
-
* Opening-hours payload as returned by the places-api. The compact raw
|
|
7804
|
-
* TomTom hours string is parsed upstream into structured `intervals`; the
|
|
7805
|
-
* source string is not exposed in the API response.
|
|
7806
|
-
*/
|
|
7807
|
-
type ExplorationOpeningHoursAPI = {
|
|
7808
|
-
is24h?: boolean;
|
|
7809
|
-
intervals?: ExplorationOpeningIntervalAPI[];
|
|
7810
|
-
};
|
|
7811
|
-
/**
|
|
7812
|
-
* @ignore
|
|
7813
|
-
*/
|
|
7814
|
-
type ExplorationChargingParkAPI = {
|
|
7815
|
-
stationId?: string;
|
|
7816
|
-
connectors?: {
|
|
7817
|
-
id: string;
|
|
7818
|
-
}[];
|
|
7819
|
-
};
|
|
7820
|
-
/**
|
|
7821
|
-
* @ignore
|
|
7822
|
-
* POI document fields nested under `poi` on each hit. The API strips
|
|
7823
|
-
* per-language name maps (`names`, `alternativeNames`) and the street
|
|
7824
|
-
* alternative-name map on the way out, so they are not modeled here.
|
|
7825
|
-
*/
|
|
7826
|
-
type ExplorationPOIAPI = {
|
|
7827
|
-
name?: string;
|
|
7828
|
-
phone?: string;
|
|
7829
|
-
url?: string;
|
|
7830
|
-
brands?: ExplorationBrandAPI[];
|
|
7831
|
-
categorySet?: string[];
|
|
7832
|
-
classifications?: ExplorationClassificationAPI[];
|
|
7833
|
-
preferredCategoryId?: string;
|
|
7834
|
-
nearbyCategoryIds?: string[] | null;
|
|
7835
|
-
feature?: string;
|
|
7836
|
-
openingHours?: ExplorationOpeningHoursAPI;
|
|
7837
|
-
accessType?: string | null;
|
|
7838
|
-
outOfBusiness?: string | null;
|
|
7839
|
-
heavyVehicleCategories?: string[];
|
|
7840
|
-
timeZone?: TimeZone;
|
|
7841
|
-
};
|
|
7842
|
-
/**
|
|
7843
|
-
* @ignore
|
|
7844
|
-
* Envelope bounding box on Street records — two corner `[lon, lat]` positions.
|
|
7845
|
-
*/
|
|
7846
|
-
type ExplorationViewportAPI = {
|
|
7847
|
-
type: 'envelope';
|
|
7848
|
-
coordinates: [Position, Position];
|
|
7849
|
-
};
|
|
7850
|
-
/**
|
|
7851
|
-
* @ignore
|
|
7852
|
-
* Hit shape shared across record types. API metadata (`id`, `score`,
|
|
7853
|
-
* `distance_m`, `address`, `position`) sits at the top level; POI document
|
|
7854
|
-
* fields are nested under `poi` on `type === 'POI'` hits. Positions are
|
|
7855
|
-
* GeoJSON `[lon, lat]` arrays (the API normalizes OpenSearch's `{lat, lon}`
|
|
7856
|
-
* storage form on the way out).
|
|
7857
|
-
*
|
|
7858
|
-
* Field presence by record type:
|
|
7859
|
-
* - `poi` — POI records only
|
|
7860
|
-
* - `viewport` — Street records only (envelope of the street extent)
|
|
7861
|
-
* - `address.entryPoint` — PointAddress records only
|
|
7862
|
-
*/
|
|
7863
|
-
type ExplorationSearchResultAPI = {
|
|
7864
|
-
id: string;
|
|
7865
|
-
score?: number;
|
|
7866
|
-
distance_m?: number;
|
|
7867
|
-
type?: ExplorationRecordType;
|
|
7868
|
-
dataSource?: string;
|
|
7869
|
-
sourceId?: string;
|
|
7870
|
-
country_code?: string;
|
|
7871
|
-
aliasIds?: string[];
|
|
7872
|
-
address?: AddressProperties & {
|
|
7873
|
-
entryPoint?: string;
|
|
7874
|
-
};
|
|
7875
|
-
position: Position;
|
|
7876
|
-
viewport?: ExplorationViewportAPI;
|
|
7877
|
-
vehicleTypes?: string[];
|
|
7878
|
-
chargingPark?: ExplorationChargingParkAPI;
|
|
7879
|
-
placeId?: string;
|
|
7880
|
-
adminChainId?: string;
|
|
7881
|
-
poi?: ExplorationPOIAPI;
|
|
7882
|
-
/** Id of the municipality polygon the hit sits in. Populated for DE / NL / FR only. */
|
|
7883
|
-
area_id?: string;
|
|
7884
|
-
/** ISO2 country of the municipality polygon the hit sits in. Populated for DE / NL / FR only. */
|
|
7885
|
-
area_country?: string;
|
|
7886
|
-
/** Area-character tokens propagated from the hit's municipality polygon. Populated for DE / NL / FR only. */
|
|
7887
|
-
area_tags?: string[];
|
|
7888
|
-
};
|
|
7889
|
-
/**
|
|
7890
|
-
* @ignore
|
|
7891
|
-
* Envelope response shape — `total` is capped at 10000 even when more records match.
|
|
7892
|
-
*/
|
|
7893
|
-
type ExplorationSearchResponseAPI = {
|
|
7894
|
-
total: number;
|
|
7895
|
-
hits: ExplorationSearchResultAPI[];
|
|
7896
|
-
};
|
|
7897
|
-
//#endregion
|
|
7898
|
-
//#region src/exploration-search/types/explorationSearchParams.d.ts
|
|
7899
|
-
/**
|
|
7900
|
-
* Record types the exploration search can return — POIs, standalone point
|
|
7901
|
-
* addresses, and street records. Matches the API's `types` filter vocabulary.
|
|
7902
|
-
*
|
|
7903
|
-
* @ignore
|
|
7904
|
-
* @experimental
|
|
7905
|
-
*/
|
|
7906
|
-
type ExplorationRecordType = 'POI' | 'PointAddress' | 'Street';
|
|
7907
|
-
/**
|
|
7908
|
-
* Parameters for the exploration search service.
|
|
7909
|
-
*
|
|
7910
|
-
* Mirrors the input surface of the existing {@link search} service, with two
|
|
7911
|
-
* extra filters exposed by the exploration places API (`municipalities` and
|
|
7912
|
-
* `geometries`).
|
|
7913
|
-
*
|
|
7914
|
-
* @remarks
|
|
7915
|
-
* **Mapping to the places API body:**
|
|
7916
|
-
* - `query` → `q`
|
|
7917
|
-
* - `countries[0]` → `country`
|
|
7918
|
-
* - `poiBrands[0]` → `brand`
|
|
7919
|
-
* - `poiCategories` → `categories` (mapped to TomTom numeric category ids)
|
|
7920
|
-
* - `geoBias` → `near.coordinates` + `near.radius_km`
|
|
7921
|
-
* - `boundingBoxes` → `bboxes`
|
|
7922
|
-
* - `geometries` → `geometries` (Polygon/MultiPolygon passed through; Circle
|
|
7923
|
-
* buffered to a Polygon; FeatureCollection flattened to its features)
|
|
7924
|
-
* - `municipalities` → `municipalities`
|
|
7925
|
-
* - `areaId` → `area_id`
|
|
7926
|
-
* - `areaTags` → `area_tags`
|
|
7927
|
-
* - `offset` → `from`
|
|
7928
|
-
* - `limit` → `size`
|
|
7929
|
-
*
|
|
7930
|
-
* @ignore
|
|
7931
|
-
* @experimental
|
|
7932
|
-
*/
|
|
7933
|
-
type ExplorationSearchParams = CommonSearchParams<ExplorationSearchRequestAPI, ExplorationSearchResponseAPI> & Omit<CommonGeocodeAndFuzzySearchParams, 'geoBias'> & {
|
|
7934
|
-
/**
|
|
7935
|
-
* The point to search around, and how far. Unlike the other search services, this endpoint
|
|
7936
|
-
* takes a point and {@link boundingBoxes} as separate filters, so both may be given.
|
|
7937
|
-
*/
|
|
7938
|
-
geoBias?: PointGeoBias;
|
|
7939
|
-
/**
|
|
7940
|
-
* Exact, case-sensitive municipality/city filters (e.g. `['Amsterdam', 'Utrecht']`).
|
|
7941
|
-
*/
|
|
7942
|
-
municipalities?: string[];
|
|
7943
|
-
/**
|
|
7944
|
-
* Bounding boxes to restrict results to, sent as the API's `bboxes` array.
|
|
7945
|
-
*/
|
|
7946
|
-
boundingBoxes?: HasBBox[];
|
|
7947
|
-
/**
|
|
7948
|
-
* Geometries to constrain results to. Accepts the same input shapes as
|
|
7949
|
-
* {@link GeometrySearchParams.geometries} — `Polygon`, `MultiPolygon`,
|
|
7950
|
-
* `Circle`, or `PolygonFeatures`. POIs whose position lies inside any
|
|
7951
|
-
* provided shape are returned.
|
|
7952
|
-
*
|
|
7953
|
-
* Circles are buffered into polygons before being sent to the API.
|
|
7954
|
-
*/
|
|
7955
|
-
geometries?: SearchGeometryInput[];
|
|
7956
|
-
/**
|
|
7957
|
-
* Restrict the response to specific record types. Defaults to all types.
|
|
7958
|
-
*
|
|
7959
|
-
* - `'POI'` — points of interest (businesses, landmarks, amenities)
|
|
7960
|
-
* - `'PointAddress'` — standalone street addresses with building numbers
|
|
7961
|
-
* - `'Street'` — street records (no building number)
|
|
7962
|
-
*
|
|
7963
|
-
* Example: `placeTypes: ['POI', 'PointAddress']` to exclude Street records.
|
|
7964
|
-
*/
|
|
7965
|
-
placeTypes?: ExplorationRecordType[];
|
|
7966
|
-
/**
|
|
7967
|
-
* Exact id of a municipality polygon — restricts results to places that
|
|
7968
|
-
* sit inside that municipality. Typically populated from the `areaId`
|
|
7969
|
-
* of a previous hit ("what else is in this same area?"). Efficient
|
|
7970
|
-
* terms-only lookup, no spatial query required.
|
|
7971
|
-
*/
|
|
7972
|
-
areaId?: string;
|
|
7973
|
-
/**
|
|
7974
|
-
* Area-character tokens describing the surrounding municipality
|
|
7975
|
-
* (`coastal`, `walkable`, `alpine`, `transit_connected`, …). Matches
|
|
7976
|
-
* places in any municipality tagged with ANY of the supplied tokens
|
|
7977
|
-
* (OR semantics). Populated for `DE` / `NL` / `FR` only — supplying
|
|
7978
|
-
* tags in other countries will return zero hits.
|
|
7979
|
-
*
|
|
7980
|
-
* Typed against {@link AreaTag} — autocompletes on the canonical
|
|
7981
|
-
* vocabulary but tolerates new tokens added in a future pipeline
|
|
7982
|
-
* run without a wire-protocol change.
|
|
7983
|
-
*/
|
|
7984
|
-
areaTags?: AreaTag[];
|
|
7985
|
-
};
|
|
7986
|
-
//#endregion
|
|
7987
|
-
//#region src/exploration-search/types/explorationSearchResponse.d.ts
|
|
7988
|
-
/**
|
|
7989
|
-
* Additional properties exposed on each feature in an exploration search
|
|
7990
|
-
* response. The places-api propagates "area" metadata from the municipality
|
|
7991
|
-
* polygon each hit sits in (currently populated for `DE` / `NL` / `FR`); the
|
|
7992
|
-
* SDK surfaces those fields alongside the standard {@link SearchPlaceProps}.
|
|
7993
|
-
*
|
|
7994
|
-
* The `address` is widened from the SDK's standard {@link AddressProperties}
|
|
7995
|
-
* to also expose the optional `entryPoint` string the places-api emits on
|
|
7996
|
-
* `PointAddress` records.
|
|
7997
|
-
*
|
|
7998
|
-
* @ignore
|
|
7999
|
-
* @experimental
|
|
8000
|
-
*/
|
|
8001
|
-
type ExplorationPlaceProps = Omit<SearchPlaceProps, 'address'> & {
|
|
8002
|
-
address: AddressProperties & {
|
|
8003
|
-
entryPoint?: string;
|
|
8004
|
-
};
|
|
8005
|
-
/**
|
|
8006
|
-
* Id of the municipality polygon this hit sits inside. Round-trips into
|
|
8007
|
-
* `areaId` on a subsequent request to fetch every other place in the
|
|
8008
|
-
* same municipality.
|
|
8009
|
-
*/
|
|
8010
|
-
areaId?: string;
|
|
8011
|
-
/**
|
|
8012
|
-
* ISO 3166-1 alpha-2 country code of the hit's municipality polygon.
|
|
8013
|
-
*/
|
|
8014
|
-
areaCountry?: string;
|
|
8015
|
-
/**
|
|
8016
|
-
* Area-character tokens describing the surrounding municipality
|
|
8017
|
-
* (e.g. `coastal`, `walkable`, `transit_connected`).
|
|
8018
|
-
*
|
|
8019
|
-
* Typed against {@link AreaTag} for editor autocompletion on the
|
|
8020
|
-
* canonical vocabulary; arbitrary strings stay compatible to
|
|
8021
|
-
* tolerate future pipeline-run additions.
|
|
8022
|
-
*/
|
|
8023
|
-
areaTags?: AreaTag[];
|
|
8024
|
-
};
|
|
8025
|
-
/**
|
|
8026
|
-
* Response from the exploration search service.
|
|
8027
|
-
*
|
|
8028
|
-
* Matches the shape produced by {@link search} — a `FeatureCollection` of
|
|
8029
|
-
* place features with search-specific properties (`score`, `distance`) and a
|
|
8030
|
-
* {@link SearchSummary} on the collection — extended with the
|
|
8031
|
-
* exploration-specific `areaId` / `areaCountry` / `areaTags` fields on each
|
|
8032
|
-
* feature.
|
|
8033
|
-
*
|
|
8034
|
-
* @ignore
|
|
8035
|
-
* @experimental
|
|
8036
|
-
*/
|
|
8037
|
-
type ExplorationSearchResponse = Places<ExplorationPlaceProps, SearchSummary>;
|
|
8038
|
-
//#endregion
|
|
8039
|
-
//#region src/exploration-search/explorationSearchTemplate.d.ts
|
|
8040
|
-
/**
|
|
8041
|
-
* Exploration search service template type.
|
|
8042
|
-
* @ignore
|
|
8043
|
-
*/
|
|
8044
|
-
type ExplorationSearchTemplate = ServiceTemplate<ExplorationSearchParams, ExplorationSearchRequestAPI, ExplorationSearchResponseAPI, ExplorationSearchResponse>;
|
|
8045
|
-
//#endregion
|
|
8046
|
-
//#region src/exploration-search/explorationSearch.d.ts
|
|
8047
|
-
/**
|
|
8048
|
-
* Search for places via the exploration places API.
|
|
8049
|
-
*
|
|
8050
|
-
* The exploration search service exposes the same input and output surface as
|
|
8051
|
-
* the existing {@link search} service, but targets the exploration places API
|
|
8052
|
-
* (POST `/places` with a JSON body) instead of the TomTom Search API.
|
|
8053
|
-
*
|
|
8054
|
-
* @remarks
|
|
8055
|
-
* Key features:
|
|
8056
|
-
* - **Fuzzy name match** via {@link ExplorationSearchParams.query}
|
|
8057
|
-
* - **Near filter** via `position` + `radiusMeters` (mapped to `near.coordinates` + `near.radius_km`)
|
|
8058
|
-
* - **Bounding box** via `boundingBox` (mapped to `bboxes`)
|
|
8059
|
-
* - **Geometries** via {@link ExplorationSearchParams.geometries} (Polygon,
|
|
8060
|
-
* MultiPolygon, Circle, or FeatureCollection — same shape as {@link geometrySearch})
|
|
8061
|
-
* - **Brand / category / country / municipalities** filters
|
|
8062
|
-
* - **Pagination** via `offset` / `limit` (mapped to `from` / `size`)
|
|
8063
|
-
*
|
|
8064
|
-
* @param params Exploration search parameters
|
|
8065
|
-
* @param customTemplate Advanced customization for request/response handling
|
|
8066
|
-
*
|
|
8067
|
-
* @returns Promise resolving to a collection of matching places, with the same
|
|
8068
|
-
* {@link SearchPlaceProps} shape used by the existing search service.
|
|
8069
|
-
*
|
|
8070
|
-
* @example
|
|
8071
|
-
* ```typescript
|
|
8072
|
-
* // Nearest restaurants to Dam Square
|
|
8073
|
-
* const results = await explorationSearch({
|
|
8074
|
-
* position: [4.9003, 52.3791],
|
|
8075
|
-
* radiusMeters: 5000,
|
|
8076
|
-
* poiCategories: ['RESTAURANT'],
|
|
8077
|
-
* limit: 10,
|
|
8078
|
-
* });
|
|
8079
|
-
*
|
|
8080
|
-
* // Inside a GeoJSON polygon
|
|
8081
|
-
* const inArea = await explorationSearch({
|
|
8082
|
-
* geometries: [{
|
|
8083
|
-
* type: 'Polygon',
|
|
8084
|
-
* coordinates: [[
|
|
8085
|
-
* [4.878, 52.364], [4.922, 52.364],
|
|
8086
|
-
* [4.922, 52.394], [4.878, 52.394],
|
|
8087
|
-
* [4.878, 52.364],
|
|
8088
|
-
* ]],
|
|
8089
|
-
* }],
|
|
8090
|
-
* poiCategories: ['RESTAURANT'],
|
|
8091
|
-
* });
|
|
8092
|
-
* ```
|
|
8093
|
-
*
|
|
8094
|
-
* @ignore
|
|
8095
|
-
* @experimental
|
|
8096
|
-
*/
|
|
8097
|
-
export declare const explorationSearch: (params: ExplorationSearchParams, customTemplate?: Partial<ExplorationSearchTemplate>) => Promise<ExplorationSearchResponse>;
|
|
8098
|
-
//#endregion
|
|
8099
7744
|
//#region src/geocode/geocoding.d.ts
|
|
8100
7745
|
/**
|
|
8101
7746
|
* Convert addresses into geographic coordinates (geocoding).
|
|
@@ -8331,7 +7976,7 @@ type PoiCategoriesResponseAPI = {
|
|
|
8331
7976
|
*
|
|
8332
7977
|
* @group POI Categories
|
|
8333
7978
|
*/
|
|
8334
|
-
type POICategoriesParams = CommonServiceParams<
|
|
7979
|
+
type POICategoriesParams = CommonServiceParams<GetObject, PoiCategoriesResponseAPI> & {
|
|
8335
7980
|
/**
|
|
8336
7981
|
* One or more filter strings applied client-side against the text index.
|
|
8337
7982
|
*
|
|
@@ -8726,8 +8371,12 @@ type FuzzySearchFeatureCollectionProps = SearchSummary & {
|
|
|
8726
8371
|
*
|
|
8727
8372
|
* Indicates how the search engine interpreted the query
|
|
8728
8373
|
* (e.g., as coordinates, nearby search, what3words, or bookmark).
|
|
8374
|
+
*
|
|
8375
|
+
* @remarks
|
|
8376
|
+
* Optional — query-intent detection is not guaranteed, so guard it rather than assuming it is
|
|
8377
|
+
* present.
|
|
8729
8378
|
*/
|
|
8730
|
-
queryIntent
|
|
8379
|
+
queryIntent?: QueryIntent[];
|
|
8731
8380
|
};
|
|
8732
8381
|
/**
|
|
8733
8382
|
* Union type for all possible query intents.
|
|
@@ -8915,7 +8564,7 @@ type FuzzySearchResponseAPI = {
|
|
|
8915
8564
|
* Summary information about the search that was performed.
|
|
8916
8565
|
*/
|
|
8917
8566
|
summary: SummaryAPI$1 & {
|
|
8918
|
-
queryIntent
|
|
8567
|
+
queryIntent?: QueryIntentAPI[];
|
|
8919
8568
|
};
|
|
8920
8569
|
/**
|
|
8921
8570
|
* The result list, sorted in descending order by score.
|
|
@@ -8984,6 +8633,10 @@ type NearbyIntentDetailsAPI = Omit<NearbyIntentDetails, 'position'> & {
|
|
|
8984
8633
|
* It's designed to handle typos, abbreviations, and incomplete input gracefully.
|
|
8985
8634
|
*
|
|
8986
8635
|
* @remarks
|
|
8636
|
+
* Pass these to {@link search}, which selects the request variant from the params it is given:
|
|
8637
|
+
* a `route` property dispatches to along-route search, a `geometries` property to geometry search,
|
|
8638
|
+
* and neither to fuzzy search. There is no separate exported function for fuzzy search.
|
|
8639
|
+
*
|
|
8987
8640
|
* **Key Features:**
|
|
8988
8641
|
* - Tolerates typos and spelling mistakes
|
|
8989
8642
|
* - Handles partial queries and abbreviations
|
|
@@ -9018,7 +8671,7 @@ type NearbyIntentDetailsAPI = Omit<NearbyIntentDetails, 'position'> & {
|
|
|
9018
8671
|
*
|
|
9019
8672
|
* @group Search
|
|
9020
8673
|
*/
|
|
9021
|
-
type FuzzySearchParams = CommonSearchParams<
|
|
8674
|
+
type FuzzySearchParams = CommonSearchParams<GetObject, FuzzySearchResponseAPI> & CommonGeocodeAndFuzzySearchParams & {
|
|
9022
8675
|
/**
|
|
9023
8676
|
* Minimum fuzziness level to be used.
|
|
9024
8677
|
*
|
|
@@ -9076,7 +8729,7 @@ type FuzzySearchParams = CommonSearchParams<URL, FuzzySearchResponseAPI> & Commo
|
|
|
9076
8729
|
* Fuzzy search service template type.
|
|
9077
8730
|
* @ignore
|
|
9078
8731
|
*/
|
|
9079
|
-
type FuzzySearchTemplate = ServiceTemplate<FuzzySearchParams,
|
|
8732
|
+
type FuzzySearchTemplate = ServiceTemplate<FuzzySearchParams, GetObject, FuzzySearchResponseAPI, FuzzySearchResponse>;
|
|
9080
8733
|
//#endregion
|
|
9081
8734
|
//#region src/search/search.d.ts
|
|
9082
8735
|
type SearchFeatureCollectionProps = SearchSummary & {
|
|
@@ -9321,4 +8974,4 @@ export declare const trafficAreaAnalytics: (params: TrafficAreaAnalyticsParams,
|
|
|
9321
8974
|
*/
|
|
9322
8975
|
export declare const trafficIncidentDetails: (params: TrafficIncidentDetailsParams, customTemplate?: Partial<TrafficIncidentDetailsTemplate>) => Promise<TrafficIncidentDetails>;
|
|
9323
8976
|
//#endregion
|
|
9324
|
-
export type { AdditionalDataAPI, AlongRouteSearchParams, AlongRouteSearchPayloadAPI, AlongRouteSearchRequestAPI, AlongRouteSearchResponse, AlongRouteSearchResponseAPI, AlongRouteSearchResultAPI, AlongRouteSortBy, AreaAnalyticsDateInput,
|
|
8977
|
+
export type { AdditionalDataAPI, AlongRouteSearchParams, AlongRouteSearchPayloadAPI, AlongRouteSearchRequestAPI, AlongRouteSearchResponse, AlongRouteSearchResponseAPI, AlongRouteSearchResultAPI, AlongRouteSortBy, AreaAnalyticsDateInput, ArrivalSide, AutocompleteGenericSearchSegment, AutocompleteSearchBrandSegment, AutocompleteSearchCategorySegment, AutocompleteSearchCategorySegmentAPI, AutocompleteSearchContext, AutocompleteSearchContextAPI, AutocompleteSearchMatch, AutocompleteSearchMatches, AutocompleteSearchParams, AutocompleteSearchPlaintextSegment, AutocompleteSearchResponse, AutocompleteSearchResponseAPI, AutocompleteSearchResult, AutocompleteSearchResultAPI, AutocompleteSearchResultGeoBias, AutocompleteSearchResultGeoBiasAPI, AutocompleteSearchSegment, AutocompleteSearchSegmentAPI, AutocompleteSearchSegmentType, BookmarkIntent, BookmarkIntentDetails, CalculateRouteParams, ChargingStationsAvailabilityParams, ChargingStopsStrategy, Circle, CircleAPI, CommonServiceParamsWithZoom, ComputeTravelTimeFor, CoordinateIntent, CoordinateIntentAPI, CoordinateIntentDetails, CoordinateIntentDetailsAPI, ExtendedRouteRepresentation, FunctionalRoadClass, FuzzySearchParams, FuzzySearchResponse, FuzzySearchResponseAPI, FuzzySearchResultAPI, GeocodingParams, GeocodingProps, GeocodingResponse, GeometriesInput, GeometryAPI, GeometryDataParams, GeometryDataResponseAPI, GeometryParams, GeometryPlaceParams, GeometrySearchFeatureCollectionProps, GeometrySearchParams, GeometrySearchPayloadAPI, GeometrySearchRequestAPI, GeometrySearchResponse, GeometrySearchResponseAPI, GeometrySearchResultAPI, GuidanceParams, InputSectionType, InputSectionTypes, LegCostModel, MaxNumberOfAlternatives, NearbyIntent, NearbyIntentAPI, NearbyIntentDetails, NearbyIntentDetailsAPI, POICategoriesParams, POICategoriesResponse, POICategoryResult, Phonetics, PlaceByIdMandatoryParams, PlaceByIdOptionalParams, PlaceByIdParams, PlaceByIdResponse, PlaceByIdResponseAPI, PlaceByIdResultAPI, PoiCategoriesResponseAPI, PoiCategoryAPI, PolygonAPI, QueryIntent, QueryIntentAPI, ReverseGeocodingMandatoryParams, ReverseGeocodingOptionalParams, ReverseGeocodingParams, RoutePointAPI, RouteStopOptions, SearchGeometryInput, TrafficAreaAnalyticsDateRange, TrafficAreaAnalyticsDays, TrafficAreaAnalyticsParams, TrafficIncidentDetailsByBBoxParams, TrafficIncidentDetailsByIdsParams, TrafficIncidentDetailsParams, W3WIntent, W3WIntentDetails, arrivalSides, chargingStopsStrategies, functionalRoadClasses, metricKeyToApiDataType };
|