@mappedin/mappedin-js 5.25.0 → 5.27.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.
- package/README.md +44 -44
- package/lib/esm/get-venue/index.d.ts +2793 -0
- package/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/navigator/index.d.ts +343 -0
- package/lib/esm/renderer/GLTFExporter-ZBGZENVY.js +1 -0
- package/lib/esm/renderer/PerformanceController-PXINY5WN.js +1 -0
- package/lib/esm/renderer/{browser-TSE6NP6L.js → browser-YREFO76D.js} +1 -1
- package/lib/esm/renderer/chunk-5HBLJ3LE.js +1 -0
- package/lib/esm/renderer/{chunk-VELRTE4Y.js → chunk-N5SZS75W.js} +1 -1
- package/lib/esm/renderer/chunk-Y2N5CZKK.js +1 -0
- package/lib/esm/renderer/index.d.ts +668 -460
- package/lib/esm/renderer/index.js +1 -1
- package/lib/esm/renderer/{outdoor-context-EFVXH7VY.js → outdoor-context-VPFU5OTZ.js} +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +4 -12
- package/lib/esm/renderer/chunk-TCVQJ2HF.js +0 -1
- /package/lib/esm/renderer/{Arrival-4TTHZQOF.js → Arrival-KLIH5LTH.js} +0 -0
- /package/lib/esm/renderer/{Chalet-LUA2Z236.js → Chalet-ZU2FPU2K.js} +0 -0
- /package/lib/esm/renderer/{HelveticaNeue-U3XEZDB5.js → HelveticaNeue-PHK3JE5I.js} +0 -0
- /package/lib/esm/renderer/{Helvetiker-WFBA7C7H.js → Helvetiker-JVUX4WK7.js} +0 -0
- /package/lib/esm/renderer/{Lato-ZI244CQU.js → Lato-BX5JVWZI.js} +0 -0
- /package/lib/esm/renderer/{MyriadPro-XF3IH7EM.js → MyriadPro-3UATSCWU.js} +0 -0
- /package/lib/esm/renderer/{ProximaNova-YIIK4S37.js → ProximaNova-54WAWGUY.js} +0 -0
- /package/lib/esm/renderer/{SimonCircular-NQ53YBIJ.js → SimonCircular-ETZIFPSM.js} +0 -0
|
@@ -0,0 +1,2793 @@
|
|
|
1
|
+
// Generated by dts-bundle v0.7.3
|
|
2
|
+
// Dependencies for this module:
|
|
3
|
+
// ../../../cms/@mappedin/mvf
|
|
4
|
+
// ../../../cms/minisearch
|
|
5
|
+
// ../../../cms/geojson
|
|
6
|
+
|
|
7
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue' {
|
|
8
|
+
import type { TGetVenueOptions, TGetVenueOptionsInternal, TVenueMetadata } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.types';
|
|
9
|
+
import { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin';
|
|
10
|
+
import { defaultThings } from '@mappedin/mappedin-js/lib/esm/get-venue/default-things';
|
|
11
|
+
import { GET_VENUE_EVENT } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
12
|
+
/**
|
|
13
|
+
* This is how we can avoid bundling in node-fetch (via isomorphic fetch),
|
|
14
|
+
* which keeps popping up in security advisories
|
|
15
|
+
* This is a pattern that most isomorphic libraries appear to use,
|
|
16
|
+
* where when running in node, you can pass your own fetch function
|
|
17
|
+
* as one is not provided by Node.js.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export function isomorphicFetch(): Window['fetch'];
|
|
21
|
+
/**
|
|
22
|
+
* Overwrite the internal `fetch` function with your own. Typically for use in Node.js and Jest.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```js
|
|
26
|
+
* const { getVenue } = require("@mappedin/mappedin-js/lib/node/index");
|
|
27
|
+
* setFetchFn(require("node-fetch-commonjs"));
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export function setFetchFn(fetchFn: any): void;
|
|
32
|
+
/** Classes */
|
|
33
|
+
export { MappedinCollectionType, MappedinNavigatable, MappedinNode, MappedinLocation, MappedinPolygon, MappedinCategory, MappedinDirections, MappedinDestinationSet, MappedinVortex, MappedinVenue, MappedinRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinCoordinate, MappedinMapGroup, Mappedin, } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
* @hidden
|
|
37
|
+
*
|
|
38
|
+
* Export this only so our internal pre-built products can use it. We don't want to document it for external developers.
|
|
39
|
+
*/
|
|
40
|
+
export { default as CustomerAnalytics } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.CustomerAnalytics';
|
|
41
|
+
export type { TMappedinDirective } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinDirections';
|
|
42
|
+
export type { IDirectionsResult } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator';
|
|
43
|
+
export type { TOperationHoursMap } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinLocation';
|
|
44
|
+
export type { TMappedinCoordinateOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinCoordinate';
|
|
45
|
+
export type { TDirectionToOptions, TTHINGS, TAccessors } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
46
|
+
export { OfflineSearch } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.OfflineSearch';
|
|
47
|
+
export type { TMappedinOfflineSearchOptions, TMappedinOfflineSearchResult, TMappedinOfflineSearchSuggestions, TMappedinOfflineAllSearchMatch, TMappedinOfflineSearchAllOptions, } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.OfflineSearch';
|
|
48
|
+
export { defaultThings };
|
|
49
|
+
/** API data types */
|
|
50
|
+
export type { TLocationType, TNode, TImage, TLogo, TGalleryImage, TPhone, TSocial, TColor, TVortex, TPicture, TOpeningHours, TSiblingGroup, TState, TCategory, TEvent, TGeoReference, TMap, TMapGroup, TBuilding, TLocation, TPolygon, TPolygonRanking, TVenue, TMappedinAPI, } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
51
|
+
export type { TGetVenueOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.types';
|
|
52
|
+
import { MAP_RENDER_MODE } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.types';
|
|
53
|
+
import { ParsedMVF } from '@mappedin/mvf';
|
|
54
|
+
export { MAP_RENDER_MODE, GET_VENUE_EVENT };
|
|
55
|
+
export function parseOptions(options: TGetVenueOptions): TGetVenueOptionsInternal & TGetVenueOptions;
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export function getVenueMVF(userOptions: TGetVenueMVFOptions): Promise<Mappedin>;
|
|
60
|
+
/**
|
|
61
|
+
* @experimental
|
|
62
|
+
* Get venue data for a map created in Mappedin Maker.
|
|
63
|
+
* @param userOptions
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const mappedin = await getVenueMaker({
|
|
67
|
+
* key: '<Your Maker Key>',
|
|
68
|
+
* secret: '<Your Maker Secret>',
|
|
69
|
+
* mapId: '<Your Maker Map ID>',
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
* @returns {@link Mappedin} object with data from the Maker map.
|
|
73
|
+
*/
|
|
74
|
+
export function getVenueMaker(userOptions: TGetVenueMakerOptions): Promise<Mappedin>;
|
|
75
|
+
/**
|
|
76
|
+
* Get Venue Data for a Mappedin Venue
|
|
77
|
+
*/
|
|
78
|
+
export function getVenue(userOptions: TGetVenueOptions): Promise<Mappedin>;
|
|
79
|
+
export function getVenueMetadata(userOptions: TGetVenueOptions): Promise<TVenueMetadata>;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
export function __setGetVenueMock(fn: any): void;
|
|
84
|
+
export type TGetVenueBundleOptions = TGetVenueOptions & {
|
|
85
|
+
bundleBaseUri?: string;
|
|
86
|
+
version?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Parse bundle and convert images to blobs. Disabled in React Native
|
|
89
|
+
* @private
|
|
90
|
+
*/
|
|
91
|
+
shouldPopulateBundledImagesAsBlobs?: boolean;
|
|
92
|
+
};
|
|
93
|
+
/** @internal */
|
|
94
|
+
export type TGetVenueMVFOptions = TGetVenueBundleOptions & {
|
|
95
|
+
onMVFParsed?: (mvf: ParsedMVF) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Override initial MVF data
|
|
98
|
+
*/
|
|
99
|
+
override?: Partial<Pick<ParsedMVF, 'styles.json'>>;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* @experimental
|
|
103
|
+
* Options for {@link getVenueMaker}.
|
|
104
|
+
*/
|
|
105
|
+
export type TGetVenueMakerOptions = {
|
|
106
|
+
/**
|
|
107
|
+
* Maker auth key.
|
|
108
|
+
*/
|
|
109
|
+
key: string;
|
|
110
|
+
/**
|
|
111
|
+
* Maker auth secret.
|
|
112
|
+
*/
|
|
113
|
+
secret: string;
|
|
114
|
+
/**
|
|
115
|
+
* Maker map ID.
|
|
116
|
+
*/
|
|
117
|
+
mapId: string;
|
|
118
|
+
/**
|
|
119
|
+
* Optionally provide a custom base URL for the Maker map API request.
|
|
120
|
+
*/
|
|
121
|
+
bundleBaseUri?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Optionally provide a custom base URL for the Maker auth token request.
|
|
124
|
+
*/
|
|
125
|
+
authBaseUri?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Whether or not to emit analytics events.
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
emitAnalyticsEvents?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Callback for when the Maker map data has been fetched and parsed as Mappedin Venue Format (MVF) data. This occurs before the {@link Mappedin} object is hydrated.
|
|
133
|
+
* @param mvf Parsed MVF data.
|
|
134
|
+
*/
|
|
135
|
+
onMVFParsed?: (mvf: ParsedMVF) => void;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* @deprecated
|
|
139
|
+
* Fetching an offline Venue bundle
|
|
140
|
+
* It is possible to download the venue bundle with all assets built in, which allows for caching/offline solutions.
|
|
141
|
+
* Note 1: This requires enabling from Mappedin's Customer Solutions team.
|
|
142
|
+
* Note 2: This may behave a lot slower for large venues, especially those with many images. We are actively working on improving load times.
|
|
143
|
+
*/
|
|
144
|
+
export function getVenueBundle(userOptions: TGetVenueBundleOptions): Promise<Mappedin>;
|
|
145
|
+
/**
|
|
146
|
+
* Get the bundle URL and updated_at time.
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
export function getVenueBundleURL(userOptions: TGetVenueBundleOptions): Promise<{
|
|
150
|
+
url: string;
|
|
151
|
+
updated_at: string;
|
|
152
|
+
}>;
|
|
153
|
+
/**
|
|
154
|
+
* Download a bundle and return a Mappedin instance
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
export function downloadBundle(userOptions: any, { url, updated_at }: {
|
|
158
|
+
url: any;
|
|
159
|
+
updated_at: any;
|
|
160
|
+
}): Promise<Mappedin>;
|
|
161
|
+
/**
|
|
162
|
+
* Get the bundle URL and updated_at time.
|
|
163
|
+
* @internal
|
|
164
|
+
*/
|
|
165
|
+
export function getVenueMVFURL(userOptions: TGetVenueBundleOptions): Promise<{
|
|
166
|
+
url: string;
|
|
167
|
+
updated_at: string;
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
export function downloadVenueBundleMVF(options: TGetVenueBundleOptions): Promise<Uint8Array>;
|
|
173
|
+
export function getMakerAccessToken(userOptions: TGetVenueMakerOptions): Promise<{
|
|
174
|
+
access_token: string;
|
|
175
|
+
expires_in: number;
|
|
176
|
+
}>;
|
|
177
|
+
export function getMakerBundleURL(userOptions: TGetVenueMakerOptions, token: string): Promise<{
|
|
178
|
+
url: string;
|
|
179
|
+
updated_at: string;
|
|
180
|
+
}>;
|
|
181
|
+
export function downloadMakerMVF(userOptions: TGetVenueMakerOptions): Promise<Uint8Array>;
|
|
182
|
+
/**
|
|
183
|
+
* Returns a {@link Mappedin} object hydrated with JSON data.
|
|
184
|
+
* @param {string|Object} mappedinSerializableData A JSON string or object representing a venue.
|
|
185
|
+
* @param {boolean} shouldPopulateBundledImagesAsBlobs
|
|
186
|
+
* @returns {Mappedin} A new Mappedin object with data from the mappedinSerializableData parameter.
|
|
187
|
+
*/
|
|
188
|
+
export function hydrateVenue(mappedinSerializableData: any, shouldPopulateBundledImagesAsBlobs?: boolean): Promise<Mappedin>;
|
|
189
|
+
/**
|
|
190
|
+
* @internal
|
|
191
|
+
* Returns a {@link Mappedin} object hydrated with MVF data.
|
|
192
|
+
*/
|
|
193
|
+
export function hydrateVenueMVF(mvfData: ParsedMVF): Promise<Mappedin>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.types' {
|
|
197
|
+
export type TGetVenueOptions = {
|
|
198
|
+
accessToken?: string;
|
|
199
|
+
clientId?: string;
|
|
200
|
+
clientSecret?: string;
|
|
201
|
+
baseUrl?: string;
|
|
202
|
+
includeHidden?: boolean;
|
|
203
|
+
noAuth?: boolean;
|
|
204
|
+
perspective?: string;
|
|
205
|
+
language?: string;
|
|
206
|
+
headers?: {
|
|
207
|
+
[key in string]: string;
|
|
208
|
+
};
|
|
209
|
+
venue: string;
|
|
210
|
+
things?: any;
|
|
211
|
+
useDraftData?: boolean;
|
|
212
|
+
platformString?: string;
|
|
213
|
+
emitAnalyticsEvents?: boolean;
|
|
214
|
+
secure?: boolean;
|
|
215
|
+
preloadMapGeometry?: boolean;
|
|
216
|
+
};
|
|
217
|
+
export type TGetVenueOptionsInternal = {
|
|
218
|
+
baseUrl?: string;
|
|
219
|
+
supplementaryUrl?: string;
|
|
220
|
+
noAuth?: boolean;
|
|
221
|
+
includeHidden?: boolean;
|
|
222
|
+
apiGateway?: string;
|
|
223
|
+
authorization?: string;
|
|
224
|
+
things?: any;
|
|
225
|
+
headers?: any;
|
|
226
|
+
};
|
|
227
|
+
export type TVenueMetadata = {
|
|
228
|
+
languages: {
|
|
229
|
+
name: string;
|
|
230
|
+
code: string;
|
|
231
|
+
}[];
|
|
232
|
+
hasSecureAssets: boolean;
|
|
233
|
+
};
|
|
234
|
+
export enum MAP_RENDER_MODE {
|
|
235
|
+
/** Each polygon, its geometry and mesh are sent to the GPU every render frame.
|
|
236
|
+
* This was the default rendering mode before 4.0.17
|
|
237
|
+
*/
|
|
238
|
+
MULTI_GEOMETRY = "MULTI_GEOMETRY",
|
|
239
|
+
/** Polygons' geometries are grouped by material and merged together, resulting in far fewer
|
|
240
|
+
* draw calls to the GPU. Default rendering mode since 4.0.17
|
|
241
|
+
*/
|
|
242
|
+
SINGLE_GEOMETRY = "SINGLE_GEOMETRY"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin' {
|
|
247
|
+
import { Navigator } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator';
|
|
248
|
+
import type { TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.types';
|
|
249
|
+
import type { MappedinNode, MappedinPolygon, MappedinLocation, MappedinCategory, MappedinVortex, MappedinVenue, MappedinTheme, MappedinRankings, MappedinLocationRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinMapGroup, GET_VENUE_PAYLOAD } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
250
|
+
import { TAccessors, GET_VENUE_EVENT } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
251
|
+
import { IAnalytics } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.CustomerAnalytics';
|
|
252
|
+
import { ParsedMVF } from '@mappedin/mvf';
|
|
253
|
+
import { ParsedMVFv1 } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.MVF.types';
|
|
254
|
+
import { PubSub } from '@mappedin/mappedin-js/lib/esm/get-venue/pub-sub.typed';
|
|
255
|
+
export const defaultOptions: TGetVenueOptionsInternal & TGetVenueOptions;
|
|
256
|
+
export class Mappedin extends PubSub<GET_VENUE_PAYLOAD, GET_VENUE_EVENT> {
|
|
257
|
+
#private;
|
|
258
|
+
perspective: any;
|
|
259
|
+
things: any;
|
|
260
|
+
options: any;
|
|
261
|
+
updatedAt?: string;
|
|
262
|
+
categories: MappedinCategory[];
|
|
263
|
+
locations: MappedinLocation[];
|
|
264
|
+
vortexes: MappedinVortex[];
|
|
265
|
+
maps: MappedinMap[];
|
|
266
|
+
nodes: MappedinNode[];
|
|
267
|
+
polygons: MappedinPolygon[];
|
|
268
|
+
venue: MappedinVenue;
|
|
269
|
+
events: MappedinEvent[];
|
|
270
|
+
mapGroups: MappedinMapGroup[];
|
|
271
|
+
themes: MappedinTheme[];
|
|
272
|
+
locationStates: MappedinLocationState[];
|
|
273
|
+
rankings?: MappedinRankings;
|
|
274
|
+
currentLanguage: {
|
|
275
|
+
name: string;
|
|
276
|
+
code: string;
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* @hidden
|
|
280
|
+
* @internal
|
|
281
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
282
|
+
*/
|
|
283
|
+
_categoriesById?: {
|
|
284
|
+
[id: string]: MappedinCategory;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* @hidden
|
|
288
|
+
* @internal
|
|
289
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
290
|
+
*/
|
|
291
|
+
_locationsById?: {
|
|
292
|
+
[id: string]: MappedinLocation;
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* @hidden
|
|
296
|
+
* @internal
|
|
297
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
298
|
+
*/
|
|
299
|
+
_vortexesById?: {
|
|
300
|
+
[id: string]: MappedinVortex;
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* @hidden
|
|
304
|
+
* @internal
|
|
305
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
306
|
+
*/
|
|
307
|
+
_mapsById?: {
|
|
308
|
+
[id: string]: MappedinMap;
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* @hidden
|
|
312
|
+
* @internal
|
|
313
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
314
|
+
*/
|
|
315
|
+
_nodesById?: {
|
|
316
|
+
[id: string]: MappedinNode;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* @hidden
|
|
320
|
+
* @internal
|
|
321
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
322
|
+
*/
|
|
323
|
+
_polygonsById?: {
|
|
324
|
+
[id: string]: MappedinPolygon;
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* @hidden
|
|
328
|
+
* @internal
|
|
329
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
330
|
+
*/
|
|
331
|
+
_eventsById?: {
|
|
332
|
+
[id: string]: MappedinEvent;
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* @hidden
|
|
336
|
+
* @internal
|
|
337
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
338
|
+
*/
|
|
339
|
+
_mapGroupsById?: {
|
|
340
|
+
[id: string]: MappedinMapGroup;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* @hidden
|
|
344
|
+
* @internal
|
|
345
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
346
|
+
*/
|
|
347
|
+
_locationStatesById?: {
|
|
348
|
+
[id: string]: MappedinLocationState;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* @hidden
|
|
352
|
+
* @internal
|
|
353
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
354
|
+
*/
|
|
355
|
+
_locationRankingsById?: {
|
|
356
|
+
[id: string]: MappedinLocationRankings;
|
|
357
|
+
};
|
|
358
|
+
/**
|
|
359
|
+
* @hidden
|
|
360
|
+
* @internal
|
|
361
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
362
|
+
*/
|
|
363
|
+
_rankingsById?: {
|
|
364
|
+
[id: string]: MappedinRankings;
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* @hidden
|
|
368
|
+
* @internal
|
|
369
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
370
|
+
*/
|
|
371
|
+
_categoriesByExternalId?: {
|
|
372
|
+
[id: string]: MappedinCategory;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* @hidden
|
|
376
|
+
* @internal
|
|
377
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
378
|
+
*/
|
|
379
|
+
_locationsByExternalId?: {
|
|
380
|
+
[id: string]: MappedinLocation;
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* @hidden
|
|
384
|
+
* @internal
|
|
385
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
386
|
+
*/
|
|
387
|
+
_vortexesByExternalId?: {
|
|
388
|
+
[id: string]: MappedinVortex;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* @hidden
|
|
392
|
+
* @internal
|
|
393
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
394
|
+
*/
|
|
395
|
+
_mapsByExternalId?: {
|
|
396
|
+
[id: string]: MappedinMap;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* @hidden
|
|
400
|
+
* @internal
|
|
401
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
402
|
+
*/
|
|
403
|
+
_nodesByExternalId?: {
|
|
404
|
+
[id: string]: MappedinNode;
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* @hidden
|
|
408
|
+
* @internal
|
|
409
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
410
|
+
*/
|
|
411
|
+
_polygonsByExternalId?: {
|
|
412
|
+
[id: string]: MappedinPolygon;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* @hidden
|
|
416
|
+
* @internal
|
|
417
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
418
|
+
*/
|
|
419
|
+
_eventsByExternalId?: {
|
|
420
|
+
[id: string]: MappedinEvent;
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* @hidden
|
|
424
|
+
* @internal
|
|
425
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
426
|
+
*/
|
|
427
|
+
_mapGroupsByExternalId?: {
|
|
428
|
+
[id: string]: MappedinMapGroup;
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* @hidden
|
|
432
|
+
* @internal
|
|
433
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
434
|
+
*/
|
|
435
|
+
_locationStatesByExternalId?: {
|
|
436
|
+
[id: string]: MappedinLocationState;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* @hidden
|
|
440
|
+
* @internal
|
|
441
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
442
|
+
*/
|
|
443
|
+
_locationRankingsByExternalId?: {
|
|
444
|
+
[id: string]: MappedinLocationRankings;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* @hidden
|
|
448
|
+
* @internal
|
|
449
|
+
* @deprecated Use {@link Mappedin.getCollectionItemById} instead
|
|
450
|
+
*/
|
|
451
|
+
_rankingsByExternalId?: {
|
|
452
|
+
[id: string]: MappedinRankings;
|
|
453
|
+
};
|
|
454
|
+
getCollectionItemById<T extends keyof TAccessors, I extends string>(name: T, id: I): TAccessors[T] | null;
|
|
455
|
+
/**
|
|
456
|
+
* @hidden
|
|
457
|
+
* @internal
|
|
458
|
+
*/
|
|
459
|
+
hydrateFromMVF(mvfData: ParsedMVF): Promise<undefined>;
|
|
460
|
+
/**
|
|
461
|
+
* @hidden
|
|
462
|
+
* @internal
|
|
463
|
+
*/
|
|
464
|
+
hydrateFromMVFv1(mvfData: ParsedMVFv1): Promise<undefined>;
|
|
465
|
+
/**
|
|
466
|
+
* Change the language of the venue. This will trigger a re-fetch of the venue data and emit a
|
|
467
|
+
* {GET_VENUE_EVENT.LANGUAGE_CHANGED} event.
|
|
468
|
+
*
|
|
469
|
+
* @param languageCode The language code to change to
|
|
470
|
+
* @param cache Whether or not to cache the current language so it doesn't need to be re-fetched
|
|
471
|
+
*/
|
|
472
|
+
changeLanguage(languageCode: string, cache?: boolean): Promise<void>;
|
|
473
|
+
/**
|
|
474
|
+
*
|
|
475
|
+
* @experimental Hydrate the Mappedin instance using a response from either {@link Mappedin.toString}, {@link getVenueBundle} or by downloading the bundle manually
|
|
476
|
+
* @param mappedinSerializableData Mappedin data that was serialized or exported as JSON
|
|
477
|
+
* @param shouldPopulateBundledImagesAsBlobs Takes the scenes and images from a bundle and maps them as blobs to where they exist as URLs in the bundle. False by default
|
|
478
|
+
*/
|
|
479
|
+
hydrate(mappedinSerializableData: string | Record<string, unknown>, shouldPopulateBundledImagesAsBlobs?: boolean): Promise<undefined>;
|
|
480
|
+
images: any;
|
|
481
|
+
imageBinaries?: Map<string, Uint8Array>;
|
|
482
|
+
scenes: any;
|
|
483
|
+
fetch(): Promise<void>;
|
|
484
|
+
/**
|
|
485
|
+
* @deprecated Use {@link hydrateVenue} instead
|
|
486
|
+
*/
|
|
487
|
+
constructor(options: TGetVenueOptionsInternal & TGetVenueOptions);
|
|
488
|
+
analytics: IAnalytics;
|
|
489
|
+
/**
|
|
490
|
+
* @hidden
|
|
491
|
+
*/
|
|
492
|
+
navigator?: Navigator;
|
|
493
|
+
/**
|
|
494
|
+
* Export venue data to JSON (for storage, encryption, etc)
|
|
495
|
+
*/
|
|
496
|
+
toJSON(): any;
|
|
497
|
+
/**
|
|
498
|
+
* Export venue data to String
|
|
499
|
+
*/
|
|
500
|
+
toString(): string;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/default-things' {
|
|
505
|
+
export const defaultThings: {
|
|
506
|
+
venue: string[];
|
|
507
|
+
nodes: string[];
|
|
508
|
+
vortexes: string[];
|
|
509
|
+
polygons: string[];
|
|
510
|
+
locations: string[];
|
|
511
|
+
categories: string[];
|
|
512
|
+
maps: string[];
|
|
513
|
+
mapGroups: string[];
|
|
514
|
+
themes: string[];
|
|
515
|
+
rankings: string[];
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/internal' {
|
|
520
|
+
import { MappedinNavigatable } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinNavigatable';
|
|
521
|
+
import { MappedinNode } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinNode';
|
|
522
|
+
import { MappedinPolygon } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinPolygon';
|
|
523
|
+
import { MappedinLocation } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinLocation';
|
|
524
|
+
import { MappedinCategory } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinCategory';
|
|
525
|
+
import { MappedinDirections } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinDirections';
|
|
526
|
+
import { MappedinDestinationSet } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinDestinationSet';
|
|
527
|
+
import { MappedinVortex } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinVortex';
|
|
528
|
+
import { MappedinVenue } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinVenue';
|
|
529
|
+
import { MappedinTheme } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinTheme';
|
|
530
|
+
import { MappedinRankings } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinRankings';
|
|
531
|
+
import { MappedinLocationRankings } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinLocationRankings';
|
|
532
|
+
import { MappedinEvent } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinEvent';
|
|
533
|
+
import { MappedinLocationState } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinLocationState';
|
|
534
|
+
import { MappedinMap } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinMap';
|
|
535
|
+
import { MappedinCoordinate } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinCoordinate';
|
|
536
|
+
import { MappedinMapGroup } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinMapGroup';
|
|
537
|
+
export { MappedinNavigatable, MappedinNode, MappedinPolygon, MappedinLocation, MappedinCategory, MappedinDirections, MappedinDestinationSet, MappedinVortex, MappedinVenue, MappedinTheme, MappedinRankings, MappedinLocationRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinCoordinate, MappedinMapGroup, };
|
|
538
|
+
export * from '@mappedin/mappedin-js/lib/esm/get-venue/utils';
|
|
539
|
+
export { default as MappedinCache } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.cache';
|
|
540
|
+
export enum MappedinCollectionType {
|
|
541
|
+
CATEGORY = "categories",
|
|
542
|
+
EVENT = "events",
|
|
543
|
+
LOCATION = "locations",
|
|
544
|
+
MAPGROUP = "mapGroups",
|
|
545
|
+
MAP = "maps",
|
|
546
|
+
NODE = "nodes",
|
|
547
|
+
POLYGON = "polygons",
|
|
548
|
+
VORTEX = "vortexes"
|
|
549
|
+
}
|
|
550
|
+
export type TAccessors = {
|
|
551
|
+
[MappedinCollectionType.CATEGORY]: MappedinCategory;
|
|
552
|
+
[MappedinCollectionType.EVENT]: MappedinEvent;
|
|
553
|
+
[MappedinCollectionType.LOCATION]: MappedinLocation;
|
|
554
|
+
[MappedinCollectionType.MAPGROUP]: MappedinMapGroup;
|
|
555
|
+
[MappedinCollectionType.MAP]: MappedinMap;
|
|
556
|
+
[MappedinCollectionType.NODE]: MappedinNode;
|
|
557
|
+
[MappedinCollectionType.POLYGON]: MappedinPolygon;
|
|
558
|
+
[MappedinCollectionType.VORTEX]: MappedinVortex;
|
|
559
|
+
};
|
|
560
|
+
export const THINGS: {
|
|
561
|
+
categories: typeof MappedinCategory;
|
|
562
|
+
locations: typeof MappedinLocation;
|
|
563
|
+
vortexes: typeof MappedinVortex;
|
|
564
|
+
maps: typeof MappedinMap;
|
|
565
|
+
nodes: typeof MappedinNode;
|
|
566
|
+
polygons: typeof MappedinPolygon;
|
|
567
|
+
venue: typeof MappedinVenue;
|
|
568
|
+
events: typeof MappedinEvent;
|
|
569
|
+
mapGroups: typeof MappedinMapGroup;
|
|
570
|
+
themes: typeof MappedinTheme;
|
|
571
|
+
locationStates: typeof MappedinLocationState;
|
|
572
|
+
rankings: typeof MappedinRankings;
|
|
573
|
+
};
|
|
574
|
+
export type TTHINGS = keyof typeof THINGS;
|
|
575
|
+
export type { TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/MappedinNavigatable';
|
|
576
|
+
export enum GET_VENUE_EVENT {
|
|
577
|
+
LANGUAGE_CHANGED = 0
|
|
578
|
+
}
|
|
579
|
+
export type GET_VENUE_PAYLOAD = {
|
|
580
|
+
[GET_VENUE_EVENT.LANGUAGE_CHANGED]: {
|
|
581
|
+
name: string;
|
|
582
|
+
code: string;
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
export { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin';
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.CustomerAnalytics' {
|
|
589
|
+
import { MappedinNavigatable, MappedinLocation, MappedinCategory } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
590
|
+
type AnalyticsUserPosition = {
|
|
591
|
+
bluedotTimestamp: number;
|
|
592
|
+
latitude: number;
|
|
593
|
+
longitude: number;
|
|
594
|
+
floorLevel?: number;
|
|
595
|
+
accuracy: number;
|
|
596
|
+
};
|
|
597
|
+
type AnalyticsOptions = {
|
|
598
|
+
clientId?: string;
|
|
599
|
+
clientSecret?: string;
|
|
600
|
+
accessToken?: string;
|
|
601
|
+
noAuth?: boolean;
|
|
602
|
+
venue: string;
|
|
603
|
+
testMode?: boolean | string;
|
|
604
|
+
context?: string;
|
|
605
|
+
platformString?: string;
|
|
606
|
+
};
|
|
607
|
+
interface IAnalytics {
|
|
608
|
+
locationSelected(location: MappedinLocation): void;
|
|
609
|
+
categorySelected(category: MappedinCategory): void;
|
|
610
|
+
/**
|
|
611
|
+
* @hidden
|
|
612
|
+
* @internal
|
|
613
|
+
* @deprecated
|
|
614
|
+
*/
|
|
615
|
+
getDirections(start: MappedinNavigatable, end: MappedinNavigatable): void;
|
|
616
|
+
}
|
|
617
|
+
interface IInternalAnalytics extends IAnalytics {
|
|
618
|
+
track(target: string, query: any): void;
|
|
619
|
+
mapViewLoaded(type: '2d' | '3d', forced: boolean, benchmark: number, reason: string): void;
|
|
620
|
+
getSessionID(): string;
|
|
621
|
+
getDeviceID(): string;
|
|
622
|
+
setGeolocationMode(mode: boolean): void;
|
|
623
|
+
trackBlueDotEvent(blueDotEvent: Record<string, unknown>): void;
|
|
624
|
+
trackSearch(searchAnalyticsObject: Record<string, unknown>): void;
|
|
625
|
+
trackSearchSuggest(searchAnalyticsObject: Record<string, unknown>): void;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* @internal
|
|
629
|
+
* @hidden
|
|
630
|
+
* A singleton class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
|
|
631
|
+
* 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`.
|
|
632
|
+
*
|
|
633
|
+
* @type {any}
|
|
634
|
+
*/
|
|
635
|
+
class Analytics implements IInternalAnalytics {
|
|
636
|
+
#private;
|
|
637
|
+
static instance: Analytics | null;
|
|
638
|
+
/**
|
|
639
|
+
* The static method to create a singleton instance of the Analytics class.
|
|
640
|
+
* @class Analytics
|
|
641
|
+
* @param options {Object} A list of configuration options for the Analytics API.
|
|
642
|
+
* @param [options.clientId] {String} The same key you are using for getVenue. Handled automatically in Mapview.initialize()
|
|
643
|
+
* @param [options.clientSecret] {String} The same secret you are using for getVenue. Handled automatically in Mapview.initialize()
|
|
644
|
+
* @param [options.venue] {String} The same venue slug you are using for getVenue. Handled automatically in MapView.initialize()
|
|
645
|
+
* @param [options.context] {String} The context to pass with the analytics request. Defaults to "websdk".
|
|
646
|
+
* @param [options.noAuth] {Boolean} Whether authentication should not be sent with analytics requests.
|
|
647
|
+
* @param [options.testMode] {Boolean} Whether analytics events should be dropped because this is running in a test environment.
|
|
648
|
+
* @returns {Analytics} The singleton instance of the Analytics class.
|
|
649
|
+
*/
|
|
650
|
+
static create(options: AnalyticsOptions): Analytics;
|
|
651
|
+
track(target: string, query: Record<string, any>): void;
|
|
652
|
+
/**
|
|
653
|
+
* This method should be called whenever the user's position changes. This information will be sent when a track call is made.
|
|
654
|
+
* @param position {AnalyticsUserPosition} The user's current position.
|
|
655
|
+
*/
|
|
656
|
+
updateAnalyticsUserPosition(position: Omit<AnalyticsUserPosition, 'bluedotTimestamp'> | undefined): void;
|
|
657
|
+
/**
|
|
658
|
+
* Whenever a location is selected, you should fire this event. What "selected" means can vary by venue,
|
|
659
|
+
* but a good rule of thumb is that you fire the event whenever you would show the location's details.
|
|
660
|
+
* Typically this is when the user taps it's polygon on the map, picks it from search results or a category list.
|
|
661
|
+
* or deep links directly into the map.
|
|
662
|
+
* @method locationSelected
|
|
663
|
+
* @param location {MappedinLocation} The location the user selected.
|
|
664
|
+
*/
|
|
665
|
+
locationSelected(location: any): void;
|
|
666
|
+
/**
|
|
667
|
+
* Whenever a category is selected, you should fire this event.
|
|
668
|
+
* @method categorySelected
|
|
669
|
+
* @param category {MappedinCategory} The category the user selected.
|
|
670
|
+
*/
|
|
671
|
+
categorySelected(category: any): void;
|
|
672
|
+
mapViewLoaded(type: any, forced: any, benchmark: any, reason: any): void;
|
|
673
|
+
/**
|
|
674
|
+
* Whenever a user requests directions, you should fire this event.
|
|
675
|
+
* @method getDirections
|
|
676
|
+
* @param start {MappedinLocation} The start location for wayfinding.
|
|
677
|
+
* @param end {MappedinLocation} The end location for wayfinding.
|
|
678
|
+
*/
|
|
679
|
+
getDirections(start: any, end: any): void;
|
|
680
|
+
getSessionID(): string;
|
|
681
|
+
getDeviceID(): string;
|
|
682
|
+
/**
|
|
683
|
+
* @param mode {Boolean} Indicates whether the user's geolocation is enabled.
|
|
684
|
+
*/
|
|
685
|
+
setGeolocationMode(mode: any): void;
|
|
686
|
+
/**
|
|
687
|
+
* Track an event.
|
|
688
|
+
* @method trackBlueDotEvent
|
|
689
|
+
* @param event {String}
|
|
690
|
+
* event param should be a property of the {{#crossLink "Analytics/BLUEDOT_EVENT:property"}}{{/crossLink}} property.
|
|
691
|
+
*/
|
|
692
|
+
trackBlueDotEvent(blueDotEvent: any): void;
|
|
693
|
+
trackSearch(searchAnalyticsObject: any): void;
|
|
694
|
+
trackSearchSuggest(searchAnalyticsObject: any): void;
|
|
695
|
+
/**
|
|
696
|
+
* Sets the current global context of the Analytics class.
|
|
697
|
+
* @method setContext
|
|
698
|
+
* @param context {String} The Analytics context to be set.
|
|
699
|
+
* @hidden
|
|
700
|
+
*/
|
|
701
|
+
static setContext(context: any): void;
|
|
702
|
+
/**
|
|
703
|
+
* Sets the current global context of the Analytics class to undefined.
|
|
704
|
+
* @method clearContext
|
|
705
|
+
* @hidden
|
|
706
|
+
*/
|
|
707
|
+
static clearContext(): void;
|
|
708
|
+
/**
|
|
709
|
+
* Destroys the singleton instance of the Analytics class.
|
|
710
|
+
* @method destroy
|
|
711
|
+
* @hidden
|
|
712
|
+
*/
|
|
713
|
+
static destroy(): void;
|
|
714
|
+
/**
|
|
715
|
+
* Enum of valid bluedot events.
|
|
716
|
+
* Pass a property of this into the {{#crossLink "Analytics/trackBlueDotEvent:method"}}{{/crossLink}} method.
|
|
717
|
+
* Valid properties are: ATTEMPT_BLUEDOT, FOUND_POSITION, FOUND_FLOOR.
|
|
718
|
+
* @property BLUEDOT_EVENT {Object}
|
|
719
|
+
* @example
|
|
720
|
+
* Analytics.trackBlueDotEvent(Analytics.BLUEDOT_EVENT.ATTEMPT_BLUEDOT)
|
|
721
|
+
*/
|
|
722
|
+
static BLUEDOT_EVENT: {
|
|
723
|
+
ATTEMPT_BLUEDOT: string;
|
|
724
|
+
FOUND_POSITION: string;
|
|
725
|
+
FOUND_FLOOR: string;
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
export type { IAnalytics };
|
|
729
|
+
export default Analytics;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinDirections' {
|
|
733
|
+
import { IDirectionsResult } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator';
|
|
734
|
+
import { ACTION_TYPE, BEARING_TYPE } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Directive';
|
|
735
|
+
import type { MappedinNode, MappedinVortex, MappedinMap, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
736
|
+
export interface IActionDeparture {
|
|
737
|
+
type: ACTION_TYPE.DEPARTURE;
|
|
738
|
+
}
|
|
739
|
+
export interface IActionArrival {
|
|
740
|
+
type: ACTION_TYPE.ARRIVAL;
|
|
741
|
+
}
|
|
742
|
+
export interface IActionTakeVortex {
|
|
743
|
+
type: ACTION_TYPE.TAKEVORTEX;
|
|
744
|
+
toMap: MappedinMap;
|
|
745
|
+
fromMap: MappedinMap;
|
|
746
|
+
}
|
|
747
|
+
export interface IActionExitVortex {
|
|
748
|
+
type: ACTION_TYPE.EXITVORTEX;
|
|
749
|
+
toMap: MappedinMap;
|
|
750
|
+
fromMap: MappedinMap;
|
|
751
|
+
}
|
|
752
|
+
export interface IActionTurn {
|
|
753
|
+
type: ACTION_TYPE.TURN;
|
|
754
|
+
bearing: BEARING_TYPE;
|
|
755
|
+
referencePosition?: string;
|
|
756
|
+
}
|
|
757
|
+
export type IAction = IActionArrival | IActionDeparture | IActionTurn | IActionTakeVortex | IActionExitVortex;
|
|
758
|
+
/** this is the "overloaded" version of the directive, with get-venue classes instead of stubs */
|
|
759
|
+
export type TMappedinDirective = {
|
|
760
|
+
node: MappedinNode;
|
|
761
|
+
/**
|
|
762
|
+
* Distance from the last instruction to the current. Useful for turn by turn navigation
|
|
763
|
+
*/
|
|
764
|
+
distance: number;
|
|
765
|
+
instruction: string;
|
|
766
|
+
action?: IAction;
|
|
767
|
+
atLocation?: MappedinVortex;
|
|
768
|
+
type?: BEARING_TYPE;
|
|
769
|
+
};
|
|
770
|
+
/**
|
|
771
|
+
* Directions Object
|
|
772
|
+
*/
|
|
773
|
+
export class MappedinDirections {
|
|
774
|
+
#private;
|
|
775
|
+
/**
|
|
776
|
+
* Total Distance in meters of the path.
|
|
777
|
+
*/
|
|
778
|
+
distance: number;
|
|
779
|
+
/**
|
|
780
|
+
* The path as an array of {@link MappedinNode}
|
|
781
|
+
*/
|
|
782
|
+
path: MappedinNode[];
|
|
783
|
+
/**
|
|
784
|
+
* An array of {@link MappedinDirective} that contains the instructions to get to the destination, which can be used for text based directions.
|
|
785
|
+
*/
|
|
786
|
+
instructions: TMappedinDirective[];
|
|
787
|
+
constructor(mappedin: Mappedin, directions: IDirectionsResult);
|
|
788
|
+
toJSON(): IDirectionsResult;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
import NavigationGraph from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/NavigationGraph';
|
|
793
|
+
import Navigator from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Navigator';
|
|
794
|
+
export { ACTION_TYPE, BEARING_TYPE } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Directive';
|
|
795
|
+
export { Navigator, NavigationGraph };
|
|
796
|
+
export type { IDirectionsResult, TSimplifyDirectionsOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Navigator';
|
|
797
|
+
export { E_MESSAGES } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Navigator';
|
|
798
|
+
export { E_SDK_LOG_LEVEL, setLoggerLevel } from '@mappedin/mappedin-js/lib/esm/get-venue/--/common/Mappedin.Logger';
|
|
799
|
+
|
|
800
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinLocation' {
|
|
801
|
+
import type { TLocation, TColor, TGalleryImage, TLogo, TOpeningHours, TPhone, TPicture, TSiblingGroup, TSocial } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
802
|
+
import type { MappedinNode, MappedinPolygon, MappedinCategory, MappedinLocationState, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
803
|
+
import { MappedinNavigatable, MappedinDirections, MappedinDestinationSet, TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
804
|
+
export function getCurrentLocationState(location: MappedinLocation, states: MappedinLocationState[], date?: Date): MappedinLocationState | undefined;
|
|
805
|
+
export type TOperationHoursMap = {
|
|
806
|
+
[key in string]: TOpeningHours[];
|
|
807
|
+
};
|
|
808
|
+
/**
|
|
809
|
+
* A {@link MappedinLocation} is something like a store or washroom on a {@link MappedinMap}. It has an ID and will be linked to zero or more {@link MappedinNode}s and {@link MappedinPolygon}s.
|
|
810
|
+
*
|
|
811
|
+
* A Location's Nodes and Polygons can be on multiple Maps, or in multiple non-adjacent places on the same Map.
|
|
812
|
+
* For example, all washroom at a given Venue could belong to one Location, or a department store could live on multiple floors. A Washroom Location might a have a few Polygons spread throughout the Venue for each one that exists, but a single store might just have one presence, and therefore one Polygon. Some Locations just have a single point and only have Nodes.
|
|
813
|
+
*
|
|
814
|
+
* A Location can have more properties (typically things like 'name', 'externalId', 'type', 'categories', 'description', 'logo', etc).
|
|
815
|
+
*
|
|
816
|
+
* The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Locations. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
817
|
+
*
|
|
818
|
+
* See below for an example a 'things' object with available Location properties specified:
|
|
819
|
+
*
|
|
820
|
+
* things: {
|
|
821
|
+
* venue: [],
|
|
822
|
+
* locations: ['venue', 'name', 'type', 'icon', 'logo', 'language', 'externalId', 'description', 'categories', 'phone', 'operationHours', 'social', 'tags', 'parents', 'sortOrder'],
|
|
823
|
+
* categories: [],
|
|
824
|
+
* maps: []
|
|
825
|
+
* }
|
|
826
|
+
*
|
|
827
|
+
* @class MappedinLocation
|
|
828
|
+
*/
|
|
829
|
+
export class MappedinLocation extends MappedinNavigatable {
|
|
830
|
+
#private;
|
|
831
|
+
states: TLocation['states'];
|
|
832
|
+
id: string;
|
|
833
|
+
name: string;
|
|
834
|
+
type: string;
|
|
835
|
+
description?: string;
|
|
836
|
+
sortOrder?: number;
|
|
837
|
+
logo?: TLogo;
|
|
838
|
+
phone?: TPhone;
|
|
839
|
+
social?: TSocial;
|
|
840
|
+
color?: TColor;
|
|
841
|
+
shortName?: string;
|
|
842
|
+
detailsUrl?: string;
|
|
843
|
+
tags?: string[];
|
|
844
|
+
/**
|
|
845
|
+
* @internal
|
|
846
|
+
*/
|
|
847
|
+
toMap?: string;
|
|
848
|
+
externalId?: string;
|
|
849
|
+
showLabelWhenImagePresent?: boolean;
|
|
850
|
+
showSmartLabelWhenImagePresent?: boolean;
|
|
851
|
+
picture?: TPicture;
|
|
852
|
+
operationHours?: TOpeningHours[] | undefined;
|
|
853
|
+
siblingGroups?: TSiblingGroup[] | undefined;
|
|
854
|
+
gallery?: TGalleryImage[] | undefined;
|
|
855
|
+
amenity?: string | undefined;
|
|
856
|
+
constructor(mappedin: Mappedin, data: any);
|
|
857
|
+
/**
|
|
858
|
+
* Polygons this Location is attached to.
|
|
859
|
+
*
|
|
860
|
+
* @property polygons
|
|
861
|
+
* @type [MappedinPolygon]
|
|
862
|
+
*/
|
|
863
|
+
get polygons(): MappedinPolygon[];
|
|
864
|
+
set polygons(polygons: MappedinPolygon[]);
|
|
865
|
+
/**
|
|
866
|
+
* Nodes this Location is attached to.
|
|
867
|
+
*
|
|
868
|
+
* @property nodes
|
|
869
|
+
* @type [MappedinNode]
|
|
870
|
+
*/
|
|
871
|
+
get nodes(): MappedinNode[];
|
|
872
|
+
set nodes(nodes: MappedinNode[]);
|
|
873
|
+
/**
|
|
874
|
+
* Parent of this Location, if any. Used in cases where one Location is inside another, more "important" Location.
|
|
875
|
+
*
|
|
876
|
+
* @property parent
|
|
877
|
+
* @type MappedinLocation
|
|
878
|
+
*/
|
|
879
|
+
get parent(): MappedinLocation | undefined;
|
|
880
|
+
set parent(parent: MappedinLocation | undefined);
|
|
881
|
+
/**
|
|
882
|
+
* Categories related to this location.
|
|
883
|
+
*
|
|
884
|
+
* @property categories
|
|
885
|
+
* @type [MappedinCategory]
|
|
886
|
+
*/
|
|
887
|
+
get categories(): MappedinCategory[];
|
|
888
|
+
get state(): MappedinLocationState | undefined;
|
|
889
|
+
clone(): MappedinLocation;
|
|
890
|
+
get nodeOperationHours(): TOperationHoursMap;
|
|
891
|
+
static hydrate(locations: any, mappedin: Mappedin): MappedinLocation[];
|
|
892
|
+
static fetch(mappedin: Mappedin): Promise<MappedinLocation[]>;
|
|
893
|
+
/**
|
|
894
|
+
*
|
|
895
|
+
* Get Directions to a node, polygon, or location
|
|
896
|
+
*/
|
|
897
|
+
directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
|
|
898
|
+
directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
|
|
899
|
+
/**
|
|
900
|
+
*
|
|
901
|
+
* Calculate distance between 2 nodes, polygons or locations
|
|
902
|
+
*/
|
|
903
|
+
distanceTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): number;
|
|
904
|
+
toJSON(): any;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinCoordinate' {
|
|
909
|
+
import { MappedinNode, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
910
|
+
import type { MappedinMap } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
911
|
+
export type TMappedinCoordinateOptions = {
|
|
912
|
+
map: MappedinMap;
|
|
913
|
+
mappedin: Mappedin;
|
|
914
|
+
x: number;
|
|
915
|
+
y: number;
|
|
916
|
+
lat?: undefined;
|
|
917
|
+
lon?: undefined;
|
|
918
|
+
} | {
|
|
919
|
+
map: MappedinMap;
|
|
920
|
+
mappedin: Mappedin;
|
|
921
|
+
x?: undefined;
|
|
922
|
+
y?: undefined;
|
|
923
|
+
lat: number;
|
|
924
|
+
lon: number;
|
|
925
|
+
};
|
|
926
|
+
/**
|
|
927
|
+
* A {@link MappedinCoordinate} represents a coordinate on a map, created using lat/lon.
|
|
928
|
+
*
|
|
929
|
+
* @class MappedinCoordinate
|
|
930
|
+
*/
|
|
931
|
+
export class MappedinCoordinate {
|
|
932
|
+
#private;
|
|
933
|
+
/**
|
|
934
|
+
* The Map that the Node is located on.
|
|
935
|
+
*
|
|
936
|
+
* @property map {MappedinMap}
|
|
937
|
+
*/
|
|
938
|
+
map: MappedinMap;
|
|
939
|
+
/**
|
|
940
|
+
* X coordinate in Mappedin Units
|
|
941
|
+
* @property x {number}
|
|
942
|
+
*/
|
|
943
|
+
get x(): number;
|
|
944
|
+
/**
|
|
945
|
+
* Y coordinate in Mappedin Units
|
|
946
|
+
* @property y {number}
|
|
947
|
+
*/
|
|
948
|
+
get y(): number;
|
|
949
|
+
/**
|
|
950
|
+
* Latitude
|
|
951
|
+
*/
|
|
952
|
+
get lat(): number;
|
|
953
|
+
/**
|
|
954
|
+
* Longitude
|
|
955
|
+
*/
|
|
956
|
+
get lon(): number;
|
|
957
|
+
/**
|
|
958
|
+
* @internal
|
|
959
|
+
*/
|
|
960
|
+
constructor(options: TMappedinCoordinateOptions);
|
|
961
|
+
/**
|
|
962
|
+
*
|
|
963
|
+
* Calculate distance between a coordinate and a {@link MappedinNode} or {@link MappedinCoordinate}
|
|
964
|
+
*
|
|
965
|
+
* @param destination Destination to measure real distance to
|
|
966
|
+
* @returns distance in meters
|
|
967
|
+
*/
|
|
968
|
+
absoluteDistanceTo(destination: MappedinCoordinate): number;
|
|
969
|
+
/**
|
|
970
|
+
* Get Nearest Node to Coordinate, which can then be used for navigation
|
|
971
|
+
*/
|
|
972
|
+
get nearestNode(): MappedinNode;
|
|
973
|
+
toJSON(): {
|
|
974
|
+
x: number;
|
|
975
|
+
y: number;
|
|
976
|
+
map: MappedinMap;
|
|
977
|
+
lat: number;
|
|
978
|
+
lon: number;
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.OfflineSearch' {
|
|
984
|
+
import type { SearchOptions } from 'minisearch';
|
|
985
|
+
import { MappedinLocation, MappedinCategory, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
986
|
+
export const removeAccents: (it: string) => string;
|
|
987
|
+
export function tokenizeAndCaptureDelimiters(text: string): string[];
|
|
988
|
+
export type { SearchOptions };
|
|
989
|
+
/**
|
|
990
|
+
* A {@link OfflineSearch} is an offline search module
|
|
991
|
+
*
|
|
992
|
+
*
|
|
993
|
+
* @class OfflineSearch
|
|
994
|
+
*/
|
|
995
|
+
export type TMappedinOfflineSearchAllOptions = {
|
|
996
|
+
/**
|
|
997
|
+
* Array of stopwords to ignore when searching, default: english stopwords
|
|
998
|
+
*/
|
|
999
|
+
stopWords?: string[];
|
|
1000
|
+
/**
|
|
1001
|
+
* Index location tags - typically better to use either tags or descriptions, depending on what's available
|
|
1002
|
+
* @default true
|
|
1003
|
+
*/
|
|
1004
|
+
searchTags?: boolean;
|
|
1005
|
+
/**
|
|
1006
|
+
* Index location descriptions - typically better to use either tags or descriptions, depending on what's available
|
|
1007
|
+
* @default true
|
|
1008
|
+
*/
|
|
1009
|
+
searchDescriptions?: boolean;
|
|
1010
|
+
/**
|
|
1011
|
+
* Also index all tags for every location in every category (caution: this may slow down indexing and search)
|
|
1012
|
+
* @default false
|
|
1013
|
+
*/
|
|
1014
|
+
searchTagsInCategories?: boolean;
|
|
1015
|
+
/**
|
|
1016
|
+
* Also index all tags for every location in every category (caution: this may slow down indexing and search)
|
|
1017
|
+
* @default false
|
|
1018
|
+
*/
|
|
1019
|
+
searchDescriptionsInCategories?: boolean;
|
|
1020
|
+
/**
|
|
1021
|
+
* Initialize Search with a previously indexed JSON string (outputted by OfflineSearch.toJSON())
|
|
1022
|
+
*/
|
|
1023
|
+
jsonIndex?: string;
|
|
1024
|
+
/**
|
|
1025
|
+
* Use the location polygons' rank in weighing results
|
|
1026
|
+
*/
|
|
1027
|
+
useLocationRank?: boolean;
|
|
1028
|
+
/**
|
|
1029
|
+
* Emit Analytics events when doing search
|
|
1030
|
+
* @default true when running in production
|
|
1031
|
+
*/
|
|
1032
|
+
emitAnalyticsEvents?: boolean;
|
|
1033
|
+
/**
|
|
1034
|
+
* Fine tune search constants
|
|
1035
|
+
*/
|
|
1036
|
+
constants: {
|
|
1037
|
+
/**
|
|
1038
|
+
* Fuzziness index for location names and tags
|
|
1039
|
+
* @default 0.09
|
|
1040
|
+
*/
|
|
1041
|
+
PRIMARY_INDEX_FUZZYNESS: number;
|
|
1042
|
+
/**
|
|
1043
|
+
* Multiplier for location names (1 by default)
|
|
1044
|
+
* @default 1
|
|
1045
|
+
*/
|
|
1046
|
+
PRIMARY_INDEX_WEIGHT: number;
|
|
1047
|
+
/**
|
|
1048
|
+
* Multiplier for descriptions
|
|
1049
|
+
* @default 0.025
|
|
1050
|
+
*/
|
|
1051
|
+
SECONDARY_INDEX_WEIGHT: number;
|
|
1052
|
+
/**
|
|
1053
|
+
* Multiplier for location names
|
|
1054
|
+
* @default 1
|
|
1055
|
+
*/
|
|
1056
|
+
LOCATION_NAME_WEIGHT: number;
|
|
1057
|
+
/**
|
|
1058
|
+
* Multiplier for category names
|
|
1059
|
+
* @default 0.5
|
|
1060
|
+
*/
|
|
1061
|
+
CATEGORY_NAME_WEIGHT: number;
|
|
1062
|
+
/**
|
|
1063
|
+
* Multiplier for category locations' descriptions
|
|
1064
|
+
* @default 0.0005
|
|
1065
|
+
*/
|
|
1066
|
+
CATEGORY_LOCATION_DESCRIPTION_WEIGHT: number;
|
|
1067
|
+
/**
|
|
1068
|
+
* Multiplier for category locations' tags
|
|
1069
|
+
* @default 0.0005
|
|
1070
|
+
*/
|
|
1071
|
+
CATEGORY_LOCATION_TAGS_WEIGHT: number;
|
|
1072
|
+
/**
|
|
1073
|
+
* Multiplier for category locations' names
|
|
1074
|
+
* @default 0.01
|
|
1075
|
+
*/
|
|
1076
|
+
CATEGORY_LOCATION_NAME_WEIGHT: number;
|
|
1077
|
+
/**
|
|
1078
|
+
* Multiplier for location tags
|
|
1079
|
+
* @default 0.05
|
|
1080
|
+
*/
|
|
1081
|
+
PRIMARY_INDEX_TAGS_NAME_WEIGHT: number;
|
|
1082
|
+
/**
|
|
1083
|
+
* Default rank when one isn't available in the data, default = 1
|
|
1084
|
+
* @default 1
|
|
1085
|
+
*/
|
|
1086
|
+
LOCATION_DEFAULT_RANK: number;
|
|
1087
|
+
/**
|
|
1088
|
+
* Ratio of Fuzzy Searches of Location names and tags relative to exact
|
|
1089
|
+
* @default 0.01
|
|
1090
|
+
*/
|
|
1091
|
+
RATIO_OF_FUZZY_TO_EXACT: number;
|
|
1092
|
+
/**
|
|
1093
|
+
* Ratio of Prefix Searches of Location names and tags relative to exact
|
|
1094
|
+
* @default 0.2
|
|
1095
|
+
*/
|
|
1096
|
+
RATIO_OF_PREFIX_TO_EXACT: number;
|
|
1097
|
+
};
|
|
1098
|
+
};
|
|
1099
|
+
export type TMappedinOfflineAllSearchMatch = {
|
|
1100
|
+
/**
|
|
1101
|
+
* The term that was found
|
|
1102
|
+
*/
|
|
1103
|
+
term: string;
|
|
1104
|
+
/**
|
|
1105
|
+
* Term's weight
|
|
1106
|
+
*/
|
|
1107
|
+
weight: number;
|
|
1108
|
+
/**
|
|
1109
|
+
* What field the search matched on
|
|
1110
|
+
*/
|
|
1111
|
+
matchesOn: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* The value of that field
|
|
1114
|
+
*/
|
|
1115
|
+
value?: string;
|
|
1116
|
+
};
|
|
1117
|
+
export type TMappedinOfflineSearchOptions = Partial<TMappedinOfflineSearchAllOptions>;
|
|
1118
|
+
export type TMappedinOfflineSearchResult = {
|
|
1119
|
+
/**
|
|
1120
|
+
* Type describing the object
|
|
1121
|
+
*/
|
|
1122
|
+
type: 'MappedinLocation' | 'MappedinCategory' | 'Custom';
|
|
1123
|
+
/**
|
|
1124
|
+
* Details on why the result was returned
|
|
1125
|
+
*/
|
|
1126
|
+
matches: TMappedinOfflineAllSearchMatch[];
|
|
1127
|
+
/**
|
|
1128
|
+
* Found object
|
|
1129
|
+
*/
|
|
1130
|
+
object: MappedinLocation | MappedinCategory | Record<string, unknown>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Total score of the result
|
|
1133
|
+
*/
|
|
1134
|
+
score: number;
|
|
1135
|
+
};
|
|
1136
|
+
export type TMappedinOfflineSearchSuggestions = {
|
|
1137
|
+
/**
|
|
1138
|
+
* Total number of suggestions generated
|
|
1139
|
+
*/
|
|
1140
|
+
total: number;
|
|
1141
|
+
/**
|
|
1142
|
+
* List of suggestions
|
|
1143
|
+
*/
|
|
1144
|
+
hits: {
|
|
1145
|
+
/**
|
|
1146
|
+
* Suggestion text
|
|
1147
|
+
*/
|
|
1148
|
+
text: string;
|
|
1149
|
+
}[];
|
|
1150
|
+
};
|
|
1151
|
+
/**
|
|
1152
|
+
* A {@link OfflineSearch} is an offline search module. It can be initialized at any time by passing the {@link Mappedin} object and a set of {@link TMappedinOfflineSearchOptions} options.
|
|
1153
|
+
*
|
|
1154
|
+
*
|
|
1155
|
+
* @class Mappedin.OfflineSearch
|
|
1156
|
+
*/
|
|
1157
|
+
export class OfflineSearch {
|
|
1158
|
+
#private;
|
|
1159
|
+
constructor(
|
|
1160
|
+
/**
|
|
1161
|
+
* Mappedin Venue Object, typically returned by `getVenue`/`showVenue`
|
|
1162
|
+
*/
|
|
1163
|
+
mappedin: Mappedin, options?: TMappedinOfflineSearchOptions);
|
|
1164
|
+
/**
|
|
1165
|
+
* Get Suggestions for term
|
|
1166
|
+
*/
|
|
1167
|
+
suggest(
|
|
1168
|
+
/**
|
|
1169
|
+
* Search term
|
|
1170
|
+
*/
|
|
1171
|
+
term: string): Promise<TMappedinOfflineSearchSuggestions>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Search for a term
|
|
1174
|
+
*/
|
|
1175
|
+
search(
|
|
1176
|
+
/**
|
|
1177
|
+
* Search term
|
|
1178
|
+
*/
|
|
1179
|
+
term: string): Promise<TMappedinOfflineSearchResult[]>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Export search index to JSON for storage/caching - this would avoid having to re-index
|
|
1182
|
+
* on page reload
|
|
1183
|
+
*/
|
|
1184
|
+
toJSON(): Promise<string>;
|
|
1185
|
+
/**
|
|
1186
|
+
* Add a custom query to the search index
|
|
1187
|
+
*/
|
|
1188
|
+
addQuery(params: {
|
|
1189
|
+
/**
|
|
1190
|
+
* Query string to match for this object
|
|
1191
|
+
*/
|
|
1192
|
+
query: string;
|
|
1193
|
+
/**
|
|
1194
|
+
* Object that is returned when query matches
|
|
1195
|
+
*/
|
|
1196
|
+
object: MappedinLocation | MappedinCategory | Record<string, unknown>;
|
|
1197
|
+
/**
|
|
1198
|
+
* Optional weight to multiply by the score
|
|
1199
|
+
*/
|
|
1200
|
+
weight?: number;
|
|
1201
|
+
}): Promise<void>;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types' {
|
|
1206
|
+
/**
|
|
1207
|
+
* This file contains the API types for MappedinSDK - before they get turned into Classes
|
|
1208
|
+
*/
|
|
1209
|
+
export type TLocationType = 'amenities' | 'tenant';
|
|
1210
|
+
export type TNode = {
|
|
1211
|
+
id: string;
|
|
1212
|
+
x: number;
|
|
1213
|
+
y: number;
|
|
1214
|
+
map: string;
|
|
1215
|
+
externalId?: string;
|
|
1216
|
+
paths: {
|
|
1217
|
+
node: string;
|
|
1218
|
+
map: string;
|
|
1219
|
+
weight?: number;
|
|
1220
|
+
}[];
|
|
1221
|
+
[propName: string]: any;
|
|
1222
|
+
};
|
|
1223
|
+
export type TImage = {
|
|
1224
|
+
original?: string;
|
|
1225
|
+
large?: string;
|
|
1226
|
+
'140x140'?: string;
|
|
1227
|
+
xxlarge?: string;
|
|
1228
|
+
xsmall?: string;
|
|
1229
|
+
'66x66'?: string;
|
|
1230
|
+
xlarge?: string;
|
|
1231
|
+
medium?: string;
|
|
1232
|
+
xxsmall?: string;
|
|
1233
|
+
small?: string;
|
|
1234
|
+
};
|
|
1235
|
+
export type TLogo = TImage;
|
|
1236
|
+
export type TGalleryImage = {
|
|
1237
|
+
image: TImage;
|
|
1238
|
+
caption?: string;
|
|
1239
|
+
};
|
|
1240
|
+
export type TPhone = {
|
|
1241
|
+
number?: string;
|
|
1242
|
+
};
|
|
1243
|
+
export type TSocial = {
|
|
1244
|
+
website?: string;
|
|
1245
|
+
twitter?: string;
|
|
1246
|
+
facebook?: string;
|
|
1247
|
+
instagram?: string;
|
|
1248
|
+
};
|
|
1249
|
+
export type TColor = {
|
|
1250
|
+
hex: string;
|
|
1251
|
+
opacity: number;
|
|
1252
|
+
rgba: string;
|
|
1253
|
+
};
|
|
1254
|
+
export type TVortex = {
|
|
1255
|
+
id: string;
|
|
1256
|
+
name: string;
|
|
1257
|
+
type: string;
|
|
1258
|
+
weight: number;
|
|
1259
|
+
multiplier: number;
|
|
1260
|
+
[propName: string]: any;
|
|
1261
|
+
};
|
|
1262
|
+
export type TPicture = {
|
|
1263
|
+
original?: string;
|
|
1264
|
+
};
|
|
1265
|
+
export type TOpeningHours = {
|
|
1266
|
+
'@type': string;
|
|
1267
|
+
opens: string;
|
|
1268
|
+
closes: string;
|
|
1269
|
+
dayOfWeek: string[];
|
|
1270
|
+
validFrom?: string;
|
|
1271
|
+
validThrough?: string;
|
|
1272
|
+
};
|
|
1273
|
+
export type TSiblingGroup = {
|
|
1274
|
+
label: string;
|
|
1275
|
+
siblings: string[];
|
|
1276
|
+
};
|
|
1277
|
+
export type TState = {
|
|
1278
|
+
type: string;
|
|
1279
|
+
start?: string;
|
|
1280
|
+
end?: string;
|
|
1281
|
+
};
|
|
1282
|
+
export type TCategory = {
|
|
1283
|
+
name?: string;
|
|
1284
|
+
externalId?: string;
|
|
1285
|
+
parents?: string[];
|
|
1286
|
+
id?: string;
|
|
1287
|
+
icon?: TPicture;
|
|
1288
|
+
};
|
|
1289
|
+
export type TEvent = {
|
|
1290
|
+
id: string;
|
|
1291
|
+
type: string;
|
|
1292
|
+
name: string;
|
|
1293
|
+
location?: string;
|
|
1294
|
+
description?: string;
|
|
1295
|
+
image?: TImage;
|
|
1296
|
+
startDate?: number;
|
|
1297
|
+
endDate?: number;
|
|
1298
|
+
showDate?: number;
|
|
1299
|
+
};
|
|
1300
|
+
export interface TGeoReference {
|
|
1301
|
+
target: {
|
|
1302
|
+
x: number;
|
|
1303
|
+
y: number;
|
|
1304
|
+
};
|
|
1305
|
+
control: {
|
|
1306
|
+
x: number;
|
|
1307
|
+
y: number;
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
export interface TMap {
|
|
1311
|
+
id: string;
|
|
1312
|
+
name: string;
|
|
1313
|
+
shortName: string;
|
|
1314
|
+
elevation?: number;
|
|
1315
|
+
scale?: number;
|
|
1316
|
+
x_scale?: number;
|
|
1317
|
+
georeference?: TGeoReference[];
|
|
1318
|
+
[propName: string]: any;
|
|
1319
|
+
}
|
|
1320
|
+
export type TMapGroup = {
|
|
1321
|
+
name: string;
|
|
1322
|
+
id: string;
|
|
1323
|
+
};
|
|
1324
|
+
export type TBuilding = TLocation & {
|
|
1325
|
+
groupId: string;
|
|
1326
|
+
};
|
|
1327
|
+
export type TLocation = {
|
|
1328
|
+
id: string;
|
|
1329
|
+
name: string;
|
|
1330
|
+
type: string;
|
|
1331
|
+
nodes: {
|
|
1332
|
+
map: TMap['id'];
|
|
1333
|
+
node: TNode['id'];
|
|
1334
|
+
}[];
|
|
1335
|
+
polygons: {
|
|
1336
|
+
map: TMap['id'];
|
|
1337
|
+
id: TPolygon['id'];
|
|
1338
|
+
}[];
|
|
1339
|
+
categories: string[];
|
|
1340
|
+
description?: string;
|
|
1341
|
+
sortOrder?: number;
|
|
1342
|
+
logo?: TLogo;
|
|
1343
|
+
phone?: TPhone;
|
|
1344
|
+
social?: TSocial;
|
|
1345
|
+
color?: TColor;
|
|
1346
|
+
shortName?: string;
|
|
1347
|
+
detailsUrl?: string;
|
|
1348
|
+
parent?: string | null;
|
|
1349
|
+
tags?: string[];
|
|
1350
|
+
externalId?: string;
|
|
1351
|
+
picture?: TPicture;
|
|
1352
|
+
states?: TState[];
|
|
1353
|
+
operationHours?: TOpeningHours[] | undefined;
|
|
1354
|
+
siblingGroups?: TSiblingGroup[] | undefined;
|
|
1355
|
+
gallery?: TGalleryImage[] | undefined;
|
|
1356
|
+
[propName: string]: any;
|
|
1357
|
+
};
|
|
1358
|
+
export type TPolygon = {
|
|
1359
|
+
id: string;
|
|
1360
|
+
map: string;
|
|
1361
|
+
layer?: string;
|
|
1362
|
+
layerId?: string;
|
|
1363
|
+
externalId?: string;
|
|
1364
|
+
name?: string;
|
|
1365
|
+
entrances: {
|
|
1366
|
+
map: TMap['id'];
|
|
1367
|
+
id: TNode['id'];
|
|
1368
|
+
}[];
|
|
1369
|
+
};
|
|
1370
|
+
export type TPolygonRanking = {
|
|
1371
|
+
polygonId: string;
|
|
1372
|
+
entranceNodeId: string;
|
|
1373
|
+
score: number;
|
|
1374
|
+
};
|
|
1375
|
+
export type TLocationState = {
|
|
1376
|
+
id: string;
|
|
1377
|
+
name: string;
|
|
1378
|
+
value: string;
|
|
1379
|
+
};
|
|
1380
|
+
export type TVenue = {
|
|
1381
|
+
address?: string;
|
|
1382
|
+
city?: string;
|
|
1383
|
+
countrycode?: string;
|
|
1384
|
+
defaultMap?: string;
|
|
1385
|
+
externalId?: string;
|
|
1386
|
+
id?: string;
|
|
1387
|
+
latitude?: number;
|
|
1388
|
+
logo?: TLogo;
|
|
1389
|
+
longitude?: number;
|
|
1390
|
+
metadata?: any;
|
|
1391
|
+
name?: string;
|
|
1392
|
+
operationHours?: TOpeningHours[];
|
|
1393
|
+
postal?: string;
|
|
1394
|
+
slug?: string;
|
|
1395
|
+
state?: string;
|
|
1396
|
+
telephone?: string;
|
|
1397
|
+
tzid?: string;
|
|
1398
|
+
tzidOverride?: string;
|
|
1399
|
+
utcOffset?: string;
|
|
1400
|
+
website?: string;
|
|
1401
|
+
};
|
|
1402
|
+
export type TMappedinAPI = {
|
|
1403
|
+
nodes: TNode[];
|
|
1404
|
+
locations: TLocation[];
|
|
1405
|
+
categories: TCategory[];
|
|
1406
|
+
mapGroups: TMapGroup[];
|
|
1407
|
+
polygons: TPolygon[];
|
|
1408
|
+
maps: TMap[];
|
|
1409
|
+
themes: any;
|
|
1410
|
+
venue: TVenue;
|
|
1411
|
+
vortexes: TVortex[];
|
|
1412
|
+
locationStates?: TLocationState[];
|
|
1413
|
+
imageBinaries?: Map<string, Uint8Array>;
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.MVF.types' {
|
|
1418
|
+
import { MapId, ObstructionCollection, EntranceCollection, SpaceCollection, Style } from '@mappedin/mvf';
|
|
1419
|
+
import { FeatureCollection, MultiPolygon, Point, Polygon } from 'geojson';
|
|
1420
|
+
import { TImage, TMap, TNode, TOpeningHours, TPhone, TSiblingGroup, TSocial } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
1421
|
+
export type WithIDs<T> = Map<string, T>;
|
|
1422
|
+
type ManifestFile = {
|
|
1423
|
+
type: 'file';
|
|
1424
|
+
name: string;
|
|
1425
|
+
};
|
|
1426
|
+
type ManifestFolder = {
|
|
1427
|
+
type: 'folder';
|
|
1428
|
+
name: string;
|
|
1429
|
+
children: ManifestFile[];
|
|
1430
|
+
};
|
|
1431
|
+
export type MVFStyle = Style & {
|
|
1432
|
+
type: string;
|
|
1433
|
+
width?: number;
|
|
1434
|
+
};
|
|
1435
|
+
export type MVFObstructionFeature = ObstructionCollection['features'][number];
|
|
1436
|
+
export type MVFEntranceFeature = EntranceCollection['features'][number];
|
|
1437
|
+
export type MVFSpaceFeature = SpaceCollection['features'][number];
|
|
1438
|
+
export type MVFv1PolygonLikeProperties = {
|
|
1439
|
+
id: string;
|
|
1440
|
+
altitude?: number;
|
|
1441
|
+
color?: string;
|
|
1442
|
+
externalId?: string | null;
|
|
1443
|
+
height?: number;
|
|
1444
|
+
opacity?: number;
|
|
1445
|
+
layer?: string;
|
|
1446
|
+
level: string;
|
|
1447
|
+
parent?: string | null;
|
|
1448
|
+
};
|
|
1449
|
+
export type MVFv1SpaceProperties = MVFv1PolygonLikeProperties & {
|
|
1450
|
+
entrances: {
|
|
1451
|
+
level: TMap['id'];
|
|
1452
|
+
id: TNode['id'];
|
|
1453
|
+
}[];
|
|
1454
|
+
};
|
|
1455
|
+
export type MVFv1ObstructionProperties = MVFv1PolygonLikeProperties;
|
|
1456
|
+
export type MVFv1ConnectionProperties = {
|
|
1457
|
+
id: string;
|
|
1458
|
+
/**
|
|
1459
|
+
* Indicates that a connection is accessible
|
|
1460
|
+
*/
|
|
1461
|
+
accessible: boolean;
|
|
1462
|
+
/**
|
|
1463
|
+
* Array of node ids that this Connection connects with.
|
|
1464
|
+
*/
|
|
1465
|
+
destinations: string[];
|
|
1466
|
+
level: string;
|
|
1467
|
+
multiplier: number;
|
|
1468
|
+
name: string;
|
|
1469
|
+
/**
|
|
1470
|
+
* Type of the connection such as `escalator` or `elevator`
|
|
1471
|
+
*/
|
|
1472
|
+
type: string;
|
|
1473
|
+
weight: number;
|
|
1474
|
+
};
|
|
1475
|
+
export type MVFv1NodeProperties = {
|
|
1476
|
+
id: string;
|
|
1477
|
+
/**
|
|
1478
|
+
* Indicates that a node is accessible
|
|
1479
|
+
*/
|
|
1480
|
+
accessible: boolean;
|
|
1481
|
+
/**
|
|
1482
|
+
* External id of a node is used to sync and connect to external systems to Mappedin data
|
|
1483
|
+
*/
|
|
1484
|
+
externalId: string | null;
|
|
1485
|
+
level: string;
|
|
1486
|
+
multiplier: number;
|
|
1487
|
+
neighbors: string[];
|
|
1488
|
+
weight: number;
|
|
1489
|
+
};
|
|
1490
|
+
export type MVFv1LevelProperties = {
|
|
1491
|
+
id: string;
|
|
1492
|
+
abbreviation?: string;
|
|
1493
|
+
building?: string;
|
|
1494
|
+
elevation?: number;
|
|
1495
|
+
name: string;
|
|
1496
|
+
};
|
|
1497
|
+
export type MVFv1ManifestProperties = {
|
|
1498
|
+
/**
|
|
1499
|
+
* Name of the venue
|
|
1500
|
+
*/
|
|
1501
|
+
name: string;
|
|
1502
|
+
folder_struct: (ManifestFolder | ManifestFile)[];
|
|
1503
|
+
/**
|
|
1504
|
+
* Mappedin Venue Format version number of the MVF bundle
|
|
1505
|
+
*/
|
|
1506
|
+
version: string;
|
|
1507
|
+
/**
|
|
1508
|
+
* Timestamp when the MVF bundle was generated. E.g. `2022-02-25T16:26:09.908Z`
|
|
1509
|
+
*/
|
|
1510
|
+
time: string;
|
|
1511
|
+
};
|
|
1512
|
+
export type MVFv1BuildingProperties = {
|
|
1513
|
+
id: string;
|
|
1514
|
+
name: string;
|
|
1515
|
+
venue: string;
|
|
1516
|
+
};
|
|
1517
|
+
export type MVFv1CategoryProperties = {
|
|
1518
|
+
id: string;
|
|
1519
|
+
name: string;
|
|
1520
|
+
picture?: TImage;
|
|
1521
|
+
};
|
|
1522
|
+
export type MVFv1LocationProperties = {
|
|
1523
|
+
id: string;
|
|
1524
|
+
address?: string | null;
|
|
1525
|
+
/**
|
|
1526
|
+
* Array of {@link MICategoryProperties | category} ids
|
|
1527
|
+
*/
|
|
1528
|
+
categories: string[];
|
|
1529
|
+
/**
|
|
1530
|
+
* A text description of the location usually indicating what the location is used for
|
|
1531
|
+
*/
|
|
1532
|
+
description?: string | null;
|
|
1533
|
+
/**
|
|
1534
|
+
* Email address to for contacting this location
|
|
1535
|
+
*/
|
|
1536
|
+
email?: string | null;
|
|
1537
|
+
/**
|
|
1538
|
+
* External id used to connect Mappedin Location to an external system
|
|
1539
|
+
*/
|
|
1540
|
+
externalId?: string | null;
|
|
1541
|
+
/**
|
|
1542
|
+
* Opening hours of the location
|
|
1543
|
+
*/
|
|
1544
|
+
hours?: TOpeningHours[] | null;
|
|
1545
|
+
/**
|
|
1546
|
+
* Collection of links related to this location
|
|
1547
|
+
*/
|
|
1548
|
+
links?: {
|
|
1549
|
+
label: string;
|
|
1550
|
+
url: string;
|
|
1551
|
+
}[] | null;
|
|
1552
|
+
logo?: TImage | null;
|
|
1553
|
+
/**
|
|
1554
|
+
* Name of the location. By default this is the string displayed in the location label
|
|
1555
|
+
*/
|
|
1556
|
+
name: string;
|
|
1557
|
+
/**
|
|
1558
|
+
* Phone number for contacting this location
|
|
1559
|
+
*/
|
|
1560
|
+
phone?: TPhone | null;
|
|
1561
|
+
picture?: TImage | null;
|
|
1562
|
+
services?: string | null;
|
|
1563
|
+
siblingGroups?: TSiblingGroup[] | null;
|
|
1564
|
+
/**
|
|
1565
|
+
* Social media links of the location
|
|
1566
|
+
*/
|
|
1567
|
+
social?: TSocial | null;
|
|
1568
|
+
/**
|
|
1569
|
+
* Array of {@link MISpaceProperties | MVF Space} ids for this location
|
|
1570
|
+
*/
|
|
1571
|
+
spaces?: {
|
|
1572
|
+
id: string;
|
|
1573
|
+
map: string;
|
|
1574
|
+
}[] | null;
|
|
1575
|
+
states?: {
|
|
1576
|
+
type: string;
|
|
1577
|
+
start?: string;
|
|
1578
|
+
end?: string;
|
|
1579
|
+
}[] | null;
|
|
1580
|
+
type: string;
|
|
1581
|
+
};
|
|
1582
|
+
export type MVFv1ObstructionCollection = FeatureCollection<Polygon, MVFv1ObstructionProperties>;
|
|
1583
|
+
export type MVFv1SpaceCollection = FeatureCollection<Polygon, MVFv1SpaceProperties>;
|
|
1584
|
+
export type MVFv1ConnectionCollection = FeatureCollection<Point, MVFv1ConnectionProperties>;
|
|
1585
|
+
export type MVFv1NodeCollection = FeatureCollection<Point, MVFv1NodeProperties>;
|
|
1586
|
+
export type MVFv1LevelCollection = FeatureCollection<Polygon | MultiPolygon, MVFv1LevelProperties>;
|
|
1587
|
+
export type MVFv1ManifestCollection = FeatureCollection<Point, MVFv1ManifestProperties>;
|
|
1588
|
+
export type MVFv1BuildingCollection = FeatureCollection<Polygon, MVFv1BuildingProperties>;
|
|
1589
|
+
export type MVFv1CategoryCollection = FeatureCollection<null, MVFv1CategoryProperties>;
|
|
1590
|
+
export type MVFv1LocationCollection = FeatureCollection<null, MVFv1LocationProperties>;
|
|
1591
|
+
export type ParsedMVFv1 = {
|
|
1592
|
+
/**
|
|
1593
|
+
* @propertyNames { "pattern": "^m_[0-9a-z]{16}$" }
|
|
1594
|
+
*/
|
|
1595
|
+
space: {
|
|
1596
|
+
[mapId: MapId]: MVFv1SpaceCollection | undefined;
|
|
1597
|
+
};
|
|
1598
|
+
/**
|
|
1599
|
+
* @propertyNames { "pattern": "^m_[0-9a-z]{16}$" }
|
|
1600
|
+
*/
|
|
1601
|
+
obstruction: {
|
|
1602
|
+
[mapId: MapId]: MVFv1ObstructionCollection | undefined;
|
|
1603
|
+
};
|
|
1604
|
+
/**
|
|
1605
|
+
* @propertyNames { "pattern": "^m_[0-9a-z]{16}$" }
|
|
1606
|
+
*/
|
|
1607
|
+
level: {
|
|
1608
|
+
[mapId: MapId]: MVFv1LevelCollection | undefined;
|
|
1609
|
+
};
|
|
1610
|
+
/**
|
|
1611
|
+
* @propertyNames { "pattern": "^m_[0-9a-z]{16}$" }
|
|
1612
|
+
*/
|
|
1613
|
+
node: {
|
|
1614
|
+
[mapId: MapId]: MVFv1NodeCollection | undefined;
|
|
1615
|
+
};
|
|
1616
|
+
/**
|
|
1617
|
+
* @propertyNames { "pattern": "^m_[0-9a-z]{16}$" }
|
|
1618
|
+
*/
|
|
1619
|
+
connection: {
|
|
1620
|
+
[mapId: MapId]: MVFv1ConnectionCollection | undefined;
|
|
1621
|
+
};
|
|
1622
|
+
'manifest.geojson': MVFv1ManifestCollection;
|
|
1623
|
+
'building.geojson': MVFv1BuildingCollection;
|
|
1624
|
+
'category.geojson': MVFv1CategoryCollection;
|
|
1625
|
+
'location.geojson': MVFv1LocationCollection;
|
|
1626
|
+
};
|
|
1627
|
+
export type RawMVFv1 = {
|
|
1628
|
+
'manifest.geojson': Uint8Array;
|
|
1629
|
+
'building.geojson': Uint8Array;
|
|
1630
|
+
'category.geojson': Uint8Array;
|
|
1631
|
+
'location.geojson': Uint8Array;
|
|
1632
|
+
level: Partial<Record<MapId, Uint8Array>>;
|
|
1633
|
+
node: Partial<Record<MapId, Uint8Array>>;
|
|
1634
|
+
space: Partial<Record<MapId, Uint8Array>>;
|
|
1635
|
+
obstruction: Partial<Record<MapId, Uint8Array>>;
|
|
1636
|
+
connection: Partial<Record<MapId, Uint8Array>>;
|
|
1637
|
+
};
|
|
1638
|
+
export {};
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/pub-sub.typed' {
|
|
1642
|
+
export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD> {
|
|
1643
|
+
/**
|
|
1644
|
+
* @private
|
|
1645
|
+
*/
|
|
1646
|
+
_subscribers: any;
|
|
1647
|
+
/**
|
|
1648
|
+
* @private
|
|
1649
|
+
*/
|
|
1650
|
+
publish<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, data?: EVENT_PAYLOAD[EVENT_NAME]): void;
|
|
1651
|
+
on<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
|
|
1652
|
+
data: null;
|
|
1653
|
+
} ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
|
|
1654
|
+
off<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME]) => void): void;
|
|
1655
|
+
/**
|
|
1656
|
+
* @private
|
|
1657
|
+
*/
|
|
1658
|
+
destroy(): void;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinNavigatable' {
|
|
1663
|
+
import type { MappedinNode, MappedinPolygon, MappedinLocation } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1664
|
+
import { MappedinDirections, MappedinDestinationSet, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1665
|
+
import { TSimplifyDirectionsOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator';
|
|
1666
|
+
export type TDirectionToOptions = {
|
|
1667
|
+
/**
|
|
1668
|
+
* If true directions will only take accessible routes
|
|
1669
|
+
* @default false
|
|
1670
|
+
*/
|
|
1671
|
+
accessible?: boolean;
|
|
1672
|
+
/**
|
|
1673
|
+
* Include all the vortexes matching the given IDs
|
|
1674
|
+
*/
|
|
1675
|
+
includedVortexIds?: string[];
|
|
1676
|
+
/**
|
|
1677
|
+
* Exclude all the vortexes matching the given IDs
|
|
1678
|
+
*/
|
|
1679
|
+
excludedVortexIds?: string[];
|
|
1680
|
+
/**
|
|
1681
|
+
* @experimental
|
|
1682
|
+
* Apply line-of-sight simplifying to directions. This will attempt to remove unnecessary nodes between turns.
|
|
1683
|
+
*/
|
|
1684
|
+
simplify?: TSimplifyDirectionsOptions;
|
|
1685
|
+
};
|
|
1686
|
+
export abstract class MappedinNavigatable {
|
|
1687
|
+
#private;
|
|
1688
|
+
constructor(mappedin: Mappedin);
|
|
1689
|
+
/**
|
|
1690
|
+
*
|
|
1691
|
+
* Get Directions to a node, polygon, or location
|
|
1692
|
+
*/
|
|
1693
|
+
directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
|
|
1694
|
+
directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
|
|
1695
|
+
/**
|
|
1696
|
+
*
|
|
1697
|
+
* Calculate walking distance in meters between 2 nodes, polygons or locations
|
|
1698
|
+
*/
|
|
1699
|
+
distanceTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): number;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinNode' {
|
|
1704
|
+
import type { MappedinPolygon, MappedinLocation, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1705
|
+
import type { TOpeningHours } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
1706
|
+
import { MappedinNavigatable, MappedinDirections, MappedinDestinationSet, MappedinMap, TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1707
|
+
/**
|
|
1708
|
+
* A {@link MappedinNode} represents a position, anchored to a specific {@link MappedinMap}.
|
|
1709
|
+
*
|
|
1710
|
+
* A Node can have more properties but usually the default is sufficient. The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Nodes. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
1711
|
+
*
|
|
1712
|
+
* @class MappedinNode
|
|
1713
|
+
*/
|
|
1714
|
+
export class MappedinNode extends MappedinNavigatable {
|
|
1715
|
+
#private;
|
|
1716
|
+
/**
|
|
1717
|
+
* Node ID.
|
|
1718
|
+
* @property id {string}
|
|
1719
|
+
*/
|
|
1720
|
+
id: string;
|
|
1721
|
+
/**
|
|
1722
|
+
* X coordinate of Node's position.
|
|
1723
|
+
* @property x {number}
|
|
1724
|
+
*/
|
|
1725
|
+
x: number;
|
|
1726
|
+
/**
|
|
1727
|
+
* Y coordinate of Node's position.
|
|
1728
|
+
* @property y {number}
|
|
1729
|
+
*/
|
|
1730
|
+
y: number;
|
|
1731
|
+
/**
|
|
1732
|
+
* Operation Hours of this node. A Location may have different operation hours per node, for example 2 washrooms
|
|
1733
|
+
*/
|
|
1734
|
+
operationHours?: TOpeningHours[];
|
|
1735
|
+
externalId?: string;
|
|
1736
|
+
constructor(mappedin: Mappedin, data: any);
|
|
1737
|
+
/**
|
|
1738
|
+
* Map Object that this Node is located on.
|
|
1739
|
+
*
|
|
1740
|
+
* @property map {MappedinMap}
|
|
1741
|
+
*/
|
|
1742
|
+
get map(): MappedinMap;
|
|
1743
|
+
/**
|
|
1744
|
+
* Latitude of node. This is expensive, especially if doing it for many/all nodes
|
|
1745
|
+
*/
|
|
1746
|
+
get lat(): number;
|
|
1747
|
+
/**
|
|
1748
|
+
* Longitude of node. This is expensive, especially if doing it for many/all nodes
|
|
1749
|
+
*/
|
|
1750
|
+
get lon(): number;
|
|
1751
|
+
/**
|
|
1752
|
+
* Adjacent Nodes.
|
|
1753
|
+
*
|
|
1754
|
+
* @property paths
|
|
1755
|
+
* @type [MappedinNode]
|
|
1756
|
+
*/
|
|
1757
|
+
get paths(): MappedinNode[];
|
|
1758
|
+
set paths(paths: MappedinNode[]);
|
|
1759
|
+
/**
|
|
1760
|
+
* Locations attached to this Node.
|
|
1761
|
+
*
|
|
1762
|
+
* @property locations
|
|
1763
|
+
* @type [MappedinLocation]
|
|
1764
|
+
*/
|
|
1765
|
+
get locations(): MappedinLocation[];
|
|
1766
|
+
/**
|
|
1767
|
+
* Polygon that this node is part of
|
|
1768
|
+
*/
|
|
1769
|
+
get polygon(): MappedinPolygon;
|
|
1770
|
+
static hydrate(nodes: any, mappedin: Mappedin): MappedinNode[];
|
|
1771
|
+
static fetch(mappedin: Mappedin): Promise<MappedinNode[]>;
|
|
1772
|
+
/**
|
|
1773
|
+
*
|
|
1774
|
+
* Get Directions to a node, polygon, or location
|
|
1775
|
+
*/
|
|
1776
|
+
directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
|
|
1777
|
+
directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
|
|
1778
|
+
/**
|
|
1779
|
+
*
|
|
1780
|
+
* Calculate walking distance in meters between 2 nodes, polygons or locations
|
|
1781
|
+
*/
|
|
1782
|
+
distanceTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): number;
|
|
1783
|
+
toJSON(): any;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinPolygon' {
|
|
1788
|
+
import type { MappedinNode, MappedinLocation, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1789
|
+
import { MappedinNavigatable, MappedinDirections, MappedinDestinationSet, MappedinMap, TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1790
|
+
/**
|
|
1791
|
+
* 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.
|
|
1792
|
+
*
|
|
1793
|
+
* A Polygon can have more properties but usually the default is sufficient. The {@link Mappedin}'things' object is where you would specify what properties you want to download for Polygons. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
1794
|
+
*
|
|
1795
|
+
* @class MappedinPolygon
|
|
1796
|
+
*/
|
|
1797
|
+
export class MappedinPolygon extends MappedinNavigatable {
|
|
1798
|
+
#private;
|
|
1799
|
+
geometry: any;
|
|
1800
|
+
perspectives?: any;
|
|
1801
|
+
image?: {
|
|
1802
|
+
visible: boolean;
|
|
1803
|
+
url: string | Blob;
|
|
1804
|
+
original: string | Blob;
|
|
1805
|
+
useLocalScaling: boolean;
|
|
1806
|
+
viewBox: {
|
|
1807
|
+
width: number;
|
|
1808
|
+
height: number;
|
|
1809
|
+
};
|
|
1810
|
+
scale: {
|
|
1811
|
+
x: number;
|
|
1812
|
+
y: number;
|
|
1813
|
+
};
|
|
1814
|
+
fitToBounds: boolean;
|
|
1815
|
+
position: {
|
|
1816
|
+
x: number;
|
|
1817
|
+
y: number;
|
|
1818
|
+
z: number;
|
|
1819
|
+
};
|
|
1820
|
+
rotation: {
|
|
1821
|
+
x: number;
|
|
1822
|
+
y: number;
|
|
1823
|
+
z: number;
|
|
1824
|
+
};
|
|
1825
|
+
_isAbsolutelyPositioned?: boolean;
|
|
1826
|
+
};
|
|
1827
|
+
holes?: unknown[];
|
|
1828
|
+
textures?: {
|
|
1829
|
+
image: any;
|
|
1830
|
+
name: 'front' | 'side';
|
|
1831
|
+
useFrontFaceImage?: boolean;
|
|
1832
|
+
}[];
|
|
1833
|
+
material: {
|
|
1834
|
+
color: string;
|
|
1835
|
+
opacity?: number;
|
|
1836
|
+
};
|
|
1837
|
+
label?: {
|
|
1838
|
+
visible: boolean;
|
|
1839
|
+
text: string;
|
|
1840
|
+
align: string;
|
|
1841
|
+
position: {
|
|
1842
|
+
x: number;
|
|
1843
|
+
y: number;
|
|
1844
|
+
z: number;
|
|
1845
|
+
};
|
|
1846
|
+
rotation: {
|
|
1847
|
+
x: number;
|
|
1848
|
+
y: number;
|
|
1849
|
+
z: number;
|
|
1850
|
+
};
|
|
1851
|
+
fontFamily: string;
|
|
1852
|
+
fontSize: number;
|
|
1853
|
+
color: string;
|
|
1854
|
+
};
|
|
1855
|
+
/**
|
|
1856
|
+
* Node ID.
|
|
1857
|
+
*
|
|
1858
|
+
* @property id {string}
|
|
1859
|
+
*/
|
|
1860
|
+
id: string;
|
|
1861
|
+
layer?: string;
|
|
1862
|
+
layerId?: string;
|
|
1863
|
+
name?: string;
|
|
1864
|
+
externalId?: string;
|
|
1865
|
+
vertexes?: {
|
|
1866
|
+
x: number;
|
|
1867
|
+
y: number;
|
|
1868
|
+
}[];
|
|
1869
|
+
/**
|
|
1870
|
+
* @internal
|
|
1871
|
+
*
|
|
1872
|
+
* The center coordinate of the polygon used for positioning {@link FloatingLabels} for MVF venues.
|
|
1873
|
+
*/
|
|
1874
|
+
center?: {
|
|
1875
|
+
x: number;
|
|
1876
|
+
y: number;
|
|
1877
|
+
};
|
|
1878
|
+
canvasBounds?: {
|
|
1879
|
+
align: string;
|
|
1880
|
+
maxHeight: number;
|
|
1881
|
+
maxWidth: number;
|
|
1882
|
+
rotation: number;
|
|
1883
|
+
x: number;
|
|
1884
|
+
y: number;
|
|
1885
|
+
};
|
|
1886
|
+
/** Category grouped ranking determined by the {@link MappedinCategory.sortOrder} and {@link rank} for this polygon. */
|
|
1887
|
+
categoryRank?: number;
|
|
1888
|
+
constructor(mappedin: Mappedin, data: any);
|
|
1889
|
+
/**
|
|
1890
|
+
* Map Object that this Polygon is located on.
|
|
1891
|
+
*
|
|
1892
|
+
* @property map {MappedinMap}
|
|
1893
|
+
*/
|
|
1894
|
+
get map(): MappedinMap;
|
|
1895
|
+
/**
|
|
1896
|
+
* Locations attached to the Polygon.
|
|
1897
|
+
*
|
|
1898
|
+
* @property locations {[MappedinLocation]}
|
|
1899
|
+
*/
|
|
1900
|
+
get locations(): MappedinLocation[];
|
|
1901
|
+
/**
|
|
1902
|
+
* Polygon's entrance Nodes.
|
|
1903
|
+
*
|
|
1904
|
+
* @property entrances {[MappedinNode]}
|
|
1905
|
+
*/
|
|
1906
|
+
get entrances(): MappedinNode[];
|
|
1907
|
+
set entrances(entrances: MappedinNode[]);
|
|
1908
|
+
/**
|
|
1909
|
+
* Ranking for this polygon.
|
|
1910
|
+
*/
|
|
1911
|
+
get rank(): {
|
|
1912
|
+
score: number;
|
|
1913
|
+
node: string;
|
|
1914
|
+
} | null;
|
|
1915
|
+
static hydrate(polygons: any, mappedin: Mappedin): MappedinPolygon[];
|
|
1916
|
+
static fetch(mappedin: Mappedin): Promise<MappedinPolygon[]>;
|
|
1917
|
+
/**
|
|
1918
|
+
*
|
|
1919
|
+
* Get Directions to a node, polygon, or location
|
|
1920
|
+
*/
|
|
1921
|
+
directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
|
|
1922
|
+
directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
|
|
1923
|
+
/**
|
|
1924
|
+
*
|
|
1925
|
+
* Calculate walking distance in meters between 2 nodes, polygons or locations
|
|
1926
|
+
*/
|
|
1927
|
+
distanceTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): number;
|
|
1928
|
+
toJSON(): any;
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinCategory' {
|
|
1933
|
+
/**
|
|
1934
|
+
* Collection of all Categories within the Venue.
|
|
1935
|
+
*
|
|
1936
|
+
* @property categories
|
|
1937
|
+
* @type [MappedinCategory]
|
|
1938
|
+
*/
|
|
1939
|
+
import type { MappedinLocation, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1940
|
+
import type { TPicture } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
1941
|
+
/**
|
|
1942
|
+
* A {@link MappedinCategory} is a collection of similar Locations.
|
|
1943
|
+
*
|
|
1944
|
+
* A Category can have more properties such as 'name', or 'parents' (for hierarchical categories) as well.
|
|
1945
|
+
* For example, you may have a Fashion category, which has a Men's Fashion and Women's Fashion category. A Men's clothing store would belong to the Men’s Fashion category, but not necessarily be present in the Fashion category's list of Locations.
|
|
1946
|
+
*
|
|
1947
|
+
* The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Categories. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
1948
|
+
*
|
|
1949
|
+
* See below for an example a 'things' object with available Category properties specified:
|
|
1950
|
+
*
|
|
1951
|
+
* things: {
|
|
1952
|
+
* venue: [],
|
|
1953
|
+
* locations: [],
|
|
1954
|
+
* categories: ['venue', 'name', 'language', 'externalId', 'parents'],
|
|
1955
|
+
* maps: []
|
|
1956
|
+
* }
|
|
1957
|
+
*
|
|
1958
|
+
* @class MappedinCategory
|
|
1959
|
+
*/
|
|
1960
|
+
export class MappedinCategory {
|
|
1961
|
+
#private;
|
|
1962
|
+
name?: string | undefined;
|
|
1963
|
+
externalId?: string | undefined;
|
|
1964
|
+
parents?: string[] | undefined;
|
|
1965
|
+
id?: string | undefined;
|
|
1966
|
+
icon?: TPicture | undefined;
|
|
1967
|
+
iconFromDefaultList?: string | undefined;
|
|
1968
|
+
/** Category sort priority. */
|
|
1969
|
+
sortOrder?: number | undefined;
|
|
1970
|
+
constructor(mappedin: Mappedin, data: any);
|
|
1971
|
+
/**
|
|
1972
|
+
* Locations in this Category.
|
|
1973
|
+
*
|
|
1974
|
+
* @property locations
|
|
1975
|
+
* @type [MappedinLocation]
|
|
1976
|
+
*/
|
|
1977
|
+
get locations(): MappedinLocation[];
|
|
1978
|
+
/**
|
|
1979
|
+
* Children of this Category.
|
|
1980
|
+
*
|
|
1981
|
+
* @property children
|
|
1982
|
+
* @type [MappedinCategory]
|
|
1983
|
+
*/
|
|
1984
|
+
get children(): MappedinCategory[];
|
|
1985
|
+
static hydrate(categories: any, mappedin: Mappedin): MappedinCategory[];
|
|
1986
|
+
static fetch(mappedin: Mappedin): Promise<MappedinCategory[]>;
|
|
1987
|
+
toJSON(): any;
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinDestinationSet' {
|
|
1992
|
+
import type { MappedinNode, MappedinPolygon, MappedinLocation } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
1993
|
+
export class MappedinDestinationSet {
|
|
1994
|
+
destinations: (MappedinLocation | MappedinNode | MappedinPolygon)[];
|
|
1995
|
+
constructor(destinations: (MappedinLocation | MappedinNode | MappedinPolygon)[]);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinVortex' {
|
|
2000
|
+
import type { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2001
|
+
/**
|
|
2002
|
+
* A {@link MappedinVortex} is a special entity that represents a link between two or more {@link MappedinMap}s at a given {@link MappedinVenue}. It is typically something like an elevator or stairs. These are also known as Connections in some parts of the system.
|
|
2003
|
+
*
|
|
2004
|
+
* They can be marked (wheelchair) Accessible or not for pathfinding purposes. If you ask for Accessible directions, paths that include non-accessible Vortexes like Stairs will not be used.
|
|
2005
|
+
*
|
|
2006
|
+
* @class MappedinVortex
|
|
2007
|
+
*/
|
|
2008
|
+
export class MappedinVortex {
|
|
2009
|
+
#private;
|
|
2010
|
+
/**
|
|
2011
|
+
* Vortex ID.
|
|
2012
|
+
*
|
|
2013
|
+
* @property id {string}
|
|
2014
|
+
*/
|
|
2015
|
+
id: string;
|
|
2016
|
+
accessible?: boolean;
|
|
2017
|
+
name?: string;
|
|
2018
|
+
type?: string;
|
|
2019
|
+
weight?: number;
|
|
2020
|
+
multiplier?: number;
|
|
2021
|
+
nodes?: string[];
|
|
2022
|
+
constructor(data: any);
|
|
2023
|
+
static hydrate(vortexes: any): MappedinVortex[];
|
|
2024
|
+
static fetch(mappedin: Mappedin): Promise<MappedinVortex[]>;
|
|
2025
|
+
toJSON(): any;
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinVenue' {
|
|
2030
|
+
import type { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2031
|
+
import type { TLogo, TOpeningHours } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
2032
|
+
/**
|
|
2033
|
+
* A {@link MappedinVenue} is a specific place (like a mall) with one or more Maps (typically representing different floors) and Locations (stores, washrooms, elevators, etc).
|
|
2034
|
+
*
|
|
2035
|
+
* A Venue can have more properties such as 'name' and 'slug'. The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Venues. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
2036
|
+
*
|
|
2037
|
+
* See below for an example a 'things' object with available Venue properties specified:
|
|
2038
|
+
*
|
|
2039
|
+
* things: {
|
|
2040
|
+
* venue: ['slug', 'name', 'language', 'address', 'city', 'state', 'postal', 'telephone', 'latitude', 'longitude', 'website', 'operationHours'],
|
|
2041
|
+
* locations: [],
|
|
2042
|
+
* categories: [],
|
|
2043
|
+
* maps: []
|
|
2044
|
+
* }
|
|
2045
|
+
*
|
|
2046
|
+
*
|
|
2047
|
+
* @class MappedinVenue
|
|
2048
|
+
*/
|
|
2049
|
+
export class MappedinVenue {
|
|
2050
|
+
#private;
|
|
2051
|
+
defaultMap: string;
|
|
2052
|
+
address: string;
|
|
2053
|
+
city: string;
|
|
2054
|
+
countrycode: string;
|
|
2055
|
+
externalId: string;
|
|
2056
|
+
id: string;
|
|
2057
|
+
latitude?: number;
|
|
2058
|
+
logo?: TLogo;
|
|
2059
|
+
longitude?: number;
|
|
2060
|
+
name: string;
|
|
2061
|
+
operationHours?: TOpeningHours[];
|
|
2062
|
+
postal: string;
|
|
2063
|
+
slug: string;
|
|
2064
|
+
state: string;
|
|
2065
|
+
telephone: string;
|
|
2066
|
+
tzid: string;
|
|
2067
|
+
tzidOverride: string;
|
|
2068
|
+
utcOffset: string;
|
|
2069
|
+
website: string;
|
|
2070
|
+
secureContentStorage: boolean;
|
|
2071
|
+
defaultLanguage: {
|
|
2072
|
+
code: string;
|
|
2073
|
+
name: string;
|
|
2074
|
+
};
|
|
2075
|
+
languages: {
|
|
2076
|
+
name: string;
|
|
2077
|
+
code: string;
|
|
2078
|
+
}[];
|
|
2079
|
+
topLocations?: string[];
|
|
2080
|
+
constructor(mappedin: Mappedin, data: any);
|
|
2081
|
+
get metadata(): any;
|
|
2082
|
+
set metadata(value: any);
|
|
2083
|
+
static hydrate(data: any, mappedin: Mappedin): MappedinVenue;
|
|
2084
|
+
static fetch(mappedin: Mappedin): Promise<MappedinVenue>;
|
|
2085
|
+
get isMultiBuilding(): any;
|
|
2086
|
+
toJSON(): any;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinTheme' {
|
|
2091
|
+
import type { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2092
|
+
export class MappedinTheme {
|
|
2093
|
+
#private;
|
|
2094
|
+
/**
|
|
2095
|
+
* Theme ID.
|
|
2096
|
+
*
|
|
2097
|
+
* @property id {string}
|
|
2098
|
+
*/
|
|
2099
|
+
id: string;
|
|
2100
|
+
constructor(data: any);
|
|
2101
|
+
static hydrate(themes: any): MappedinTheme[];
|
|
2102
|
+
static fetch(mappedin: Mappedin): Promise<MappedinTheme[]>;
|
|
2103
|
+
toJSON(): any;
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinRankings' {
|
|
2108
|
+
import type { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2109
|
+
import type { TPolygonRanking } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
2110
|
+
/**
|
|
2111
|
+
* A {@link MappedinRankings} object is something that contains all the rankings for all the {@link MappedinPolygon}s in the venue. It has a `polygons` array in which each item is linked to zero or more {@link MappedinPolygon}s.
|
|
2112
|
+
*
|
|
2113
|
+
* Rankings shows what the priority of displaying each polygon is.
|
|
2114
|
+
*
|
|
2115
|
+
* A specific polygon's ranking can have the properties `polygonId`, `entranceNodeId`, `score`.
|
|
2116
|
+
*
|
|
2117
|
+
* The {@link Mappedin} `things` object is where you would specify what type of ranking data you want to download for the venue. Only specify what you will actually use, to minimize transfer time.
|
|
2118
|
+
*
|
|
2119
|
+
* See below for an example a `things` object with the available ranking properties specified:
|
|
2120
|
+
*
|
|
2121
|
+
* things: {
|
|
2122
|
+
* venue: [],
|
|
2123
|
+
* locations: [],
|
|
2124
|
+
* categories: [],
|
|
2125
|
+
* maps: [],
|
|
2126
|
+
* rankings: ['polygons'],
|
|
2127
|
+
* }
|
|
2128
|
+
*
|
|
2129
|
+
* @class MappedinRankings
|
|
2130
|
+
*/
|
|
2131
|
+
export class MappedinRankings {
|
|
2132
|
+
#private;
|
|
2133
|
+
constructor(data: any);
|
|
2134
|
+
polygons: TPolygonRanking[];
|
|
2135
|
+
static hydrate(rankings: any): MappedinRankings;
|
|
2136
|
+
static fetch(mappedin: Mappedin): Promise<MappedinRankings | null>;
|
|
2137
|
+
toJSON(): any;
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinLocationRankings' {
|
|
2142
|
+
import type { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2143
|
+
import type { TLocation } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
2144
|
+
/** One of these contains all the venue's rankings. * */
|
|
2145
|
+
export class MappedinLocationRankings {
|
|
2146
|
+
#private;
|
|
2147
|
+
constructor(data: any);
|
|
2148
|
+
locations: TLocation[];
|
|
2149
|
+
static hydrate(locationRankings: any): MappedinLocationRankings;
|
|
2150
|
+
static fetch(mappedin: Mappedin): Promise<MappedinLocationRankings>;
|
|
2151
|
+
toJSON(): any;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinEvent' {
|
|
2156
|
+
import type { TImage } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
2157
|
+
import type { MappedinLocation, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2158
|
+
/**
|
|
2159
|
+
* An event such as a promotion attached to a location in a venue for a period of time. Events can be created in the Mappedin CMS.
|
|
2160
|
+
*
|
|
2161
|
+
* @class MappedinEvent
|
|
2162
|
+
*/
|
|
2163
|
+
export class MappedinEvent {
|
|
2164
|
+
#private;
|
|
2165
|
+
/**
|
|
2166
|
+
* Unique id string of the event.
|
|
2167
|
+
*/
|
|
2168
|
+
id: string;
|
|
2169
|
+
type: string;
|
|
2170
|
+
/**
|
|
2171
|
+
* Event name
|
|
2172
|
+
*/
|
|
2173
|
+
name: string;
|
|
2174
|
+
/**
|
|
2175
|
+
* Optional, longer description of the event.
|
|
2176
|
+
*/
|
|
2177
|
+
description?: string | undefined;
|
|
2178
|
+
/**
|
|
2179
|
+
* Optional image to be used for displaying the event.
|
|
2180
|
+
*/
|
|
2181
|
+
image?: TImage | undefined;
|
|
2182
|
+
/**
|
|
2183
|
+
* Start timestamp of the event. Javascript date in milliseconds since 1 January 1970 UTC.
|
|
2184
|
+
*/
|
|
2185
|
+
startDate?: number | undefined;
|
|
2186
|
+
/**
|
|
2187
|
+
* Start timestamp of the event. Javascript date in milliseconds since 1 January 1970 UTC.
|
|
2188
|
+
*/
|
|
2189
|
+
endDate?: number | undefined;
|
|
2190
|
+
/**
|
|
2191
|
+
* Timestamp when the event should be displayed. Javascript date in milliseconds since 1 January 1970 UTC.
|
|
2192
|
+
*/
|
|
2193
|
+
showDate?: number | undefined;
|
|
2194
|
+
/**
|
|
2195
|
+
* @internal
|
|
2196
|
+
*/
|
|
2197
|
+
constructor(mappedin: Mappedin, data: any);
|
|
2198
|
+
/**
|
|
2199
|
+
* Location this event is occuring at.
|
|
2200
|
+
*/
|
|
2201
|
+
location(): MappedinLocation | undefined;
|
|
2202
|
+
/**
|
|
2203
|
+
* @internal
|
|
2204
|
+
*/
|
|
2205
|
+
static hydrate(events: any, mappedin: Mappedin): MappedinEvent[];
|
|
2206
|
+
/**
|
|
2207
|
+
* @internal
|
|
2208
|
+
*/
|
|
2209
|
+
static fetch(mappedin: Mappedin): Promise<MappedinEvent[]>;
|
|
2210
|
+
toJSON(): any;
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinLocationState' {
|
|
2215
|
+
import type { Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2216
|
+
/**
|
|
2217
|
+
* A location state, that can belong to any number of {@link MappedinLocation}s.
|
|
2218
|
+
* @class MappedinLocationState
|
|
2219
|
+
*/
|
|
2220
|
+
export class MappedinLocationState {
|
|
2221
|
+
#private;
|
|
2222
|
+
/**
|
|
2223
|
+
* @internal
|
|
2224
|
+
*/
|
|
2225
|
+
constructor(data: any);
|
|
2226
|
+
/**
|
|
2227
|
+
* @internal
|
|
2228
|
+
*/
|
|
2229
|
+
static hydrate(locationStates: any): MappedinLocationState[];
|
|
2230
|
+
id: string;
|
|
2231
|
+
name: string;
|
|
2232
|
+
value: string;
|
|
2233
|
+
/**
|
|
2234
|
+
* @internal
|
|
2235
|
+
*/
|
|
2236
|
+
static fetch(mappedin: Mappedin): Promise<MappedinLocationState[]>;
|
|
2237
|
+
toJSON(): any;
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinMap' {
|
|
2242
|
+
import type { MappedinMapGroup, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2243
|
+
import type { TGeoReference } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.API.types';
|
|
2244
|
+
import { MappedinPolygon, MappedinLocation, MappedinCoordinate } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2245
|
+
/**
|
|
2246
|
+
* A {@link MappedinMap} belonging to a specific {@link MappedinVenue}. Typically represents a certain floor. Give this to a {@link MapView} to display to the user.
|
|
2247
|
+
*
|
|
2248
|
+
* A Map can have more properties such as 'elevation', 'name' (e.g. Level 1), and 'shortName' (e.g. L1). The elevation property can be used to determine the order of the floors (first, second, etc). Elevation is 0 based, going up and down in integers representing the number of floors above or below 0, which is ground level.
|
|
2249
|
+
*
|
|
2250
|
+
* The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Maps. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
2251
|
+
*
|
|
2252
|
+
* See below for an example a 'things' object with available Map properties specified:
|
|
2253
|
+
*
|
|
2254
|
+
* things: {
|
|
2255
|
+
* venue: [],
|
|
2256
|
+
* locations: [],
|
|
2257
|
+
* categories: [],
|
|
2258
|
+
* maps: ['name', 'elevation', 'shortName']
|
|
2259
|
+
* }
|
|
2260
|
+
*
|
|
2261
|
+
* @class MappedinMap
|
|
2262
|
+
*/
|
|
2263
|
+
export class MappedinMap {
|
|
2264
|
+
#private;
|
|
2265
|
+
id: string;
|
|
2266
|
+
group: string;
|
|
2267
|
+
name: string;
|
|
2268
|
+
shortName: string;
|
|
2269
|
+
elevation: number;
|
|
2270
|
+
subtitle?: string;
|
|
2271
|
+
scale?: number;
|
|
2272
|
+
layers: {
|
|
2273
|
+
visible: boolean;
|
|
2274
|
+
name: string;
|
|
2275
|
+
id: string;
|
|
2276
|
+
}[];
|
|
2277
|
+
x_scale?: number;
|
|
2278
|
+
perspectiveId?: string;
|
|
2279
|
+
scene: any;
|
|
2280
|
+
width: number;
|
|
2281
|
+
height: number;
|
|
2282
|
+
georeference: TGeoReference[];
|
|
2283
|
+
constructor(mappedin: Mappedin, data: any);
|
|
2284
|
+
_scale: number;
|
|
2285
|
+
/**
|
|
2286
|
+
* Polygons on this Map.
|
|
2287
|
+
*
|
|
2288
|
+
* @property polygons {[MappedinPolygon]}
|
|
2289
|
+
*/
|
|
2290
|
+
get polygons(): MappedinPolygon[] | undefined;
|
|
2291
|
+
/**
|
|
2292
|
+
* Locations on this map
|
|
2293
|
+
*/
|
|
2294
|
+
get locations(): MappedinLocation[];
|
|
2295
|
+
get nodes(): import("./MappedinNode").MappedinNode[];
|
|
2296
|
+
/**
|
|
2297
|
+
* Map Group this map belongs to.
|
|
2298
|
+
*
|
|
2299
|
+
* @property mapGroup {MappedinMapGroup}
|
|
2300
|
+
*/
|
|
2301
|
+
get mapGroup(): MappedinMapGroup | null;
|
|
2302
|
+
/**
|
|
2303
|
+
* Create coordinate using mappedin units
|
|
2304
|
+
* @internal
|
|
2305
|
+
*
|
|
2306
|
+
* @param x x of coordinate
|
|
2307
|
+
* @param y y of coordinate
|
|
2308
|
+
*/
|
|
2309
|
+
createCoordinateByXY(x: number, y: number): MappedinCoordinate;
|
|
2310
|
+
/**
|
|
2311
|
+
* Create coordinate using lat/lon
|
|
2312
|
+
*
|
|
2313
|
+
* @param lat latitude of coordinate
|
|
2314
|
+
* @param lon longitude of coordinate
|
|
2315
|
+
*/
|
|
2316
|
+
createCoordinate(lat: number, lon: number): MappedinCoordinate;
|
|
2317
|
+
/**
|
|
2318
|
+
*
|
|
2319
|
+
* @returns map rotation in radians from north
|
|
2320
|
+
*/
|
|
2321
|
+
getNorth(): any;
|
|
2322
|
+
static hydrate(maps: any, mappedin: Mappedin): MappedinMap[];
|
|
2323
|
+
static fetch(mappedin: Mappedin): Promise<MappedinMap[]>;
|
|
2324
|
+
get center(): any;
|
|
2325
|
+
toJSON(): any;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/MappedinMapGroup' {
|
|
2330
|
+
import type { MappedinMap, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2331
|
+
/**
|
|
2332
|
+
* A {@link MappedinMapGroup} is a collection of maps, usually representing the different floors of a single building. All Maps will be in a MapGroup, but if your Venue is only a single building (like a mall) you can likely ignore MapGroups entirely.
|
|
2333
|
+
*
|
|
2334
|
+
* @class MappedinMapGroup
|
|
2335
|
+
*/
|
|
2336
|
+
export class MappedinMapGroup {
|
|
2337
|
+
#private;
|
|
2338
|
+
id: string;
|
|
2339
|
+
name: string;
|
|
2340
|
+
constructor(mappedin: Mappedin, data: any);
|
|
2341
|
+
/**
|
|
2342
|
+
* Maps within this MapGroup.
|
|
2343
|
+
*
|
|
2344
|
+
* @property maps {[MappedinMap]}
|
|
2345
|
+
*/
|
|
2346
|
+
get maps(): MappedinMap[];
|
|
2347
|
+
static hydrate(mapGroups: any, mappedin: Mappedin): MappedinMapGroup[];
|
|
2348
|
+
static fetch(mappedin: Mappedin): Promise<MappedinMapGroup[]>;
|
|
2349
|
+
toJSON(): any;
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/utils' {
|
|
2354
|
+
import type { TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.types';
|
|
2355
|
+
import type { MappedinMap } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2356
|
+
import { Mappedin, MappedinNavigatable, MappedinNode, MappedinPolygon, MappedinLocation, MappedinCoordinate } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2357
|
+
export function isGatewayKey(key: string): boolean;
|
|
2358
|
+
export function stringifyQuery(query: any, gateway?: boolean): string;
|
|
2359
|
+
export function buildUrl(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean): string;
|
|
2360
|
+
/**
|
|
2361
|
+
* Make a network request to the Mappedin API to fetch an array of objects.
|
|
2362
|
+
* @param options options from getVenue- baseUrl and supplementaryUrl are used
|
|
2363
|
+
* @param pathname the type of data to request (like polygons or nodes)
|
|
2364
|
+
* @param query extra parameters to pass in the request
|
|
2365
|
+
* @param supplementary whether to use the supplementaryUrl when sending the request
|
|
2366
|
+
* @returns the result json
|
|
2367
|
+
*/
|
|
2368
|
+
export function getArray(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean): Promise<any>;
|
|
2369
|
+
/**
|
|
2370
|
+
* Make a network request to the Mappedin API to fetch an object.
|
|
2371
|
+
* @param options options from getVenue- baseUrl and supplementaryUrl are used
|
|
2372
|
+
* @param pathname the type of data to request (like polygons or nodes)
|
|
2373
|
+
* @param query extra parameters to pass in the request
|
|
2374
|
+
* @param supplementary whether to use the supplementaryUrl when sending the request
|
|
2375
|
+
* @param isExpectingArray whether the endpoint returns an array
|
|
2376
|
+
* @returns the result json
|
|
2377
|
+
*/
|
|
2378
|
+
export function getObject(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean, isExpectingArray?: boolean): Promise<any>;
|
|
2379
|
+
/**
|
|
2380
|
+
* Prepares the request and URL fields to pass into generateAPIRequest
|
|
2381
|
+
* @param options options from getVenue- baseUrl and supplementaryUrl are used
|
|
2382
|
+
* @param url string describing the url corresponding to the client's request
|
|
2383
|
+
* @param supplementary whether to use the supplementaryUrl when sending the request
|
|
2384
|
+
*/
|
|
2385
|
+
export function constructParamsForRequest(options: TGetVenueOptionsInternal & TGetVenueOptions, url: string, supplementary?: boolean): {
|
|
2386
|
+
req: {
|
|
2387
|
+
method: string;
|
|
2388
|
+
headers: any;
|
|
2389
|
+
};
|
|
2390
|
+
url: string;
|
|
2391
|
+
};
|
|
2392
|
+
export function generateAPIRequest(options: TGetVenueOptionsInternal & TGetVenueOptions, url: string, supplementary?: boolean): Promise<any>;
|
|
2393
|
+
export function addToSet(array: any, value: any): void;
|
|
2394
|
+
export function getDistanceBetweenLatLon([lat1, lon1]: [number, number], [lat2, lon2]: [number, number]): any;
|
|
2395
|
+
export function getMapScale(map: MappedinMap): any;
|
|
2396
|
+
export function getNodesForNavigatable(obj: MappedinNavigatable): string[];
|
|
2397
|
+
export function populateBundledImagesAsBlobs(data: any): Promise<any>;
|
|
2398
|
+
export function getNearestNode(nodes: MappedinNode[], nodeOrCoordinate: MappedinNode | MappedinCoordinate): MappedinNode;
|
|
2399
|
+
export function debounce(func: any, wait: any, immediate?: any): (...args: any[]) => void;
|
|
2400
|
+
/**
|
|
2401
|
+
* Normalize the sortOrder value between 1 and 2, excluding 1 and 2.
|
|
2402
|
+
* Smaller sortOrder numbers result in higher priority (closer to 2) while higher numbers result in lower (closer to 1).
|
|
2403
|
+
* Provide an additional polygonRank for more granular ranking.
|
|
2404
|
+
* @param sortOrder the value of the category's sortOrder
|
|
2405
|
+
* @param min minimum sortOrder
|
|
2406
|
+
* @param max maximum sortOrder
|
|
2407
|
+
* @param polygonRank optional polygonRank between 0 and 1
|
|
2408
|
+
* @returns the normalized value
|
|
2409
|
+
*/
|
|
2410
|
+
export function normalizeCategoryRank(sortOrder: number, min: number, max: number, polygonRank?: number): number;
|
|
2411
|
+
export function getDeviceID(): string;
|
|
2412
|
+
export function getSessionID(): string;
|
|
2413
|
+
/**
|
|
2414
|
+
* Finds the main Location associated with a Polygon. This means a Location
|
|
2415
|
+
* attached to the Polygon that has no parents, or, if there are none of those,
|
|
2416
|
+
* a Location nearest the top of some hierarchy that does have the Polygon attached.
|
|
2417
|
+
*
|
|
2418
|
+
* This means if there are multiple hierarchies of Locations attached to the Polygon,
|
|
2419
|
+
* the one that gets returned is not guaranteed to be what you want.
|
|
2420
|
+
*
|
|
2421
|
+
* @method getPrimaryLocationForPolygon
|
|
2422
|
+
* @param polygon {MappedinPolygon} The Polygon you want the primary Location of.
|
|
2423
|
+
* @return {MappedinLocation}
|
|
2424
|
+
*/
|
|
2425
|
+
export const getPrimaryLocationForPolygon: (polygon: MappedinPolygon | string | undefined, venue: Mappedin) => MappedinLocation | null;
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
declare module '@mappedin/mappedin-js/lib/esm/get-venue/Mappedin.cache' {
|
|
2429
|
+
import { MappedinNode, MappedinPolygon, MappedinLocation, MappedinCategory, MappedinVortex, MappedinRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinCoordinate, MappedinMapGroup, Mappedin } from '@mappedin/mappedin-js/lib/esm/get-venue/internal';
|
|
2430
|
+
class MappedinCache {
|
|
2431
|
+
#private;
|
|
2432
|
+
constructor(mappedin: Mappedin);
|
|
2433
|
+
/**
|
|
2434
|
+
* Caches for getCollectionById function in `Mappedin.ts`
|
|
2435
|
+
* `!` is fine here, we're telling typescript that these
|
|
2436
|
+
* fields will be initialized at a later time (aka lazy)
|
|
2437
|
+
*/
|
|
2438
|
+
categories: {
|
|
2439
|
+
[id: string]: MappedinCategory;
|
|
2440
|
+
};
|
|
2441
|
+
locations: {
|
|
2442
|
+
[id: string]: MappedinLocation;
|
|
2443
|
+
};
|
|
2444
|
+
vortexes: {
|
|
2445
|
+
[id: string]: MappedinVortex;
|
|
2446
|
+
};
|
|
2447
|
+
maps: {
|
|
2448
|
+
[id: string]: MappedinMap;
|
|
2449
|
+
};
|
|
2450
|
+
nodes: {
|
|
2451
|
+
[id: string]: MappedinNode;
|
|
2452
|
+
};
|
|
2453
|
+
polygons: {
|
|
2454
|
+
[id: string]: MappedinPolygon;
|
|
2455
|
+
};
|
|
2456
|
+
events: {
|
|
2457
|
+
[id: string]: MappedinEvent;
|
|
2458
|
+
};
|
|
2459
|
+
mapGroups: {
|
|
2460
|
+
[id: string]: MappedinMapGroup;
|
|
2461
|
+
};
|
|
2462
|
+
locationStates: {
|
|
2463
|
+
[id: string]: MappedinLocationState;
|
|
2464
|
+
};
|
|
2465
|
+
rankings: {
|
|
2466
|
+
[id: string]: MappedinRankings;
|
|
2467
|
+
};
|
|
2468
|
+
languages: {
|
|
2469
|
+
[id: string]: string;
|
|
2470
|
+
};
|
|
2471
|
+
get polygonsByMapId(): Map<string, MappedinPolygon[]>;
|
|
2472
|
+
get nodesByMapId(): Map<string, MappedinNode[]>;
|
|
2473
|
+
findNearestNodeOnMap(mapId: string, coordinate: MappedinCoordinate): MappedinNode;
|
|
2474
|
+
get locationsByMapId(): Map<string, MappedinLocation[]>;
|
|
2475
|
+
static instances: Map<Mappedin, MappedinCache>;
|
|
2476
|
+
static create(mappedin: Mappedin): MappedinCache;
|
|
2477
|
+
static clear(): void;
|
|
2478
|
+
static clearInstance(mappedin: Mappedin): void;
|
|
2479
|
+
}
|
|
2480
|
+
export default MappedinCache;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
import ILocation from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/ILocation';
|
|
2484
|
+
import IMap from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/IMap';
|
|
2485
|
+
import INode from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/INode';
|
|
2486
|
+
export declare enum ACTION_TYPE {
|
|
2487
|
+
DEPARTURE = "Departure",
|
|
2488
|
+
TAKEVORTEX = "TakeVortex",
|
|
2489
|
+
EXITVORTEX = "ExitVortex",
|
|
2490
|
+
TURN = "Turn",
|
|
2491
|
+
ARRIVAL = "Arrival"
|
|
2492
|
+
}
|
|
2493
|
+
export declare enum BEARING_TYPE {
|
|
2494
|
+
STRAIGHT = "Straight",
|
|
2495
|
+
RIGHT = "Right",
|
|
2496
|
+
SLIGHTRIGHT = "SlightRight",
|
|
2497
|
+
LEFT = "Left",
|
|
2498
|
+
SLIGHTLEFT = "SlightLeft"
|
|
2499
|
+
}
|
|
2500
|
+
export declare enum VORTEX_DIRECTION_TYPE {
|
|
2501
|
+
UP = "up",
|
|
2502
|
+
DOWN = "down",
|
|
2503
|
+
NONE = "none"
|
|
2504
|
+
}
|
|
2505
|
+
interface IActionDeparture {
|
|
2506
|
+
type: ACTION_TYPE.DEPARTURE;
|
|
2507
|
+
}
|
|
2508
|
+
interface IActionArrival {
|
|
2509
|
+
type: ACTION_TYPE.ARRIVAL;
|
|
2510
|
+
}
|
|
2511
|
+
interface IActionTakeVortex {
|
|
2512
|
+
type: ACTION_TYPE.TAKEVORTEX;
|
|
2513
|
+
toMap: IMap;
|
|
2514
|
+
fromMap: IMap;
|
|
2515
|
+
direction: VORTEX_DIRECTION_TYPE;
|
|
2516
|
+
}
|
|
2517
|
+
interface IActionExitVortex {
|
|
2518
|
+
type: ACTION_TYPE.EXITVORTEX;
|
|
2519
|
+
toMap: IMap;
|
|
2520
|
+
fromMap: IMap;
|
|
2521
|
+
}
|
|
2522
|
+
interface IActionTurn {
|
|
2523
|
+
type: ACTION_TYPE.TURN;
|
|
2524
|
+
bearing: BEARING_TYPE;
|
|
2525
|
+
referencePosition?: string;
|
|
2526
|
+
}
|
|
2527
|
+
export type IAction = IActionArrival | IActionDeparture | IActionTurn | IActionTakeVortex | IActionExitVortex;
|
|
2528
|
+
declare class Directive {
|
|
2529
|
+
node?: INode;
|
|
2530
|
+
instruction: string;
|
|
2531
|
+
action?: IAction;
|
|
2532
|
+
atLocation?: ILocation;
|
|
2533
|
+
type?: BEARING_TYPE;
|
|
2534
|
+
distance: number;
|
|
2535
|
+
constructor({ origin, action, distance, atLocation, instruction, }: {
|
|
2536
|
+
origin?: INode;
|
|
2537
|
+
action?: IAction;
|
|
2538
|
+
distance?: number;
|
|
2539
|
+
atLocation?: ILocation;
|
|
2540
|
+
instruction?: string;
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
export default Directive;
|
|
2544
|
+
|
|
2545
|
+
import Edge from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Edge';
|
|
2546
|
+
import IMap from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/IMap';
|
|
2547
|
+
import INode from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/INode';
|
|
2548
|
+
import IVortex from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/IVortex';
|
|
2549
|
+
export declare function getMapScale(map: IMap): number;
|
|
2550
|
+
export declare function getAngle(origin: INode, destination: INode): number;
|
|
2551
|
+
declare class NavigationGraph {
|
|
2552
|
+
edges: {
|
|
2553
|
+
[propName: string]: Edge[];
|
|
2554
|
+
};
|
|
2555
|
+
nodesById: {
|
|
2556
|
+
[propName: string]: INode;
|
|
2557
|
+
};
|
|
2558
|
+
mapsById: {
|
|
2559
|
+
[propName: string]: IMap;
|
|
2560
|
+
};
|
|
2561
|
+
constructor({ nodes, vortexes, maps, showVortexNames, }: {
|
|
2562
|
+
nodes: INode[];
|
|
2563
|
+
vortexes: IVortex[];
|
|
2564
|
+
maps: IMap[];
|
|
2565
|
+
showVortexNames?: boolean;
|
|
2566
|
+
});
|
|
2567
|
+
/**
|
|
2568
|
+
* aStar takes one or more origin node ids, one or more destination node ids
|
|
2569
|
+
* and returns an array of nodes that define the shortest path from an origin
|
|
2570
|
+
* a destination.
|
|
2571
|
+
*
|
|
2572
|
+
* @param originIds array - of one or more node ids
|
|
2573
|
+
* @param destinationNodeIds array - of onr or more node ids
|
|
2574
|
+
* @param accessible boolean - optional, if true directions will only take accessible route, defaults to false
|
|
2575
|
+
* @param includedVortexIds set - optional, exclude all the vertexes matching the given IDs
|
|
2576
|
+
* @param excludedVortexIds set - optional, exclude all the vertexes matching the given IDs
|
|
2577
|
+
*/
|
|
2578
|
+
aStar({ originIds, destinationNodeIds, accessible, includedVortexIds, excludedVortexIds, }: {
|
|
2579
|
+
originIds: string[];
|
|
2580
|
+
destinationNodeIds: string[];
|
|
2581
|
+
accessible: boolean;
|
|
2582
|
+
includedVortexIds?: Set<string>;
|
|
2583
|
+
excludedVortexIds?: Set<string>;
|
|
2584
|
+
}): Edge[];
|
|
2585
|
+
getDistance(origin: INode, destination: INode): number;
|
|
2586
|
+
getShortestEuclideanDistance(origin: INode, destinations: INode[]): number;
|
|
2587
|
+
}
|
|
2588
|
+
export default NavigationGraph;
|
|
2589
|
+
|
|
2590
|
+
import Directive from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Directive';
|
|
2591
|
+
import Edge from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Edge';
|
|
2592
|
+
import { TCoordinate } from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/Navigator.utils';
|
|
2593
|
+
import ILocation from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/ILocation';
|
|
2594
|
+
import IMap from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/IMap';
|
|
2595
|
+
import INode from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/INode';
|
|
2596
|
+
import IPolygon from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/IPolygon';
|
|
2597
|
+
import IVortex from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/IVortex';
|
|
2598
|
+
export declare enum E_MESSAGES {
|
|
2599
|
+
NO_VALID_PATH = "No Valid Path Available"
|
|
2600
|
+
}
|
|
2601
|
+
export declare function differenceBetweenAngles(a: any, b: any): number;
|
|
2602
|
+
export interface IDirectionsResult {
|
|
2603
|
+
distance: number;
|
|
2604
|
+
path: INode[];
|
|
2605
|
+
instructions: Directive[];
|
|
2606
|
+
}
|
|
2607
|
+
/**
|
|
2608
|
+
* @experimental
|
|
2609
|
+
* Configuration options for directions simplifying.
|
|
2610
|
+
*/
|
|
2611
|
+
export type TSimplifyDirectionsOptions = {
|
|
2612
|
+
/**
|
|
2613
|
+
* Enable or disable simplifying.
|
|
2614
|
+
*/
|
|
2615
|
+
enabled: boolean;
|
|
2616
|
+
/**
|
|
2617
|
+
* The radius of the buffer around the path.
|
|
2618
|
+
* @default 1.8
|
|
2619
|
+
*/
|
|
2620
|
+
bufferRadius?: number;
|
|
2621
|
+
};
|
|
2622
|
+
declare class Navigator {
|
|
2623
|
+
constructor({ locations, nodes, vortexes, maps, polygons, showVortexNames, }: {
|
|
2624
|
+
locations: ILocation[];
|
|
2625
|
+
nodes: INode[];
|
|
2626
|
+
vortexes: IVortex[];
|
|
2627
|
+
maps: IMap[];
|
|
2628
|
+
polygons?: IPolygon[];
|
|
2629
|
+
showVortexNames?: boolean;
|
|
2630
|
+
});
|
|
2631
|
+
getClosestLocationInRay(startingEdge: Edge, angleThreshold?: number, distanceThreshold?: number): ILocation | null;
|
|
2632
|
+
/**
|
|
2633
|
+
* getDirections takes one or more origin node ids, one or more destination node ids
|
|
2634
|
+
* and returns a distance, array of directives, and an array of nodes that define the
|
|
2635
|
+
* path to take.
|
|
2636
|
+
*
|
|
2637
|
+
* The returned directives array defines nodes, vortexes, and locations along the path
|
|
2638
|
+
* along with text directions.
|
|
2639
|
+
*
|
|
2640
|
+
* @param originIds array - of one or more node ids
|
|
2641
|
+
* @param destinationNodeIds array - of onr or more node ids
|
|
2642
|
+
* @param accessible boolean - optional, if true directions will only take accessible route, defaults to false
|
|
2643
|
+
* @param departFrom ILocation - optional, id and name of a location to represent start of journey
|
|
2644
|
+
* @param arriveAt ILocation - optional, id and name of a location to represent end of journey
|
|
2645
|
+
* @param includedVortexIds set - optional, exclude all the vertexes matching the given IDs
|
|
2646
|
+
* @param excludedVortexIds set - optional, exclude all the vertexes matching the given IDs
|
|
2647
|
+
*/
|
|
2648
|
+
getDirections({ originIds, destinationNodeIds, accessible, departFrom, arriveAt, includedVortexIds, excludedVortexIds, simplify, }: {
|
|
2649
|
+
originIds: string[];
|
|
2650
|
+
includedVortexIds?: Set<string>;
|
|
2651
|
+
excludedVortexIds?: Set<string>;
|
|
2652
|
+
destinationNodeIds: string[];
|
|
2653
|
+
accessible: boolean;
|
|
2654
|
+
departFrom?: ILocation;
|
|
2655
|
+
arriveAt?: ILocation;
|
|
2656
|
+
simplify?: TSimplifyDirectionsOptions;
|
|
2657
|
+
}): IDirectionsResult;
|
|
2658
|
+
/**
|
|
2659
|
+
* Iterates through each N step node and determines if a direct line to the next M step node intersects any polygons.
|
|
2660
|
+
* If it doesn't, remove all steps between the two.
|
|
2661
|
+
*/
|
|
2662
|
+
simplifySteps(steps: Edge[], geometryEdges: TCoordinate[][], bufferRadius: number): Edge[];
|
|
2663
|
+
}
|
|
2664
|
+
export default Navigator;
|
|
2665
|
+
|
|
2666
|
+
export declare const MI_DEBUG_KEY = "mi-debug";
|
|
2667
|
+
export declare enum E_SDK_LOG_LEVEL {
|
|
2668
|
+
LOG = 0,
|
|
2669
|
+
WARN = 1,
|
|
2670
|
+
ERROR = 2,
|
|
2671
|
+
SILENT = 3
|
|
2672
|
+
}
|
|
2673
|
+
export declare function setLoggerLevel(level: E_SDK_LOG_LEVEL): void;
|
|
2674
|
+
declare const Logger: {
|
|
2675
|
+
logState: E_SDK_LOG_LEVEL;
|
|
2676
|
+
log(...args: any[]): void;
|
|
2677
|
+
warn(...args: any[]): void;
|
|
2678
|
+
error(...args: any[]): void;
|
|
2679
|
+
assert(...args: any[]): void;
|
|
2680
|
+
time(label: string): void;
|
|
2681
|
+
timeEnd(label: string): void;
|
|
2682
|
+
};
|
|
2683
|
+
export default Logger;
|
|
2684
|
+
|
|
2685
|
+
interface ILocation {
|
|
2686
|
+
id: string;
|
|
2687
|
+
name: string;
|
|
2688
|
+
[propName: string]: any;
|
|
2689
|
+
}
|
|
2690
|
+
export default ILocation;
|
|
2691
|
+
|
|
2692
|
+
interface IGeoReference {
|
|
2693
|
+
target: {
|
|
2694
|
+
x: number;
|
|
2695
|
+
y: number;
|
|
2696
|
+
};
|
|
2697
|
+
control: {
|
|
2698
|
+
x: number;
|
|
2699
|
+
y: number;
|
|
2700
|
+
};
|
|
2701
|
+
}
|
|
2702
|
+
interface IMap {
|
|
2703
|
+
id: string;
|
|
2704
|
+
name: string;
|
|
2705
|
+
shortName: string;
|
|
2706
|
+
elevation?: number;
|
|
2707
|
+
scale?: number;
|
|
2708
|
+
x_scale?: number;
|
|
2709
|
+
georeference?: IGeoReference[];
|
|
2710
|
+
[propName: string]: any;
|
|
2711
|
+
}
|
|
2712
|
+
export default IMap;
|
|
2713
|
+
|
|
2714
|
+
interface INode {
|
|
2715
|
+
id: string;
|
|
2716
|
+
x: number;
|
|
2717
|
+
y: number;
|
|
2718
|
+
map: string;
|
|
2719
|
+
externalId?: string;
|
|
2720
|
+
[propName: string]: any;
|
|
2721
|
+
}
|
|
2722
|
+
export default INode;
|
|
2723
|
+
|
|
2724
|
+
import INode from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/INode';
|
|
2725
|
+
import IVortex from '@mappedin/mappedin-js/lib/esm/get-venue/--/navigator/interfaces/IVortex';
|
|
2726
|
+
declare class Edge {
|
|
2727
|
+
origin: INode;
|
|
2728
|
+
destination: INode;
|
|
2729
|
+
vortex?: IVortex;
|
|
2730
|
+
distance: number;
|
|
2731
|
+
angle: number;
|
|
2732
|
+
weight: number;
|
|
2733
|
+
constructor({ origin, destination, vortex, elevationDelta, distance, angle, pathWeight, }: {
|
|
2734
|
+
origin: INode;
|
|
2735
|
+
destination: INode;
|
|
2736
|
+
vortex?: IVortex;
|
|
2737
|
+
elevationDelta?: number;
|
|
2738
|
+
distance?: number;
|
|
2739
|
+
angle?: number;
|
|
2740
|
+
pathWeight?: number;
|
|
2741
|
+
});
|
|
2742
|
+
}
|
|
2743
|
+
export default Edge;
|
|
2744
|
+
|
|
2745
|
+
interface IVortex {
|
|
2746
|
+
id: string;
|
|
2747
|
+
name: string;
|
|
2748
|
+
type: string;
|
|
2749
|
+
weight: number;
|
|
2750
|
+
multiplier: number;
|
|
2751
|
+
[propName: string]: any;
|
|
2752
|
+
}
|
|
2753
|
+
export default IVortex;
|
|
2754
|
+
|
|
2755
|
+
export type TCoordinate = {
|
|
2756
|
+
x: number;
|
|
2757
|
+
y: number;
|
|
2758
|
+
};
|
|
2759
|
+
/**
|
|
2760
|
+
* Modified line intercept math by Paul Bourke http://paulbourke.net/geometry/pointlineplane/
|
|
2761
|
+
* Determines the intersection point of two line segments.
|
|
2762
|
+
* Return null if the lines don't intersect.
|
|
2763
|
+
*/
|
|
2764
|
+
export declare function getLineIntersection(line1Point1: TCoordinate, line1Point2: TCoordinate, line2Point1: TCoordinate, line2Point2: TCoordinate): {
|
|
2765
|
+
x: number;
|
|
2766
|
+
y: number;
|
|
2767
|
+
} | null;
|
|
2768
|
+
/**
|
|
2769
|
+
* Offsets a line between two nodes by a certain distance.
|
|
2770
|
+
*/
|
|
2771
|
+
export declare function getOffsetLine(point1: TCoordinate, point2: TCoordinate, offset: number): {
|
|
2772
|
+
x: number;
|
|
2773
|
+
y: number;
|
|
2774
|
+
}[];
|
|
2775
|
+
/**
|
|
2776
|
+
* Determines if there is a line of sight between two nodes.
|
|
2777
|
+
*/
|
|
2778
|
+
export declare function hasLineOfSight(origin: TCoordinate, destination: TCoordinate, edges?: TCoordinate[][], bufferRadius?: number): boolean;
|
|
2779
|
+
|
|
2780
|
+
interface IPolygon {
|
|
2781
|
+
id: string;
|
|
2782
|
+
map: string;
|
|
2783
|
+
layer?: string;
|
|
2784
|
+
layerId?: string;
|
|
2785
|
+
externalId?: string;
|
|
2786
|
+
name?: string;
|
|
2787
|
+
vertexes: {
|
|
2788
|
+
x: number;
|
|
2789
|
+
y: number;
|
|
2790
|
+
}[];
|
|
2791
|
+
}
|
|
2792
|
+
export default IPolygon;
|
|
2793
|
+
|