@mappedin/mappedin-js 5.2.1 → 5.3.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.
@@ -35,6 +35,13 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue' {
35
35
  export { MappedinRankings } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinRankings';
36
36
  export { MappedinDestinationSet } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDestinationSet';
37
37
  export { MappedinNavigatable } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNavigatable';
38
+ /**
39
+ * @internal
40
+ * @hidden
41
+ *
42
+ * Export this only so our internal pre-built products can use it. We don't want to document it for external developers.
43
+ */
44
+ export { default as CustomerAnalytics } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.CustomerAnalytics';
38
45
  export type { TTHINGS } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin';
39
46
  export type { TMappedinDirective } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDirections';
40
47
  export type { IDirectionsResult } from '@mappedin/mappedin-js/lib/esm/get-venue/navigator';
@@ -137,6 +144,13 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue' {
137
144
  * and may be determental to smaller ones, hence it is off by default
138
145
  */
139
146
  useWorker?: boolean): Promise<unknown>;
147
+ /**
148
+ * Returns a {@link Mappedin} object hydrated with JSON data.
149
+ * @param {string|Object} mappedinSerializableData A JSON string or object representing a venue.
150
+ * @param {boolean} shouldPopulateBundledImagesAsBlobs
151
+ * @returns {Mappedin} A new Mappedin object with data from the mappedinSerializableData parameter.
152
+ */
153
+ export function hydrateVenue(mappedinSerializableData: any, shouldPopulateBundledImagesAsBlobs?: boolean): Promise<Mappedin>;
140
154
  }
141
155
 
142
156
  declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.types' {
@@ -445,6 +459,9 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin' {
445
459
  imageBinaries?: Map<string, Uint8Array>;
446
460
  scenes: any;
447
461
  fetch(): Promise<void>;
462
+ /**
463
+ * @deprecated Use {@link hydrateVenue} instead
464
+ */
448
465
  constructor(options: TGetVenueOptionsInternal & TGetVenueOptions);
449
466
  analytics: IAnalytics;
450
467
  /**
@@ -471,6 +488,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinLocati
471
488
  import type { MappedinPolygon } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinPolygon';
472
489
  import type { MappedinCategory } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinCategory';
473
490
  import { MappedinNavigatable, TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNavigatable';
491
+ import { MappedinDestinationSet } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDestinationSet';
492
+ import { MappedinDirections } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDirections';
474
493
  export function getCurrentLocationState(location: MappedinLocation, states: MappedinLocationState[], date?: Date): MappedinLocationState | undefined;
475
494
  export type TOperationHoursMap = {
476
495
  [key in string]: TOpeningHours[];
@@ -559,8 +578,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinLocati
559
578
  *
560
579
  * Get Directions to a node, polygon, or location
561
580
  */
562
- directionsTo(destination: any, options?: TDirectionToOptions): any;
563
- directionsTo(destination: any, options?: TDirectionToOptions): any;
581
+ directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
582
+ directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
564
583
  distanceTo(destination: any, options: any): number;
565
584
  toJSON(): any;
566
585
  }
@@ -572,6 +591,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinPolygo
572
591
  import type { MappedinNode } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNode';
573
592
  import { MappedinNavigatable, TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNavigatable';
574
593
  import { MappedinMap } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinMap';
594
+ import { MappedinDestinationSet } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDestinationSet';
595
+ import { MappedinDirections } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDirections';
575
596
  /**
576
597
  * The {@link MappedinPolygon} class represents the 3D shape of a {@link MappedinLocation} on a {{@link MappedinMap}. Polygons have access to Locations they belong to, and any entrances to the Polygon.
577
598
  *
@@ -692,8 +713,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinPolygo
692
713
  *
693
714
  * Get Directions to a node, polygon, or location
694
715
  */
695
- directionsTo(destination: any, options?: TDirectionToOptions): any;
696
- directionsTo(destination: any, options?: TDirectionToOptions): any;
716
+ directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
717
+ directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
697
718
  distanceTo(destination: any, options: any): number;
698
719
  toJSON(): any;
699
720
  }
@@ -706,6 +727,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNode'
706
727
  import type { TOpeningHours } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.API.types';
707
728
  import { MappedinNavigatable, TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNavigatable';
708
729
  import { MappedinMap } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinMap';
730
+ import { MappedinDestinationSet } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDestinationSet';
731
+ import { MappedinDirections } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDirections';
709
732
  /**
710
733
  * A {@link MappedinNode} represents a position, anchored to a specific {@link MappedinMap}.
711
734
  *
@@ -775,8 +798,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNode'
775
798
  *
776
799
  * Get Directions to a node, polygon, or location
777
800
  */
778
- directionsTo(destination: any, options?: TDirectionToOptions): any;
779
- directionsTo(destination: any, options?: TDirectionToOptions): any;
801
+ directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
802
+ directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
780
803
  distanceTo(destination: any, options: any): number;
781
804
  toJSON(): any;
782
805
  }
@@ -1289,6 +1312,121 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNaviga
1289
1312
  }
1290
1313
  }
1291
1314
 
1315
+ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.CustomerAnalytics' {
1316
+ import { MappedinCategory, MappedinLocation } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue';
1317
+ type AnalyticsOptions = {
1318
+ clientId?: string;
1319
+ clientSecret?: string;
1320
+ accessToken?: string;
1321
+ noAuth?: boolean;
1322
+ venue: string;
1323
+ testMode?: boolean | string;
1324
+ context?: string;
1325
+ platformString?: string;
1326
+ };
1327
+ interface IAnalytics {
1328
+ locationSelected(location: MappedinLocation): void;
1329
+ categorySelected(category: MappedinCategory): void;
1330
+ getDirections(start: MappedinLocation, end: MappedinLocation): void;
1331
+ }
1332
+ interface IInternalAnalytics extends IAnalytics {
1333
+ track(target: string, query: any): void;
1334
+ mapViewLoaded(type: '2d' | '3d', forced: boolean, benchmark: number, reason: string): void;
1335
+ getSessionID(): string;
1336
+ getDeviceID(): string;
1337
+ setGeolocationMode(mode: boolean): void;
1338
+ trackBlueDotEvent(blueDotEvent: Record<string, unknown>): void;
1339
+ trackSearch(searchAnalyticsObject: Record<string, unknown>): void;
1340
+ trackSearchSuggest(searchAnalyticsObject: Record<string, unknown>): void;
1341
+ }
1342
+ /**
1343
+ * A class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
1344
+ * This will be created for you as part of Mappedin.{{#crossLink "Mappedin/initialize:method"}}{{/crossLink}}, but you can also create one manually. You are mostly going to use `locationSelected`.
1345
+ *
1346
+ * @type {any}
1347
+ *
1348
+ * @class Analytics
1349
+ * @param options {Object} A list of configuration options for the Analytics API.
1350
+ * @param [options.clientId] {String} The same key you are using for getVenue. Handled automatically in Mapview.initialize()
1351
+ * @param [options.clientSecret] {String} The same secret you are using for getVenue. Handled automatically in Mapview.initialize()
1352
+ * @param [options.venue] {String} The same venue slug you are using for getVenue. Handled automatically in MapView.initialize()
1353
+ * @param [options.context] {String} The context to pass with the analytics request. Defaults to "websdk".
1354
+ * @param [options.noAuth] {Boolean} Whether authentication should not be sent with analytics requests.
1355
+ * @param [options.testMode] {Boolean} Whether analytics events should be dropped because this is running in a test environment.
1356
+ */
1357
+ class Analytics implements IInternalAnalytics {
1358
+ #private;
1359
+ constructor(options: AnalyticsOptions);
1360
+ track(target: any, query: any): void;
1361
+ /**
1362
+ * Whenever a location is selected, you should fire this event. What "selected" means can vary by venue,
1363
+ * but a good rule of thumb is that you fire the event whenever you would show the location's details.
1364
+ * Typically this is when the user taps it's polygon on the map, picks it from search results or a category list.
1365
+ * or deep links directly into the map.
1366
+ * @method locationSelected
1367
+ * @param location {MappedinLocation} The location the user selected.
1368
+ */
1369
+ locationSelected(location: any): void;
1370
+ /**
1371
+ * Whenever a category is selected, you should fire this event.
1372
+ * @method categorySelected
1373
+ * @param category {MappedinCategory} The category the user selected.
1374
+ */
1375
+ categorySelected(category: any): void;
1376
+ mapViewLoaded(type: any, forced: any, benchmark: any, reason: any): void;
1377
+ /**
1378
+ * Whenever a user requests directions, you should fire this event.
1379
+ * @method getDirections
1380
+ * @param start {MappedinLocation} The start location for wayfinding.
1381
+ * @param end {MappedinLocation} The end location for wayfinding.
1382
+ */
1383
+ getDirections(start: any, end: any): void;
1384
+ getSessionID(): string;
1385
+ getDeviceID(): string;
1386
+ /**
1387
+ * @param mode {Boolean} Indicates whether the user's geolocation is enabled.
1388
+ */
1389
+ setGeolocationMode(mode: any): void;
1390
+ /**
1391
+ * Track an event.
1392
+ * @method trackBlueDotEvent
1393
+ * @param event {String}
1394
+ * event param should be a property of the {{#crossLink "Analytics/BLUEDOT_EVENT:property"}}{{/crossLink}} property.
1395
+ */
1396
+ trackBlueDotEvent(blueDotEvent: any): void;
1397
+ trackSearch(searchAnalyticsObject: any): void;
1398
+ trackSearchSuggest(searchAnalyticsObject: any): void;
1399
+ /**
1400
+ * Sets the current global context of the Analytics class.
1401
+ * @method setContext
1402
+ * @param context {String} The Analytics context to be set.
1403
+ * @hidden
1404
+ */
1405
+ static setContext(context: any): void;
1406
+ /**
1407
+ * Sets the current global context of the Analytics class to undefined.
1408
+ * @method clearContext
1409
+ * @hidden
1410
+ */
1411
+ static clearContext(): void;
1412
+ /**
1413
+ * Enum of valid bluedot events.
1414
+ * Pass a property of this into the {{#crossLink "Analytics/trackBlueDotEvent:method"}}{{/crossLink}} method.
1415
+ * Valid properties are: ATTEMPT_BLUEDOT, FOUND_POSITION, FOUND_FLOOR.
1416
+ * @property BLUEDOT_EVENT {Object}
1417
+ * @example
1418
+ * Analytics.trackBlueDotEvent(Analytics.BLUEDOT_EVENT.ATTEMPT_BLUEDOT)
1419
+ */
1420
+ static BLUEDOT_EVENT: {
1421
+ ATTEMPT_BLUEDOT: string;
1422
+ FOUND_POSITION: string;
1423
+ FOUND_FLOOR: string;
1424
+ };
1425
+ }
1426
+ export type { IAnalytics };
1427
+ export default Analytics;
1428
+ }
1429
+
1292
1430
  declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator' {
1293
1431
  import NavigationGraph from '@mappedin/mappedin-js/lib/esm/get-venue/navigator/NavigationGraph';
1294
1432
  import Navigator from '@mappedin/mappedin-js/lib/esm/get-venue/navigator/Navigator';
@@ -2004,121 +2142,6 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinTheme'
2004
2142
  }
2005
2143
  }
2006
2144
 
2007
- declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.CustomerAnalytics' {
2008
- import { MappedinCategory, MappedinLocation } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue';
2009
- type AnalyticsOptions = {
2010
- clientId?: string;
2011
- clientSecret?: string;
2012
- accessToken?: string;
2013
- noAuth?: boolean;
2014
- venue: string;
2015
- testMode?: boolean | string;
2016
- context?: string;
2017
- platformString?: string;
2018
- };
2019
- interface IAnalytics {
2020
- locationSelected(location: MappedinLocation): void;
2021
- categorySelected(category: MappedinCategory): void;
2022
- getDirections(start: MappedinLocation, end: MappedinLocation): void;
2023
- }
2024
- interface IInternalAnalytics extends IAnalytics {
2025
- track(target: string, query: any): void;
2026
- mapViewLoaded(type: '2d' | '3d', forced: boolean, benchmark: number, reason: string): void;
2027
- getSessionID(): string;
2028
- getDeviceID(): string;
2029
- setGeolocationMode(mode: boolean): void;
2030
- trackBlueDotEvent(blueDotEvent: Record<string, unknown>): void;
2031
- trackSearch(searchAnalyticsObject: Record<string, unknown>): void;
2032
- trackSearchSuggest(searchAnalyticsObject: Record<string, unknown>): void;
2033
- }
2034
- /**
2035
- * A class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
2036
- * This will be created for you as part of Mappedin.{{#crossLink "Mappedin/initialize:method"}}{{/crossLink}}, but you can also create one manually. You are mostly going to use `locationSelected`.
2037
- *
2038
- * @type {any}
2039
- *
2040
- * @class Analytics
2041
- * @param options {Object} A list of configuration options for the Analytics API.
2042
- * @param [options.clientId] {String} The same key you are using for getVenue. Handled automatically in Mapview.initialize()
2043
- * @param [options.clientSecret] {String} The same secret you are using for getVenue. Handled automatically in Mapview.initialize()
2044
- * @param [options.venue] {String} The same venue slug you are using for getVenue. Handled automatically in MapView.initialize()
2045
- * @param [options.context] {String} The context to pass with the analytics request. Defaults to "websdk".
2046
- * @param [options.noAuth] {Boolean} Whether authentication should not be sent with analytics requests.
2047
- * @param [options.testMode] {Boolean} Whether analytics events should be dropped because this is running in a test environment.
2048
- */
2049
- class Analytics implements IInternalAnalytics {
2050
- #private;
2051
- constructor(options: AnalyticsOptions);
2052
- track(target: any, query: any): void;
2053
- /**
2054
- * Whenever a location is selected, you should fire this event. What "selected" means can vary by venue,
2055
- * but a good rule of thumb is that you fire the event whenever you would show the location's details.
2056
- * Typically this is when the user taps it's polygon on the map, picks it from search results or a category list.
2057
- * or deep links directly into the map.
2058
- * @method locationSelected
2059
- * @param location {MappedinLocation} The location the user selected.
2060
- */
2061
- locationSelected(location: any): void;
2062
- /**
2063
- * Whenever a category is selected, you should fire this event.
2064
- * @method categorySelected
2065
- * @param category {MappedinCategory} The category the user selected.
2066
- */
2067
- categorySelected(category: any): void;
2068
- mapViewLoaded(type: any, forced: any, benchmark: any, reason: any): void;
2069
- /**
2070
- * Whenever a user requests directions, you should fire this event.
2071
- * @method getDirections
2072
- * @param start {MappedinLocation} The start location for wayfinding.
2073
- * @param end {MappedinLocation} The end location for wayfinding.
2074
- */
2075
- getDirections(start: any, end: any): void;
2076
- getSessionID(): string;
2077
- getDeviceID(): string;
2078
- /**
2079
- * @param mode {Boolean} Indicates whether the user's geolocation is enabled.
2080
- */
2081
- setGeolocationMode(mode: any): void;
2082
- /**
2083
- * Track an event.
2084
- * @method trackBlueDotEvent
2085
- * @param event {String}
2086
- * event param should be a property of the {{#crossLink "Analytics/BLUEDOT_EVENT:property"}}{{/crossLink}} property.
2087
- */
2088
- trackBlueDotEvent(blueDotEvent: any): void;
2089
- trackSearch(searchAnalyticsObject: any): void;
2090
- trackSearchSuggest(searchAnalyticsObject: any): void;
2091
- /**
2092
- * Sets the current global context of the Analytics class.
2093
- * @method setContext
2094
- * @param context {String} The Analytics context to be set.
2095
- * @hidden
2096
- */
2097
- static setContext(context: any): void;
2098
- /**
2099
- * Sets the current global context of the Analytics class to undefined.
2100
- * @method clearContext
2101
- * @hidden
2102
- */
2103
- static clearContext(): void;
2104
- /**
2105
- * Enum of valid bluedot events.
2106
- * Pass a property of this into the {{#crossLink "Analytics/trackBlueDotEvent:method"}}{{/crossLink}} method.
2107
- * Valid properties are: ATTEMPT_BLUEDOT, FOUND_POSITION, FOUND_FLOOR.
2108
- * @property BLUEDOT_EVENT {Object}
2109
- * @example
2110
- * Analytics.trackBlueDotEvent(Analytics.BLUEDOT_EVENT.ATTEMPT_BLUEDOT)
2111
- */
2112
- static BLUEDOT_EVENT: {
2113
- ATTEMPT_BLUEDOT: string;
2114
- FOUND_POSITION: string;
2115
- FOUND_FLOOR: string;
2116
- };
2117
- }
2118
- export type { IAnalytics };
2119
- export default Analytics;
2120
- }
2121
-
2122
2145
  declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue' {
2123
2146
  import type { TGetVenueOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.types';
2124
2147
  import { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin';
@@ -2151,6 +2174,13 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue' {
2151
2174
  export { MappedinRankings } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinRankings';
2152
2175
  export { MappedinDestinationSet } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDestinationSet';
2153
2176
  export { MappedinNavigatable } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNavigatable';
2177
+ /**
2178
+ * @internal
2179
+ * @hidden
2180
+ *
2181
+ * Export this only so our internal pre-built products can use it. We don't want to document it for external developers.
2182
+ */
2183
+ export { default as CustomerAnalytics } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.CustomerAnalytics';
2154
2184
  export type { TTHINGS } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin';
2155
2185
  export type { TMappedinDirective } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinDirections';
2156
2186
  export type { IDirectionsResult } from '@mappedin/mappedin-js/lib/esm/get-venue/navigator';
@@ -2253,6 +2283,13 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue' {
2253
2283
  * and may be determental to smaller ones, hence it is off by default
2254
2284
  */
2255
2285
  useWorker?: boolean): Promise<unknown>;
2286
+ /**
2287
+ * Returns a {@link Mappedin} object hydrated with JSON data.
2288
+ * @param {string|Object} mappedinSerializableData A JSON string or object representing a venue.
2289
+ * @param {boolean} shouldPopulateBundledImagesAsBlobs
2290
+ * @returns {Mappedin} A new Mappedin object with data from the mappedinSerializableData parameter.
2291
+ */
2292
+ export function hydrateVenue(mappedinSerializableData: any, shouldPopulateBundledImagesAsBlobs?: boolean): Promise<Mappedin>;
2256
2293
  }
2257
2294
 
2258
2295
  declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator/Directive' {