@micrio/client 6.1.1 → 6.1.3

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/micrio.min.d.ts CHANGED
@@ -88,14 +88,9 @@ declare module '@micrio/client' {
88
88
  * @returns A copy of the current screen viewport array, or undefined if not initialized.
89
89
  */
90
90
  getViewRaw: () => Float64Array;
91
- /**
92
- * Gets the current image view rectangle [x0, y0, x1, y1] relative to the image (0-1).
93
- * @returns A copy of the current screen viewport array, or undefined if not initialized.
94
- */
95
- getViewLegacy: () => Models.Camera.ViewRect | undefined;
96
91
  /**
97
92
  * Sets the camera view instantly to the specified viewport.
98
- * @param view The target viewport as either a View [x0, y0, x1, y1] or View {centerX, centerY, width, height}.
93
+ * @param view The target viewport as a View [x0, y0, width, height].
99
94
  * @param opts Options for setting the view.
100
95
  */
101
96
  setView(view: Models.Camera.View, opts?: {
@@ -184,7 +179,7 @@ declare module '@micrio/client' {
184
179
  aniIsKinetic(): boolean;
185
180
  /**
186
181
  * Animates the camera smoothly to a target viewport.
187
- * @param view The target viewport as either a View [x0, y0, x1, y1] or View {centerX, centerY, width, height}.
182
+ * @param view The target viewport as a View [x0, y0, width, height].
188
183
  * @param opts Optional animation settings.
189
184
  * @returns A Promise that resolves when the animation completes, or rejects if aborted.
190
185
  */
@@ -413,8 +408,6 @@ declare module '@micrio/client' {
413
408
  * @returns Formatted time string (e.g., "1:23", "1:05:09", "-0:15").
414
409
  */
415
410
  export function parseTime(s: number): string;
416
- /** Type for error codes */
417
- export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
418
411
  /**
419
412
  * Centralized data loading controller.
420
413
  * Uses the `bundle.json` endpoint which returns info + data for multiple
@@ -427,6 +420,7 @@ declare module '@micrio/client' {
427
420
  *
428
421
  * @author Marcel Duin <marcel@micr.io>
429
422
  */
423
+ type BundleImage = Models.ImageBundle.BundleImage;
430
424
  export const DataLoader: {
431
425
  /** Returns the info for an image ID, or undefined if not found in its bundle. */
432
426
  getInfo(id: string): Promise<Models.ImageInfo.ImageInfo | undefined>;
@@ -444,29 +438,16 @@ declare module '@micrio/client' {
444
438
  /** Returns the organisation data from the bundle, or undefined. */
445
439
  getOrganisation(): Models.ImageInfo.Organisation | undefined;
446
440
  /**
447
- * Returns both info + data for a single image ID, or undefined if the image
448
- * is not present in its bundle.
441
+ * Returns the full bundle entry (info + data) for a single image ID,
442
+ * fetching the bundle once if not cached.
449
443
  */
450
- getBundleImage(id: string): Promise<{
451
- data: Models.ImageData.ImageData;
452
- info: Models.ImageInfo.ImageInfo;
453
- } | undefined>;
454
- /**
455
- * Bulk variant of {@link getBundleImage}.
456
- *
457
- * Fetches the bundle for the first non‑IIIF ID, then resolves every requested
458
- * image from the cached bundle results.
459
- */
460
- getBundleImages(ids: string[]): Promise<Map<string, {
461
- info: Models.ImageInfo.ImageInfo;
462
- data: Models.ImageData.ImageData;
463
- }>>;
444
+ getBundleImage(id: string): Promise<BundleImage | undefined>;
464
445
  };
465
446
  /**
466
447
  * # Micrio State management
467
448
  *
468
449
  * Manages the application state using Svelte stores, allowing reactive updates
469
- * throughout the UI and providing methods to get/set the overall state.
450
+ * throughout the UI.
470
451
  * Replaces the imperative API of Micrio 3.x.
471
452
  *
472
453
  * Consists of two main state controllers:
@@ -477,46 +458,13 @@ declare module '@micrio/client' {
477
458
  * @author Marcel Duin <marcel@micr.io>
478
459
  */
479
460
  export namespace State {
480
- /** Represents the entire serializable state of a Micrio instance. */
481
- type MicrioStateJSON = {
482
- /** The ID of the currently active main image. */
483
- id: string;
484
- /** Array containing the state of each individual image canvas. */
485
- c: ImageState[];
486
- /** Optional information about the currently active tour [tourId, currentTime?, pausedState?]. */
487
- t?: [string, number?, string?];
488
- /** Reference to the currently active HTMLMediaElement (unused?). */
489
- m?: HTMLMediaElement;
490
- };
491
- /** Represents the serializable state of a single MicrioImage instance. */
492
- type ImageState = [
493
- /** The image ID. */
494
- string,
495
- /** The current viewport x0. */
496
- number,
497
- /** The current viewport y0. */
498
- number,
499
- /** The current viewport x1. */
500
- number,
501
- /** The current viewport y1. */
502
- number,
503
- /** The ID of the currently opened marker within this image (optional). */
504
- string?,
505
- /** The UUID of the media element associated with the opened marker (optional). */
506
- string?,
507
- /** The currentTime of the marker's media element (optional). */
508
- number?,
509
- /** The paused state ('p') of the marker's media element (optional). */
510
- string?
511
- ];
512
461
  /**
513
462
  * # HTMLMicrioElement state controller (`micrio.state`)
514
463
  *
515
464
  * Manages the global application state associated with the main `<micr-io>` element.
516
- * Provides Svelte stores for reactive UI updates and methods for state serialization.
465
+ * Provides Svelte stores for reactive UI updates.
517
466
  */
518
467
  class Main {
519
- private micrio;
520
468
  /** Writable Svelte store holding the currently active tour object (VideoTour or MarkerTour), or undefined if no tour is active. */
521
469
  readonly tour: Writable<Models.ImageData.VideoTour | Models.ImageData.MarkerTour | undefined>;
522
470
  /** Getter for the current value of the {@link tour} store. */
@@ -542,32 +490,6 @@ declare module '@micrio/client' {
542
490
  /** Writable store: true when gallery controls are hovered or focused, keeping all UI visible. */
543
491
  hover: Writable<boolean>;
544
492
  };
545
- /**
546
- * Gets the current state of the Micrio viewer as a serializable JSON object.
547
- * This object captures the active image(s), viewports, open markers, active tour,
548
- * and media playback states, allowing the exact state to be restored later or elsewhere.
549
- *
550
- * @example
551
- * ```javascript
552
- * const currentState = micrio.state.get();
553
- * // Store or transmit `currentState`
554
- * ```
555
- * @returns The current state as a {@link MicrioStateJSON} object, or undefined if no image is loaded.
556
- */
557
- get(): MicrioStateJSON | undefined;
558
- /**
559
- * Sets the Micrio viewer state from a previously saved {@link MicrioStateJSON} object.
560
- * This will attempt to restore the active image, viewports, open markers, active tour,
561
- * and media playback states.
562
- *
563
- * @example
564
- * ```javascript
565
- * const savedState = // ... load state object ...
566
- * micrio.state.set(savedState);
567
- * ```
568
- * @param s The state object to load.
569
- */
570
- set(s: MicrioStateJSON): Promise<void>;
571
493
  }
572
494
  /**
573
495
  * # MicrioImage state controller (`micrioImage.state`)
@@ -999,7 +921,7 @@ declare module '@micrio/client' {
999
921
  version: string;
1000
922
  /** Created date */
1001
923
  created?: number;
1002
- /** Has new viewport model, optimized for 360 images */
924
+ /** Has new viewport model, optimized for 360 images. Server-side only, not read client-side. */
1003
925
  viewsWH?: boolean;
1004
926
  /** For V5+: published revisions per language */
1005
927
  revision?: RevisionType;
@@ -1082,7 +1004,7 @@ declare module '@micrio/client' {
1082
1004
  type Settings = {
1083
1005
  /** The starting viewport */
1084
1006
  view?: Camera.View;
1085
- /** Restrict navigation to this viewport (`[x0,y0,x1,y1]`) */
1007
+ /** Restrict navigation to this viewport (`[x0, y0, width, height]`) */
1086
1008
  restrict?: Camera.View;
1087
1009
  /** Load a cover-initing image focussed on this coordinate (`[x, y]`) */
1088
1010
  focus?: [number, number];
@@ -1121,8 +1043,6 @@ declare module '@micrio/client' {
1121
1043
  keepRendering?: boolean;
1122
1044
  /** Don't load GTM module */
1123
1045
  noGTag?: boolean;
1124
- /** With routing enabled, enable marker/tour deeplinks */
1125
- routerMarkerTours?: boolean;
1126
1046
  /** Skip the deepest zoom levels */
1127
1047
  skipBaseLevels?: number;
1128
1048
  /** The camera animation speed (default: 1) */
@@ -1742,8 +1662,6 @@ declare module '@micrio/client' {
1742
1662
  keepMarkers?: boolean;
1743
1663
  /** Don't disable user navigation when running */
1744
1664
  keepInteraction?: boolean;
1745
- /** The tour is a direct outside instance using legacy [x0,y0,x1,y1] viewports */
1746
- isLegacy?: boolean;
1747
1665
  /** Current running tour instance */
1748
1666
  instance?: VideoTourInstance;
1749
1667
  };
@@ -2312,8 +2230,6 @@ declare module '@micrio/client' {
2312
2230
  'data-skipmeta'?: boolean;
2313
2231
  /** Simulate an <img/> element. No logo, loader bar, and no event listeners. Default: false */
2314
2232
  'data-static'?: boolean;
2315
- /** Read and write deeplinks to opened tours and markers. Default: null */
2316
- 'data-router'?: string;
2317
2233
  /** Sending user input as GA Events to any available GTag instance (does nothing if none). Default: true */
2318
2234
  'data-gtag'?: boolean;
2319
2235
  /** Set the speed factor for camera animations. Default: 1 */
@@ -2967,8 +2883,6 @@ declare module '@micrio/client' {
2967
2883
  readonly state: State.Main;
2968
2884
  /** The Google Analytics integration controller. */
2969
2885
  private readonly analytics;
2970
- /** The URL router, handling deep linking and history management. */
2971
- private readonly _router;
2972
2886
  /** Writable Svelte store indicating if barebone texture downloading is enabled (lower quality, less bandwidth). */
2973
2887
  readonly barebone: Writable<boolean>;
2974
2888
  /** Custom settings object provided programmatically, overriding server-fetched settings. */
@@ -3208,7 +3122,7 @@ declare module '@micrio/client' {
3208
3122
  /**
3209
3123
  * Parsed media source information.
3210
3124
  */
3211
- export interface ParsedMediaSource {
3125
+ interface ParsedMediaSource {
3212
3126
  /** The detected media type */
3213
3127
  type: MediaType;
3214
3128
  /** The frame type for iframe embeds (YouTube/Vimeo) */
@@ -3236,10 +3150,6 @@ declare module '@micrio/client' {
3236
3150
  * Parses a media source URL and determines its type and configuration.
3237
3151
  */
3238
3152
  export function parseMediaSource(src: string | undefined, tour: Models.ImageData.VideoTour | null, useNativeFrames?: boolean, currentTime?: number): ParsedMediaSource;
3239
- /**
3240
- * Checks if the browser natively supports HLS playback.
3241
- */
3242
- export function hasNativeHLS(el?: HTMLMediaElement): boolean;
3243
3153
  /**
3244
3154
  * Returns a shared Audio element instance for iOS.
3245
3155
  * This is a workaround for iOS audio playback restrictions where user
@@ -3309,7 +3219,6 @@ declare module '@micrio/client' {
3309
3219
  export { HLSPlayerAdapter } from "ts/media/hls-adapter";
3310
3220
  export { GLEmbedVideo } from "ts/media/embedvideo";
3311
3221
  export { VideoTourInstance } from "ts/media/videotour";
3312
- export { Router } from "ts/nav/router";
3313
3222
  export { Grid } from "ts/nav/grid";
3314
3223
  export { GallerySwiper } from "ts/nav/swiper";
3315
3224
  export { Engine } from "ts/render/engine";
@@ -3326,7 +3235,7 @@ declare module '@micrio/client' {
3326
3235
  */
3327
3236
  type MarkerData = Models.ImageData.Marker;
3328
3237
  export type MarkerCoords = [x: number, y: number, w?: number, h?: number];
3329
- export interface ClusterResult {
3238
+ interface ClusterResult {
3330
3239
  overlapped: number[];
3331
3240
  clusterMarkers: MarkerData[];
3332
3241
  }