@tomtom-org/maps-sdk 0.33.0 → 0.34.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tomtom-org/maps-sdk",
3
3
  "author": "TomTom International B.V.",
4
4
  "license": "See in LICENSE.txt",
5
- "version": "0.33.0",
5
+ "version": "0.34.0",
6
6
  "description": "TomTom Maps for JavaScript",
7
7
  "keywords": [
8
8
  "tomtom",
@@ -2,7 +2,6 @@ import { $ZodError } from 'zod/v4/core';
2
2
  import { $ZodIssue } from 'zod/v4/core';
3
3
  import { AddressProperties } from '../../../../core';
4
4
  import { Avoidable } from '../../../../core';
5
- import { Brand } from '../../../../core';
6
5
  import { ChargingStation } from '../../../../core';
7
6
  import { ChargingStationsAccessType } from '../../../../core';
8
7
  import { ChargingStationsAvailability } from '../../../core';
@@ -68,7 +67,7 @@ import { ZodMiniObject } from 'zod/v4-mini';
68
67
  */
69
68
  export declare type AdditionalDataAPI = {
70
69
  providerID: string;
71
- error: string;
70
+ error?: string;
72
71
  geometryData: GeoJsonObject;
73
72
  };
74
73
 
@@ -709,6 +708,18 @@ declare type BoundingBoxSouthWestAPI = {
709
708
  */
710
709
  declare type BoundingBoxTopLeftAPI = ViewportAPI;
711
710
 
711
+ /**
712
+ * @ignore
713
+ */
714
+ declare type BrandAPI = {
715
+ /**
716
+ * Brand name.
717
+ *
718
+ * The commercial or franchise name (e.g., 'McDonald\'s', 'Shell', 'Hilton').
719
+ */
720
+ name: string;
721
+ };
722
+
712
723
  /**
713
724
  * Type of budget constraint for reachable range calculation.
714
725
  *
@@ -883,9 +894,9 @@ export declare const calculateRoute: (params: CalculateRouteParams, customTempla
883
894
  * engineType: 'electric',
884
895
  * model: {
885
896
  * engine: {
897
+ * charging: { maxChargeKWH: 85 },
886
898
  * consumption: {
887
- * charging: { maxChargeKWH: 85 },
888
- * speedToConsumption: [
899
+ * speedsToConsumptionsKWH: [
889
900
  * { speedKMH: 50, consumptionUnitsPer100KM: 8 },
890
901
  * { speedKMH: 80, consumptionUnitsPer100KM: 12 },
891
902
  * { speedKMH: 120, consumptionUnitsPer100KM: 18 }
@@ -915,7 +926,8 @@ export declare type CalculateRouteParams = CommonServiceParams<CalculateRouteReq
915
926
  * - Path arrays for route reconstruction
916
927
  * - (not supported) Waypoint objects with radius for circle waypoints
917
928
  *
918
- * @see [POST data parameters](https://docs.tomtom.com/routing-api/documentation/routing/calculate-route#post-data-parameters)
929
+ * @see [POST data parameters](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/calculate-route#post-data-parameters)
930
+ * @see [Response structure](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/calculate-route#structure-of-a-successful-response)
919
931
  *
920
932
  * @example
921
933
  * ```typescript
@@ -969,10 +981,10 @@ export declare type CalculateRouteParams = CommonServiceParams<CalculateRouteReq
969
981
  /**
970
982
  * Request additional travel time calculations for different traffic scenarios.
971
983
  *
972
- * When set to 'all', the response includes travel times for:
973
- * - Free-flow (no traffic)
974
- * - Historic traffic patterns
975
- * - Current live traffic
984
+ * When set to 'all', the returned route summary will contain extra fields:
985
+ * - `noTrafficTravelTimeInSeconds` – Free-flow (no traffic)
986
+ * - `historicTrafficTravelTimeInSeconds` – Historic traffic patterns
987
+ * - `liveTrafficIncidentsTravelTimeInSeconds` – Current live traffic
976
988
  *
977
989
  * Useful for comparing traffic impact and displaying "X minutes saved by leaving now".
978
990
  *
@@ -980,7 +992,6 @@ export declare type CalculateRouteParams = CommonServiceParams<CalculateRouteReq
980
992
  *
981
993
  * @example
982
994
  * ```typescript
983
- * // Get all traffic-based estimates
984
995
  * computeAdditionalTravelTimeFor: 'all'
985
996
  * ```
986
997
  */
@@ -989,6 +1000,11 @@ export declare type CalculateRouteParams = CommonServiceParams<CalculateRouteReq
989
1000
  * Request extended progress information at route polyline points.
990
1001
  *
991
1002
  * Includes cumulative distance and/or time from start to each coordinate.
1003
+ * When non-empty, the route features will contain additional property "progress" with an array of objects containing:
1004
+ * - `pointIndex` – Index of the coordinate in the route geometry
1005
+ * - `travelTimeInSeconds` - Cumulative travel time from start to this point (if "travelTime" is requested)
1006
+ * - `distanceInMeters` - Cumulative distance from start to this point (if "distance" is requested)
1007
+ *
992
1008
  * Useful for displaying progress during navigation or animating route visualization.
993
1009
  *
994
1010
  * @default ['distance', 'travelTime']
@@ -1564,7 +1580,7 @@ declare type CombustionEngineModel = {
1564
1580
  * engine: {
1565
1581
  * consumption: {
1566
1582
  * fuelEnergyDensityInMJoulesPerLiter: 34.2,
1567
- * speedToConsumption: [
1583
+ * speedsToConsumptionsLiters: [
1568
1584
  * { speedKMH: 50, consumptionUnitsPer100KM: 6.5 },
1569
1585
  * { speedKMH: 90, consumptionUnitsPer100KM: 7.2 },
1570
1586
  * { speedKMH: 120, consumptionUnitsPer100KM: 9.0 }
@@ -2604,7 +2620,7 @@ export declare type CommonSearchParams<ApiRequest, ApiResponse> = CommonPlacesPa
2604
2620
  /**
2605
2621
  * @ignore
2606
2622
  */
2607
- declare type CommonSearchPlaceResultAPI = Omit<SearchPlaceProps, 'distance' | 'position' | 'addressRanges' | 'geographyType' | 'entryPoints' | 'chargingPark'> & {
2623
+ declare type CommonSearchPlaceResultAPI = Omit<SearchPlaceProps, 'distance' | 'position' | 'addressRanges' | 'geographyType' | 'entryPoints' | 'chargingPark' | 'poi'> & {
2608
2624
  id: string;
2609
2625
  position: LatLonAPI;
2610
2626
  dist?: number;
@@ -2738,7 +2754,7 @@ export declare type ComputeTravelTimeFor = 'none' | 'all';
2738
2754
  /**
2739
2755
  * @ignore
2740
2756
  */
2741
- declare type ConnectorAPI = Omit<Connector, 'type'> & {
2757
+ declare type ConnectorAPI = Omit<Connector, 'type' | 'chargingSpeed'> & {
2742
2758
  connectorType: ConnectorType;
2743
2759
  };
2744
2760
 
@@ -3070,8 +3086,6 @@ declare type DepartArriveOption = 'departAt' | 'arriveBy';
3070
3086
  * - Account for time-dependent road restrictions
3071
3087
  *
3072
3088
  * **Important Notes:**
3073
- * - Past dates will default to departing immediately
3074
- * - Impossible dates (e.g., imminent arrival for long routes) default to departing now
3075
3089
  * - Times are processed in the timezone of the origin/destination
3076
3090
  *
3077
3091
  * @example
@@ -3188,17 +3202,41 @@ declare type ElectricEngineModel = {
3188
3202
  * weightKG: 2000
3189
3203
  * },
3190
3204
  * engine: {
3205
+ * charging: {
3206
+ * maxChargeKWH: 75,
3207
+ * batteryCurve: [
3208
+ * { stateOfChargeInkWh: 50, maxPowerInkW: 200 },
3209
+ * { stateOfChargeInkWh: 70, maxPowerInkW: 100 },
3210
+ * { stateOfChargeInkWh: 80, maxPowerInkW: 40 },
3211
+ * ],
3212
+ * chargingConnectors: [
3213
+ * {
3214
+ * currentType: 'AC3',
3215
+ * plugTypes: [
3216
+ * 'IEC_62196_Type_2_Outlet',
3217
+ * 'IEC_62196_Type_2_Connector_Cable_Attached',
3218
+ * 'Combo_to_IEC_62196_Type_2_Base',
3219
+ * ],
3220
+ * efficiency: 0.9,
3221
+ * baseLoadInkW: 0.2,
3222
+ * maxPowerInkW: 11,
3223
+ * },
3224
+ * {
3225
+ * currentType: 'DC',
3226
+ * plugTypes: [
3227
+ * 'IEC_62196_Type_2_Outlet',
3228
+ * 'IEC_62196_Type_2_Connector_Cable_Attached',
3229
+ * 'Combo_to_IEC_62196_Type_2_Base',
3230
+ * ],
3231
+ * voltageRange: { minVoltageInV: 0, maxVoltageInV: 500 },
3232
+ * efficiency: 0.9,
3233
+ * baseLoadInkW: 0.2,
3234
+ * maxPowerInkW: 150,
3235
+ * },
3236
+ * ]
3237
+ * },
3191
3238
  * consumption: {
3192
- * charging: {
3193
- * maxChargeKWH: 75,
3194
- * chargingCurve: [
3195
- * { chargeKWH: 0, timeToChargeMinutes: 0 },
3196
- * { chargeKWH: 37.5, timeToChargeMinutes: 30 },
3197
- * { chargeKWH: 75, timeToChargeMinutes: 75 }
3198
- * ],
3199
- * connectorTypes: ['IEC_62196_TYPE_2']
3200
- * },
3201
- * speedToConsumption: [
3239
+ * speedsToConsumptionsKWH: [
3202
3240
  * { speedKMH: 50, consumptionUnitsPer100KM: 15 },
3203
3241
  * { speedKMH: 90, consumptionUnitsPer100KM: 18 },
3204
3242
  * { speedKMH: 120, consumptionUnitsPer100KM: 23 }
@@ -3580,75 +3618,6 @@ export declare type FetchInput<PostData = void> = {
3580
3618
  method: 'POST';
3581
3619
  } & PostObject<PostData>);
3582
3620
 
3583
- /**
3584
- * Search for places using free-text queries with fuzzy matching.
3585
- *
3586
- * The Fuzzy Search service provides a flexible search that handles typos, abbreviations,
3587
- * and incomplete addresses. It searches across POIs (Points of Interest), addresses,
3588
- * and geographic areas to find the best matches for your query.
3589
- *
3590
- * @remarks
3591
- * Key features:
3592
- * - **Typo tolerance**: Handles misspellings and typing errors
3593
- * - **Partial matching**: Works with incomplete queries
3594
- * - **Multi-category search**: Searches POIs, addresses, and places simultaneously
3595
- * - **Position bias**: Prioritizes results near a given location
3596
- * - **Flexible input**: Accepts natural language queries
3597
- *
3598
- * The service is ideal for:
3599
- * - User-facing search boxes where typos are common
3600
- * - Location lookup without knowing exact names
3601
- * - General "find anything" search functionality
3602
- * - Autocomplete with final selection
3603
- *
3604
- * @param params Fuzzy search parameters including the search query
3605
- * @param customTemplate Advanced customization for request/response handling
3606
- *
3607
- * @returns Promise resolving to a collection of matching places
3608
- *
3609
- * @example
3610
- * ```typescript
3611
- * // Basic search with typo tolerance
3612
- * const results = await fuzzySearch({
3613
- * key: 'your-api-key',
3614
- * query: 'amstrdam' // Typo: missing 'e'
3615
- * });
3616
- * // Still finds "Amsterdam"
3617
- *
3618
- * // Search near a specific location
3619
- * const nearby = await fuzzySearch({
3620
- * key: 'your-api-key',
3621
- * query: 'pizza',
3622
- * at: [4.9041, 52.3676], // Amsterdam
3623
- * radius: 2000, // Within 2km
3624
- * limit: 10
3625
- * });
3626
- *
3627
- * // Search with category filter
3628
- * const restaurants = await fuzzySearch({
3629
- * key: 'your-api-key',
3630
- * query: 'italian',
3631
- * categorySet: [7315], // Restaurant category
3632
- * at: [4.9041, 52.3676]
3633
- * });
3634
- *
3635
- * // Partial address search
3636
- * const addresses = await fuzzySearch({
3637
- * key: 'your-api-key',
3638
- * query: '123 main st',
3639
- * countrySet: ['US'],
3640
- * limit: 5
3641
- * });
3642
- * ```
3643
- *
3644
- * @see [Fuzzy Search API Documentation](https://docs.tomtom.com/search-api/documentation/search-service/fuzzy-search)
3645
- * @see [Places Quickstart Guide](https://docs.tomtom.com/maps-sdk-js/guides/services/places/quickstart)
3646
- * @see [Search Guide](https://docs.tomtom.com/maps-sdk-js/guides/services/places/search)
3647
- *
3648
- * @group Search
3649
- */
3650
- export declare const fuzzySearch: (params: FuzzySearchParams, customTemplate?: Partial<FuzzySearchTemplate>) => Promise<FuzzySearchResponse>;
3651
-
3652
3621
  /**
3653
3622
  * Additional properties for fuzzy search feature collection.
3654
3623
  *
@@ -5119,7 +5088,7 @@ declare type PlaceByIdTemplate = ServiceTemplate<PlaceByIdParams, URL, PlaceById
5119
5088
  declare type POIAPI = {
5120
5089
  name: string;
5121
5090
  phone?: string;
5122
- brands?: Brand[];
5091
+ brands?: BrandAPI[];
5123
5092
  url?: string;
5124
5093
  categorySet?: CategoryAPI[];
5125
5094
  categories?: string[];
@@ -5795,18 +5764,28 @@ declare type ReverseGeocodingResponseAPI = {
5795
5764
  addresses: [
5796
5765
  {
5797
5766
  address: AddressProperties & {
5798
- boundingBox: {
5767
+ boundingBox?: {
5799
5768
  northEast: string;
5800
5769
  southWest: string;
5801
5770
  entity: 'position';
5802
5771
  };
5803
- sideOfStreet: SideOfStreet;
5804
- offsetPosition: string;
5772
+ sideOfStreet?: SideOfStreet;
5773
+ offsetPosition?: string;
5774
+ [key: string]: any;
5805
5775
  };
5806
- dataSources: PlaceDataSources;
5807
- entityType: PlaceType;
5776
+ linkedAddress?: AddressProperties & {
5777
+ boundingBox?: {
5778
+ northEast: string;
5779
+ southWest: string;
5780
+ entity: 'position';
5781
+ };
5782
+ [key: string]: any;
5783
+ };
5784
+ dataSources?: PlaceDataSources;
5785
+ entityType?: PlaceType;
5808
5786
  mapcodes?: Mapcode[];
5809
5787
  position: string;
5788
+ roadUse?: string[];
5810
5789
  }
5811
5790
  ];
5812
5791
  };
@@ -5935,8 +5914,8 @@ declare type SchemaRefinement<T = any> = {
5935
5914
  * @group Errors
5936
5915
  */
5937
5916
  export declare class SDKError extends Error {
5938
- private readonly service;
5939
- private readonly issues?;
5917
+ readonly service: string;
5918
+ readonly issues?: $ZodIssue[] | undefined;
5940
5919
  /**
5941
5920
  * Creates a new SDKError instance.
5942
5921
  *
@@ -6323,7 +6302,9 @@ declare type SectionAPI = {
6323
6302
  streetName?: {
6324
6303
  text: string;
6325
6304
  };
6326
- roadNumbers?: string[];
6305
+ roadNumbers?: {
6306
+ text: string;
6307
+ }[];
6327
6308
  };
6328
6309
 
6329
6310
  /**
@@ -6440,10 +6421,13 @@ declare type SummaryAPI = Omit<SearchSummary, 'geoBias'> & {
6440
6421
  /**
6441
6422
  * @ignore
6442
6423
  */
6443
- declare type SummaryAPI_2 = Omit<RouteSummary & LegSummary, 'arrivalTime' | 'departureTime' | 'batteryConsumptionInPCT' | 'remainingChargeAtArrivalInPCT' | 'chargingInformationAtEndOfLeg'> & {
6424
+ declare type SummaryAPI_2 = Omit<RouteSummary & LegSummary, 'arrivalTime' | 'departureTime' | 'batteryConsumptionInPCT' | 'remainingChargeAtArrivalInPCT' | 'chargingInformationAtEndOfLeg' | 'deviationPoint'> & {
6444
6425
  arrivalTime: string;
6445
6426
  departureTime: string;
6446
6427
  chargingInformationAtEndOfLeg?: ChargingStopAPI;
6428
+ deviationDistance?: number;
6429
+ deviationTime?: number;
6430
+ deviationPoint?: LatitudeLongitudePointAPI;
6447
6431
  };
6448
6432
 
6449
6433
  /**