@minmaps-dev/mm-web-sdk 1.0.0-rc.32 → 1.0.0-rc.33

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/dist/index.d.ts CHANGED
@@ -536,6 +536,23 @@ declare class AmenityManager {
536
536
  declare class MinuteMaps {
537
537
  private config;
538
538
  private map;
539
+ /**
540
+ * Generation token for `init()`. Bumped by every `init()` and by `destroy()`,
541
+ * so an init suspended on a network await can tell it has been superseded and
542
+ * bail instead of creating a map nobody holds a reference to.
543
+ *
544
+ * This is what makes `destroy()` safe *during* init: `destroy()` only removes
545
+ * `this.map`, which is still null until step 3, so a teardown that lands
546
+ * mid-fetch has nothing to clean up — and without this token the init would
547
+ * resume and build a fully live orphan (WebGL context, render loop, map-level
548
+ * listeners, YAH pulse) that can never be reached to shut down. React
549
+ * StrictMode's mount → unmount → mount does exactly this on every dev load.
550
+ *
551
+ * A counter, not a sticky `destroyed` flag: `destroy()` → `init()` re-init is
552
+ * a supported lifecycle (see the manager-class note in CLAUDE.md), so the
553
+ * instance has to stay usable after teardown.
554
+ */
555
+ private initGeneration;
539
556
  private data;
540
557
  private wayfindingProvider;
541
558
  private events;
@@ -564,6 +581,11 @@ declare class MinuteMaps {
564
581
  /** Captured destination-layer filters to restore when the selection clears,
565
582
  * or `null` when no destination focus is active. See `setDestinationFocus`. */
566
583
  private destFocusRestore;
584
+ /** The allow-list currently narrowing the destination layers, or `null` when
585
+ * no focus is active. Kept alongside `destFocusRestore` (which holds the
586
+ * *previous* filters, not the ids) so `setTheme` can re-apply the same focus
587
+ * to the new style's layers after a swap discards the old ones. */
588
+ private destFocusIds;
567
589
  private youAreHerePulse;
568
590
  /** Theme layers whose features represent a tappable destination/amenity.
569
591
  * A click hit-tests these (see `SelectionManager`) → `poiSelected`. The
@@ -602,6 +624,25 @@ declare class MinuteMaps {
602
624
  private poiVisibleTypes;
603
625
  constructor(config: SDKConfig);
604
626
  init(): Promise<void>;
627
+ /**
628
+ * Supply an image the current style has requested but doesn't have.
629
+ *
630
+ * Every imperatively-registered image is served from here, because a theme
631
+ * swap (`setStyle` with `diff: false`) drops all of them and the code that
632
+ * registered them doesn't run again:
633
+ *
634
+ * - the **route arrow** isn't in the sprite sheet at all — it's canvas-drawn
635
+ * on demand (this was already the case);
636
+ * - **amenity / destination icons** come back from `iconCache`. Their
637
+ * registrars run only during `init`, so before this they went missing on
638
+ * the first theme swap and never returned — the map kept the dots and
639
+ * labels but lost every badge and logo.
640
+ *
641
+ * Serving lazily (rather than re-registering everything on `style.load`)
642
+ * means only the ids the new style actually asks for are restored, with no
643
+ * refetch and no re-compositing.
644
+ */
645
+ private serveMissingStyleImage;
605
646
  on(event: string, cb: (e: MapEvent) => void): void;
606
647
  off(event: string, cb?: (e: MapEvent) => void): void;
607
648
  addControl(control: IControl, position?: ControlPosition): void;