@tomtom-org/maps-sdk 0.33.0 → 0.34.1

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/map/package.json CHANGED
@@ -41,7 +41,7 @@
41
41
  "maplibre-gl": "catalog:"
42
42
  },
43
43
  "dependencies": {
44
- "@turf/bearing": "^7.3.0",
44
+ "@turf/bearing": "^7.3.1",
45
45
  "core": "workspace:*",
46
46
  "lodash-es": "catalog:"
47
47
  }
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.1",
6
6
  "description": "TomTom Maps for JavaScript",
7
7
  "keywords": [
8
8
  "tomtom",
@@ -18,12 +18,12 @@
18
18
  "nodejs"
19
19
  ],
20
20
  "devDependencies": {
21
- "@biomejs/biome": "^2.3.6",
21
+ "@biomejs/biome": "^2.3.8",
22
22
  "@size-limit/file": "^11.2.0",
23
23
  "@size-limit/preset-app": "^11.2.0",
24
24
  "size-limit": "^11.2.0",
25
- "typedoc": "^0.28.14",
26
- "yaml": "^2.8.1"
25
+ "typedoc": "^0.28.15",
26
+ "yaml": "^2.8.2"
27
27
  },
28
28
  "size-limit": [
29
29
  {
@@ -37,7 +37,7 @@
37
37
  }
38
38
  ],
39
39
  "engines": {
40
- "node": ">=22",
40
+ "node": ">=24",
41
41
  "pnpm": ">=10"
42
42
  },
43
43
  "files": [
@@ -1,5 +1,5 @@
1
1
  Name: zod
2
- Version: 4.1.12
2
+ Version: 4.1.13
3
3
  License: MIT
4
4
  Private: false
5
5
  Description: TypeScript-first schema declaration and validation library with static type inference
@@ -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']
@@ -1377,12 +1393,6 @@ export declare type ChargingPreferencesPCT = {
1377
1393
  * - Access restrictions
1378
1394
  * - Opening hours
1379
1395
  *
1380
- * **Use Cases:**
1381
- * - Show available chargers in navigation apps
1382
- * - Display real-time status on charging station maps
1383
- * - Help EV drivers plan charging stops
1384
- * - Monitor charging infrastructure for fleet management
1385
- *
1386
1396
  * @example
1387
1397
  * ```typescript
1388
1398
  * // Basic usage
@@ -1564,7 +1574,7 @@ declare type CombustionEngineModel = {
1564
1574
  * engine: {
1565
1575
  * consumption: {
1566
1576
  * fuelEnergyDensityInMJoulesPerLiter: 34.2,
1567
- * speedToConsumption: [
1577
+ * speedsToConsumptionsLiters: [
1568
1578
  * { speedKMH: 50, consumptionUnitsPer100KM: 6.5 },
1569
1579
  * { speedKMH: 90, consumptionUnitsPer100KM: 7.2 },
1570
1580
  * { speedKMH: 120, consumptionUnitsPer100KM: 9.0 }
@@ -2604,7 +2614,7 @@ export declare type CommonSearchParams<ApiRequest, ApiResponse> = CommonPlacesPa
2604
2614
  /**
2605
2615
  * @ignore
2606
2616
  */
2607
- declare type CommonSearchPlaceResultAPI = Omit<SearchPlaceProps, 'distance' | 'position' | 'addressRanges' | 'geographyType' | 'entryPoints' | 'chargingPark'> & {
2617
+ declare type CommonSearchPlaceResultAPI = Omit<SearchPlaceProps, 'distance' | 'position' | 'addressRanges' | 'geographyType' | 'entryPoints' | 'chargingPark' | 'poi'> & {
2608
2618
  id: string;
2609
2619
  position: LatLonAPI;
2610
2620
  dist?: number;
@@ -2738,7 +2748,7 @@ export declare type ComputeTravelTimeFor = 'none' | 'all';
2738
2748
  /**
2739
2749
  * @ignore
2740
2750
  */
2741
- declare type ConnectorAPI = Omit<Connector, 'type'> & {
2751
+ declare type ConnectorAPI = Omit<Connector, 'type' | 'chargingSpeed'> & {
2742
2752
  connectorType: ConnectorType;
2743
2753
  };
2744
2754
 
@@ -3070,8 +3080,6 @@ declare type DepartArriveOption = 'departAt' | 'arriveBy';
3070
3080
  * - Account for time-dependent road restrictions
3071
3081
  *
3072
3082
  * **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
3083
  * - Times are processed in the timezone of the origin/destination
3076
3084
  *
3077
3085
  * @example
@@ -3188,17 +3196,41 @@ declare type ElectricEngineModel = {
3188
3196
  * weightKG: 2000
3189
3197
  * },
3190
3198
  * engine: {
3199
+ * charging: {
3200
+ * maxChargeKWH: 75,
3201
+ * batteryCurve: [
3202
+ * { stateOfChargeInkWh: 50, maxPowerInkW: 200 },
3203
+ * { stateOfChargeInkWh: 70, maxPowerInkW: 100 },
3204
+ * { stateOfChargeInkWh: 80, maxPowerInkW: 40 },
3205
+ * ],
3206
+ * chargingConnectors: [
3207
+ * {
3208
+ * currentType: 'AC3',
3209
+ * plugTypes: [
3210
+ * 'IEC_62196_Type_2_Outlet',
3211
+ * 'IEC_62196_Type_2_Connector_Cable_Attached',
3212
+ * 'Combo_to_IEC_62196_Type_2_Base',
3213
+ * ],
3214
+ * efficiency: 0.9,
3215
+ * baseLoadInkW: 0.2,
3216
+ * maxPowerInkW: 11,
3217
+ * },
3218
+ * {
3219
+ * currentType: 'DC',
3220
+ * plugTypes: [
3221
+ * 'IEC_62196_Type_2_Outlet',
3222
+ * 'IEC_62196_Type_2_Connector_Cable_Attached',
3223
+ * 'Combo_to_IEC_62196_Type_2_Base',
3224
+ * ],
3225
+ * voltageRange: { minVoltageInV: 0, maxVoltageInV: 500 },
3226
+ * efficiency: 0.9,
3227
+ * baseLoadInkW: 0.2,
3228
+ * maxPowerInkW: 150,
3229
+ * },
3230
+ * ]
3231
+ * },
3191
3232
  * 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: [
3233
+ * speedsToConsumptionsKWH: [
3202
3234
  * { speedKMH: 50, consumptionUnitsPer100KM: 15 },
3203
3235
  * { speedKMH: 90, consumptionUnitsPer100KM: 18 },
3204
3236
  * { speedKMH: 120, consumptionUnitsPer100KM: 23 }
@@ -3441,12 +3473,6 @@ declare type EVChargingStationResultAPI = {
3441
3473
  * - **Access information**: Public, private, or restricted access
3442
3474
  * - **Opening hours**: When the charging facility is accessible
3443
3475
  *
3444
- * Use cases:
3445
- * - EV navigation apps: Show available chargers along routes
3446
- * - Charging station maps: Display real-time availability
3447
- * - Trip planning: Verify chargers will be available at destination
3448
- * - Fleet management: Monitor charging infrastructure status
3449
- *
3450
3476
  * @param params - Charging availability parameters with station ID
3451
3477
  * @param customTemplate - Advanced customization for request/response handling
3452
3478
  *
@@ -3580,75 +3606,6 @@ export declare type FetchInput<PostData = void> = {
3580
3606
  method: 'POST';
3581
3607
  } & PostObject<PostData>);
3582
3608
 
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
3609
  /**
3653
3610
  * Additional properties for fuzzy search feature collection.
3654
3611
  *
@@ -5119,7 +5076,7 @@ declare type PlaceByIdTemplate = ServiceTemplate<PlaceByIdParams, URL, PlaceById
5119
5076
  declare type POIAPI = {
5120
5077
  name: string;
5121
5078
  phone?: string;
5122
- brands?: Brand[];
5079
+ brands?: BrandAPI[];
5123
5080
  url?: string;
5124
5081
  categorySet?: CategoryAPI[];
5125
5082
  categories?: string[];
@@ -5795,18 +5752,28 @@ declare type ReverseGeocodingResponseAPI = {
5795
5752
  addresses: [
5796
5753
  {
5797
5754
  address: AddressProperties & {
5798
- boundingBox: {
5755
+ boundingBox?: {
5756
+ northEast: string;
5757
+ southWest: string;
5758
+ entity: 'position';
5759
+ };
5760
+ sideOfStreet?: SideOfStreet;
5761
+ offsetPosition?: string;
5762
+ [key: string]: any;
5763
+ };
5764
+ linkedAddress?: AddressProperties & {
5765
+ boundingBox?: {
5799
5766
  northEast: string;
5800
5767
  southWest: string;
5801
5768
  entity: 'position';
5802
5769
  };
5803
- sideOfStreet: SideOfStreet;
5804
- offsetPosition: string;
5770
+ [key: string]: any;
5805
5771
  };
5806
- dataSources: PlaceDataSources;
5807
- entityType: PlaceType;
5772
+ dataSources?: PlaceDataSources;
5773
+ entityType?: PlaceType;
5808
5774
  mapcodes?: Mapcode[];
5809
5775
  position: string;
5776
+ roadUse?: string[];
5810
5777
  }
5811
5778
  ];
5812
5779
  };
@@ -5935,8 +5902,8 @@ declare type SchemaRefinement<T = any> = {
5935
5902
  * @group Errors
5936
5903
  */
5937
5904
  export declare class SDKError extends Error {
5938
- private readonly service;
5939
- private readonly issues?;
5905
+ readonly service: string;
5906
+ readonly issues?: $ZodIssue[] | undefined;
5940
5907
  /**
5941
5908
  * Creates a new SDKError instance.
5942
5909
  *
@@ -6323,7 +6290,9 @@ declare type SectionAPI = {
6323
6290
  streetName?: {
6324
6291
  text: string;
6325
6292
  };
6326
- roadNumbers?: string[];
6293
+ roadNumbers?: {
6294
+ text: string;
6295
+ }[];
6327
6296
  };
6328
6297
 
6329
6298
  /**
@@ -6440,10 +6409,13 @@ declare type SummaryAPI = Omit<SearchSummary, 'geoBias'> & {
6440
6409
  /**
6441
6410
  * @ignore
6442
6411
  */
6443
- declare type SummaryAPI_2 = Omit<RouteSummary & LegSummary, 'arrivalTime' | 'departureTime' | 'batteryConsumptionInPCT' | 'remainingChargeAtArrivalInPCT' | 'chargingInformationAtEndOfLeg'> & {
6412
+ declare type SummaryAPI_2 = Omit<RouteSummary & LegSummary, 'arrivalTime' | 'departureTime' | 'batteryConsumptionInPCT' | 'remainingChargeAtArrivalInPCT' | 'chargingInformationAtEndOfLeg' | 'deviationPoint'> & {
6444
6413
  arrivalTime: string;
6445
6414
  departureTime: string;
6446
6415
  chargingInformationAtEndOfLeg?: ChargingStopAPI;
6416
+ deviationDistance?: number;
6417
+ deviationTime?: number;
6418
+ deviationPoint?: LatitudeLongitudePointAPI;
6447
6419
  };
6448
6420
 
6449
6421
  /**