@minmaps-dev/mm-web-sdk 0.0.0-rc-20260623204551

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.
@@ -0,0 +1,833 @@
1
+ import { IControl, ControlPosition, StyleSpecification, Map } from 'maplibre-gl';
2
+
3
+ /**
4
+ * Represents a floor in a building
5
+ */
6
+ interface Floor {
7
+ /** Unique floor identifier */
8
+ id: string | number;
9
+ /**
10
+ * Underlying map entity id. Separate from `id` (the floor entity id) — used
11
+ * by waypoints (`wp.mapId`) and floor-geojson endpoints. Optional because
12
+ * not all providers populate it.
13
+ */
14
+ mapId?: string | number;
15
+ /** Display name of the floor */
16
+ name: string;
17
+ /** Floor sequence/order (e.g., -1 for basement, 0 for ground, 1 for first floor) */
18
+ sequence?: number;
19
+ /** Associated map data */
20
+ geojson?: GeoJSON.FeatureCollection;
21
+ /** Whether this is the default floor to display */
22
+ isDefault?: boolean;
23
+ /** Additional floor metadata */
24
+ metadata?: Record<string, unknown>;
25
+ }
26
+ /**
27
+ * Floor metadata for display purposes
28
+ */
29
+ interface FloorMetadata {
30
+ id: string | number;
31
+ name: string;
32
+ sequence?: number;
33
+ isDefault?: boolean;
34
+ isActive?: boolean;
35
+ }
36
+
37
+ interface POI {
38
+ /** Unique identifier */
39
+ id: string | number;
40
+ /** POI type */
41
+ type: 'amenity' | 'destination' | 'kiosk';
42
+ /** Display name */
43
+ name: string;
44
+ /** Geographic coordinates [longitude, latitude] */
45
+ coordinates: [number, number];
46
+ /** Icon identifier for rendering */
47
+ iconId?: string;
48
+ /** Whether this POI should render its label */
49
+ showLabel?: boolean;
50
+ /** Floor this POI belongs to */
51
+ floorId: string | number;
52
+ /** Category/type of amenity (e.g., 'restroom', 'elevator') */
53
+ amenityType?: string;
54
+ /** Search keywords */
55
+ keywords?: string[];
56
+ /** Additional properties */
57
+ properties?: Record<string, unknown>;
58
+ /** JMap waypoint ID that this POI instance is bound to */
59
+ waypointId?: string | number;
60
+ /** Full waypoint object for this POI instance */
61
+ waypoint?: Waypoint;
62
+ /** Marks this POI as the "You are here" kiosk */
63
+ isYouAreHere?: boolean;
64
+ /** For kiosk POIs only: compass heading the device physically faces, in
65
+ * degrees clockwise from north. Sourced from JACS `Device.heading`. */
66
+ heading?: number | null;
67
+ }
68
+ /**
69
+ * Amenity - a specific type of POI (facilities, services)
70
+ */
71
+ interface Amenity {
72
+ /** Unique identifier */
73
+ id: string | number;
74
+ /** Display name */
75
+ name: string;
76
+ /** Inline SVG markup (legacy fullcall DTO). When absent, icon is resolved from `uris`. */
77
+ svg?: string;
78
+ /**
79
+ * Hosted icon descriptors from JACS (`uris[].locales[].uriPath`). Used by
80
+ * the SDK's runtime icon fetcher to register a map image at init time.
81
+ */
82
+ uris?: Array<{
83
+ mimeType?: string;
84
+ resourceType?: string;
85
+ locales?: Array<{
86
+ locale?: string;
87
+ uriPath?: string;
88
+ }>;
89
+ }>;
90
+ /**
91
+ * Map-image id used as `icon-image` in the POI style layer. Decorated
92
+ * in-place by AmenityIcons.register once the SVG is fetched and registered.
93
+ */
94
+ iconId?: string;
95
+ /** Search keywords */
96
+ keywords?: string[];
97
+ /** Associated waypoints */
98
+ waypoints?: Waypoint[];
99
+ /** Amenity type/category */
100
+ type?: string;
101
+ /** Extended properties */
102
+ extensors?: Record<string, unknown>;
103
+ }
104
+ /**
105
+ * Destination - a specific location or room
106
+ */
107
+ interface Destination {
108
+ /** Unique identifier */
109
+ id: string | number;
110
+ /** Display name */
111
+ name: string;
112
+ /** Associated waypoints */
113
+ waypoints?: Waypoint[];
114
+ /** Category/classification */
115
+ category?: string;
116
+ /** Additional properties */
117
+ properties?: Record<string, unknown>;
118
+ /** Uploaded image (e.g. brand/store logo). JACS `/all` fullcall serves this
119
+ * as `{ items: [{ resourceType, mimeType, path }] }`; the legacy/basic shape
120
+ * is `[{ locales: [{ uriPath }] }]`. `DestinationIcons.register` handles both. */
121
+ uris?: unknown;
122
+ /** Free-form CMS metadata (reserved for future destination icon options). */
123
+ extensors?: Record<string, unknown>;
124
+ /** Map-manager "Label Display" mode (JACS `displayMode`):
125
+ * `0` Hidden (dot only) · `1` Label (dot + text) · `2` Image (uploaded logo).
126
+ * Undefined → treated as Label (backwards-compatible default). */
127
+ displayMode?: number;
128
+ /** Runtime-assigned map-image id, decorated in place by
129
+ * `DestinationIcons.register` (only for `displayMode === 2`).
130
+ * Read by the POI builder + theme layer. */
131
+ iconId?: string;
132
+ }
133
+ /**
134
+ * Waypoint - a specific point location
135
+ */
136
+ interface Waypoint {
137
+ /** Geographic coordinates [longitude, latitude] */
138
+ coordinates: number[];
139
+ /** Associated map ID */
140
+ mapId: string | number;
141
+ /** Associated floor ID */
142
+ floorId?: string | number;
143
+ /** Whether this is the primary/default waypoint */
144
+ isPrimary?: boolean;
145
+ }
146
+ /**
147
+ * Amenity enriched with the floor it belongs to
148
+ */
149
+ type AmenityWithFloor = Amenity & {
150
+ floorId: Floor['id'];
151
+ };
152
+ /**
153
+ * Search result for POIs
154
+ */
155
+ interface POISearchResult {
156
+ /** The matched POI */
157
+ poi: POI;
158
+ /** Search relevance score (0-1) */
159
+ score: number;
160
+ /** Matched keywords or fields */
161
+ matchedFields: string[];
162
+ }
163
+
164
+ /** Captured camera state (center, zoom, pitch, bearing) */
165
+ type CameraState = {
166
+ center: [number, number];
167
+ zoom: number;
168
+ pitch: number;
169
+ bearing: number;
170
+ };
171
+ /** Options for animating or setting the map view */
172
+ type ViewOptions = {
173
+ center?: [number, number];
174
+ zoom?: number;
175
+ pitch?: number;
176
+ bearing?: number;
177
+ animate?: boolean;
178
+ duration?: number;
179
+ };
180
+ /** SW/NE bounding box */
181
+ type Bounds = [[number, number], [number, number]];
182
+
183
+ /** How to center the map after computing a route */
184
+ type WayfindCenterMode = 'none' | 'destination' | 'route';
185
+ /**
186
+ * Per-call routing preferences forwarded to the wayfinding provider.
187
+ *
188
+ * - `accessible` — prefer accessible paths; providers should drop or heavily
189
+ * penalize edges marked inaccessible (stairs by default, anything else
190
+ * the provider's data flags).
191
+ * - `avoidStairs` — hard-filter stairs from the graph.
192
+ *
193
+ * The bundled stub provider doesn't compute routes; consumers wire a real
194
+ * provider (see `mm-web-sdk-example/lib/wayfinding`) that reads these
195
+ * flags when building edge weights.
196
+ */
197
+ type RoutingOptions = {
198
+ accessible?: boolean;
199
+ avoidStairs?: boolean;
200
+ };
201
+
202
+ /**
203
+ * A single point along the rendered route. `mapId` lets the renderer
204
+ * split the polyline by floor (so other-floor segments don't paint
205
+ * through the visible floor's geometry); `waypointId` and `pathTypeId`
206
+ * let downstream layers (text-directions, step UI) classify
207
+ * transitions — e.g. "Take the elevator" vs "Walk straight". The two
208
+ * endpoint points are the kiosk and destination anchors (`isEndpoint`
209
+ * marks them so they can render endpoint pins). All fields except
210
+ * `coordinates` are optional for backward-compat with the straight-line
211
+ * fallback.
212
+ */
213
+ type RoutePoint = {
214
+ coordinates: [number, number];
215
+ /** Floor mapId this point sits on. Missing on the straight-line fallback. */
216
+ mapId?: number;
217
+ /** JACS waypoint id this point resolved to, if any. */
218
+ waypointId?: number;
219
+ /** Path type of the edge that LEADS INTO this point (i.e. the edge
220
+ * whose `toKey` is this node). Used to detect elevator / stair /
221
+ * escalator transitions. Missing on the start point and on the
222
+ * straight-line fallback. */
223
+ pathTypeId?: number;
224
+ /** True for the snapped kiosk + destination anchors. */
225
+ isEndpoint?: boolean;
226
+ };
227
+
228
+ type WayfindStep = DepartStep | TurnStep | ContinueStep | TransitionStep | ArriveStep;
229
+ type StepBase = {
230
+ /** Indices into the input `points` array that this step spans. */
231
+ pointRange: [startInclusive: number, endInclusive: number];
232
+ /** Floor this step is on. `null` for cross-floor transitions. */
233
+ floorId: number | null;
234
+ /** Localized instruction text. */
235
+ text: string;
236
+ /** Total walking distance within this step, in meters (rounded). */
237
+ distanceMeters?: number;
238
+ /** Landmark name used for anchoring, if any. */
239
+ landmark?: string;
240
+ };
241
+ type DepartStep = StepBase & {
242
+ type: 'depart';
243
+ };
244
+ type TurnStep = StepBase & {
245
+ type: 'turn-left' | 'turn-right' | 'u-turn';
246
+ };
247
+ type ContinueStep = StepBase & {
248
+ type: 'continue';
249
+ };
250
+ type TransitionStep = StepBase & {
251
+ type: 'transition';
252
+ transition: 'elevator' | 'stairs' | 'escalator';
253
+ fromFloorId: number | null;
254
+ toFloorId: number | null;
255
+ };
256
+ type ArriveStep = StepBase & {
257
+ type: 'arrive';
258
+ };
259
+
260
+ interface MapEvent {
261
+ floor?: Floor;
262
+ poi?: POI;
263
+ coordinates?: [number, number];
264
+ error?: any;
265
+ venue?: any;
266
+ camera?: CameraState;
267
+ /** Emitted by `themeChanged`; `'custom'` when consumer passed a raw style. */
268
+ theme?: 'default' | 'high-contrast' | 'custom';
269
+ /** Emitted by `localeChanged` after `setLocale()` finishes patching the
270
+ * venue model. BCP-47 code (`'en'`, `'es'`, `'es-MX'`). */
271
+ locale?: string;
272
+ /** Emitted by `routeReady` after a successful `navigateFromKioskToPOI`.
273
+ * Carries the raw geometry (`points`) and the human-readable
274
+ * step-by-step directions. Subscribe to drive a turn-by-turn UI. */
275
+ route?: {
276
+ points: RoutePoint[];
277
+ steps: WayfindStep[];
278
+ /** Floor mapId of each segment, in render order. `null` for
279
+ * segments emitted by the straight-line fallback. */
280
+ floorIds: Array<number | null>;
281
+ };
282
+ }
283
+ type EventCallback = (event: MapEvent) => void;
284
+
285
+ /**
286
+ * Padding kept clear inside the viewport when the SDK frames bounds —
287
+ * the initial venue/floor fit and the wayfinding route fit. A plain
288
+ * number pads all sides equally; the object form lets a kiosk reserve
289
+ * space for fixed UI overlays (header, dock, side rails) so framed
290
+ * content is never hidden behind them.
291
+ */
292
+ type BoundsPadding = number | {
293
+ top: number;
294
+ bottom: number;
295
+ left: number;
296
+ right: number;
297
+ };
298
+ /**
299
+ * Built-in theme names accepted by `MinuteMaps.setTheme()` and the
300
+ * `options.theme` init option. Pass a `StyleSpecification` directly for
301
+ * custom themes.
302
+ */
303
+ type ThemeName = 'default' | 'high-contrast';
304
+ /**
305
+ * Style of the disc + ring rendered behind each amenity icon. The SDK
306
+ * composites this into the icon bitmap at registration time, so badge +
307
+ * icon participate in symbol collision as one unit.
308
+ */
309
+ type AmenityBadgeStyle = {
310
+ /** Fill colour of the badge disc. Default `'#fdb81e'`. */
311
+ color?: string;
312
+ /** Stroke colour of the ring around the disc. Default `'#FFFFFF'`. */
313
+ ringColor?: string;
314
+ /** Ring width in logical px. Default `2`. */
315
+ ringWidth?: number;
316
+ };
317
+ type DestinationChipStyle = {
318
+ /** Chip fill colour. Default `'#FFFFFF'`. */
319
+ color?: string;
320
+ /** Chip border colour. Default navy `'#162e51'`. */
321
+ borderColor?: string;
322
+ /** Chip border width in logical px. Default `2`. */
323
+ borderWidth?: number;
324
+ };
325
+ interface SDKOptions {
326
+ debug?: boolean;
327
+ /**
328
+ * Initial theme. `'default'` uses the bundled hybrid 3D theme.
329
+ * `'high-contrast'` uses the WCAG-AA tuned theme. Pass a
330
+ * `StyleSpecification` for fully custom styling.
331
+ */
332
+ theme?: ThemeName | any;
333
+ /**
334
+ * When true, the SDK skips animations on imperative camera calls
335
+ * (wayfinding fits, `setView`, idle re-frames). Consumers should
336
+ * mirror their app's `prefers-reduced-motion` state into this.
337
+ */
338
+ reducedMotion?: boolean;
339
+ initialFloor?: string | number;
340
+ enableInteractions?: boolean;
341
+ customSprite?: string;
342
+ minIndoorZoom?: number;
343
+ wallThickness?: number;
344
+ boundsPadding?: BoundsPadding;
345
+ /**
346
+ * Pitch (deg) for the opening view, applied centred on the kiosk ("You
347
+ * are here"). Omit for top-down.
348
+ */
349
+ initialPitch?: number;
350
+ /**
351
+ * Zoom for the opening view, centred on the kiosk. Set this above the
352
+ * theme's unit-walls breakpoint (~16.5 in the bundled hybrid theme) so the
353
+ * kiosk opens on the building's interior floor plan (its contents) rather
354
+ * than a zoomed-out 3D massing outline. Omit to keep the post-floor-fit
355
+ * zoom.
356
+ */
357
+ initialZoom?: number;
358
+ /**
359
+ * Clamp zoom-out relative to the opening view. When set, the map's
360
+ * `minZoom` becomes `(initialZoom − this)`, so visitors can nudge out by
361
+ * this many zoom levels but never pull back below the interior into the
362
+ * massing/region. `0` locks zoom-out exactly to the opening view.
363
+ */
364
+ minZoomBelowInitialFit?: number;
365
+ /**
366
+ * Override the colour the SDK recolours every amenity SVG to before it
367
+ * composites the badge. `none` / `transparent` fills are preserved so
368
+ * cut-outs stay. When the badge is enabled (the default), this defaults
369
+ * to navy (`#162e51`) so icons read on gold. Set explicitly for a
370
+ * different look, or set `amenityBadge: false` to disable recolouring
371
+ * altogether and keep the CMS-uploaded colours.
372
+ */
373
+ amenityIconColor?: string;
374
+ /**
375
+ * Badge composited behind each amenity icon. Pass `false` to render the
376
+ * icon alone (no badge — useful for high-contrast or 2D themes where the
377
+ * gold disc would compete with the floor). Pass an object to tune the
378
+ * disc / ring style. Defaults to a VA-gold disc with a 2px white ring.
379
+ *
380
+ * The badge is baked into the icon bitmap (canvas composite) rather than
381
+ * drawn as a separate circle layer, so badge + icon participate in symbol
382
+ * collision together — overlapping amenities hide as one unit instead of
383
+ * the icon hiding while the disc stays painted.
384
+ */
385
+ amenityBadge?: AmenityBadgeStyle | false;
386
+ /**
387
+ * Chip composited behind each destination's uploaded logo. Destinations are
388
+ * full-colour brand images (not recoloured), so they get a neutral white
389
+ * rounded chip for legibility instead of the amenity gold badge. Pass `false`
390
+ * to render the logo bare, or an object to tune the chip fill / border.
391
+ * Defaults to a white chip with a 2px navy border.
392
+ */
393
+ destinationChip?: DestinationChipStyle | false;
394
+ styleMode?: 'venueStyleUrl' | 'sdkTemplate';
395
+ templateOverrideMode?: 'colorsOnly' | 'colorsAndConstants' | 'all';
396
+ }
397
+ type JMapAuth = {
398
+ clientId: string;
399
+ clientSecret: string;
400
+ };
401
+ interface JMapConfig {
402
+ host: string;
403
+ auth: JMapAuth;
404
+ customerId: number;
405
+ venueId?: number;
406
+ locale?: string;
407
+ }
408
+ type JacsAuth = {
409
+ clientId: string;
410
+ username: string;
411
+ password: string;
412
+ };
413
+ type JacsConfig = {
414
+ host: string;
415
+ auth: JacsAuth;
416
+ };
417
+ type SDKConfig = {
418
+ container: HTMLElement | string;
419
+ jmap: {
420
+ host: string;
421
+ customerId: number;
422
+ venueId: number;
423
+ locale?: string;
424
+ auth?: JMapAuth;
425
+ /**
426
+ * Identifies which physical kiosk this instance is, so the SDK can pin
427
+ * the "You are here" marker. Matched against either the numeric device
428
+ * `id` or the device `uuid` from the venue's `devices`. The device's
429
+ * attached waypoint (`waypoint.deviceIds`) is the kiosk's location.
430
+ */
431
+ deviceId?: string | number;
432
+ };
433
+ jacs: {
434
+ mode: 'proxy' | 'direct';
435
+ host?: string;
436
+ auth?: {
437
+ clientId: string;
438
+ username: string;
439
+ password: string;
440
+ };
441
+ proxyBaseUrl?: string;
442
+ };
443
+ options?: SDKOptions;
444
+ };
445
+
446
+ type LoggerFn = (...args: unknown[]) => void;
447
+ type AmenityManagerDeps = {
448
+ getVenue: () => any;
449
+ getFloors: () => Floor[];
450
+ getFloorById: (id: Floor['id']) => Floor | null;
451
+ log?: LoggerFn;
452
+ };
453
+ declare class AmenityManager {
454
+ private getVenue;
455
+ private getFloors;
456
+ private getFloorById;
457
+ private logFn?;
458
+ constructor(deps: AmenityManagerDeps);
459
+ private get venue();
460
+ private log;
461
+ private loadForFloor;
462
+ getAll(): AmenityWithFloor[];
463
+ /**
464
+ * Venue-wide amenities, one entry per id. `getAll()` returns each amenity
465
+ * once per floor it appears on (and so renders a multi-floor "Bathroom"
466
+ * three times in a venue list); this collapses those into a single record
467
+ * with all its waypoints merged across floors.
468
+ *
469
+ * Also folds any duplicate-id records from the provider (a CMS data bug)
470
+ * into a single entry so React lists don't trip on dup keys.
471
+ *
472
+ * Use this for venue-wide browse UIs; pair it with `findClosestWaypoint`
473
+ * (on the SDK) to resolve a tap to the nearest physical instance.
474
+ */
475
+ getDistinct(): Amenity[];
476
+ getByFloorId(floorId: Floor['id']): AmenityWithFloor[];
477
+ getAllKiosks(): AmenityWithFloor[];
478
+ getKioskForFloor(floorId: Floor['id']): AmenityWithFloor | null;
479
+ logKioskForFloor(floorId: Floor['id']): void;
480
+ }
481
+
482
+ declare class MinuteMaps {
483
+ private config;
484
+ private map;
485
+ private data;
486
+ private wayfindingProvider;
487
+ private events;
488
+ private floorsApi;
489
+ private venue;
490
+ private spriteKeys;
491
+ private readonly debug;
492
+ private readonly logger;
493
+ private defaultCamera;
494
+ private viewModes;
495
+ /** Mirror of `config.options.reducedMotion`, mutable via `setReducedMotion`. */
496
+ private reducedMotion;
497
+ /** Tracks the active theme name so `setTheme()` is a no-op when re-requested. */
498
+ private activeThemeName;
499
+ /** Tracks the active locale so `setLocale()` is a no-op when re-requested.
500
+ * Seeded from `config.jmap.locale` at construction; `undefined` means
501
+ * whatever the customer's default locale is on the JACS side. */
502
+ private currentLocale;
503
+ private amenityManager;
504
+ private wayfinding;
505
+ private highlightManager;
506
+ private youAreHerePulse;
507
+ /** Categorical POI layers in the bundled theme that `setPOIFilter`
508
+ * toggles. Layers absent from this list — `poi-you-are-here-*`, the
509
+ * `poi-accessibility-icons` badge, and the `poi-highlight-*` layers —
510
+ * are intentionally unaffected; they're either anchors, status
511
+ * indicators, or transient focus state, not categorical content. */
512
+ private static readonly POI_CATEGORY_LAYERS;
513
+ private poiVisibleTypes;
514
+ constructor(config: SDKConfig);
515
+ init(): Promise<void>;
516
+ on(event: string, cb: (e: MapEvent) => void): void;
517
+ off(event: string, cb?: (e: MapEvent) => void): void;
518
+ addControl(control: IControl, position?: ControlPosition): void;
519
+ setView(options: ViewOptions): void;
520
+ get amenities(): AmenityManager;
521
+ resetView(opts?: {
522
+ animate?: boolean;
523
+ duration?: number;
524
+ }): void;
525
+ /**
526
+ * Content-aware re-frame: fit an active route if one is displayed,
527
+ * otherwise fit the current floor's geojson. Unlike `resetView()`, this
528
+ * preserves the user's pitch and bearing — it only adjusts center/zoom
529
+ * to bring the scene back into view. Intended use is after the map
530
+ * container resizes (e.g. a side drawer opens beside the map and the
531
+ * pane gets narrower), so what matters stays framed without a yank.
532
+ */
533
+ refit(opts?: {
534
+ animate?: boolean;
535
+ duration?: number;
536
+ }): void;
537
+ private fitToBounds;
538
+ set3dEnabled(enabled: boolean): void;
539
+ toggle3d(): void;
540
+ getIs3dEnabled(): boolean;
541
+ /**
542
+ * Set the active map theme by name (`'default'` / `'high-contrast'`) or by
543
+ * passing a custom `StyleSpecification`. The current floor, route, POIs
544
+ * and camera are preserved across the swap — only layer styling changes.
545
+ *
546
+ * Used by kiosk consumers to wire the OS-level / popover high-contrast
547
+ * toggle to the map. See `KIOSK.md` for the pattern.
548
+ */
549
+ setTheme(theme: ThemeName | StyleSpecification): Promise<void>;
550
+ /** Currently active theme name (or `'custom'` when a raw style was passed). */
551
+ getActiveTheme(): 'default' | 'high-contrast' | 'custom';
552
+ /**
553
+ * Update the SDK's reduced-motion preference at runtime. When true,
554
+ * imperative camera animations (route fits, idle re-frames) and the
555
+ * route line-draw animation run with `duration: 0`.
556
+ */
557
+ setReducedMotion(enabled: boolean): void;
558
+ getReducedMotion(): boolean;
559
+ /**
560
+ * Switch the locale used for POI / amenity / destination / floor names at
561
+ * runtime. The SDK refetches localized names from JACS (per-entity
562
+ * endpoints — `/all` does not honor `?locale=`), patches the in-memory
563
+ * venue model in place, then redraws the POI source for the current floor
564
+ * so map labels render in the new language.
565
+ *
566
+ * Structural data (waypoints, coordinates, iconIds) is preserved — only
567
+ * the localized fields (`name`, `description`) move.
568
+ *
569
+ * Emits a `localeChanged` event with the new code after the patch
570
+ * completes. No-op when the code matches the current locale.
571
+ *
572
+ * Throws if the underlying data provider doesn't implement locale support
573
+ * (only `JacsDataProvider` does today), or if the JACS fetch fails — the
574
+ * prior locale is left intact in that case.
575
+ */
576
+ setLocale(locale: string): Promise<void>;
577
+ /** Currently active locale (BCP-47), or `undefined` when no locale has
578
+ * been set — meaning JACS resolves names to the customer's default. */
579
+ getActiveLocale(): string | undefined;
580
+ setUnits2dEnabled(enabled: boolean): void;
581
+ toggleUnits2d(): void;
582
+ getIsUnits2dEnabled(): boolean;
583
+ setFlatMode(enabled: boolean): void;
584
+ toggleFlatMode(): void;
585
+ getIsFlatMode(): boolean;
586
+ getFloors(): Floor[];
587
+ getCurrentFloor(): Floor | null;
588
+ getDefaultFloor(): Floor | null;
589
+ getDestinations(floor?: Floor): Destination[];
590
+ getPolygonLayers(): any[];
591
+ getFloorMapTemplate3d(floorId: string | number): any[];
592
+ getAllPOIs(floor?: Floor): POI[];
593
+ getYouAreHerePOI(floor?: Floor): POI | null;
594
+ getYouAreHereCoordinates(floor?: Floor): [number, number] | null;
595
+ /**
596
+ * Compass heading the kiosk's physical hardware faces, in degrees
597
+ * clockwise from north. Sourced from JACS `Device.heading`. `null` when
598
+ * the venue's device record has no heading set.
599
+ *
600
+ * Drives `recenterOnKiosk({ useHeading: true })` and the directional
601
+ * cone rendered next to the "You are here" marker.
602
+ */
603
+ getKioskHeading(): number | null;
604
+ /**
605
+ * Display name of the JACS device the kiosk is anchored to (e.g.
606
+ * "Main Lobby Kiosk", "Information Desk Kiosk"). `null` when the venue
607
+ * has no kiosk anchor or the device record carries no `name`.
608
+ *
609
+ * Distinct from `getYouAreHerePOI()?.name`, which is always the
610
+ * literal "You are here" label rendered on the map. Use this for chrome
611
+ * that needs the kiosk's identity — e.g. the directions overlay's
612
+ * "From <kiosk>" header.
613
+ */
614
+ getKioskName(): string | null;
615
+ /**
616
+ * Distance + walking time from the kiosk's anchor waypoint to a target,
617
+ * computed over the JACS path graph (the same graph the routing engine
618
+ * uses). Designed for "Closest: 30 sec walk" subtitles in the consumer
619
+ * UI — no second graph build, no second Dijkstra implementation.
620
+ *
621
+ * Accepts a raw waypoint id, an amenity / destination object (the first
622
+ * entry of its `waypoints` array is treated as the entry point), or any
623
+ * `{ id, mapId? }` shape. Returns `null` when the kiosk isn't anchored,
624
+ * the target waypoint isn't on the graph, or no path resolves.
625
+ *
626
+ * Walking speed defaults to 1.2 m/s (indoor wayfinding norm). Pass
627
+ * `walkingSpeedMps` to estimate for accessibility (e.g. 0.9).
628
+ */
629
+ getWalkTimeFromKiosk(target: number | string | {
630
+ id?: number | string;
631
+ mapId?: number;
632
+ } | {
633
+ waypoints?: Array<number | string | {
634
+ id?: number | string;
635
+ }>;
636
+ }, opts?: {
637
+ walkingSpeedMps?: number;
638
+ }): {
639
+ meters: number;
640
+ seconds: number;
641
+ pathNodeCount: number;
642
+ } | null;
643
+ /**
644
+ * Center the camera on the kiosk's "You are here" position. Use this
645
+ * (not `resetView`) for a chrome "Recenter" button — `resetView` snaps
646
+ * to the SDK's captured default camera, which may have been a venue
647
+ * overview rather than the kiosk's spot.
648
+ *
649
+ * When `useHeading` is true (default) and the kiosk device has a
650
+ * `heading` on file, the camera's bearing is rotated so the direction
651
+ * the kiosk physically faces ends up at the top of the screen. That
652
+ * way "what the user sees in front of them" matches "what's up on the
653
+ * map" — the single largest readability win for stressed indoor users.
654
+ */
655
+ recenterOnKiosk(opts?: {
656
+ useHeading?: boolean;
657
+ zoom?: number;
658
+ pitch?: number;
659
+ animate?: boolean;
660
+ duration?: number;
661
+ }): void;
662
+ searchPOIs(query: string, floor?: Floor): POI[];
663
+ /**
664
+ * Search POIs across every floor in the venue. Returns raw matches —
665
+ * an amenity that exists on multiple floors appears multiple times,
666
+ * once per instance. Consumers that need one row per logical amenity
667
+ * should dedupe by id (and, for "nearest", pick the instance closest
668
+ * to the kiosk via planar distance on `coordinates`).
669
+ */
670
+ searchAllPOIs(query: string): POI[];
671
+ wayfindBetweenWaypoints(fromWaypoint: any, toWaypoint: any, options?: {
672
+ centerMode?: 'none' | 'destination' | 'route';
673
+ zoom?: number;
674
+ /** Prefer accessible paths (drops or penalizes stairs / inaccessible edges). */
675
+ accessible?: boolean;
676
+ /** Hard-filter stairs from the graph. */
677
+ avoidStairs?: boolean;
678
+ }): Promise<any>;
679
+ navigateFromKioskToDestination(destination: any): Promise<any>;
680
+ /**
681
+ * Route from the kiosk to a specific POI's waypoint. Use this when you
682
+ * already hold a resolved POI (e.g. from `searchPOIs` / `searchAllPOIs`).
683
+ * For a venue-wide amenity record with multiple instances, resolve via
684
+ * `findClosestWaypoint` first — or use `highlightAmenity` instead, if
685
+ * you want a visual focus rather than a route.
686
+ */
687
+ navigateFromKioskToPOI(poi: POI, options?: {
688
+ accessible?: boolean;
689
+ avoidStairs?: boolean;
690
+ }): Promise<any>;
691
+ /** Build the landmark / floor-name context the directions module needs.
692
+ * Pulled out so `setLocale()` or `setActiveStep()` can rebuild it on
693
+ * demand if we ever surface a locale-aware variant. */
694
+ private buildDirectionsContext;
695
+ /**
696
+ * Drive the turn-by-turn UI. Two effects:
697
+ *
698
+ * 1. When the step's `floorId` differs from the active floor, switch
699
+ * floors so the segment for the step's leg becomes visible.
700
+ * 2. Highlight the step's slice of the route line by writing the
701
+ * point range to the `route-active-step` source; the bundled
702
+ * theme's `route-line-active` layer paints it in gold over the
703
+ * muted base route.
704
+ *
705
+ * Transition steps (cross-floor elevator / stair hops) clear the
706
+ * highlight — the overlay text carries the action, and there's no
707
+ * meaningful on-floor segment to paint.
708
+ *
709
+ * Pass `null` to clear the highlight without changing the floor or
710
+ * tearing down the route.
711
+ */
712
+ setActiveStep(step: WayfindStep | null): Promise<void>;
713
+ private writeActiveStepHighlight;
714
+ private clearActiveStepHighlight;
715
+ clearRoute(): void;
716
+ /**
717
+ * Highlight a single POI on the map — a pulsing ring — and bring it into
718
+ * view. Resolves the POI across all floors, switching the active floor if
719
+ * it lives on another one. Pass a POI / amenity / destination id.
720
+ */
721
+ highlightPOI(id: string | number): Promise<void>;
722
+ /** Remove the POI highlight set by `highlightPOI`. */
723
+ clearHighlight(): void;
724
+ /**
725
+ * Show only the named POI categories on the map. Pass `['amenity']` to
726
+ * emphasize amenities (e.g. while an Amenities drawer is open) — destination
727
+ * POIs hide. Call `clearPOIFilter()` to restore the default (all categories).
728
+ *
729
+ * The "You are here" marker, the wheelchair-accessibility badge, and any
730
+ * active highlight are not affected and always render.
731
+ */
732
+ setPOIFilter(types: Array<'amenity' | 'destination'>): void;
733
+ /** Restore the default — every POI category renders. */
734
+ clearPOIFilter(): void;
735
+ private applyPOIFilter;
736
+ /**
737
+ * Return the waypoint in `waypoints` closest to `from`. Useful for
738
+ * "route to the nearest X" against a venue-wide amenity record that has
739
+ * multiple physical instances. Defaults `from` to the kiosk's
740
+ * "You are here" coordinates.
741
+ *
742
+ * Distance is planar Euclidean on lng/lat — sufficient for ordering at
743
+ * single-venue scale, and avoids a turf dependency on the hot path.
744
+ */
745
+ findClosestWaypoint(waypoints: Waypoint[], from?: [number, number]): Waypoint | null;
746
+ /**
747
+ * Route from the kiosk to the closest physical instance of an amenity.
748
+ * Resolves the amenity venue-wide, picks the instance with the smallest
749
+ * path-graph walk time from the kiosk (falling back to planar Euclidean
750
+ * when the walk-time graph can't resolve any waypoint), switches the
751
+ * active floor if needed, and routes via the same plumbing as
752
+ * `navigateFromKioskToPOI` — so step-by-step directions, the
753
+ * `routeReady` event, and the active-floor camera fit all "just work."
754
+ *
755
+ * Pass `accessible` / `avoidStairs` to weight the *route* (the SDK's
756
+ * routing engine reads these per call). Note: closest-instance picking
757
+ * itself is currently distance-based and does not yet honor those
758
+ * weights — the underlying walk-time graph applies pixel-length only.
759
+ * In practice this matters when an amenity has multiple instances and
760
+ * the geometrically closest is reachable only via stairs; the picked
761
+ * instance won't change today, but the *route* to it will avoid stairs
762
+ * (or fail gracefully) if `accessible`/`avoidStairs` is set.
763
+ */
764
+ navigateFromKioskToClosestAmenity(amenityId: string | number, options?: {
765
+ accessible?: boolean;
766
+ avoidStairs?: boolean;
767
+ }): Promise<any>;
768
+ /**
769
+ * Highlight + center on the closest physical instance of an amenity.
770
+ * The amenity is resolved against `amenities.getDistinct()` (venue-wide,
771
+ * deduped); the closest waypoint to the kiosk is picked; the active floor
772
+ * is switched if that instance lives on another one.
773
+ *
774
+ * This is the right call from a venue-wide list ("here are all the
775
+ * bathrooms in the building, take me to the closest one"). For taps on
776
+ * a specific resolved POI (e.g. a search result that already names one
777
+ * instance), use `highlightPOI` instead.
778
+ */
779
+ highlightAmenity(amenityId: string | number): Promise<void>;
780
+ /** Which floor owns this waypoint, by matching mapId against the floor's
781
+ * `mapId` (or `id` as fallback). Used to switch floors when routing /
782
+ * highlighting hits an instance on a different one. */
783
+ private findFloorForWaypoint;
784
+ getCameraPosition(): CameraState | null;
785
+ getMap(): Map | null;
786
+ destroy(): void;
787
+ setCurrentFloor(floor: Floor): Promise<void>;
788
+ /**
789
+ * Filter the route-line / route-halo layers to only render segments
790
+ * whose `floorId` matches the active floor (or features that carry no
791
+ * `floorId` at all — the straight-line fallback, which we want visible
792
+ * on every floor since it has no floor membership to filter against).
793
+ *
794
+ * Features are tagged with the JACS pixel `mapId` (that's what flows
795
+ * through the route point's `mapId`), so the filter compares against
796
+ * the active floor's `mapId`, NOT its `id` — those are two different
797
+ * JACS identifiers (`floor.id` is the building-floor record; `mapId`
798
+ * is the SVG asset). We accept the floor's `id` here for convenience
799
+ * and resolve to `mapId` via `getFloors()`.
800
+ *
801
+ * Applied imperatively rather than baked into the theme JSON so the
802
+ * filter tracks runtime floor changes without restyling the map.
803
+ */
804
+ private updateRouteFloorFilter;
805
+ isReady(): boolean;
806
+ private setFloorLayerVisibility;
807
+ private getBoundsPadding;
808
+ /**
809
+ * Shrink per-side padding if the requested insets would leave no room.
810
+ * `cameraForBounds` / `fitBounds` silently fail ("Map cannot fit within
811
+ * canvas") when an axis's total padding meets or exceeds that axis — cap
812
+ * each axis's total at 80% so a fit always has space to land.
813
+ */
814
+ private clampPadding;
815
+ private getVenueBounds;
816
+ /**
817
+ * Opening-framing policy applied once after the initial floor fit.
818
+ * - `initialPitch`: tilt to this and re-fit the building footprint so the
819
+ * kiosk opens on a tilted building instead of a flat top-down plan.
820
+ * - `minZoomBelowInitialFit`: clamp the map's minZoom to
821
+ * `(fitZoom − margin)` so visitors can't pull back to the empty region.
822
+ * Both are no-ops when their option is unset.
823
+ */
824
+ private applyInitialFraming;
825
+ private applyInitialViewFromVenue;
826
+ private loadAndPatchVenueStyle;
827
+ private ensureFloorLayersFromStyle;
828
+ private ensureCoreSources;
829
+ }
830
+ declare function createMinuteMapsSDK(config: SDKConfig): MinuteMaps;
831
+
832
+ export { MinuteMaps, createMinuteMapsSDK };
833
+ export type { Amenity, AmenityBadgeStyle, AmenityWithFloor, Bounds, BoundsPadding, CameraState, Destination, DestinationChipStyle, EventCallback, Floor, FloorMetadata, JMapAuth, JMapConfig, JacsAuth, JacsConfig, MapEvent, POI, POISearchResult, RoutePoint, RoutingOptions, SDKConfig, SDKOptions, ThemeName, ViewOptions, WayfindCenterMode, WayfindStep, Waypoint };