@tomtom-org/maps-sdk 1.0.0-rc.3 → 1.0.0-rc.4
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 +178 -0
- package/README.md +4 -2
- package/THIRD_PARTY.txt +2 -2
- package/core/dist/core.es.js +1 -1
- package/core/dist/index.d.ts +626 -89
- package/map/dist/THIRD_PARTY.txt +1 -1
- package/map/dist/chunks/maplibre-gl-DudBHU-O.js +1 -0
- package/map/dist/index.d.ts +2612 -1869
- package/map/dist/map.es.js +3 -3
- package/map/dist/third-party.json +1 -1
- package/package.json +6 -5
- package/services/dist/THIRD_PARTY.txt +1 -1
- package/services/dist/index.d.ts +261 -100
- package/services/dist/services.es.js +1 -1
- package/services/dist/third-party.json +1 -1
- package/map/dist/chunks/maplibre-gl-Dp2tuNKx.js +0 -1
package/services/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
-
import { AddressProperties, AreaAnalyticsMetricKey, Avoidable, BBox, ChargingPoint, ChargingStation, CommonPlaceProps, Connector, ConnectorType, EntryPoint, Fuel, GeographyType, GeopoliticalView, GetPositionEntryPointOption, GlobalConfig, HasBBox, HasLngLat, MapcodeType, OpeningHours, OpeningHoursMode, POICategory, Place, PlaceDataSources, PlaceType, Places, PolygonFeature, PolygonFeatures, ReachableRangeBudget, RevGeoAddressProps, RoadShieldReference, Route, RoutePlanningLocation, Routes, SDKErrorCode, SearchPlaceProps, TimeZone, TomTomAPIHeaders, TrafficAreaAnalytics, TrafficIncidentDetails, TrafficIncidentRequestCategory, TrafficIncidentTEC, TrafficIncidentTimeValidity, TravelMode, inputSectionTypesWithGuidance } from "@tomtom-org/maps-sdk/core";
|
|
1
|
+
import { AddressProperties, AreaAnalyticsMetricKey, Avoidable, BBox, ChargingPoint, ChargingStation, CommonPlaceProps, Connector, ConnectorType, CurveDetectionOptions, EntryPoint, Fuel, GeographyType, GeopoliticalView, GetPositionEntryPointOption, GlobalConfig, HasBBox, HasLngLat, MapcodeType, OpeningHours, OpeningHoursMode, POICategory, Place, PlaceDataSources, PlaceType, Places, PolygonFeature, PolygonFeatures, ReachableRangeBudget, RevGeoAddressProps, RoadShieldReference, Route, RoutePlanningLocation, Routes, SDKErrorCode, SearchPlaceProps, TimeZone, TomTomAPIHeaders, TrafficAreaAnalytics, TrafficIncidentDetails, TrafficIncidentRequestCategory, TrafficIncidentTEC, TrafficIncidentTimeValidity, TravelMode, inputSectionTypesWithGuidance } from "@tomtom-org/maps-sdk/core";
|
|
2
2
|
import { core } from "zod";
|
|
3
|
+
//#region src/along-route-search/types/alongRoutePlaceProps.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The properties of a place that {@link discoverPlaces} finds along a route: the search properties
|
|
6
|
+
* plus the detour a stop at the place costs.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* A detour is measured against the original route, so either figure can be negative.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const cafes = await discoverPlaces({ route, maxDetourTimeSeconds: 600, query: 'cafe' });
|
|
14
|
+
* const minutes = Math.round(cafes.features[0].properties.detourTimeInSeconds / 60);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @group Along Route Search
|
|
18
|
+
*/
|
|
19
|
+
type AlongRoutePlaceProps = SearchPlaceProps & {
|
|
20
|
+
/** Seconds a stop at the place adds to the route, negative when the route through it is faster. */
|
|
21
|
+
detourTimeInSeconds: number;
|
|
22
|
+
/** Meters a stop at the place adds to the route, negative when the route through it is shorter. */
|
|
23
|
+
detourDistanceInMeters: number;
|
|
24
|
+
/**
|
|
25
|
+
* Meters from the start of the route to where the detour to the place leaves it.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* It is present only when you sort by `'detourOffset'`, which types it as required.
|
|
29
|
+
*/
|
|
30
|
+
detourOffsetInMeters?: number;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
3
33
|
//#region ../node_modules/.pnpm/@types+geojson@7946.0.16/node_modules/@types/geojson/index.d.ts
|
|
4
34
|
/**
|
|
5
35
|
* The value values for the "type" property of GeoJSON Objects.
|
|
@@ -264,8 +294,9 @@ type CommonServiceParams<ApiRequest = any, ApiResponse = any> = Partial<Omit<Glo
|
|
|
264
294
|
* Whether the SDK validates the request parameters against the expected schema before sending them.
|
|
265
295
|
*
|
|
266
296
|
* @remarks
|
|
267
|
-
*
|
|
268
|
-
*
|
|
297
|
+
* Validation also rejects a parameter the service doesn't know, and names it. To skip validation,
|
|
298
|
+
* set it to `false`, which then drops an unknown parameter silently. The `commonBaseURL` check
|
|
299
|
+
* (`INSECURE_BASE_URL`) runs either way.
|
|
269
300
|
*
|
|
270
301
|
* @defaultValue `true`
|
|
271
302
|
*/
|
|
@@ -331,9 +362,9 @@ type CommonServiceParams<ApiRequest = any, ApiResponse = any> = Partial<Omit<Glo
|
|
|
331
362
|
* 2. API errors are recoverable errors that occur during SDK operations,
|
|
332
363
|
* such as network failures or invalid API responses.
|
|
333
364
|
*
|
|
334
|
-
* A service call rejects with one,
|
|
335
|
-
* that geometry search does not support sent with `validateRequest: false
|
|
336
|
-
*
|
|
365
|
+
* A service call rejects with one, even for a request it cannot build at all, such as one with a geometry type
|
|
366
|
+
* that geometry search does not support sent with `validateRequest: false`. That one is an `INVALID_REQUEST`.
|
|
367
|
+
* An `onAPIRequest` or `onAPIResponse` hook that throws rejects the call with its own error.
|
|
337
368
|
*
|
|
338
369
|
* @example
|
|
339
370
|
* ```typescript
|
|
@@ -477,8 +508,8 @@ export declare class SDKAbortError extends SDKError {
|
|
|
477
508
|
/**
|
|
478
509
|
* What {@link LatestRequest.run} resolves to.
|
|
479
510
|
*
|
|
480
|
-
* `current: false` means a newer
|
|
481
|
-
* stale and must not be shown.
|
|
511
|
+
* `current: false` means a newer request or a `cancel` retired the request, so its value or error
|
|
512
|
+
* is stale and must not be shown.
|
|
482
513
|
*
|
|
483
514
|
* @group Shared
|
|
484
515
|
*/
|
|
@@ -489,7 +520,32 @@ export type LatestRequestResult<T> = {
|
|
|
489
520
|
current: false;
|
|
490
521
|
};
|
|
491
522
|
/**
|
|
492
|
-
*
|
|
523
|
+
* When a newer request retires the ones started before it.
|
|
524
|
+
*
|
|
525
|
+
* - `'on-start'`: as it starts, so only one request is ever in flight.
|
|
526
|
+
* - `'on-answer'`: as its answer arrives, so the older ones keep running and each answer that
|
|
527
|
+
* lands first is still shown. Use it when requests start faster than they answer, such as a
|
|
528
|
+
* route re-planned during a drag, where `'on-start'` would show nothing until the drag pauses.
|
|
529
|
+
*
|
|
530
|
+
* @group Shared
|
|
531
|
+
*/
|
|
532
|
+
export type LatestRequestSupersede = 'on-start' | 'on-answer';
|
|
533
|
+
/**
|
|
534
|
+
* Options for {@link createLatestRequest}.
|
|
535
|
+
*
|
|
536
|
+
* @group Shared
|
|
537
|
+
*/
|
|
538
|
+
export type LatestRequestOptions = {
|
|
539
|
+
/**
|
|
540
|
+
* When a newer request retires the ones started before it.
|
|
541
|
+
*
|
|
542
|
+
* @defaultValue `'on-start'`
|
|
543
|
+
*/
|
|
544
|
+
supersede?: LatestRequestSupersede;
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* A request slot that keeps only the latest answer, where each request retires the ones started
|
|
548
|
+
* before it, as {@link LatestRequestOptions.supersede} sets.
|
|
493
549
|
*
|
|
494
550
|
* @see {@link createLatestRequest}
|
|
495
551
|
*
|
|
@@ -497,18 +553,19 @@ export type LatestRequestResult<T> = {
|
|
|
497
553
|
*/
|
|
498
554
|
export type LatestRequest = {
|
|
499
555
|
/**
|
|
500
|
-
*
|
|
556
|
+
* Starts this request, and retires the ones started before it when it starts or when it answers.
|
|
501
557
|
*
|
|
502
558
|
* @remarks
|
|
503
559
|
* `request` is called synchronously with a fresh signal, which it passes to every service
|
|
504
|
-
* call it makes. A rejection is rethrown only while the
|
|
505
|
-
* deadline of your own composed onto the signal still surfaces
|
|
560
|
+
* call it makes. Retiring a request aborts its signal. A rejection is rethrown only while the
|
|
561
|
+
* request is still current, so a deadline of your own composed onto the signal still surfaces
|
|
562
|
+
* as an {@link SDKAbortError}.
|
|
506
563
|
*
|
|
507
564
|
* @param request - The work to run, typically one or more service calls sharing the signal
|
|
508
565
|
*/
|
|
509
566
|
run: <T>(request: (signal: AbortSignal) => Promise<T>) => Promise<LatestRequestResult<T>>;
|
|
510
567
|
/**
|
|
511
|
-
* Aborts
|
|
568
|
+
* Aborts every request in flight without starting another, so each resolves `{ current: false }`.
|
|
512
569
|
*/
|
|
513
570
|
cancel: () => void;
|
|
514
571
|
/**
|
|
@@ -521,14 +578,18 @@ export type LatestRequest = {
|
|
|
521
578
|
/**
|
|
522
579
|
* Creates a slot that keeps only the latest request.
|
|
523
580
|
*
|
|
524
|
-
*
|
|
525
|
-
* dropped rather than returned.
|
|
581
|
+
* A newer request aborts the ones started before it, and an answer arriving after a newer one or a
|
|
582
|
+
* `cancel` is dropped rather than returned.
|
|
526
583
|
*
|
|
527
584
|
* @remarks
|
|
528
585
|
* Use one per thing that can be superseded, like a click lookup, a search box or a refetch on map
|
|
529
586
|
* move. Aborting stops the network work. Checking again once the answer is in also catches a `cancel`
|
|
530
587
|
* that arrives after the response but before the caller paints it.
|
|
531
588
|
*
|
|
589
|
+
* By default a request retires the older ones as it starts. With `supersede: 'on-answer'` they keep
|
|
590
|
+
* running until a newer answer arrives, so a stream of requests faster than their answers still
|
|
591
|
+
* shows each answer in order.
|
|
592
|
+
*
|
|
532
593
|
* @example
|
|
533
594
|
* ```ts
|
|
534
595
|
* const lookup = createLatestRequest();
|
|
@@ -541,11 +602,19 @@ export type LatestRequest = {
|
|
|
541
602
|
* clearButton.addEventListener('click', lookup.cancel);
|
|
542
603
|
* ```
|
|
543
604
|
*
|
|
605
|
+
* @example
|
|
606
|
+
* Show each route re-planned during a drag as it arrives, never an older one after a newer one:
|
|
607
|
+
* ```ts
|
|
608
|
+
* const latestRoute = createLatestRequest({ supersede: 'on-answer' });
|
|
609
|
+
* const result = await latestRoute.run((signal) => calculateRoute({ locations, signal }));
|
|
610
|
+
* if (result.current) await routingModule.showRoutes(result.value);
|
|
611
|
+
* ```
|
|
612
|
+
*
|
|
544
613
|
* @see [Keeping only the latest request](https://docs.tomtom.com/maps-sdk-js/guides/services/request-options-and-errors#keeping-only-the-latest-request)
|
|
545
614
|
*
|
|
546
615
|
* @group Shared
|
|
547
616
|
*/
|
|
548
|
-
export declare const createLatestRequest: () => LatestRequest;
|
|
617
|
+
export declare const createLatestRequest: (options?: LatestRequestOptions) => LatestRequest;
|
|
549
618
|
//#endregion
|
|
550
619
|
//#region src/shared/types/geoBias.d.ts
|
|
551
620
|
/**
|
|
@@ -574,8 +643,8 @@ export type PointGeoBias = {
|
|
|
574
643
|
*/
|
|
575
644
|
export type BoundingBoxGeoBias = {
|
|
576
645
|
/**
|
|
577
|
-
* The rectangle, as `[
|
|
578
|
-
* value a bounding box can be derived from (a `bbox` property, a Feature, or a geometry).
|
|
646
|
+
* The rectangle, as a {@link BBox} `[west, south, east, north]` (west > east across the antimeridian),
|
|
647
|
+
* or any GeoJSON value a bounding box can be derived from (a `bbox` property, a Feature, or a geometry).
|
|
579
648
|
*/
|
|
580
649
|
boundingBox: HasBBox;
|
|
581
650
|
};
|
|
@@ -864,8 +933,12 @@ export type CommonGeocodeAndFuzzySearchParams = {
|
|
|
864
933
|
* the same parameters. Leave it out for the first page.
|
|
865
934
|
*
|
|
866
935
|
* @remarks
|
|
867
|
-
* The value is **opaque**.
|
|
868
|
-
* change without breaking callers.
|
|
936
|
+
* The value is **opaque**. Its format isn't part of the contract, so the pagination mechanism
|
|
937
|
+
* can change without breaking callers. A value the SDK can't read as a cursor throws an `SDKError`.
|
|
938
|
+
*
|
|
939
|
+
* The cursor isn't tied to the search that minted it. If you pass it with another `query` or
|
|
940
|
+
* other `filters`, that search starts at the same position and skips its first pages. Leave
|
|
941
|
+
* `cursor` out to start a new search.
|
|
869
942
|
*
|
|
870
943
|
* @example
|
|
871
944
|
* ```typescript
|
|
@@ -1320,12 +1393,27 @@ export type CostModel = {
|
|
|
1320
1393
|
routeType?: RouteType;
|
|
1321
1394
|
};
|
|
1322
1395
|
type DepartArriveOption = 'departAt' | 'arriveBy';
|
|
1396
|
+
/**
|
|
1397
|
+
* A wall-clock date and time without a UTC offset, as `YYYY-MM-DDTHH:mm:ss`, such as
|
|
1398
|
+
* `'2026-10-19T08:15:00'`.
|
|
1399
|
+
*
|
|
1400
|
+
* @remarks
|
|
1401
|
+
* Seconds are required, and an offset, a trailing `Z` or a date that doesn't exist, such as
|
|
1402
|
+
* `2026-02-30`, is rejected. Each field takes two digits, which the type can't check, so pad what
|
|
1403
|
+
* you build at runtime and cast it with `as LocalDateTime`. Request validation checks the rest.
|
|
1404
|
+
*
|
|
1405
|
+
* @group Routing
|
|
1406
|
+
*/
|
|
1407
|
+
export type LocalDateTime = `${number}-${number}-${number}T${number}:${number}:${number}`;
|
|
1323
1408
|
/**
|
|
1324
1409
|
* The departure or arrival time for route planning.
|
|
1325
1410
|
*
|
|
1326
1411
|
* It sets either when to depart from the origin or when to arrive at the destination. The routing
|
|
1327
1412
|
* engine then optimises the route for that time window, considering traffic patterns for that time of day.
|
|
1328
1413
|
*
|
|
1414
|
+
* Pass exactly one of `date`, an instant, and `localDateTime`, a wall-clock time the routing API
|
|
1415
|
+
* reads in the local time zone of the place it applies to.
|
|
1416
|
+
*
|
|
1329
1417
|
* @typeParam Option - Whether this specifies departure or arrival time
|
|
1330
1418
|
*
|
|
1331
1419
|
* @remarks
|
|
@@ -1342,23 +1430,17 @@ type DepartArriveOption = 'departAt' | 'arriveBy';
|
|
|
1342
1430
|
*
|
|
1343
1431
|
* @example
|
|
1344
1432
|
* ```typescript
|
|
1345
|
-
* // Depart at
|
|
1433
|
+
* // Depart at 08:15 in Tokyo, wherever the code runs
|
|
1346
1434
|
* const departParams: DepartArriveParams = {
|
|
1347
1435
|
* option: 'departAt',
|
|
1348
|
-
*
|
|
1436
|
+
* localDateTime: '2026-10-19T08:15:00'
|
|
1349
1437
|
* };
|
|
1350
1438
|
*
|
|
1351
|
-
* // Arrive by
|
|
1439
|
+
* // Arrive by an instant (catch a flight)
|
|
1352
1440
|
* const arriveParams: DepartArriveParams = {
|
|
1353
1441
|
* option: 'arriveBy',
|
|
1354
1442
|
* date: new Date('2025-10-20T14:00:00+02:00')
|
|
1355
1443
|
* };
|
|
1356
|
-
*
|
|
1357
|
-
* // Plan route avoiding rush hour
|
|
1358
|
-
* const offPeakDepart: DepartArriveParams = {
|
|
1359
|
-
* option: 'departAt',
|
|
1360
|
-
* date: new Date('2025-10-20T10:30:00+02:00') // After morning rush
|
|
1361
|
-
* };
|
|
1362
1444
|
* ```
|
|
1363
1445
|
*
|
|
1364
1446
|
* @group Routing
|
|
@@ -1372,18 +1454,32 @@ export type DepartArriveParams<Option extends DepartArriveOption = DepartArriveO
|
|
|
1372
1454
|
* - `arriveBy` calculates the route backward to arrive by this time.
|
|
1373
1455
|
*/
|
|
1374
1456
|
option: Option;
|
|
1457
|
+
} & ({
|
|
1375
1458
|
/**
|
|
1376
|
-
* The
|
|
1459
|
+
* The instant to depart or arrive.
|
|
1377
1460
|
*
|
|
1378
1461
|
* @remarks
|
|
1379
1462
|
* If you pass a past date, or one that is impossible to achieve (such as an imminent arrival
|
|
1380
1463
|
* date for a very long route), the route defaults to departing immediately.
|
|
1381
1464
|
*
|
|
1382
|
-
* The date is
|
|
1383
|
-
* with the origin's UTC offset.
|
|
1465
|
+
* The date is sent in UTC. For a wall-clock time at the origin, use `localDateTime` instead.
|
|
1384
1466
|
*/
|
|
1385
1467
|
date: Date;
|
|
1386
|
-
|
|
1468
|
+
localDateTime?: never;
|
|
1469
|
+
} | {
|
|
1470
|
+
/**
|
|
1471
|
+
* The wall-clock time to depart or arrive, without a UTC offset.
|
|
1472
|
+
*
|
|
1473
|
+
* @remarks
|
|
1474
|
+
* `localDateTime` is a wall-clock time without an offset, read in the origin's time zone.
|
|
1475
|
+
* With `arriveBy`, it is read in the time zone of the route's final destination instead.
|
|
1476
|
+
*
|
|
1477
|
+
* The response's `summary.departureTime` and `summary.arrivalTime` carry the instants it
|
|
1478
|
+
* resolved to. A past or unreachable time defaults to departing immediately, as with `date`.
|
|
1479
|
+
*/
|
|
1480
|
+
localDateTime: LocalDateTime;
|
|
1481
|
+
date?: never;
|
|
1482
|
+
});
|
|
1387
1483
|
/**
|
|
1388
1484
|
* The parameters every routing service request shares.
|
|
1389
1485
|
*
|
|
@@ -1413,7 +1509,7 @@ export type DepartArriveParams<Option extends DepartArriveOption = DepartArriveO
|
|
|
1413
1509
|
* travelMode: 'car',
|
|
1414
1510
|
* when: {
|
|
1415
1511
|
* option: 'departAt',
|
|
1416
|
-
*
|
|
1512
|
+
* localDateTime: '2026-10-19T08:00:00'
|
|
1417
1513
|
* }
|
|
1418
1514
|
* };
|
|
1419
1515
|
*
|
|
@@ -1436,7 +1532,7 @@ export type DepartArriveParams<Option extends DepartArriveOption = DepartArriveO
|
|
|
1436
1532
|
* };
|
|
1437
1533
|
* ```
|
|
1438
1534
|
*
|
|
1439
|
-
* @see [
|
|
1535
|
+
* @see [Calculate Route POST data parameters](https://docs.tomtom.com/routing-api/documentation/tomtom-orbis-maps/v3/calculate-route#post-data-parameters)
|
|
1440
1536
|
*
|
|
1441
1537
|
* @group Routing
|
|
1442
1538
|
*/
|
|
@@ -1448,15 +1544,16 @@ export type CommonRoutingParams = {
|
|
|
1448
1544
|
/**
|
|
1449
1545
|
* The travel mode for the requested route, which is the primary means of transport while routing.
|
|
1450
1546
|
*
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1547
|
+
* Only `'car'` is supported, which is also the routing service's default.
|
|
1548
|
+
* For `calculateRoute`, the parts of the route a car may not use come back as its
|
|
1549
|
+
* `vehicleRestricted` sections, unless `sectionTypes` leaves them out.
|
|
1550
|
+
* @default 'car'
|
|
1454
1551
|
*/
|
|
1455
1552
|
travelMode?: TravelMode;
|
|
1456
1553
|
/**
|
|
1457
|
-
* When to depart or arrive.
|
|
1458
|
-
* If you pass a past
|
|
1459
|
-
*
|
|
1554
|
+
* When to depart or arrive, as an instant or a wall-clock time.
|
|
1555
|
+
* If you pass a past time, or one that is impossible to achieve (such as an imminent arrival
|
|
1556
|
+
* for a long route), it defaults to departing now.
|
|
1460
1557
|
* @default depart now
|
|
1461
1558
|
*/
|
|
1462
1559
|
when?: DepartArriveParams;
|
|
@@ -1669,7 +1766,6 @@ type SummaryQueryType = 'NEARBY' | 'NON_NEAR';
|
|
|
1669
1766
|
* });
|
|
1670
1767
|
*
|
|
1671
1768
|
* const summary = results.properties;
|
|
1672
|
-
* console.log(`Found ${summary?.totalResults ?? 'an unknown number of'} total results`);
|
|
1673
1769
|
* console.log(`Showing ${summary?.numResults} results`);
|
|
1674
1770
|
* console.log(`Query type: ${summary?.queryType}`); // 'NEARBY'
|
|
1675
1771
|
* console.log(`Search took ${summary?.queryTime}ms`);
|
|
@@ -1721,9 +1817,8 @@ export type SearchSummary = {
|
|
|
1721
1817
|
*
|
|
1722
1818
|
* @example
|
|
1723
1819
|
* ```typescript
|
|
1724
|
-
* // If limit=10 and
|
|
1820
|
+
* // If limit=10 and more results exist
|
|
1725
1821
|
* numResults: 10 // Only 10 results in this response
|
|
1726
|
-
* totalResults: 50 // 50 total matches exist
|
|
1727
1822
|
* ```
|
|
1728
1823
|
*/
|
|
1729
1824
|
numResults: number;
|
|
@@ -1733,24 +1828,30 @@ export type SearchSummary = {
|
|
|
1733
1828
|
* @remarks
|
|
1734
1829
|
* See {@link CommonGeocodeAndFuzzySearchParams.cursor}. Only fuzzy search and geocoding page this way.
|
|
1735
1830
|
*
|
|
1736
|
-
* If it is absent, pagination has ended. Either the
|
|
1737
|
-
* empty, or the next page would start past result 1900, the furthest the backend
|
|
1831
|
+
* If it is absent, pagination has ended. Either the next page would start at `totalResults`, this
|
|
1832
|
+
* page came back empty, or the next page would start past result 1900, the furthest the backend
|
|
1833
|
+
* serves. Fuzzy search's `totalResults` is at most 100 and can be lower at a larger `limit`, so its
|
|
1834
|
+
* pagination ends there.
|
|
1738
1835
|
*/
|
|
1739
1836
|
nextCursor?: string;
|
|
1740
1837
|
/**
|
|
1741
|
-
* The
|
|
1838
|
+
* The number of results the search API reports for the query.
|
|
1742
1839
|
*
|
|
1743
1840
|
* @remarks
|
|
1744
|
-
*
|
|
1745
|
-
*
|
|
1746
|
-
*
|
|
1841
|
+
* It is not guaranteed, so guard it rather than assume a number. For geocoding, it counts matches
|
|
1842
|
+
* beyond the page returned. Fuzzy and geometry search report at most 100, the most one search
|
|
1843
|
+
* returns, and fuzzy search's number can drop as `limit` grows. Along-route search reports the
|
|
1844
|
+
* page's own length. So don't show it as a total except for geocoding.
|
|
1845
|
+
*
|
|
1846
|
+
* Don't drive pagination with it either. `nextCursor` decides whether a further page exists.
|
|
1747
1847
|
*
|
|
1748
1848
|
* @example
|
|
1749
1849
|
* ```typescript
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1850
|
+
* // geocode({ query: 'Main Street' })
|
|
1851
|
+
* totalResults: 58090 // Matches counted, this page included
|
|
1852
|
+
* numResults: 10 // Showing the first 10
|
|
1752
1853
|
*
|
|
1753
|
-
* // Fetch
|
|
1854
|
+
* // Fetch more by passing `nextCursor` back as `cursor`
|
|
1754
1855
|
* ```
|
|
1755
1856
|
*/
|
|
1756
1857
|
totalResults?: number;
|
|
@@ -2017,11 +2118,24 @@ type AlongRouteSearchPayloadAPI = {
|
|
|
2017
2118
|
type AlongRouteSearchRequestAPI = PostObject<AlongRouteSearchPayloadAPI>;
|
|
2018
2119
|
//#endregion
|
|
2019
2120
|
//#region src/along-route-search/types/alongRouteSearchResponseAPI.d.ts
|
|
2121
|
+
/**
|
|
2122
|
+
* @ignore
|
|
2123
|
+
*/
|
|
2124
|
+
type AlongRouteSearchResultAPI = CommonSearchPlaceResultAPI & {
|
|
2125
|
+
/** In seconds. */
|
|
2126
|
+
detourTime: number;
|
|
2127
|
+
/** In meters. */
|
|
2128
|
+
detourDistance: number;
|
|
2129
|
+
/** In meters, sent only when sorting by `detourOffset`. */
|
|
2130
|
+
detourOffset?: number;
|
|
2131
|
+
};
|
|
2020
2132
|
/**
|
|
2021
2133
|
* Its results are sorted by detour time or offset.
|
|
2022
2134
|
* @ignore
|
|
2023
2135
|
*/
|
|
2024
|
-
type AlongRouteSearchResponseAPI = SearchResultsResponseAPI
|
|
2136
|
+
type AlongRouteSearchResponseAPI = Omit<SearchResultsResponseAPI, 'results'> & {
|
|
2137
|
+
results: AlongRouteSearchResultAPI[];
|
|
2138
|
+
};
|
|
2025
2139
|
//#endregion
|
|
2026
2140
|
//#region src/along-route-search/types/alongRouteSearchParams.d.ts
|
|
2027
2141
|
/**
|
|
@@ -2030,8 +2144,11 @@ type AlongRouteSearchResponseAPI = SearchResultsResponseAPI;
|
|
|
2030
2144
|
* Controls how the returned POIs are ordered relative to the route.
|
|
2031
2145
|
*
|
|
2032
2146
|
* @remarks
|
|
2033
|
-
* - `detourTime`: Sort by
|
|
2034
|
-
*
|
|
2147
|
+
* - `detourTime`: Sort by the detour time, the travel time a stop at the POI adds (default). It is
|
|
2148
|
+
* negative when the route through the POI is faster than the original one, so those POIs come first.
|
|
2149
|
+
* Each result carries it as `detourTimeInSeconds`, in {@link AlongRoutePlaceProps}.
|
|
2150
|
+
* - `detourOffset`: Sort by how far along the route the detour point falls. Each result then carries it
|
|
2151
|
+
* as `detourOffsetInMeters`, in {@link AlongRoutePlaceProps}.
|
|
2035
2152
|
*
|
|
2036
2153
|
* @group Along Route Search
|
|
2037
2154
|
*/
|
|
@@ -2040,7 +2157,7 @@ type AlongRouteSortBy = 'detourTime' | 'detourOffset';
|
|
|
2040
2157
|
* Parameters for searching places along a route.
|
|
2041
2158
|
*
|
|
2042
2159
|
* Along-route search finds POIs near a provided route geometry and ranks them
|
|
2043
|
-
* by the detour
|
|
2160
|
+
* by the detour time a stop adds, or by the detour point's offset along the route.
|
|
2044
2161
|
*
|
|
2045
2162
|
* @remarks
|
|
2046
2163
|
* **Key Features:**
|
|
@@ -2099,7 +2216,8 @@ type AlongRouteSearchParams = CommonSearchParams<AlongRouteSearchRequestAPI, Alo
|
|
|
2099
2216
|
*/
|
|
2100
2217
|
route: LineString | Route | Position[];
|
|
2101
2218
|
/**
|
|
2102
|
-
* Maximum allowed detour time in seconds
|
|
2219
|
+
* Maximum allowed detour time in seconds, a positive integer up to `3600` (one hour);
|
|
2220
|
+
* request validation rejects a larger one.
|
|
2103
2221
|
*
|
|
2104
2222
|
* Only POIs reachable within this additional travel time from the route
|
|
2105
2223
|
* are returned. It controls the width of the search corridor.
|
|
@@ -2583,7 +2701,7 @@ type GeocodingParams = Omit<CommonPlacesParams<GetObject, GeocodingResponseAPI>
|
|
|
2583
2701
|
* Address or location query to geocode.
|
|
2584
2702
|
*
|
|
2585
2703
|
* The text to convert into geographic coordinates, typically a street address,
|
|
2586
|
-
* intersection
|
|
2704
|
+
* intersection or city name. The service tolerates typos and incomplete
|
|
2587
2705
|
* inputs. Pass it as plain text. The SDK encodes it for the request path, so a value
|
|
2588
2706
|
* you already encoded is encoded again and can resolve to a different place.
|
|
2589
2707
|
*
|
|
@@ -2592,14 +2710,16 @@ type GeocodingParams = Omit<CommonPlacesParams<GetObject, GeocodingResponseAPI>
|
|
|
2592
2710
|
* - Full street address: "1600 Pennsylvania Avenue NW, Washington, DC"
|
|
2593
2711
|
* - City name: "Amsterdam"
|
|
2594
2712
|
* - Intersection: "Broadway & 42nd St, New York"
|
|
2595
|
-
* - Landmark: "Eiffel Tower, Paris"
|
|
2596
2713
|
* - Partial address: "Dam Square" (city context resolved via `geoBias` or `filters.countries`)
|
|
2597
2714
|
*
|
|
2715
|
+
* A landmark such as "Eiffel Tower, Paris" is a POI, which geocoding never returns: find it
|
|
2716
|
+
* with {@link discoverPlaces}.
|
|
2717
|
+
*
|
|
2598
2718
|
* @example
|
|
2599
2719
|
* ```typescript
|
|
2600
2720
|
* query: '1600 Pennsylvania Avenue NW, Washington, DC'
|
|
2601
2721
|
* query: 'Museumplein, Amsterdam'
|
|
2602
|
-
* query: '
|
|
2722
|
+
* query: 'Broadway & 42nd St, New York'
|
|
2603
2723
|
* ```
|
|
2604
2724
|
*/
|
|
2605
2725
|
query: string;
|
|
@@ -2693,7 +2813,7 @@ export declare const geocode: (params: GeocodingParams) => Promise<GeocodingResp
|
|
|
2693
2813
|
*
|
|
2694
2814
|
* @param queryOrParams - The address or place name to geocode, or the full {@link GeocodingParams} without `limit`.
|
|
2695
2815
|
* @returns The best-matching place.
|
|
2696
|
-
* @throws {
|
|
2816
|
+
* @throws {SDKError} With the code `NOT_FOUND` and the service `'Geocode'` if no results are found for the query
|
|
2697
2817
|
*
|
|
2698
2818
|
* @remarks
|
|
2699
2819
|
* To handle finding no results without throwing, use {@link geocode} with a `limit`
|
|
@@ -3194,8 +3314,7 @@ type PlaceDetailsMandatoryParams = {
|
|
|
3194
3314
|
*
|
|
3195
3315
|
* @remarks
|
|
3196
3316
|
* You can get this ID from:
|
|
3197
|
-
* - Previous search results (place.id)
|
|
3198
|
-
* - POI details data source (place.properties.dataSources.poiDetails.id)
|
|
3317
|
+
* - Previous search results (place.id, on the feature rather than in its properties)
|
|
3199
3318
|
* - Related POIs (place.properties.relatedPois[].id)
|
|
3200
3319
|
*
|
|
3201
3320
|
* @example
|
|
@@ -3255,8 +3374,8 @@ type PlaceDetailsResponse = Place<SearchPlaceProps> | undefined;
|
|
|
3255
3374
|
* Retrieves detailed information about a place using its unique identifier.
|
|
3256
3375
|
*
|
|
3257
3376
|
* The place details service fetches comprehensive data for a specific place when you
|
|
3258
|
-
* have its ID from a previous search
|
|
3259
|
-
*
|
|
3377
|
+
* have its ID from a previous search. Use it to get additional details or refresh
|
|
3378
|
+
* information about a known location.
|
|
3260
3379
|
*
|
|
3261
3380
|
* @remarks
|
|
3262
3381
|
* Use it to fetch a POI's opening hours, related POIs and EV charging hardware, update
|
|
@@ -3264,8 +3383,7 @@ type PlaceDetailsResponse = Place<SearchPlaceProps> | undefined;
|
|
|
3264
3383
|
* deep links, or explore parent/child relationships between related POIs.
|
|
3265
3384
|
*
|
|
3266
3385
|
* You can get the ID from:
|
|
3267
|
-
* - Previous search results (place.id)
|
|
3268
|
-
* - POI details data source (place.properties.dataSources.poiDetails.id)
|
|
3386
|
+
* - Previous search results (place.id, on the feature rather than in its properties)
|
|
3269
3387
|
* - Related POIs (place.properties.relatedPois[].id)
|
|
3270
3388
|
* - Deep links or bookmarks
|
|
3271
3389
|
*
|
|
@@ -3277,23 +3395,13 @@ type PlaceDetailsResponse = Place<SearchPlaceProps> | undefined;
|
|
|
3277
3395
|
* ```typescript
|
|
3278
3396
|
* // Get a search result's full details
|
|
3279
3397
|
* const searchResult = await discoverPlaces({ query: 'Eiffel Tower' });
|
|
3280
|
-
* const
|
|
3398
|
+
* const place = searchResult.features[0];
|
|
3281
3399
|
*
|
|
3282
3400
|
* const placeDetails = await getPlaceDetails({
|
|
3283
|
-
* entityId:
|
|
3401
|
+
* entityId: place.id,
|
|
3402
|
+
* openingHours: 'nextSevenDays'
|
|
3284
3403
|
* });
|
|
3285
3404
|
*
|
|
3286
|
-
* // Get extended POI details
|
|
3287
|
-
* const place = searchResult.features[0];
|
|
3288
|
-
* const poiDetailsId = place.properties.dataSources?.poiDetails?.id;
|
|
3289
|
-
*
|
|
3290
|
-
* if (poiDetailsId) {
|
|
3291
|
-
* const detailedPOI = await getPlaceDetails({
|
|
3292
|
-
* entityId: poiDetailsId,
|
|
3293
|
-
* openingHours: 'nextSevenDays'
|
|
3294
|
-
* });
|
|
3295
|
-
* }
|
|
3296
|
-
*
|
|
3297
3405
|
* // Navigate to related POI
|
|
3298
3406
|
* const relatedPOI = place.properties.relatedPois?.[0];
|
|
3299
3407
|
* if (relatedPOI) {
|
|
@@ -3656,7 +3764,7 @@ export type ReachableRangeOwnParams = {
|
|
|
3656
3764
|
*/
|
|
3657
3765
|
smoothing?: 'none' | 'weak' | 'strong';
|
|
3658
3766
|
/**
|
|
3659
|
-
* When to depart.
|
|
3767
|
+
* When to depart, as an instant (`date`) or a wall-clock time at the origin (`localDateTime`).
|
|
3660
3768
|
*
|
|
3661
3769
|
* @remarks
|
|
3662
3770
|
* If you supply past dates or dates that are impossible to achieve, it
|
|
@@ -3669,7 +3777,7 @@ export type ReachableRangeOwnParams = {
|
|
|
3669
3777
|
*
|
|
3670
3778
|
* @example
|
|
3671
3779
|
* ```typescript
|
|
3672
|
-
* when: { option: 'departAt',
|
|
3780
|
+
* when: { option: 'departAt', localDateTime: '2026-10-19T08:00:00' }
|
|
3673
3781
|
* ```
|
|
3674
3782
|
*/
|
|
3675
3783
|
when?: DepartArriveParams<'departAt'>;
|
|
@@ -3773,7 +3881,7 @@ export type ReachableRangeProperties = Omit<ReachableRangeParams, keyof CommonSe
|
|
|
3773
3881
|
* const morningRange = await calculateReachableRange({
|
|
3774
3882
|
* origin: [4.9041, 52.3676],
|
|
3775
3883
|
* budget: { type: 'timeMinutes', value: 45 },
|
|
3776
|
-
* when: { option: 'departAt',
|
|
3884
|
+
* when: { option: 'departAt', localDateTime: '2026-10-19T08:00:00' } // Rush hour in Amsterdam
|
|
3777
3885
|
* });
|
|
3778
3886
|
* ```
|
|
3779
3887
|
*
|
|
@@ -4432,6 +4540,8 @@ type InputSectionType = (typeof inputSectionTypesWithGuidance)[number];
|
|
|
4432
4540
|
* - `roadShields`: Road shield information
|
|
4433
4541
|
* - `importantRoadStretch`: Named important road stretches along the route
|
|
4434
4542
|
* - `lanes`: Lane guidance
|
|
4543
|
+
* - `curve`: Curves, with their heading change and radius, which the SDK finds in the route's geometry
|
|
4544
|
+
* - `curvyStretch`: Stretches where curves follow one another closely, which the SDK groups the curves into
|
|
4435
4545
|
*
|
|
4436
4546
|
* A requested section type is only present in the response if the route actually traverses it
|
|
4437
4547
|
* (e.g. `ferry` is omitted on a route with no water crossing). The `lanes` section is returned only
|
|
@@ -4443,14 +4553,14 @@ type InputSectionType = (typeof inputSectionTypesWithGuidance)[number];
|
|
|
4443
4553
|
* // Request toll, ferry, and traffic sections
|
|
4444
4554
|
* const sectionTypes: InputSectionTypes = ['toll', 'ferry', 'traffic'];
|
|
4445
4555
|
*
|
|
4446
|
-
* //
|
|
4447
|
-
* const sectionTypes: InputSectionTypes =
|
|
4556
|
+
* // The default sections, and the curves
|
|
4557
|
+
* const sectionTypes: InputSectionTypes = [...defaultSectionTypes, 'curve', 'curvyStretch'];
|
|
4448
4558
|
*
|
|
4449
4559
|
* // Request no optional sections (leg sections still included)
|
|
4450
4560
|
* const sectionTypes: InputSectionTypes = [];
|
|
4451
4561
|
* ```
|
|
4452
4562
|
*
|
|
4453
|
-
* @default When omitted,
|
|
4563
|
+
* @default When omitted, core's `defaultSectionTypes`: every type but `curve` and `curvyStretch`.
|
|
4454
4564
|
*
|
|
4455
4565
|
* @group Routing
|
|
4456
4566
|
*/
|
|
@@ -4588,7 +4698,7 @@ type MaxNumberOfAlternatives = 0 | 1 | 2 | 3 | 4 | 5;
|
|
|
4588
4698
|
* },
|
|
4589
4699
|
* when: {
|
|
4590
4700
|
* option: 'departAt',
|
|
4591
|
-
*
|
|
4701
|
+
* localDateTime: '2026-10-19T08:00:00'
|
|
4592
4702
|
* }
|
|
4593
4703
|
* };
|
|
4594
4704
|
*
|
|
@@ -4624,8 +4734,8 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
|
|
|
4624
4734
|
* pins the geometry the route must follow, but its endpoints go out as waypoints as well,
|
|
4625
4735
|
* so it shapes the route without shortening the list of legs.
|
|
4626
4736
|
*
|
|
4627
|
-
* @see [POST data parameters](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/calculate-route#post-data-parameters)
|
|
4628
|
-
* @see [Response structure](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/calculate-route#structure-of-a-successful-response)
|
|
4737
|
+
* @see [POST data parameters](https://docs.tomtom.com/routing-api/documentation/tomtom-orbis-maps/v3/calculate-route#post-data-parameters)
|
|
4738
|
+
* @see [Response structure](https://docs.tomtom.com/routing-api/documentation/tomtom-orbis-maps/v3/calculate-route#structure-of-a-successful-response)
|
|
4629
4739
|
*
|
|
4630
4740
|
* @example
|
|
4631
4741
|
* ```typescript
|
|
@@ -4653,7 +4763,8 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
|
|
|
4653
4763
|
* They improve routing accuracy by directing to the correct entrance.
|
|
4654
4764
|
*
|
|
4655
4765
|
* @remarks
|
|
4656
|
-
* - `main-when-available`: Use
|
|
4766
|
+
* - `main-when-available`: Use the entry point {@link GetPositionEntryPointOption} picks, otherwise the
|
|
4767
|
+
* place center (recommended for routing)
|
|
4657
4768
|
* - `ignore`: Always use place center position
|
|
4658
4769
|
*
|
|
4659
4770
|
* @default 'ignore' (a place's geometry is used)
|
|
@@ -4747,20 +4858,42 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
|
|
|
4747
4858
|
* when two or more routes come back. A section type is only present in the response if the
|
|
4748
4859
|
* route actually traverses it. The `lanes` section is returned only when
|
|
4749
4860
|
* {@link GuidanceParams | `guidance`} is also requested, and, when a list is given, only if it
|
|
4750
|
-
* includes `lanes`.
|
|
4861
|
+
* includes `lanes`. The SDK finds `curve` and `curvyStretch` in the route's geometry, with
|
|
4862
|
+
* the thresholds of `curveDetection`, and only when the list names them.
|
|
4751
4863
|
*
|
|
4752
|
-
* @default When omitted,
|
|
4864
|
+
* @default When omitted, core's `defaultSectionTypes`: every type but `curve` and `curvyStretch`.
|
|
4753
4865
|
*
|
|
4754
4866
|
* @example
|
|
4755
4867
|
* ```typescript
|
|
4756
4868
|
* // Request specific sections (any combination of available section types)
|
|
4757
4869
|
* sectionTypes: ['toll', 'ferry', 'traffic', 'country', 'roadShields']
|
|
4758
4870
|
*
|
|
4871
|
+
* // The default sections, and the curves
|
|
4872
|
+
* sectionTypes: [...defaultSectionTypes, 'curve', 'curvyStretch']
|
|
4873
|
+
*
|
|
4759
4874
|
* // Request no optional sections
|
|
4760
4875
|
* sectionTypes: []
|
|
4761
4876
|
* ```
|
|
4762
4877
|
*/
|
|
4763
4878
|
sectionTypes?: InputSectionTypes;
|
|
4879
|
+
/**
|
|
4880
|
+
* The thresholds the SDK finds the `curve` and `curvyStretch` sections with, when
|
|
4881
|
+
* `sectionTypes` names them.
|
|
4882
|
+
*
|
|
4883
|
+
* @remarks
|
|
4884
|
+
* The SDK finds them in the route's geometry once it comes back, so they change nothing the
|
|
4885
|
+
* routing API returns. To find them again with other thresholds, with no new request, pass
|
|
4886
|
+
* the route to core's `withCurveSections`.
|
|
4887
|
+
*
|
|
4888
|
+
* @default The defaults of core's `getCurveSections` and `getCurvyStretchSections`.
|
|
4889
|
+
*
|
|
4890
|
+
* @example
|
|
4891
|
+
* ```typescript
|
|
4892
|
+
* // Only the hard curves, and the stretches of five or more of them
|
|
4893
|
+
* curveDetection: { curve: { maxRadiusInMeters: 100 }, curvyStretch: { minCurveCount: 5 } }
|
|
4894
|
+
* ```
|
|
4895
|
+
*/
|
|
4896
|
+
curveDetection?: CurveDetectionOptions;
|
|
4764
4897
|
/**
|
|
4765
4898
|
* Maximum number of alternative routes to calculate.
|
|
4766
4899
|
*
|
|
@@ -4789,7 +4922,7 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
|
|
|
4789
4922
|
* @param params - The locations, travel mode and other route calculation options.
|
|
4790
4923
|
* @returns The calculated routes, with their geometry, distance and travel time.
|
|
4791
4924
|
*
|
|
4792
|
-
* @see [Calculate Route API Documentation](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/calculate-route)
|
|
4925
|
+
* @see [Calculate Route API Documentation](https://docs.tomtom.com/routing-api/documentation/tomtom-orbis-maps/v3/calculate-route)
|
|
4793
4926
|
*
|
|
4794
4927
|
* @group Routing
|
|
4795
4928
|
*/
|
|
@@ -4890,6 +5023,17 @@ type RouteStopOptions = {
|
|
|
4890
5023
|
legCostModel?: LegCostModel;
|
|
4891
5024
|
};
|
|
4892
5025
|
//#endregion
|
|
5026
|
+
//#region src/along-route-search/types/alongRouteSearchResponse.d.ts
|
|
5027
|
+
/**
|
|
5028
|
+
* Response from an along-route search query: the places found near the route, sorted by detour
|
|
5029
|
+
* time or offset, with the search summary.
|
|
5030
|
+
*
|
|
5031
|
+
* @typeParam P - The place properties, which carry `detourOffsetInMeters` when sorted by offset.
|
|
5032
|
+
*
|
|
5033
|
+
* @ignore
|
|
5034
|
+
*/
|
|
5035
|
+
type AlongRouteSearchResponse<P extends AlongRoutePlaceProps = AlongRoutePlaceProps> = Places<P, SearchSummary>;
|
|
5036
|
+
//#endregion
|
|
4893
5037
|
//#region src/search/discoverPlaces.d.ts
|
|
4894
5038
|
/** The keys of `Params` that `Base` lacks, each forbidden. */
|
|
4895
5039
|
type Without<Params, Base> = { [Key in Exclude<keyof Params, keyof Base>]?: never; };
|
|
@@ -4955,6 +5099,9 @@ export type DiscoverPlacesResponse = Places<SearchPlaceProps, FuzzySearchFeature
|
|
|
4955
5099
|
* - Geometry search when `geometries` is given, for places inside those areas.
|
|
4956
5100
|
* - Fuzzy search otherwise, for free text, optionally biased by `geoBias`.
|
|
4957
5101
|
*
|
|
5102
|
+
* With a `route`, each result's properties are {@link AlongRoutePlaceProps}, which add the detour a stop
|
|
5103
|
+
* at the place costs.
|
|
5104
|
+
*
|
|
4958
5105
|
* @param params - The {@link FuzzySearchParams}, {@link GeometrySearchParams} or {@link AlongRouteSearchParams}.
|
|
4959
5106
|
*
|
|
4960
5107
|
* @returns The matching places.
|
|
@@ -4994,7 +5141,15 @@ export type DiscoverPlacesResponse = Places<SearchPlaceProps, FuzzySearchFeature
|
|
|
4994
5141
|
*
|
|
4995
5142
|
* @group Places Search
|
|
4996
5143
|
*/
|
|
4997
|
-
export declare
|
|
5144
|
+
export declare function discoverPlaces(params: Extract<DiscoverPlacesParams, {
|
|
5145
|
+
route: unknown;
|
|
5146
|
+
}> & {
|
|
5147
|
+
sortBy: 'detourOffset';
|
|
5148
|
+
}): Promise<AlongRouteSearchResponse<AlongRoutePlaceProps & Required<Pick<AlongRoutePlaceProps, 'detourOffsetInMeters'>>>>;
|
|
5149
|
+
export declare function discoverPlaces(params: Extract<DiscoverPlacesParams, {
|
|
5150
|
+
route: unknown;
|
|
5151
|
+
}>): Promise<AlongRouteSearchResponse>;
|
|
5152
|
+
export declare function discoverPlaces(params: DiscoverPlacesParams): Promise<DiscoverPlacesResponse>;
|
|
4998
5153
|
/**
|
|
4999
5154
|
* Searches for a single place by text query.
|
|
5000
5155
|
*
|
|
@@ -5003,7 +5158,7 @@ export declare const discoverPlaces: (params: DiscoverPlacesParams) => Promise<D
|
|
|
5003
5158
|
*
|
|
5004
5159
|
* @param queryOrParams - The search query, or the full {@link FuzzySearchParams} without `limit`.
|
|
5005
5160
|
* @returns The first matching place.
|
|
5006
|
-
* @throws {
|
|
5161
|
+
* @throws {SDKError} With the code `NOT_FOUND` and the service `'FuzzySearch'` if no results are found for the query
|
|
5007
5162
|
*
|
|
5008
5163
|
* @example
|
|
5009
5164
|
* ```typescript
|
|
@@ -5050,7 +5205,13 @@ type PlaceSuggestion = SuggestionBase & {
|
|
|
5050
5205
|
kind: 'place' | 'address' | 'street' | 'area';
|
|
5051
5206
|
/** The place id, as {@link getPlaceDetails} takes it. */
|
|
5052
5207
|
id: string;
|
|
5053
|
-
/**
|
|
5208
|
+
/**
|
|
5209
|
+
* Lines under the title that tell similar results apart, such as the address.
|
|
5210
|
+
*
|
|
5211
|
+
* The last one is the country, unless it's the home country: that of the place nearest
|
|
5212
|
+
* `geoBias.position`, or, without `geoBias`, the country most places are in. Both are judged over
|
|
5213
|
+
* the up to 10 places the search fetches, not only the suggestions returned.
|
|
5214
|
+
*/
|
|
5054
5215
|
subtitles: string[];
|
|
5055
5216
|
/** Distance from `geoBias.position`, when one was given. */
|
|
5056
5217
|
distanceInMeters?: number;
|
|
@@ -5525,8 +5686,8 @@ type TrafficIncidentDetailsByBBoxParams = TrafficIncidentDetailsBaseParams & {
|
|
|
5525
5686
|
/**
|
|
5526
5687
|
* The bounding box to query for incidents.
|
|
5527
5688
|
*
|
|
5528
|
-
* It accepts a
|
|
5529
|
-
* (Feature, FeatureCollection, Geometry, …), or an array of GeoJSON objects. For a GeoJSON
|
|
5689
|
+
* It accepts a {@link BBox} `[west, south, east, north]` (west > east across the antimeridian), any
|
|
5690
|
+
* GeoJSON object (Feature, FeatureCollection, Geometry, …), or an array of GeoJSON objects. For a GeoJSON
|
|
5530
5691
|
* value, its bounding box is calculated automatically with {@link bboxFromGeoJSON}.
|
|
5531
5692
|
*
|
|
5532
5693
|
* It covers at most 10,000 km².
|
|
@@ -5682,4 +5843,4 @@ type TrafficIncidentDetailsParams = TrafficIncidentDetailsByBBoxParams | Traffic
|
|
|
5682
5843
|
*/
|
|
5683
5844
|
export declare const trafficIncidentDetails: (params: TrafficIncidentDetailsParams) => Promise<TrafficIncidentDetails>;
|
|
5684
5845
|
//#endregion
|
|
5685
|
-
export type { AlongRouteSearchParams, AlongRouteSortBy, AreaAnalyticsDateInput, ArrivalSide, BookmarkIntent, BookmarkIntentDetails, BrandSuggestion, CalculateRouteParams, CategorySuggestion, Circle, CommonServiceParams, CommonServiceParamsWithZoom, ComputeTravelTimeFor, CoordinateIntent, CoordinateIntentDetails, ExtendedRouteRepresentation, FetchInput, FunctionalRoadClass, FuzzyLevel, FuzzySearchParams, GeocodingParams, GeocodingProps, GeocodingResponse, GeometriesInput, GeometryDataParams, GeometryParams, GeometryPlaceParams, GeometrySearchParams, GetObject, GuidanceParams, InputSectionType, InputSectionTypes, LegCostModel, MaxNumberOfAlternatives, NearbyIntent, NearbyIntentDetails, POICategoriesParams, POICategoriesResponse, POICategoryResult, PlaceDetailsMandatoryParams, PlaceDetailsOptionalParams, PlaceDetailsParams, PlaceDetailsResponse, PlaceGeometryProps, PlaceSuggestion, PostObject, QueryIntent, RefinementSuggestion, ResolvePOICategoriesParams, ResolvedPOICategories, ReverseGeocodingMandatoryParams, ReverseGeocodingOptionalParams, ReverseGeocodingParams, ReverseGeocodingResponse, RouteStopOptions, SearchGeometryInput, SearchSuggestion, SearchSuggestionKind, SearchSuggestionsParams, SearchSuggestionsResponse, TrafficAreaAnalyticsDateRange, TrafficAreaAnalyticsDays, TrafficAreaAnalyticsParams, TrafficIncidentDetailsByBBoxParams, TrafficIncidentDetailsByIdsParams, TrafficIncidentDetailsByPolygonParams, TrafficIncidentDetailsParams, W3WIntent, W3WIntentDetails };
|
|
5846
|
+
export type { AlongRoutePlaceProps, AlongRouteSearchParams, AlongRouteSortBy, AreaAnalyticsDateInput, ArrivalSide, BookmarkIntent, BookmarkIntentDetails, BrandSuggestion, CalculateRouteParams, CategorySuggestion, Circle, CommonServiceParams, CommonServiceParamsWithZoom, ComputeTravelTimeFor, CoordinateIntent, CoordinateIntentDetails, ExtendedRouteRepresentation, FetchInput, FunctionalRoadClass, FuzzyLevel, FuzzySearchParams, GeocodingParams, GeocodingProps, GeocodingResponse, GeometriesInput, GeometryDataParams, GeometryParams, GeometryPlaceParams, GeometrySearchParams, GetObject, GuidanceParams, InputSectionType, InputSectionTypes, LegCostModel, MaxNumberOfAlternatives, NearbyIntent, NearbyIntentDetails, POICategoriesParams, POICategoriesResponse, POICategoryResult, PlaceDetailsMandatoryParams, PlaceDetailsOptionalParams, PlaceDetailsParams, PlaceDetailsResponse, PlaceGeometryProps, PlaceSuggestion, PostObject, QueryIntent, RefinementSuggestion, ResolvePOICategoriesParams, ResolvedPOICategories, ReverseGeocodingMandatoryParams, ReverseGeocodingOptionalParams, ReverseGeocodingParams, ReverseGeocodingResponse, RouteStopOptions, SearchGeometryInput, SearchSuggestion, SearchSuggestionKind, SearchSuggestionsParams, SearchSuggestionsResponse, TrafficAreaAnalyticsDateRange, TrafficAreaAnalyticsDays, TrafficAreaAnalyticsParams, TrafficIncidentDetailsByBBoxParams, TrafficIncidentDetailsByIdsParams, TrafficIncidentDetailsByPolygonParams, TrafficIncidentDetailsParams, W3WIntent, W3WIntentDetails };
|