@tomtom-org/maps-sdk 0.55.1 → 0.56.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.
@@ -1,5 +1,5 @@
1
1
  import { ZodError, ZodIssue, ZodObject } from "zod";
2
- import { AddressProperties, AreaAnalyticsMetricKey, Avoidable, BBox, 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";
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?: VehicleModel;
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?: VehicleModel<'combustion'>;
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$1 = [number, number, number, number] | [number, number, number, number, number, number];
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$1 | undefined;
3054
+ bbox?: BBox | undefined;
3029
3055
  }
3030
3056
  /**
3031
3057
  * Union of GeoJSON objects.
@@ -3520,6 +3546,10 @@ type AlongRouteSearchResponseAPI = {
3520
3546
  * Controls how the returned POIs are ordered relative to the route.
3521
3547
  *
3522
3548
  * @remarks
3549
+ * Pass these to {@link search}, which selects the request variant from the params it is given:
3550
+ * a `route` property dispatches to along-route search, a `geometries` property to geometry search,
3551
+ * and neither to fuzzy search. {@link alongRouteSearch} is also exported directly.
3552
+ *
3523
3553
  * - `detourTime`: Sort by additional travel time required to visit the POI (default)
3524
3554
  * - `detourOffset`: Sort by how far along the route the detour point falls
3525
3555
  *
@@ -4794,6 +4824,10 @@ type GeometrySearchResponseAPI = {
4794
4824
  * like "restaurants in this neighborhood" or "hotels within these city boundaries".
4795
4825
  *
4796
4826
  * @remarks
4827
+ * Pass these to {@link search}, which selects the request variant from the params it is given:
4828
+ * a `route` property dispatches to along-route search, a `geometries` property to geometry search,
4829
+ * and neither to fuzzy search. There is no separate exported function for geometry search.
4830
+ *
4797
4831
  * **Key Features:**
4798
4832
  * - Search within multiple geometries simultaneously
4799
4833
  * - Supports polygons, multipolygons, and circles
@@ -5189,6 +5223,10 @@ type PlaceByIdOptionalParams = {
5189
5223
  * - `RU`: Russia
5190
5224
  * - `TR`: Turkey
5191
5225
  * - `CN`: China
5226
+ * - `TW`: Taiwan
5227
+ * - `RS`: Serbia
5228
+ *
5229
+ * `MA` is accepted by this type but is not supported by the current backend.
5192
5230
  *
5193
5231
  * @default 'Unified'
5194
5232
  *
@@ -5416,7 +5454,7 @@ type SummaryAPI = {
5416
5454
  arrivalDateTime: string;
5417
5455
  deviationDistanceInMeters?: number;
5418
5456
  deviationDurationInSeconds?: number;
5419
- deviationPoint?: Point;
5457
+ deviationPoint?: RoutePointAPI$1;
5420
5458
  originalWaypointIndexAtEndOfLeg?: number;
5421
5459
  historicTrafficTravelTimeInSeconds?: number;
5422
5460
  liveTrafficIncidentsTravelTimeInSeconds?: number;
@@ -5533,19 +5571,20 @@ type SectionsAPI = {
5533
5571
  importantRoadStretch?: ImportantRoadStretchSectionAPI[];
5534
5572
  };
5535
5573
  /**
5536
- * Lat/lon point used in guidance instructions (different from the GeoJSON used elsewhere).
5574
+ * Every point in a routing response — `deviationPoint`, a route-path point, an instruction's
5575
+ * `maneuverPoint` — is a two-dimensional GeoJSON `Point`, so its coordinates are already
5576
+ * `[longitude, latitude]` and the parser needs no narrowing of its own.
5537
5577
  * @ignore
5538
5578
  */
5539
- type LatLonPointAPI = {
5540
- latitude: number;
5541
- longitude: number;
5579
+ type RoutePointAPI$1 = Omit<Point, 'coordinates'> & {
5580
+ coordinates: [number, number];
5542
5581
  };
5543
5582
  /**
5544
5583
  * A point on the route path.
5545
5584
  * @ignore
5546
5585
  */
5547
5586
  type RoutePathPointAPI = {
5548
- point: LatLonPointAPI;
5587
+ point: RoutePointAPI$1;
5549
5588
  distanceFromRouteStartInMeters: number;
5550
5589
  travelTimeFromRouteStartInSeconds: number;
5551
5590
  };
@@ -5631,7 +5670,7 @@ type SignpostAPI = {
5631
5670
  type InstructionAPI = {
5632
5671
  routeOffsetInMeters: number;
5633
5672
  maneuver?: string;
5634
- maneuverPoint: LatLonPointAPI;
5673
+ maneuverPoint: RoutePointAPI$1;
5635
5674
  routePath?: RoutePathPointAPI[];
5636
5675
  nextRoadInformation?: InstructionRoadInformationAPI;
5637
5676
  previousRoadInformation?: InstructionRoadInformationAPI;
@@ -5830,18 +5869,23 @@ export type ReachableRangeCostModel = Omit<CostModel, 'avoid' | 'avoidAreas'> &
5830
5869
  * Vehicle parameters accepted by `calculateReachableRange`.
5831
5870
  *
5832
5871
  * @remarks
5833
- * {@link VehicleParameters} without `state.heading`, which this endpoint rejects with
5834
- * *"parameter [vehicleHeading] not supported"*. It stays available on `calculateRoute`, where the
5835
- * routing API takes it as `vehicleHeadingInDegrees`.
5872
+ * {@link VehicleParameters} without the two things this endpoint has no parameter for:
5873
+ *
5874
+ * - `state.heading`, which it rejects with *"parameter [vehicleHeading] not supported"*. The
5875
+ * routing API takes it as `vehicleHeadingInDegrees`.
5876
+ * - `preferences`, whose only member is `chargingPreferences`. Those belong to the charging-stops
5877
+ * endpoint, and a range has no stops to plan. A predefined `model.variantId` therefore needs
5878
+ * nothing beside it here, unlike on `calculateRoute`.
5836
5879
  *
5837
- * Everything else is unchanged, including the engine-specific `state` variants -- an electric
5838
- * vehicle still picks between the percentage and kWh forms.
5880
+ * Both stay available on `calculateRoute`. Everything else is unchanged, including the
5881
+ * engine-specific `state` variants -- an electric vehicle still picks between the percentage and
5882
+ * kWh forms.
5839
5883
  *
5840
5884
  * @group Reachable Range
5841
5885
  */
5842
- export type ReachableRangeVehicleParameters = (Omit<GenericVehicleParams, 'state'> | (Omit<CombustionVehicleParams, 'state'> & {
5886
+ export type ReachableRangeVehicleParameters = (Omit<GenericVehicleParams, 'state' | 'preferences'> | (Omit<CombustionVehicleParams, 'state' | 'preferences'> & {
5843
5887
  state?: CombustionVehicleState;
5844
- }) | (Omit<ElectricVehicleParams, 'state'> & {
5888
+ }) | (Omit<ElectricVehicleParams, 'state' | 'preferences'> & {
5845
5889
  state?: ElectricVehicleState;
5846
5890
  })) & VehicleRestrictions;
5847
5891
  /**
@@ -6210,6 +6254,8 @@ type ReverseGeocodingOptionalParams = {
6210
6254
  * - `TR` - Turkey
6211
6255
  * - `TW` - Taiwan
6212
6256
  *
6257
+ * `MA` is accepted by this type but is not supported by the current backend.
6258
+ *
6213
6259
  * @defaultValue `"Unified"`
6214
6260
  */
6215
6261
  view?: View;
@@ -6676,7 +6722,28 @@ type MaxNumberOfAlternatives = 0 | 1 | 2 | 3 | 4 | 5;
6676
6722
  *
6677
6723
  * @group Routing
6678
6724
  */
6679
- type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, CalculateRouteResponseAPI> & CommonRoutingParams & {
6725
+ type CalculateRouteParams = ({
6726
+ chargingStopsStrategy?: never;
6727
+ } | {
6728
+ /**
6729
+ * How the service should plan charging stops on an electric route.
6730
+ *
6731
+ * Only the charging-stops endpoint understands it, and
6732
+ * `vehicle.preferences.chargingPreferences` is what selects that endpoint — hence the
6733
+ * vehicle this variant requires.
6734
+ *
6735
+ * @default 'automaticFastest' (the service's own default when unset)
6736
+ *
6737
+ * @example
6738
+ * ```typescript
6739
+ * // Plan the fastest journey, choosing charging stops along the way
6740
+ * chargingStopsStrategy: 'automaticFastest'
6741
+ * ```
6742
+ */
6743
+ chargingStopsStrategy: ChargingStopsStrategy;
6744
+ /** An electric vehicle whose charging preferences ask the service to plan stops. */
6745
+ vehicle: ElectricVehicleParamsWithChargingStops;
6746
+ }) & CommonServiceParams<CalculateRouteRequestAPI, CalculateRouteResponseAPI> & CommonRoutingParams & {
6680
6747
  /**
6681
6748
  * Ordered list of locations (waypoints) and/or path points for route calculation.
6682
6749
  *
@@ -6774,21 +6841,6 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
6774
6841
  * ```
6775
6842
  */
6776
6843
  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
6844
  /**
6793
6845
  * Request extended progress information at route polyline points.
6794
6846
  *
@@ -7662,440 +7714,6 @@ export declare function getPlacesWithEVAvailability<P extends CommonPlaceProps =
7662
7714
  */
7663
7715
  export declare const hasChargingAvailability: (chargingPark: ChargingPark | ChargingParkWithAvailability | undefined) => chargingPark is ChargingParkWithAvailability;
7664
7716
  //#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
7717
  //#region src/geocode/geocoding.d.ts
8100
7718
  /**
8101
7719
  * Convert addresses into geographic coordinates (geocoding).
@@ -8984,6 +8602,10 @@ type NearbyIntentDetailsAPI = Omit<NearbyIntentDetails, 'position'> & {
8984
8602
  * It's designed to handle typos, abbreviations, and incomplete input gracefully.
8985
8603
  *
8986
8604
  * @remarks
8605
+ * Pass these to {@link search}, which selects the request variant from the params it is given:
8606
+ * a `route` property dispatches to along-route search, a `geometries` property to geometry search,
8607
+ * and neither to fuzzy search. There is no separate exported function for fuzzy search.
8608
+ *
8987
8609
  * **Key Features:**
8988
8610
  * - Tolerates typos and spelling mistakes
8989
8611
  * - Handles partial queries and abbreviations
@@ -9321,4 +8943,4 @@ export declare const trafficAreaAnalytics: (params: TrafficAreaAnalyticsParams,
9321
8943
  */
9322
8944
  export declare const trafficIncidentDetails: (params: TrafficIncidentDetailsParams, customTemplate?: Partial<TrafficIncidentDetailsTemplate>) => Promise<TrafficIncidentDetails>;
9323
8945
  //#endregion
9324
- export type { AdditionalDataAPI, AlongRouteSearchParams, AlongRouteSearchPayloadAPI, AlongRouteSearchRequestAPI, AlongRouteSearchResponse, AlongRouteSearchResponseAPI, AlongRouteSearchResultAPI, AlongRouteSortBy, AreaAnalyticsDateInput, AreaTag, ArrivalSide, AutocompleteGenericSearchSegment, AutocompleteSearchBrandSegment, AutocompleteSearchCategorySegment, AutocompleteSearchCategorySegmentAPI, AutocompleteSearchContext, AutocompleteSearchContextAPI, AutocompleteSearchMatch, AutocompleteSearchMatches, AutocompleteSearchParams, AutocompleteSearchPlaintextSegment, AutocompleteSearchResponse, AutocompleteSearchResponseAPI, AutocompleteSearchResult, AutocompleteSearchResultAPI, AutocompleteSearchResultGeoBias, AutocompleteSearchResultGeoBiasAPI, AutocompleteSearchSegment, AutocompleteSearchSegmentAPI, AutocompleteSearchSegmentType, BookmarkIntent, BookmarkIntentDetails, CalculateRouteParams, CanonicalAreaTag, ChargingStationsAvailabilityParams, ChargingStopsStrategy, Circle, CircleAPI, CommonServiceParamsWithZoom, ComputeTravelTimeFor, CoordinateIntent, CoordinateIntentAPI, CoordinateIntentDetails, CoordinateIntentDetailsAPI, ExplorationBrandAPI, ExplorationChargingParkAPI, ExplorationClassificationAPI, ExplorationOpeningHoursAPI, ExplorationOpeningIntervalAPI, ExplorationPOIAPI, ExplorationPlaceProps, ExplorationRecordType, ExplorationSearchParams, ExplorationSearchPayloadAPI, ExplorationSearchRequestAPI, ExplorationSearchResponse, ExplorationSearchResponseAPI, ExplorationSearchResultAPI, ExplorationViewportAPI, 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, NearAPI, NearbyIntent, NearbyIntentAPI, NearbyIntentDetails, NearbyIntentDetailsAPI, POICategoriesParams, POICategoriesResponse, POICategoryResult, Phonetics, PlaceByIdMandatoryParams, PlaceByIdOptionalParams, PlaceByIdParams, PlaceByIdResponse, PlaceByIdResponseAPI, PlaceByIdResultAPI, PoiCategoriesResponseAPI, PoiCategoryAPI, PolygonAPI, PopulatedAreaTag, QueryIntent, QueryIntentAPI, ReverseGeocodingMandatoryParams, ReverseGeocodingOptionalParams, ReverseGeocodingParams, RoutePointAPI, RouteStopOptions, SearchGeometryInput, TrafficAreaAnalyticsDateRange, TrafficAreaAnalyticsDays, TrafficAreaAnalyticsParams, TrafficIncidentDetailsByBBoxParams, TrafficIncidentDetailsByIdsParams, TrafficIncidentDetailsParams, W3WIntent, W3WIntentDetails, arrivalSides, chargingStopsStrategies, functionalRoadClasses, metricKeyToApiDataType };
8946
+ 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 };