@micrio/client 7.1.9 → 7.2.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/micrio.min.d.ts CHANGED
@@ -7,12 +7,12 @@ declare module '@micrio/client' {
7
7
  * This data is created in the [Micrio editor](https://dash.micr.io/), and published as static JSON file per image.
8
8
  */
9
9
  export namespace Models {
10
- export type I18n<T> = {
10
+ export interface I18n<T> {
11
11
  [lang: string]: T;
12
- };
13
- export type RevisionType = {
12
+ }
13
+ export interface RevisionType {
14
14
  [key: string]: number;
15
- };
15
+ }
16
16
  export namespace Camera {
17
17
  /** A numeric array or Float64Array used for camera geometry. */
18
18
  type CameraArray = number[] | Float64Array;
@@ -21,12 +21,12 @@ declare module '@micrio/client' {
21
21
  /** Coordinate tuple, [x, y, scale] */
22
22
  type Coords = [number, number, number?] | Float64Array;
23
23
  /** A 360 vector for use in Spaces */
24
- type Vector = {
24
+ interface Vector {
25
25
  direction: number;
26
26
  distanceX: number;
27
27
  distanceY: number;
28
- };
29
- type TimingFunction = ('ease' | 'ease-in' | 'ease-out' | 'linear');
28
+ }
29
+ type TimingFunction = 'ease' | 'ease-in' | 'ease-out' | 'linear';
30
30
  interface AnimationOptions {
31
31
  /** Animation duration in ms */
32
32
  duration?: number;
@@ -47,7 +47,7 @@ declare module '@micrio/client' {
47
47
  /** The embed will have a minimal memory footprint, without its own camera */
48
48
  asImage?: boolean;
49
49
  /** Fit the embed's original size into the specified area. Defaults to 'stretch' */
50
- fit?: ('contain' | 'cover' | 'stretch');
50
+ fit?: 'contain' | 'cover' | 'stretch';
51
51
  }
52
52
  }
53
53
  export namespace Attributes {
@@ -60,9 +60,9 @@ declare module '@micrio/client' {
60
60
  type EmbedGLMode = 'auto' | 'true' | 'false';
61
61
  interface MicrioCustomAttributes {
62
62
  /** The image ID */
63
- 'id'?: string;
63
+ id?: string;
64
64
  /** The data language code to use. Default: 'en' */
65
- 'lang'?: string;
65
+ lang?: string;
66
66
  /** For custom hosted Micrio images, specify the root URL. Default: Based on image */
67
67
  'data-path'?: string;
68
68
  /** Set this to 'cover' to start the image using the full viewport. Default: undefined */
@@ -70,7 +70,7 @@ declare module '@micrio/client' {
70
70
  /** The user cannot zoom out further than the full viewport. Default: undefined */
71
71
  'data-coverlimit'?: boolean;
72
72
  /** Only start loading the image when it's been scrolled into the user's view. Default: false */
73
- 'lazyload'?: boolean;
73
+ lazyload?: boolean;
74
74
  /** Do not load any metadata (markers, tours, etc). Default: false */
75
75
  'data-skipmeta'?: boolean;
76
76
  /** Simulate an <img/> element. No logo, loader bar, and no event listeners. Default: false */
@@ -130,9 +130,9 @@ declare module '@micrio/client' {
130
130
  /** The minimap width in pixels. Default: 200 */
131
131
  'data-minimap-width'?: number;
132
132
  /** All audio will be disabled if this attribute is present. */
133
- 'muted'?: boolean;
133
+ muted?: boolean;
134
134
  /** The general sound volume for music/sfx (between 0 and 1). Default: 1 */
135
- 'volume'?: number;
135
+ volume?: number;
136
136
  /** Fade music to this volume while other audio plays (between 0 and 1). Default: 0 */
137
137
  'data-mutedvolume'?: number;
138
138
  /** How embedded images/videos are rendered. `'auto'` (default, same as omitting
@@ -177,7 +177,7 @@ declare module '@micrio/client' {
177
177
  }
178
178
  /** Assets (audio, video, images) */
179
179
  export namespace Assets {
180
- type BaseAsset = {
180
+ interface BaseAsset {
181
181
  /** The asset title (not filename) */
182
182
  title: string;
183
183
  /** The asset file name */
@@ -188,7 +188,7 @@ declare module '@micrio/client' {
188
188
  size: number;
189
189
  /** Created */
190
190
  uploaded: number;
191
- };
191
+ }
192
192
  type Audio = BaseAsset & {
193
193
  /** The sample duration */
194
194
  duration: number;
@@ -325,48 +325,48 @@ declare module '@micrio/client' {
325
325
  }
326
326
  }
327
327
  /**
328
- * # Base image data
329
- *
330
- * The MicrioData.ImageInfo.ImageInfo JSON data object, containing all basic image properties.
331
- *
332
- * The static image information, such as original resolution, image type, title, and all non-language specific **settings** ({@link ImageInfo.Settings}), such as initial viewport, camera behavior, and 360&deg; settings.
333
- *
334
- * The only required field is `id`. If only the `id` field is specified, Micrio attempts to download the additional image data by itself (`info.json`), published by the Micrio servers. This data will also include image title, and any custom viewing settings set in the image editor.
335
- *
336
- * This is a minimal accepted example:
337
- *
338
- * ```json
339
- * {
340
- * "id": "dzzLm",
341
- * }
342
- * ```
343
- *
344
- * If you have manually entered the image `width` and `height`, _it will not download_ the `info.json` file, assuming you have provided correct and complete data:
345
- *
346
- * ```json
347
- * {
348
- * "id": "dzzLm",
349
- * "width": 41472,
350
- * "height": 30219
351
- * }
352
- * ```
353
- *
354
- * Optionally, when using {@link HTMLMicrioElement} `<micr-io>` tag attributes, these will overwrite whatever is loaded from the server. So if in the Micrio editor you have enabled the fullscreen toggle button, you can disable it in your own HTML using `<micr-io data-fullscreen="false">`.
355
- *
356
- *
357
- */
328
+ * # Base image data
329
+ *
330
+ * The MicrioData.ImageInfo.ImageInfo JSON data object, containing all basic image properties.
331
+ *
332
+ * The static image information, such as original resolution, image type, title, and all non-language specific **settings** ({@link ImageInfo.Settings}), such as initial viewport, camera behavior, and 360&deg; settings.
333
+ *
334
+ * The only required field is `id`. If only the `id` field is specified, Micrio attempts to download the additional image data by itself (`info.json`), published by the Micrio servers. This data will also include image title, and any custom viewing settings set in the image editor.
335
+ *
336
+ * This is a minimal accepted example:
337
+ *
338
+ * ```json
339
+ * {
340
+ * "id": "dzzLm",
341
+ * }
342
+ * ```
343
+ *
344
+ * If you have manually entered the image `width` and `height`, _it will not download_ the `info.json` file, assuming you have provided correct and complete data:
345
+ *
346
+ * ```json
347
+ * {
348
+ * "id": "dzzLm",
349
+ * "width": 41472,
350
+ * "height": 30219
351
+ * }
352
+ * ```
353
+ *
354
+ * Optionally, when using {@link HTMLMicrioElement} `<micr-io>` tag attributes, these will overwrite whatever is loaded from the server. So if in the Micrio editor you have enabled the fullscreen toggle button, you can disable it in your own HTML using `<micr-io data-fullscreen="false">`.
355
+ *
356
+ *
357
+ */
358
358
  export namespace ImageInfo {
359
359
  /** A Micrio image's main static image data object */
360
- type ImageInfo = {
360
+ interface ImageInfo {
361
361
  /** The image id */
362
362
  id: string;
363
363
  /** The image base path URI, with a trailing `/`
364
364
  * @default https://b.micr.io/
365
- */
365
+ */
366
366
  path: string;
367
367
  /** The Micrio version this image was created in
368
368
  * @default autoloaded
369
- */
369
+ */
370
370
  version: string;
371
371
  /** Created date */
372
372
  created?: number;
@@ -376,15 +376,15 @@ declare module '@micrio/client' {
376
376
  revision?: RevisionType;
377
377
  /** The original image width
378
378
  * @default autoloaded
379
- */
379
+ */
380
380
  width: number;
381
381
  /** The original image height
382
382
  * @default autoloaded
383
- */
383
+ */
384
384
  height: number;
385
385
  /** The original tile size in px
386
386
  * @default 1024
387
- */
387
+ */
388
388
  tileSize?: number;
389
389
  /** Use an alternative image ID for the image tiles */
390
390
  tilesId?: string;
@@ -416,7 +416,7 @@ declare module '@micrio/client' {
416
416
  albumId?: string;
417
417
  /** The 360 tour space ID */
418
418
  spacesId?: string;
419
- };
419
+ }
420
420
  interface Organisation {
421
421
  name: string;
422
422
  slug: string;
@@ -428,7 +428,7 @@ declare module '@micrio/client' {
428
428
  fontFamily?: string;
429
429
  }
430
430
  /** Micrio image settings */
431
- type Settings = {
431
+ interface Settings {
432
432
  /** The starting viewport */
433
433
  view?: Camera.View;
434
434
  /** Restrict navigation to this viewport (`[x0, y0, width, height]`) */
@@ -437,7 +437,7 @@ declare module '@micrio/client' {
437
437
  focus?: [number, number];
438
438
  /** When opening the image without a predefined deeplink, open this */
439
439
  start?: {
440
- type: ('marker' | 'markerTour' | 'tour' | 'page');
440
+ type: 'marker' | 'markerTour' | 'tour' | 'page';
441
441
  id: string;
442
442
  };
443
443
  /** Use a custom uri for the info json file */
@@ -547,7 +547,7 @@ declare module '@micrio/client' {
547
547
  /** The clustered marker radius */
548
548
  clusterMarkerRadius?: number;
549
549
  /** Dark/light theme */
550
- theme?: ("dark" | "light" | "os");
550
+ theme?: 'dark' | 'light' | 'os';
551
551
  /** Load a custom JS file with this image */
552
552
  js?: {
553
553
  /** The asset href */
@@ -600,7 +600,7 @@ declare module '@micrio/client' {
600
600
  * uniform sampler2D u_image; // the render buffer texture
601
601
  * varying vec2 v_texCoord; // the texture coordinate
602
602
  * uniform float u_time; // elapsed time in seconds
603
- */
603
+ */
604
604
  postProcessingFragmentShader?: string;
605
605
  /** Watermark opacity, defaults to 0.075 */
606
606
  watermarkOpacity?: number;
@@ -610,8 +610,8 @@ declare module '@micrio/client' {
610
610
  noFollow?: boolean;
611
611
  /** Split-screen: if false, the secondary image is display-only (no user interaction). */
612
612
  secondaryInteractive?: boolean;
613
- };
614
- type OmniSettings = {
613
+ }
614
+ interface OmniSettings {
615
615
  /** Number of frames */
616
616
  frames: number;
617
617
  /** Starting frame index */
@@ -644,9 +644,9 @@ declare module '@micrio/client' {
644
644
  twoAxes?: boolean;
645
645
  /** Don't add key bindings for rotating */
646
646
  noKeys?: boolean;
647
- };
647
+ }
648
648
  /** Image-wide marker settings */
649
- type MarkerSettings = {
649
+ interface MarkerSettings {
650
650
  /** An image-wise custom marker icon */
651
651
  markerIcon?: Assets.Image;
652
652
  /** The default marker color */
@@ -689,9 +689,9 @@ declare module '@micrio/client' {
689
689
  keepPopupsDuringTourTransitions?: boolean;
690
690
  /** Optional custom uploaded icons */
691
691
  customIcons?: Assets.Image[];
692
- };
692
+ }
693
693
  /** Custom interface settings */
694
- type UserInterfaceSettings = {
694
+ interface UserInterfaceSettings {
695
695
  controls?: {
696
696
  /** Show the culture switch button if there are multiple available languages */
697
697
  cultureSwitch?: boolean;
@@ -699,7 +699,7 @@ declare module '@micrio/client' {
699
699
  serialTourNoTimeScrub?: boolean;
700
700
  };
701
701
  icons?: Partial<Record<IconName, string>>;
702
- };
702
+ }
703
703
  }
704
704
  export interface Album {
705
705
  /** The number of pages in this album */
@@ -722,15 +722,17 @@ declare module '@micrio/client' {
722
722
  currentImage?: Writable<MicrioImage>;
723
723
  }
724
724
  /** Gallery configuration */
725
- export type GalleryConfig = {
726
- type: 'swipe' | 'switch' | 'grid' | 'book3d';
725
+ export interface GalleryConfig {
726
+ /** The gallery type; unset while a gallery config is still being collected from attributes. */
727
+ type?: 'swipe' | 'switch' | 'grid' | 'book3d';
727
728
  startId?: string;
728
729
  sort?: 'name' | '-name' | 'created' | '-created' | 'random';
729
730
  isSpreads?: boolean;
730
731
  coverPages?: number;
731
732
  archive?: string;
732
733
  archiveLayerOffset?: number;
733
- revisions?: Record<string, Record<string, any>>;
734
+ revisions?: Record<string, Record<string, unknown>>;
735
+ /** Custom gallery settings JSON. */
734
736
  settings?: Record<string, any>;
735
737
  id?: string;
736
738
  name?: string;
@@ -738,11 +740,11 @@ declare module '@micrio/client' {
738
740
  clickable?: 'focus' | 'zoom' | false;
739
741
  panZoom?: 'cells' | 'grid';
740
742
  };
741
- };
743
+ }
742
744
  export namespace Grid {
743
745
  /** Grid .focus() transition from current view */
744
- type MarkerFocusTransition = ('crossfade' | 'slide' | 'slide-horiz' | 'slide-vert' | 'slide-up' | 'slide-down' | 'slide-right' | 'slide-left' | 'swipe' | 'swipe-horiz' | 'swipe-vert' | 'swipe-up' | 'swipe-down' | 'swipe-right' | 'swipe-left' | 'behind' | 'behind-left' | 'behind-right');
745
- type GridSetTransition = ('crossfade' | 'behind' | 'behind-delayed' | 'appear-delayed');
746
+ type MarkerFocusTransition = 'crossfade' | 'slide' | 'slide-horiz' | 'slide-vert' | 'slide-up' | 'slide-down' | 'slide-right' | 'slide-left' | 'swipe' | 'swipe-horiz' | 'swipe-vert' | 'swipe-up' | 'swipe-down' | 'swipe-right' | 'swipe-left' | 'behind' | 'behind-left' | 'behind-right';
747
+ type GridSetTransition = 'crossfade' | 'behind' | 'behind-delayed' | 'appear-delayed';
746
748
  /** Virtual ImageInfo extension to support grid logic */
747
749
  interface GridImage {
748
750
  id: string;
@@ -770,75 +772,75 @@ declare module '@micrio/client' {
770
772
  }
771
773
  }
772
774
  /**
773
- * # Image content data
774
- *
775
- * The image content {@link ImageData} JSON object, which is accessible as {@link MicrioImage.data} as the Writable store, and {@link MicrioImage.$data} for its current value.
776
- *
777
- * This JSON data includes, for all published languages for this image:
778
- *
779
- * * Markers
780
- * * Marker tours
781
- * * Video tours
782
- * * Audio, music
783
- * * In-image embeds
784
- * * Custom menu screens and content pages
785
- *
786
- * To access the data of the current viewed image, use:
787
- *
788
- * ```js
789
- * // The current shown image value of the .data store Writable
790
- * const data = micrio.$current.$data;
791
- *
792
- * if(data) console.log(`The current image has ${data.markers.length} markers!`);
793
- * else console.warn('The current image has no data set.');
794
- * ```
795
- *
796
- * To subscribe to any data changes:
797
- *
798
- * ```js
799
- * micrio.$current.data.subscribe(data => {
800
- * console.log('Image has new or updated data!', data);
801
- * })
802
- * ```
803
- *
804
- * To set your own custom data:
805
- *
806
- * ```js
807
- * micrio.$current.data.set({
808
- * "markers": [
809
- * {
810
- * "i18n": {
811
- * "en": {
812
- * "title": "This is a test marker!"
813
- * }
814
- * },
815
- * "x": .5,
816
- * "y": .5
817
- * }
818
- * ]
819
- * })
820
- * ```
821
- *
822
- * Or to update an existing loaded data object:
823
- *
824
- * ```js
825
- * micrio.$current.data.update(data => {
826
- * data.markers.push({
827
- * "i18n": {
828
- * "en": {
829
- * "title": "This is a newly added marker"
830
- * }
831
- * },
832
- * "x": .6,
833
- * "y": .5
834
- * });
835
- * return data;
836
- * })
837
- * ```
838
- */
775
+ * # Image content data
776
+ *
777
+ * The image content {@link ImageData} JSON object, which is accessible as {@link MicrioImage.data} as the Writable store, and {@link MicrioImage.$data} for its current value.
778
+ *
779
+ * This JSON data includes, for all published languages for this image:
780
+ *
781
+ * * Markers
782
+ * * Marker tours
783
+ * * Video tours
784
+ * * Audio, music
785
+ * * In-image embeds
786
+ * * Custom menu screens and content pages
787
+ *
788
+ * To access the data of the current viewed image, use:
789
+ *
790
+ * ```js
791
+ * // The current shown image value of the .data store Writable
792
+ * const data = micrio.$current.$data;
793
+ *
794
+ * if(data) console.log(`The current image has ${data.markers.length} markers!`);
795
+ * else console.warn('The current image has no data set.');
796
+ * ```
797
+ *
798
+ * To subscribe to any data changes:
799
+ *
800
+ * ```js
801
+ * micrio.$current.data.subscribe(data => {
802
+ * console.log('Image has new or updated data!', data);
803
+ * })
804
+ * ```
805
+ *
806
+ * To set your own custom data:
807
+ *
808
+ * ```js
809
+ * micrio.$current.data.set({
810
+ * "markers": [
811
+ * {
812
+ * "i18n": {
813
+ * "en": {
814
+ * "title": "This is a test marker!"
815
+ * }
816
+ * },
817
+ * "x": .5,
818
+ * "y": .5
819
+ * }
820
+ * ]
821
+ * })
822
+ * ```
823
+ *
824
+ * Or to update an existing loaded data object:
825
+ *
826
+ * ```js
827
+ * micrio.$current.data.update(data => {
828
+ * data.markers.push({
829
+ * "i18n": {
830
+ * "en": {
831
+ * "title": "This is a newly added marker"
832
+ * }
833
+ * },
834
+ * "x": .6,
835
+ * "y": .5
836
+ * });
837
+ * return data;
838
+ * })
839
+ * ```
840
+ */
839
841
  export namespace ImageData {
840
842
  /** The main data JSON structure */
841
- type ImageData = {
843
+ interface ImageData {
842
844
  /** V5+: Save revision */
843
845
  revision?: RevisionType;
844
846
  /** Localized image details */
@@ -862,7 +864,7 @@ declare module '@micrio/client' {
862
864
  /** The music audio volume [0-1] (default: `1`) */
863
865
  volume?: number;
864
866
  };
865
- };
867
+ }
866
868
  interface ImageDetailsCultureData {
867
869
  /** Optional lang-specific image title */
868
870
  title?: string;
@@ -894,7 +896,7 @@ declare module '@micrio/client' {
894
896
  embedDescription?: string;
895
897
  }
896
898
  /** A Marker */
897
- type Marker = {
899
+ interface Marker {
898
900
  /** The marker ID */
899
901
  id: string;
900
902
  /** The relative marker X coordinate [0-1] */
@@ -915,9 +917,9 @@ declare module '@micrio/client' {
915
917
  /** If an image has multiple layers, switch to this layer */
916
918
  imageLayer?: number;
917
919
  /** Content type, for displaying */
918
- type?: ('default' | 'image' | 'audio' | 'video' | 'media' | 'link' | 'waypoint' | 'cluster');
920
+ type?: 'default' | 'image' | 'audio' | 'video' | 'media' | 'link' | 'waypoint' | 'cluster';
919
921
  /** Popup type */
920
- popupType?: ('popup' | 'popover' | 'none' | 'micrioLink');
922
+ popupType?: 'popup' | 'popover' | 'none' | 'micrioLink';
921
923
  /** If type is area, this HTML embed will be used for the marker */
922
924
  clickableArea?: Embed;
923
925
  /** Custom marker tags which will be also used as classnames on the marker elements */
@@ -942,9 +944,9 @@ declare module '@micrio/client' {
942
944
  onclick?: (m: ImageData.Marker) => void;
943
945
  /** Additional options */
944
946
  data?: MarkerData;
945
- };
947
+ }
946
948
  /** Optional individual marker settings */
947
- type MarkerData = {
949
+ interface MarkerData {
948
950
  /** A custom marker icon image */
949
951
  icon?: Assets.Image;
950
952
  /** A predefined custom icon idx in MarkerSettings */
@@ -955,7 +957,7 @@ declare module '@micrio/client' {
955
957
  noAnimate?: boolean;
956
958
  /** Show the title below the marker
957
959
  * @deprecated Use the main marker setting for this
958
- */
960
+ */
959
961
  showTitle?: boolean;
960
962
  /** Don't open a large image viewer/gallery on image click */
961
963
  preventImageOpen?: boolean;
@@ -983,9 +985,9 @@ declare module '@micrio/client' {
983
985
  /** When opening this marker inside a grid, resize the tile to this */
984
986
  gridSize?: number | string;
985
987
  /** Any other value is accepted */
986
- [key: string]: any;
988
+ [key: string]: unknown;
987
989
  };
988
- };
990
+ }
989
991
  /**
990
992
  * An embedded element inside the main image. This could be an image,
991
993
  * iframe embed, or simple empty HTML element (Spaces).
@@ -1015,7 +1017,7 @@ declare module '@micrio/client' {
1015
1017
  /** Opacity */
1016
1018
  opacity?: number;
1017
1019
  /** Click interaction */
1018
- clickAction?: ('markerId' | 'href');
1020
+ clickAction?: 'markerId' | 'href';
1019
1021
  /** Click action target */
1020
1022
  clickTarget?: string;
1021
1023
  /** Opens link in new window */
@@ -1052,8 +1054,8 @@ declare module '@micrio/client' {
1052
1054
  }
1053
1055
  /** The MicrioTour abstract shared class for both {@link MarkerTour} and {@link VideoTour}
1054
1056
  * @abstract
1055
- */
1056
- type Tour = {
1057
+ */
1058
+ interface Tour {
1057
1059
  /** The tour id */
1058
1060
  id: string;
1059
1061
  /** Localized tour culture data */
@@ -1064,9 +1066,9 @@ declare module '@micrio/client' {
1064
1066
  cannotClose?: boolean;
1065
1067
  /** Exit the tour on finish */
1066
1068
  closeOnFinish?: boolean;
1067
- };
1069
+ }
1068
1070
  /** A single videotour timeline viewport */
1069
- type VideoTourView = {
1071
+ interface VideoTourView {
1070
1072
  /** Start time in seconds */
1071
1073
  start: number;
1072
1074
  /** End time in seconds */
@@ -1075,7 +1077,7 @@ declare module '@micrio/client' {
1075
1077
  title?: string;
1076
1078
  /** View rectangle */
1077
1079
  rect: Camera.View;
1078
- };
1080
+ }
1079
1081
  interface VideoTourCultureData extends TourCultureData {
1080
1082
  /** The tour duration in seconds */
1081
1083
  duration: number;
@@ -1103,7 +1105,7 @@ declare module '@micrio/client' {
1103
1105
  instance?: VideoTourInstance;
1104
1106
  };
1105
1107
  /** Timed events inside a {@link VideoTour} */
1106
- type Event = {
1108
+ interface Event {
1107
1109
  /** Start time in seconds */
1108
1110
  start: number;
1109
1111
  /** End time in seconds */
@@ -1116,7 +1118,7 @@ declare module '@micrio/client' {
1116
1118
  id?: string;
1117
1119
  /** The event is currently active */
1118
1120
  active?: boolean;
1119
- };
1121
+ }
1120
1122
  /**
1121
1123
  * A Micrio marker tour -- a sequence of markers, which the user can navigate
1122
1124
  * through. This is created in the [Micrio editor](https://dash.micr.io/).
@@ -1152,7 +1154,7 @@ declare module '@micrio/client' {
1152
1154
  goto?: (n: number) => void;
1153
1155
  };
1154
1156
  /** Auto generated metadata for marker tours */
1155
- type MarkerTourStepInfo = {
1157
+ interface MarkerTourStepInfo {
1156
1158
  markerId: string;
1157
1159
  micrioId: string;
1158
1160
  duration: number;
@@ -1166,14 +1168,14 @@ declare module '@micrio/client' {
1166
1168
  /** Media has ended */
1167
1169
  ended?: boolean;
1168
1170
  hasSubtitle?: boolean;
1169
- };
1171
+ }
1170
1172
  interface MenuPageButton {
1171
1173
  /** Localized button title */
1172
1174
  i18nTitle: {
1173
1175
  [key: string]: string;
1174
1176
  };
1175
1177
  /** Button action type */
1176
- type: ('close' | 'marker' | 'mtour' | 'vtour' | 'link');
1178
+ type: 'close' | 'marker' | 'mtour' | 'vtour' | 'link';
1177
1179
  /** The action value */
1178
1180
  action?: string;
1179
1181
  /** Link opens in net tab */
@@ -1192,7 +1194,7 @@ declare module '@micrio/client' {
1192
1194
  * websites, or direct links to opening a marker.
1193
1195
  * This is created in the [Micrio editor](https://dash.micr.io/).
1194
1196
  */
1195
- type Menu = {
1197
+ interface Menu {
1196
1198
  /** The menu ID */
1197
1199
  id: string;
1198
1200
  /** Localized culture data */
@@ -1211,20 +1213,20 @@ declare module '@micrio/client' {
1211
1213
  image?: Assets.Image;
1212
1214
  /** Custom page action buttons */
1213
1215
  buttons?: MenuPageButton[];
1214
- };
1216
+ }
1215
1217
  }
1216
1218
  /**
1217
1219
  * A bundled image response from the `bundle.json` endpoint.
1218
1220
  * Contains both info and data for one or more related images in a single response.
1219
1221
  */
1220
1222
  export namespace ImageBundle {
1221
- type BundleImage = {
1223
+ interface BundleImage {
1222
1224
  id: string;
1223
1225
  info: ImageInfo.ImageInfo;
1224
1226
  data?: ImageData.ImageData;
1225
1227
  settings?: Partial<ImageInfo.Settings>;
1226
- };
1227
- type BundleResponse = {
1228
+ }
1229
+ interface BundleResponse {
1228
1230
  images: BundleImage[];
1229
1231
  organisation?: ImageInfo.Organisation;
1230
1232
  spaces?: {
@@ -1233,52 +1235,52 @@ declare module '@micrio/client' {
1233
1235
  }[];
1234
1236
  album?: GalleryConfig;
1235
1237
  tours?: ImageData.MarkerTour[];
1236
- };
1238
+ }
1237
1239
  }
1238
- export type MicrioEvent<T = any> = Event & {
1240
+ export type MicrioEvent<T = unknown> = Event & {
1239
1241
  detail: T;
1240
1242
  };
1241
1243
  export interface MicrioEventDetails {
1242
1244
  /** The main Micrio image is loaded and fully shown */
1243
- 'show': HTMLMicrioElement;
1245
+ show: HTMLMicrioElement;
1244
1246
  /** Before the ImageInfo settings are read, this event allows you to alter them */
1245
1247
  'pre-info': ImageInfo.ImageInfo;
1246
1248
  /** Before the ImageData contents are read, this event allows you to alter it */
1247
1249
  'pre-data': {
1248
1250
  [micrioId: string]: ImageData.ImageData;
1249
1251
  };
1250
- /** The main Micrio element has initialized and is being printed */
1251
- 'print': ImageInfo.ImageInfo;
1252
+ /** The main Micrio element has initialized and is being printed. The detail carries the parsed attribute options, which are partial. */
1253
+ print: Partial<ImageInfo.ImageInfo>;
1252
1254
  /** Individual image data is loaded and Micrio will start rendering */
1253
- 'load': MicrioImage;
1255
+ load: MicrioImage;
1254
1256
  /** The user has switched available languages */
1255
1257
  'lang-switch': string;
1256
1258
  /** The camera has zoomed */
1257
- 'zoom': {
1259
+ zoom: {
1258
1260
  image: MicrioImage;
1259
1261
  view: Camera.View;
1260
1262
  };
1261
1263
  /** The camera has moved */
1262
- 'move': {
1264
+ move: {
1263
1265
  image: MicrioImage;
1264
1266
  view: Camera.View;
1265
1267
  };
1266
1268
  /** A frame has been drawn */
1267
- 'draw': void;
1269
+ draw: void;
1268
1270
  /** The <micr-io> element was resized */
1269
- 'resize': DOMRect;
1271
+ resize: DOMRect;
1270
1272
  /** The user has started panning */
1271
- 'panstart': void;
1273
+ panstart: void;
1272
1274
  /** The user has stopped panning */
1273
- 'panend': {
1275
+ panend: {
1274
1276
  duration: number;
1275
1277
  movedX: number;
1276
1278
  movedY: number;
1277
1279
  };
1278
1280
  /** The user has stopped pinching */
1279
- 'pinchstart': void;
1281
+ pinchstart: void;
1280
1282
  /** The user has stopped pinching */
1281
- 'pinchend': {
1283
+ pinchend: {
1282
1284
  duration: number;
1283
1285
  movedX: number;
1284
1286
  movedY: number;
@@ -1330,7 +1332,7 @@ declare module '@micrio/client' {
1330
1332
  /** Media has ended */
1331
1333
  'media-ended': void;
1332
1334
  /** A media timeupdate tick */
1333
- 'timeupdate': number;
1335
+ timeupdate: number;
1334
1336
  /** A custom popover page was opened */
1335
1337
  'page-open': ImageData.Menu;
1336
1338
  /** A custom popover page was closed */
@@ -1352,7 +1354,7 @@ declare module '@micrio/client' {
1352
1354
  /** A split-screen secondary image has been closed */
1353
1355
  'splitscreen-stop': MicrioImage;
1354
1356
  /** When there is any user action, this event fires. Deferred and fires at a maximum rate of every 500ms */
1355
- 'update': Array<string>;
1357
+ update: string[];
1356
1358
  }
1357
1359
  export type MicrioEventMap = {
1358
1360
  [K in keyof MicrioEventDetails]: MicrioEvent<MicrioEventDetails[K]>;
@@ -1360,7 +1362,7 @@ declare module '@micrio/client' {
1360
1362
  }
1361
1363
 
1362
1364
  /** Names of all icons available in the Micrio UI icon library. */
1363
- export type IconName = ('zoomIn' | 'zoomOut' | 'fullscreenEnter' | 'fullscreenLeave' | 'close' | 'next' | 'down' | 'prev' | 'up' | 'rotateLeft' | 'rotateRight' | 'play' | 'pause' | 'subtitles' | 'subtitlesOff' | 'muted' | 'unmuted' | 'playFilled' | 'a11y' | 'menu' | 'audio' | 'video' | 'share' | 'error' | 'chevronDown' | 'link' | 'linkExt' | 'ellipsisVertical' | 'image' | 'layerGroup');
1365
+ export type IconName = 'zoomIn' | 'zoomOut' | 'fullscreenEnter' | 'fullscreenLeave' | 'close' | 'next' | 'down' | 'prev' | 'up' | 'rotateLeft' | 'rotateRight' | 'play' | 'pause' | 'subtitles' | 'subtitlesOff' | 'muted' | 'unmuted' | 'playFilled' | 'a11y' | 'menu' | 'audio' | 'video' | 'share' | 'error' | 'chevronDown' | 'link' | 'linkExt' | 'ellipsisVertical' | 'image' | 'layerGroup';
1364
1366
 
1365
1367
  /**
1366
1368
  * # Store API in Micrio
@@ -1439,16 +1441,16 @@ declare module '@micrio/client' {
1439
1441
  type Updater<T> = (value: T) => T;
1440
1442
  /** A read-only store that emits value changes to subscribers. */
1441
1443
  export interface Readable<T> {
1442
- subscribe(this: void, run: Subscriber<T>, invalidate?: (value?: T) => void): Unsubscriber;
1444
+ subscribe: (this: void, run: Subscriber<T>, invalidate?: (value?: T) => void) => Unsubscriber;
1443
1445
  }
1444
1446
  /** A writable store that supports setting and updating its value. */
1445
1447
  export interface Writable<T> extends Readable<T> {
1446
- set(value: T): void;
1447
- update(fn: Updater<T>): void;
1448
+ set: (value: T) => void;
1449
+ update: (fn: Updater<T>) => void;
1448
1450
  }
1449
1451
  /** Synchronously reads the current value of a store by subscribing and immediately unsubscribing. */
1450
1452
  export function get<T>(store: {
1451
- subscribe(fn: Subscriber<T>): Unsubscriber;
1453
+ subscribe: (fn: Subscriber<T>) => Unsubscriber;
1452
1454
  }): T;
1453
1455
  export type { Subscriber, Unsubscriber, Updater };
1454
1456
 
@@ -1690,7 +1692,7 @@ declare module '@micrio/client' {
1690
1692
  * Provides a standard lifecycle and prop/render pattern, store subscription helpers,
1691
1693
  * and a context (provide/inject) system for parent-child communication.
1692
1694
  */
1693
- export abstract class MicrioElement<_P = {}> extends HTMLElement {
1695
+ export abstract class MicrioElement<_P extends object = Record<string, unknown>> extends HTMLElement {
1694
1696
  #private;
1695
1697
  }
1696
1698
 
@@ -2364,7 +2366,7 @@ declare module '@micrio/client' {
2364
2366
  * This likely affects how viewports are calculated or limited.
2365
2367
  * @param width The horizontal offset margin in pixels.
2366
2368
  * @param height The vertical offset margin in pixels.
2367
- */
2369
+ */
2368
2370
  setMargins(width: number, height: number): void;
2369
2371
  }
2370
2372
 
@@ -2396,7 +2398,7 @@ declare module '@micrio/client' {
2396
2398
  /**
2397
2399
  * Checks if the user is currently interacting with the map via panning, pinching, or wheeling.
2398
2400
  * @returns True if the user is actively navigating.
2399
- */
2401
+ */
2400
2402
  get isNavigating(): boolean;
2401
2403
  /** Hooks all necessary event listeners based on current settings. */
2402
2404
  hook(): void;
@@ -2446,11 +2448,11 @@ declare module '@micrio/client' {
2446
2448
  */
2447
2449
  export namespace State {
2448
2450
  /**
2449
- * # HTMLMicrioElement state controller (`micrio.state`)
2450
- *
2451
- * Manages the global application state associated with the main `<micr-io>` element.
2452
- * Provides stores for reactive UI updates.
2453
- */
2451
+ * # HTMLMicrioElement state controller (`micrio.state`)
2452
+ *
2453
+ * Manages the global application state associated with the main `<micr-io>` element.
2454
+ * Provides stores for reactive UI updates.
2455
+ */
2454
2456
  class Main {
2455
2457
  #private;
2456
2458
  /** Writable store holding the currently active tour object (VideoTour or MarkerTour), or undefined if no tour is active. */
@@ -2469,11 +2471,11 @@ declare module '@micrio/client' {
2469
2471
  readonly popover: Writable<Models.State.PopoverType | undefined>;
2470
2472
  }
2471
2473
  /**
2472
- * # MicrioImage state controller (`micrioImage.state`)
2473
- *
2474
- * Manages the state specific to a single {@link MicrioImage} instance,
2475
- * primarily its viewport and currently opened marker.
2476
- */
2474
+ * # MicrioImage state controller (`micrioImage.state`)
2475
+ *
2476
+ * Manages the state specific to a single {@link MicrioImage} instance,
2477
+ * primarily its viewport and currently opened marker.
2478
+ */
2477
2479
  class Image {
2478
2480
  #private;
2479
2481
  /** Writable store holding the current viewport [x0, y0, width, height] of this image. */
@@ -2513,7 +2515,7 @@ declare module '@micrio/client' {
2513
2515
  * ```
2514
2516
  *
2515
2517
  * @author Marcel Duin <marcel@micr.io>
2516
- */
2518
+ */
2517
2519
  export class HTMLMicrioElement extends MicrioElement {
2518
2520
  #private;
2519
2521
  /** Observed attributes trigger `attributeChangedCallback` when changed. */
@@ -2531,7 +2533,7 @@ declare module '@micrio/client' {
2531
2533
  * Getter for the current value of the {@link current} store.
2532
2534
  * Provides direct access to the active {@link MicrioImage} instance.
2533
2535
  * @readonly
2534
- */
2536
+ */
2535
2537
  get $current(): MicrioImage | undefined;
2536
2538
  /** Getter for the virtual {@link Camera} instance of the currently active image. */
2537
2539
  get camera(): Camera | undefined;
@@ -2560,7 +2562,7 @@ declare module '@micrio/client' {
2560
2562
  * @param idOrInfo A Micrio image ID string or a full {@link Models.ImageBundle.BundleImage} object.
2561
2563
  * @param opts Options for opening the image.
2562
2564
  * @returns The {@link MicrioImage} instance being opened.
2563
- */
2565
+ */
2564
2566
  open(idOrInfo: string | Models.ImageBundle.BundleImage, opts?: {
2565
2567
  /** If true, keeps the grid view active instead of focusing on the opened image. */
2566
2568
  gridView?: boolean;
@@ -2570,11 +2572,11 @@ declare module '@micrio/client' {
2570
2572
  vector?: Models.Camera.Vector;
2571
2573
  /** Optional Gallery controller, used for gallery/grid views. */
2572
2574
  gallery?: Gallery;
2573
- }): Promise<MicrioImage>;
2575
+ }): Promise<MicrioImage | undefined>;
2574
2576
  /**
2575
2577
  * Closes an opened MicrioImage and removes its canvas from the engine.
2576
2578
  * @param img The {@link MicrioImage} instance to close.
2577
- */
2579
+ */
2578
2580
  close(img: MicrioImage): void;
2579
2581
  /** Getter for the current language code. */
2580
2582
  get lang(): string;
@@ -2608,8 +2610,12 @@ declare module '@micrio/client' {
2608
2610
  }
2609
2611
 
2610
2612
  /** The main Grid controller that arranges {@link MicrioImage} instances into a CSS grid layout. */
2611
- export class Grid extends MicrioElement {
2613
+ export class Grid extends MicrioElement<GridProps> {
2612
2614
  #private;
2615
+ /** All {@link MicrioImage} instances managed by this grid. */
2616
+ get images(): readonly MicrioImage[];
2617
+ /** Get a grid {@link MicrioImage} instance by its image ID, if it is part of this grid. */
2618
+ getImage(id: string): MicrioImage | undefined;
2613
2619
  /** The currently focussed (single-view) image, if any. */
2614
2620
  get $focussed(): MicrioImage | undefined;
2615
2621
  /** The parent `<micrio-*>` element this grid is bound to. */
@@ -2657,7 +2663,7 @@ declare module '@micrio/client' {
2657
2663
  *
2658
2664
  * Instances are typically created and managed by the main {@link HTMLMicrioElement}.
2659
2665
  * @author Marcel Duin <marcel@micr.io>
2660
- */
2666
+ */
2661
2667
  export class MicrioImage {
2662
2668
  #private;
2663
2669
  /** The unique identifier (Micrio ID) for this image. */
@@ -2666,7 +2672,7 @@ declare module '@micrio/client' {
2666
2672
  readonly uuid: string;
2667
2673
  /** Getter for the current value of the {@link info} property.
2668
2674
  * @readonly
2669
- */
2675
+ */
2670
2676
  get $info(): Models.ImageInfo.ImageInfo;
2671
2677
  /** Getter for the current value of the {@link settings} store. */
2672
2678
  get $settings(): Models.ImageInfo.Settings;
@@ -2682,7 +2688,7 @@ declare module '@micrio/client' {
2682
2688
  readonly video: Writable<HTMLVideoElement | undefined>;
2683
2689
  /** Writable store indicating if this image's canvas is currently visible and being rendered.
2684
2690
  * @readonly
2685
- */
2691
+ */
2686
2692
  readonly visible: Writable<boolean>;
2687
2693
  /** Album information if this image is part of a V5 album. */
2688
2694
  album?: Models.Album | undefined;