@tomtom-org/maps-sdk 0.47.0 → 0.47.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.
@@ -2144,6 +2144,34 @@ export declare interface FeatureCollectionWithProperties<G extends Geometry | nu
2144
2144
  */
2145
2145
  export declare const findBestWaypointInsertionIndex: (route: Route, existingWaypoints: WaypointLike[], newWaypoint: WaypointLike) => number;
2146
2146
 
2147
+ /**
2148
+ * Multi-waypoint variant of {@link findBestWaypointInsertionIndex}.
2149
+ *
2150
+ * Projects every existing and new waypoint onto the route exactly once, then returns one
2151
+ * insertion slot per new waypoint. The i-th returned index is the slot in `existingWaypoints`
2152
+ * (0 = before origin, `existingWaypoints.length` = after destination) where the i-th new
2153
+ * waypoint falls based on its along-route location.
2154
+ *
2155
+ * Multiple new waypoints may share the same slot. Use {@link withInsertedWaypoints} when you
2156
+ * also need them merged into the existing array in correct along-route order — that helper
2157
+ * handles within-slot ranking on top of these slot indices.
2158
+ *
2159
+ * @param route The existing calculated route Feature with LineString geometry
2160
+ * @param existingWaypoints Array of existing waypoints in order (origin, intermediate waypoints, destination)
2161
+ * @param newWaypoints The waypoints whose insertion slots to compute
2162
+ * @returns An array of insertion slot indices, one per new waypoint, in input order
2163
+ *
2164
+ * @remarks
2165
+ * - Empty `newWaypoints` returns an empty array.
2166
+ * - Edge cases (empty route geometry, fewer than 2 existing waypoints) return `0` for every
2167
+ * new waypoint — i.e. they would all prepend.
2168
+ * - A new waypoint whose projection has no resolvable along-route location also returns `0`,
2169
+ * matching the singular {@link findBestWaypointInsertionIndex} behavior.
2170
+ *
2171
+ * @group Utils
2172
+ */
2173
+ export declare const findBestWaypointInsertionIndices: (route: Route, existingWaypoints: WaypointLike[], newWaypoints: WaypointLike[]) => number[];
2174
+
2147
2175
  /**
2148
2176
  * Formatting is based on the number of meters passed and unit type. Less meters more precision.
2149
2177
  * @example
@@ -2260,6 +2288,22 @@ export declare const formatDuration: (seconds: number | undefined, options?: Tim
2260
2288
  */
2261
2289
  export declare type Fuel = 'Petrol' | 'LPG' | 'Diesel' | 'Biodiesel' | 'DieselForCommercialVehicles' | 'E85' | 'LNG' | 'CNG' | 'Hydrogen' | 'AdBlue';
2262
2290
 
2291
+ /**
2292
+ * All possible traffic incident categories.
2293
+ *
2294
+ * @remarks
2295
+ * Composed of {@link trafficIncidentRequestCategories} (categories that can be both
2296
+ * sent as filter inputs and received in responses) plus the response-only categories
2297
+ * `'animals-on-road'` and `'narrow-lanes'`, which appear in API responses and on
2298
+ * vector-tile features but are rejected as `categoryFilter` inputs. Use this list
2299
+ * when a category can be *received*; use {@link trafficIncidentRequestCategories}
2300
+ * when a category must be *sent* to the Incident Details API as a `categoryFilter`
2301
+ * input.
2302
+ *
2303
+ * @group Traffic
2304
+ */
2305
+ export declare const fullTrafficIncidentCategories: readonly ["accident", "broken-down-vehicle", "danger", "flooding", "fog", "frost", "jam", "lane-closed", "other", "rain", "road-closed", "roadworks", "wind", "animals-on-road", "narrow-lanes"];
2306
+
2263
2307
  /**
2264
2308
  * Generate random id for map features
2265
2309
  * @ignore
@@ -5043,12 +5087,6 @@ export declare type TrafficIncidentBaseProperties = {
5043
5087
  lastReportTime?: Date;
5044
5088
  };
5045
5089
 
5046
- /**
5047
- * All possible traffic incident categories.
5048
- * @group Traffic
5049
- */
5050
- export declare const trafficIncidentCategories: readonly ["accident", "animals-on-road", "broken-down-vehicle", "danger", "flooding", "fog", "frost", "jam", "lane-closed", "narrow-lanes", "other", "rain", "road-closed", "roadworks", "wind"];
5051
-
5052
5090
  /**
5053
5091
  * Simple category classification for traffic incidents.
5054
5092
  *
@@ -5071,7 +5109,7 @@ export declare const trafficIncidentCategories: readonly ["accident", "animals-o
5071
5109
  *
5072
5110
  * @group Traffic
5073
5111
  */
5074
- export declare type TrafficIncidentCategory = (typeof trafficIncidentCategories)[number];
5112
+ export declare type TrafficIncidentCategory = (typeof fullTrafficIncidentCategories)[number];
5075
5113
 
5076
5114
  /**
5077
5115
  * Response from the Incident Details service.
@@ -5157,6 +5195,34 @@ export declare type TrafficIncidentProperties = TrafficIncidentBaseProperties &
5157
5195
  tmc?: TrafficIncidentTMC;
5158
5196
  };
5159
5197
 
5198
+ /**
5199
+ * Traffic incident categories accepted as `categoryFilter` inputs by the Incident
5200
+ * Details API.
5201
+ *
5202
+ * @remarks
5203
+ * Strict subset of {@link fullTrafficIncidentCategories} — every value here is also
5204
+ * a valid response category. The two values omitted (`'animals-on-road'` and
5205
+ * `'narrow-lanes'`) are documented as response-only: the upstream's default-values
5206
+ * list is `0,1,2,3,4,5,6,7,8,9,10,11,14`, intentionally excluding iconCategory 12
5207
+ * and 13. Including either makes the upstream reject the whole filter with
5208
+ * `Unsupported categoryFilter parameter value`.
5209
+ *
5210
+ * @see https://docs.tomtom.com/traffic-api/documentation/tomtom-orbis-maps/traffic-incidents/incident-details
5211
+ * @group Traffic
5212
+ */
5213
+ export declare const trafficIncidentRequestCategories: readonly ["accident", "broken-down-vehicle", "danger", "flooding", "fog", "frost", "jam", "lane-closed", "other", "rain", "road-closed", "roadworks", "wind"];
5214
+
5215
+ /**
5216
+ * Categories accepted as `categoryFilter` input to the Incident Details API.
5217
+ *
5218
+ * @remarks
5219
+ * Strict subset of {@link TrafficIncidentCategory} — see
5220
+ * {@link trafficIncidentRequestCategories} for the rationale.
5221
+ *
5222
+ * @group Traffic
5223
+ */
5224
+ export declare type TrafficIncidentRequestCategory = (typeof trafficIncidentRequestCategories)[number];
5225
+
5160
5226
  /**
5161
5227
  * Traffic incident information based on TPEG2-TEC standard.
5162
5228
  *
@@ -5514,4 +5580,44 @@ export declare type Waypoints<T extends Anything = Anything> = FeatureCollection
5514
5580
  */
5515
5581
  export declare const withInsertedWaypoint: (route: Route, existingWaypoints: WaypointLike[], newWaypoint: WaypointLike) => WaypointLike[];
5516
5582
 
5583
+ /**
5584
+ * Returns a new array of waypoints with each new waypoint inserted at its optimal position.
5585
+ *
5586
+ * Multi-waypoint variant of {@link withInsertedWaypoint}. Unlike a sequential one-at-a-time
5587
+ * insertion, this function projects every existing and new waypoint onto the route exactly
5588
+ * once, then merges them by:
5589
+ *
5590
+ * 1. Computing each new waypoint's insertion slot via {@link findBestWaypointInsertionIndices}.
5591
+ * 2. Within each slot, ranking the new waypoints by their along-route location (with a stable
5592
+ * tie-break on input order when multiple waypoints project to the same location).
5593
+ *
5594
+ * The result is the existing waypoints with newcomers spliced in at the right positions and in
5595
+ * natural along-route order — accurate regardless of input order.
5596
+ *
5597
+ * @param route The existing calculated route Feature with LineString geometry
5598
+ * @param existingWaypoints Array of existing waypoints in order (origin, intermediate waypoints, destination)
5599
+ * @param newWaypoints The waypoints to insert
5600
+ * @returns A new array with the waypoints inserted at their optimal positions
5601
+ *
5602
+ * @remarks
5603
+ * - Returns a new array; does not modify the original `existingWaypoints` array.
5604
+ * - Passing an empty `newWaypoints` array returns a shallow copy of `existingWaypoints`.
5605
+ * - When the route has no geometry or fewer than 2 existing waypoints, all new waypoints are
5606
+ * prepended in input order.
5607
+ *
5608
+ * @example
5609
+ * ```typescript
5610
+ * const waypoints: WaypointLike[] = [
5611
+ * [4.9, 52.3], // origin
5612
+ * [5.0, 52.4] // destination
5613
+ * ];
5614
+ *
5615
+ * const updated = withInsertedWaypoints(route, waypoints, [[4.97, 52.37], [4.93, 52.33]]);
5616
+ * // → [[4.9, 52.3], [4.93, 52.33], [4.97, 52.37], [5.0, 52.4]]
5617
+ * ```
5618
+ *
5619
+ * @group Utils
5620
+ */
5621
+ export declare const withInsertedWaypoints: (route: Route, existingWaypoints: WaypointLike[], newWaypoints: WaypointLike[]) => WaypointLike[];
5622
+
5517
5623
  export { }