@mappedin/mappedin-js 6.0.1-alpha.21 → 6.0.1-alpha.22

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.
@@ -4,6 +4,7 @@
4
4
  // ../maker/geojson
5
5
  // ../maker/three
6
6
  // ../maker/@mappedin/core-sdk
7
+ // ../maker/@mappedin/core-sdk/src/camera
7
8
  // ../maker/minisearch
8
9
  // ../maker/@turf/turf
9
10
  // ../maker/@tweenjs/tween.js
@@ -1036,8 +1037,8 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-geojson' {
1036
1037
  import { GeoJSONTEvents as TEvents } from '@mappedin/mappedin-js/maker/src/events';
1037
1038
  import { Floor, MapObject, Space } from '@mappedin/mappedin-js/maker/src/map-data-objects';
1038
1039
  import MapData from '@mappedin/mappedin-js/maker/src/map-data';
1039
- import { ICamera, IMapView, IMarkers, IPaths, TUpdateState, INavigation, TNavigationTarget, TGetDirectionsOptions, TGeometryState, TLabelState } from '@mappedin/mappedin-js/maker/src/map-view-interface';
1040
- import { Directions, Label } from '@mappedin/mappedin-js/maker/src/map-view-objects';
1040
+ import { ICamera, IMapView, IMarkers, IPaths, TUpdateState, INavigation, TNavigationTarget, TGetDirectionsOptions, TGeometryState, TLabelState, TMarkerState } from '@mappedin/mappedin-js/maker/src/map-view-interface';
1041
+ import { Directions, Label, Marker } from '@mappedin/mappedin-js/maker/src/map-view-objects';
1041
1042
  import type { RendererCore } from '@mappedin/core-sdk';
1042
1043
  import { LabelsApi } from '@mappedin/mappedin-js/maker/src/api-geojson/labels';
1043
1044
  import { Inspector } from '@mappedin/mappedin-js/maker/src/api-geojson';
@@ -1100,11 +1101,11 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-geojson' {
1100
1101
  * // Update the color of a space to red.
1101
1102
  * map.updateState(space, { color: 'red' });
1102
1103
  */
1103
- updateState<T extends Space | MapObject | Label | string>(target: T, state: TUpdateState<T>): void;
1104
+ updateState<T extends Space | MapObject | Label | Marker | string>(target: T, state: TUpdateState<T>): void;
1104
1105
  setHoverColor(c: string): void;
1105
- getHoverColor(): string | undefined;
1106
+ getHoverColor(): any;
1106
1107
  getState(id: string): TGeometryState | TLabelState | undefined;
1107
- getState(target: Space | Label | MapObject): TGeometryState | TLabelState;
1108
+ getState(target: Space | Label | Marker | MapObject): TGeometryState | TLabelState | TMarkerState;
1108
1109
  /**
1109
1110
  * Retrieves the current floor of the map.
1110
1111
  *
@@ -1144,6 +1145,7 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-interface' {
1144
1145
  import type { Coordinate, Floor, Door, Space, MapObject, PointOfInterest, Connection } from '@mappedin/mappedin-js/maker/src/map-data-objects';
1145
1146
  import { Label, Marker, Path, Directions } from '@mappedin/mappedin-js/maker/src/map-view-objects';
1146
1147
  import type { MapData, TNavigationOptions } from '@mappedin/mappedin-js/maker/src';
1148
+ import { EasingCurve } from '@mappedin/core-sdk/src/camera';
1147
1149
  /**
1148
1150
  * Interface defining the controls and actions for a label on the map.
1149
1151
  */
@@ -1158,6 +1160,20 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-interface' {
1158
1160
  */
1159
1161
  readonly __type: 'Label';
1160
1162
  }
1163
+ /**
1164
+ * Interface defining the controls and actions for a label on the map.
1165
+ */
1166
+ export interface IMarker {
1167
+ /**
1168
+ * Label's id
1169
+ */
1170
+ id: string;
1171
+ /**
1172
+ * Label's internal type
1173
+ * @internal
1174
+ */
1175
+ readonly __type: 'Marker';
1176
+ }
1161
1177
  /**
1162
1178
  * Interface defining the controls and actions for labels ({@link Label}) on the map.
1163
1179
  */
@@ -1230,7 +1246,7 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-interface' {
1230
1246
  * @example
1231
1247
  * map.Markers.removeAll();
1232
1248
  */
1233
- removeAll: () => void;
1249
+ removeAll: () => Marker[];
1234
1250
  }
1235
1251
  /**
1236
1252
  * Interface defining the controls and actions for paths ({@link Path}) on the map.
@@ -1290,6 +1306,18 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-interface' {
1290
1306
  priority: number | 'initial';
1291
1307
  interactive: boolean;
1292
1308
  };
1309
+ export type TMarkerState = {
1310
+ type: 'marker';
1311
+ /**
1312
+ * HTML element for the marker.
1313
+ */
1314
+ element: HTMLElement;
1315
+ /**
1316
+ * Priority level of the marker, used for determining display order.
1317
+ */
1318
+ priority: number | 'initial';
1319
+ interactive: boolean;
1320
+ };
1293
1321
  /**
1294
1322
  * Defines the state for geometry elements like {@link Space} when updated.
1295
1323
  */
@@ -1311,8 +1339,8 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-interface' {
1311
1339
  /**
1312
1340
  * The type for updating the state of map elements (colors, texts, etc.).
1313
1341
  */
1314
- export type TUpdateState<T> = T extends ILabel ? Partial<TLabelState> : T extends Space | MapObject ? Partial<TGeometryState> : T extends string ? Record<string, any> : never;
1315
- export type TGetState<T> = T extends Label ? TLabelState : T extends Space | MapObject ? TGeometryState : T extends string ? TLabelState | TGeometryState | undefined : never;
1342
+ export type TUpdateState<T> = T extends IMarker ? Partial<TMarkerState> : T extends ILabel ? Partial<TLabelState> : T extends Space | MapObject ? Partial<TGeometryState> : T extends string ? Record<string, any> : never;
1343
+ export type TGetState<T> = T extends Marker ? TMarkerState : T extends Label ? TLabelState : T extends Space | MapObject ? TGeometryState : T extends string ? TLabelState | TGeometryState | TMarkerState | undefined : never;
1316
1344
  /**
1317
1345
  * Options for {@link ICamera} animations on the map.
1318
1346
  */
@@ -1324,7 +1352,7 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-interface' {
1324
1352
  /**
1325
1353
  * Easing function to use for the animation.
1326
1354
  */
1327
- easing?: TEasingFunction;
1355
+ easing?: EasingCurve;
1328
1356
  };
1329
1357
  /**
1330
1358
  * Types of easing for animations.
@@ -5340,7 +5368,11 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-objects/marker' {
5340
5368
  /**
5341
5369
  * @internal
5342
5370
  */
5343
- readonly __type: 'Marker';
5371
+ static readonly __type = "Marker";
5372
+ /**
5373
+ * @internal
5374
+ */
5375
+ readonly __type = "Marker";
5344
5376
  /**
5345
5377
  * The HTML element that represents the marker.
5346
5378
  */
@@ -5349,6 +5381,13 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-objects/marker' {
5349
5381
  * Updates the marker's position on the map.
5350
5382
  */
5351
5383
  readonly update: () => void;
5384
+ /**
5385
+ * Checks if the provided instance is of type Label.
5386
+ *
5387
+ * @param instance The instance to check.
5388
+ * @returns {boolean} True if the instance is a Label, false otherwise.
5389
+ */
5390
+ static is(instance: object): instance is Marker;
5352
5391
  /**
5353
5392
  * @internal
5354
5393
  */
@@ -9736,7 +9775,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
9736
9775
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controllers/StackedMapsController' {
9737
9776
  import { MappedinDirections, MappedinMap, MappedinNode } from '@mappedin/mappedin-js/packages/get-venue';
9738
9777
  import { STACKED_MAPS_STATE, MapViewScene, MapViewStackScene, CAMERA_EASING_MODE } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
9739
- import type { ICore, TCameraTransform } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
9778
+ import type { ICore, TCameraTransform, TCameraAnimationOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
9740
9779
  import { TStackedMapsOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/MapView.types';
9741
9780
  enum ACTION {
9742
9781
  enable = "enable",
@@ -9755,18 +9794,24 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
9755
9794
  stackScene: MapViewStackScene;
9756
9795
  directions: MappedinDirections | MappedinDirections[];
9757
9796
  verticalDistanceBetweenMaps?: number;
9797
+ animationOptions?: TCameraAnimationOptions;
9758
9798
  } | {
9759
9799
  stackScene: MapViewStackScene;
9760
9800
  verticalDistanceBetweenMaps?: number;
9761
9801
  map: MappedinMap;
9762
9802
  nodes: MappedinNode[];
9803
+ cameraOptions?: TCameraTransform & TCameraAnimationOptions;
9804
+ duration?: number;
9805
+ animationOptions?: TCameraAnimationOptions;
9763
9806
  } | {
9764
9807
  stackScene: MapViewStackScene;
9765
9808
  map: MappedinMap;
9766
9809
  nodes: MappedinNode[];
9767
9810
  rotation: number;
9768
- cameraTransform?: TCameraTransform;
9811
+ cameraOptions?: TCameraTransform & TCameraAnimationOptions;
9769
9812
  verticalDistanceBetweenMaps?: number;
9813
+ duration?: number;
9814
+ animationOptions?: TCameraAnimationOptions;
9770
9815
  };
9771
9816
  type TActionFn = [STACKED_MAPS_STATE, TTargetTransitionFunction[]];
9772
9817
  type TState = {
@@ -9799,6 +9844,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
9799
9844
  tilt: number;
9800
9845
  rotation: number;
9801
9846
  position?: MappedinNode | import("../../internal").MappedinCoordinate | undefined;
9847
+ duration?: number | undefined;
9802
9848
  easing: CAMERA_EASING_MODE;
9803
9849
  };
9804
9850
  };
@@ -9810,8 +9856,9 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
9810
9856
  activeMap: MappedinMap;
9811
9857
  focusOn: {
9812
9858
  options: {
9813
- tilt: number;
9814
9859
  duration: number;
9860
+ easing?: CAMERA_EASING_MODE | undefined;
9861
+ tilt: number;
9815
9862
  };
9816
9863
  };
9817
9864
  verticalDistanceBetweenMaps: number | undefined;
@@ -9827,6 +9874,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
9827
9874
  };
9828
9875
  };
9829
9876
  activeMap: MappedinMap;
9877
+ duration: number | undefined;
9830
9878
  })[] | undefined;
9831
9879
  getRestackOptions: (params: TParams) => (MapViewStackScene | {
9832
9880
  activeMap: MappedinMap;
@@ -9852,10 +9900,10 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
9852
9900
  disable: () => Promise<void>;
9853
9901
  enable: (opts?: TStackedMapsOptions) => Promise<void>;
9854
9902
  get nodesInJourneyOrMap(): any[];
9855
- showOverview: () => Promise<void>;
9856
- scrollToMap: (map: MappedinMap) => Promise<void>;
9903
+ showOverview: (animationOptions?: TCameraAnimationOptions) => Promise<void>;
9904
+ scrollToMap: (map: MappedinMap, duration?: number) => Promise<void>;
9857
9905
  restack: (options?: TStackedMapsOptions) => Promise<void>;
9858
- zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
9906
+ zoomInToMap: (map: MappedinMap, cameraOptions?: TCameraTransform & TCameraAnimationOptions) => Promise<void>;
9859
9907
  get currentMap(): MappedinMap;
9860
9908
  }
9861
9909
  export default StackedMapsController;
@@ -13030,10 +13078,9 @@ declare module '@mappedin/mappedin-js/maker/src/map-data-objects/base-metadata-o
13030
13078
  declare module '@mappedin/mappedin-js/maker/src/api-geojson/map-object' {
13031
13079
  import { ParsedMVF } from '@mappedin/mvf';
13032
13080
  import { FloorObject } from '@mappedin/mappedin-js/maker/src/api-geojson/floor-object';
13033
- import { AddLabelOptions } from '@mappedin/core-sdk';
13034
13081
  import { Position } from '@mappedin/core-sdk';
13035
13082
  import { TAddMarkerOptions } from '@mappedin/mappedin-js/maker/src';
13036
- import { Geometry2D, RendererCore } from '@mappedin/core-sdk';
13083
+ import { AddLabelOptions, Geometry2D, RendererCore } from '@mappedin/core-sdk';
13037
13084
  export class GeojsonApiMapObject {
13038
13085
  floors: FloorObject[];
13039
13086
  currentFloorId: string;
@@ -13046,7 +13093,7 @@ declare module '@mappedin/mappedin-js/maker/src/api-geojson/map-object' {
13046
13093
  floorId?: string;
13047
13094
  }) => import("@mappedin/core-sdk").Marker;
13048
13095
  remove: (_id: string) => void;
13049
- getContentEl: (id: string) => HTMLDivElement | null;
13096
+ getContentEl: (id: string) => any;
13050
13097
  removeAll: () => void;
13051
13098
  all({ onCreate }: {
13052
13099
  onCreate: (entity: Geometry2D) => void;
@@ -13085,7 +13132,7 @@ declare module '@mappedin/mappedin-js/maker/src/api-geojson/api' {
13085
13132
  import MapData from '@mappedin/mappedin-js/maker/src/map-data';
13086
13133
  import { Coordinate, Floor, MapDataInternal, Space, MapObject } from '@mappedin/mappedin-js/maker/src/map-data-objects';
13087
13134
  import { ICamera, IMapView, INavigation, TGetState, TUpdateState } from '@mappedin/mappedin-js/maker/src/map-view-interface';
13088
- import { CameraTransform, Label, Path } from '@mappedin/mappedin-js/maker/src/map-view-objects';
13135
+ import { CameraTransform, Label, Marker, Path } from '@mappedin/mappedin-js/maker/src/map-view-objects';
13089
13136
  import { RendererCore, InteractionPayload } from '@mappedin/core-sdk';
13090
13137
  import { GeojsonApiMapObject } from '@mappedin/mappedin-js/maker/src/api-geojson/map-object';
13091
13138
  import GUI from 'lil-gui';
@@ -13109,7 +13156,7 @@ declare module '@mappedin/mappedin-js/maker/src/api-geojson/api' {
13109
13156
  Markers: MarkersApi;
13110
13157
  constructor(rendererCore: RendererCore, _options?: any);
13111
13158
  updateStackState: RendererCore['updateStackState'];
13112
- updateState<T extends Space | MapObject | Label | string>(target: T, state: TUpdateState<T>): void;
13159
+ updateState<T extends Space | MapObject | Label | Marker | string>(target: T, state: TUpdateState<T>): void;
13113
13160
  update: () => void;
13114
13161
  getMapData(): MapDataInternal | undefined;
13115
13162
  addMap(mapData: MapData): Promise<MapData>;
@@ -13120,9 +13167,9 @@ declare module '@mappedin/mappedin-js/maker/src/api-geojson/api' {
13120
13167
  remove: (_label: any) => void;
13121
13168
  removeAll: () => void;
13122
13169
  };
13123
- getState<T extends Space | MapObject | Label | string>(target: T): TGetState<T> | undefined;
13170
+ getState<T extends Space | MapObject | Label | Marker | string>(target: T): TGetState<T> | undefined;
13124
13171
  setHoverColor(c: string): void;
13125
- getHoverColor(): string | undefined;
13172
+ getHoverColor(): any;
13126
13173
  getDirections: IMapView['getDirections'];
13127
13174
  Navigation: INavigation;
13128
13175
  createCoordinate(latitude: number, longitude: number, floor?: Floor): Coordinate;
@@ -13144,14 +13191,16 @@ declare module '@mappedin/mappedin-js/maker/src/api-geojson/utils' {
13144
13191
  import type { Position, EntranceCollection, LineString, ObstructionProperties } from '@mappedin/mvf';
13145
13192
  import { FeatureCollection } from '@turf/turf';
13146
13193
  import { Feature, MultiLineString } from 'geojson';
13147
- import { CollisionRankingTier, LabelState } from '@mappedin/core-sdk';
13194
+ import { CollisionRankingTier, LabelState, MarkerState } from '@mappedin/core-sdk';
13148
13195
  import { TGeometryState, TLabelState } from '@mappedin/mappedin-js/maker/src';
13149
13196
  import { GeometryState } from '@mappedin/core-sdk';
13197
+ import { TMarkerState } from '@mappedin/mappedin-js/maker/src/map-view-interface';
13150
13198
  export function convertCoordinateToPosition(coord: Coordinate): Position;
13151
13199
  export function convertPositionToCoordinate(coord: Position): Coordinate;
13152
13200
  export const cutEntracesFromLineStrings: (lineStrings: FeatureCollection<LineString, ObstructionProperties>['features'], entranceCollection: EntranceCollection['features']) => Feature<MultiLineString, any>;
13153
13201
  export function convertPriorityToCollisionTier(priority: TLabelState['priority']): CollisionRankingTier;
13154
13202
  export function translateLabelStateToGeojsonCore(state: Partial<TLabelState>): Partial<LabelState>;
13203
+ export function translateMarkerStateToGeojsonCore(state: Partial<TMarkerState>): Partial<MarkerState>;
13155
13204
  export function translateSpaceStateToGeojsonCore(state: Partial<TGeometryState>): Partial<GeometryState>;
13156
13205
  }
13157
13206
 
@@ -14622,7 +14671,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Camera
14622
14671
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/StackedMaps' {
14623
14672
  import { MappedinMap } from '@mappedin/mappedin-js/packages/get-venue';
14624
14673
  import { TStackedMapsOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/MapView.types';
14625
- import { STACKED_MAPS_STATE, StackedMapsController, TCameraTransform } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
14674
+ import { STACKED_MAPS_STATE, StackedMapsController, TCameraTransform, TCameraAnimationOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
14626
14675
  /**
14627
14676
  * @experimental
14628
14677
  * API for showing multiple maps involved in a {@link Journey} as a vertical stack.
@@ -14686,7 +14735,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Stacke
14686
14735
  *
14687
14736
  * @returns Promise when all animations are complete.
14688
14737
  */
14689
- showOverview: () => Promise<void>;
14738
+ showOverview: (animationOptions?: TCameraAnimationOptions) => Promise<void>;
14690
14739
  /**
14691
14740
  * @experimental
14692
14741
  *
@@ -14694,7 +14743,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Stacke
14694
14743
  *
14695
14744
  * @example
14696
14745
  * ```ts
14697
- * // Zoom into a clicked map if Stacked Maps is in Overview state
14746
+ * // Scroll the camera to a specific map if Stacked Maps is in Overview state
14698
14747
  * mapView.on(E_SDK_EVENT.CLICK, ({ maps }) => {
14699
14748
  * if (maps.length <= 0) return;
14700
14749
  * if (mapView.StackedMaps.state === STACKED_MAPS_STATE.OVERVIEW) {
@@ -14705,7 +14754,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Stacke
14705
14754
  *
14706
14755
  * @returns Promise when all animations are complete.
14707
14756
  */
14708
- scrollToMap: (map: MappedinMap) => Promise<void>;
14757
+ scrollToMap: (map: MappedinMap, duration?: number) => Promise<void>;
14709
14758
  /**
14710
14759
  * @experimental
14711
14760
  *
@@ -14724,7 +14773,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Stacke
14724
14773
  *
14725
14774
  * @returns Promise when all animations are complete.
14726
14775
  */
14727
- zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
14776
+ zoomInToMap: (map: MappedinMap, cameraOptions?: TCameraTransform & TCameraAnimationOptions) => Promise<void>;
14728
14777
  /**
14729
14778
  * @experimental
14730
14779
  *