@mappedin/viewer 0.59.5 → 0.59.6

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,7 +1,7 @@
1
1
  /**
2
2
  * Any utilities that work on MapData from the SDK should be in this file.
3
3
  */
4
- import { Annotation, Place, Coordinate, TNavigationTarget, Floor, LocationProfile, IFocusable, Geometry, LocationCategory, Area } from '../sdk';
4
+ import { Annotation, Place, Coordinate, TNavigationTarget, Floor, LocationProfile, IFocusable, Geometry, LocationCategory, Area, TFindNearestOptions, TFindNearestResult, TQueriables } from '../sdk';
5
5
  import OpeningHours from '../time/opening-hours';
6
6
  /**
7
7
  * Whether the location can be assumed to be a washroom
@@ -49,6 +49,25 @@ export declare const isValidPlace: (place: Place) => boolean;
49
49
  * yield better results.
50
50
  */
51
51
  export declare const getNavigationTargetForPlaces: (places: Place[]) => TNavigationTarget | TNavigationTarget[];
52
+ /**
53
+ * The shape of the SDK's `Query.nearest` method. Kept as a standalone type so it can be injected (and faked) for
54
+ * testability without importing the `Query` class.
55
+ */
56
+ export type TNearestQuery = <T extends TQueriables>(origin: Coordinate, include: T[], options?: TFindNearestOptions) => Promise<TFindNearestResult<T> | undefined>;
57
+ /**
58
+ * Resolve the single nearest {@link TNavigationTarget} to an origin, selecting the nearest destination by travel
59
+ * distance across all floors (`Query.nearest` with `mode: 'travel-distance'` and `limit: 'all-floors'`). Used when
60
+ * a search/category resolves to multiple destination places so we route to only one.
61
+ *
62
+ * `Coordinate` entries are filtered out of `destinations` before querying because they are not valid
63
+ * `include` members for `Query.nearest`.
64
+ */
65
+ export declare const getNearestNavigationTarget: (origin: Coordinate, destinations: TNavigationTarget[], nearest: TNearestQuery) => Promise<TNavigationTarget | undefined>;
66
+ /**
67
+ * Derive an origin {@link Coordinate} from a departure navigation target. Departures are usually a dropped-pin
68
+ * {@link Coordinate}; otherwise the first coordinate of the (first) place is used.
69
+ */
70
+ export declare const getNavigationOriginCoordinate: (departure: TNavigationTarget | TNavigationTarget[]) => Coordinate | undefined;
52
71
  /**
53
72
  * Abstraction for getting camera targets for places. Any place should technically be fine to use
54
73
  * as a camera target, but sometimes the SDK types are stale, and sometimes certain behaviours
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.59.5",
3
+ "version": "0.59.6",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@ladle/react": "^5.0.3",
21
- "@mappedin/blue-dot": "6.23.0-v6-e3a9fd02.0",
22
- "@mappedin/dynamic-focus": "6.23.0-v6-e3a9fd02.0",
23
- "@mappedin/mappedin-js": "6.23.1-v6-e3a9fd02.0",
21
+ "@mappedin/blue-dot": "6.25.0-v6-fa2c491ea.0",
22
+ "@mappedin/dynamic-focus": "6.25.0-v6-fa2c491ea.0",
23
+ "@mappedin/mappedin-js": "6.25.1-v6-fa2c491ea.0",
24
24
  "@mappedin/mvf": "3.0.0-69b7308.0",
25
25
  "@mappedin/self-serve-icons": "1.105.0-alpha.SRV-2719-add-bleed-kit-annotation.1754600609",
26
26
  "@napi-rs/canvas": "^0.1.89",