@micrio/client 5.3.1 → 5.3.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
@@ -4,7 +4,14 @@ declare module '@micrio/client' {
4
4
  * Defines the current version of the Micrio library.
5
5
  * This constant is used internally and exposed statically via `HTMLMicrioElement.VERSION`.
6
6
  */
7
- export const VERSION = "5.3.1";
7
+ export const VERSION = "5.3.3";
8
+ /**
9
+ * Loads an image texture asynchronously. Adds the request to the queue
10
+ * and returns a Promise that resolves with the TextureBitmap or rejects on error.
11
+ * @param src The URL of the image to load.
12
+ * @returns A Promise resolving to the loaded TextureBitmap.
13
+ */
14
+ export const loadTexture: (src: string) => Promise<TextureBitmap>;
8
15
  export type PREDEFINED = [string, Models.ImageInfo.ImageInfo, Models.ImageData.ImageData | undefined];
9
16
  /** Enum for identifying media type. */
10
17
  export enum MediaType {
@@ -102,158 +109,6 @@ declare module '@micrio/client' {
102
109
  }
103
110
  }
104
111
  }
105
- /**
106
- * Micrio grid display controller
107
- * @author Marcel Duin <marcel@micr.io>
108
- */
109
- /**
110
- * Controls the display and interaction logic for grid layouts.
111
- * Instantiated on the primary {@link MicrioImage} if grid data is present.
112
- * Accessed via `micrioImage.grid`.
113
- */
114
- export class Grid {
115
- micrio: HTMLMicrioElement;
116
- image: MicrioImage;
117
- /** Array of {@link MicrioImage} instances currently part of the grid definition (loaded). */
118
- readonly images: MicrioImage[];
119
- /** Array of {@link MicrioImage} instances currently visible in the grid layout. */
120
- current: MicrioImage[];
121
- /** If true, the HTML grid overlay remains visible and interactive even when an image is focused. */
122
- clickable: boolean;
123
- /** Writable Svelte store holding the currently focused {@link MicrioImage} instance, or undefined if in grid view. */
124
- readonly focussed: Writable<MicrioImage | undefined>;
125
- /** Getter for the current value of the {@link focussed} store. */
126
- get $focussed(): MicrioImage | undefined;
127
- /** Writable Svelte store holding an array of {@link MicrioImage} instances whose markers should be displayed in the grid view. */
128
- readonly markersShown: Writable<MicrioImage[]>;
129
- /** Array storing the history of grid layouts for back navigation. */
130
- history: Models.Grid.GridHistory[];
131
- /** Writable Svelte store indicating the current depth in the grid history stack. */
132
- depth: Writable<number>;
133
- /** Default animation duration (seconds) when transitioning *into* a new layout or focused view. */
134
- aniDurationIn: number;
135
- /** Default animation duration (seconds) when transitioning *out* of a focused view or going back in history. */
136
- aniDurationOut: number;
137
- /** Delay (seconds) between individual image transitions for 'delayed' effects. */
138
- transitionDelay: number;
139
- /**
140
- * The Grid constructor. Initializes the grid based on image settings.
141
- * @param micrio The main HTMLMicrioElement instance.
142
- * @param image The MicrioImage instance acting as the virtual container for the grid.
143
- */
144
- constructor(micrio: HTMLMicrioElement, image: MicrioImage);
145
- /**
146
- * Sets the grid layout based on an input string or array of image definitions.
147
- * This is the main method for changing the grid's content and appearance.
148
- *
149
- * @param input The grid definition. Can be:
150
- * - A semicolon-separated string following the format defined in `Grid.getString`.
151
- * - An array of {@link MicrioImage} instances.
152
- * - An array of objects `{image: MicrioImage, ...GridImageOptions}`.
153
- * @param opts Options controlling the transition and layout.
154
- * @returns A Promise that resolves with the array of currently displayed {@link MicrioImage} instances when the transition completes.
155
- */
156
- set(input?: string | MicrioImage[] | ({
157
- image: MicrioImage;
158
- } & Models.Grid.GridImageOptions)[], opts?: {
159
- /** If true, does not add the previous layout to the history stack. */
160
- noHistory?: boolean;
161
- /** If true, keeps the HTML grid element in the DOM (used internally). */
162
- keepGrid?: boolean;
163
- /** If true, arranges images in a single horizontal row. */
164
- horizontal?: boolean;
165
- /** Overrides the default animation duration for the main grid view transition. */
166
- duration?: number;
167
- /** If provided, animates the main grid view to this viewport rectangle. */
168
- view?: Models.Camera.View;
169
- /** If true, skips the main grid camera animation. */
170
- noCamAni?: boolean;
171
- /** If true, forces area animation even for images not currently visible. */
172
- forceAreaAni?: boolean;
173
- /** If true, does not unfocus the currently focused image when setting a new layout. */
174
- noBlur?: boolean;
175
- /** If true, skips the fade-in animation for new images. */
176
- noFade?: boolean;
177
- /** Specifies the transition animation type (e.g., 'crossfade', 'slide-left', 'behind-delayed'). */
178
- transition?: Models.Grid.GridSetTransition;
179
- /** If true, forces animation even if duration is 0. */
180
- forceAni?: boolean;
181
- /** If true, limits individual image views to cover their grid cell. */
182
- coverLimit?: boolean;
183
- /** If true, sets the initial view of images to cover their grid cell (but doesn't enforce limit). */
184
- cover?: boolean;
185
- /** Scale factor (0-1) applied to each grid cell (creates margins). */
186
- scale?: number;
187
- /** Overrides the automatic calculation of grid columns. */
188
- columns?: number;
189
- }): Promise<MicrioImage[]>;
190
- /**
191
- * Parses an individual image grid string into a GridImage object.
192
- * @param s The grid string for a single image.
193
- * @returns The parsed {@link Models.Grid.GridImage} object.
194
- */
195
- getImage(s: string): Models.Grid.GridImage;
196
- /**
197
- * Converts an ImageInfo object and options back into the grid string format.
198
- * @returns The grid encoded string for this image.
199
- */
200
- getString: (i: Models.ImageInfo.ImageInfo, opts?: Models.Grid.GridImageOptions) => string;
201
- /** Fade out unused images in the grid
202
- * @param images The images to hide
203
- */
204
- private removeImages;
205
- /** Checks whether current viewed image is (part of) grid */
206
- insideGrid(): boolean;
207
- /** Reset the grid to its initial layout
208
- * @param duration Duration in seconds
209
- * @param noCamAni Don't do any camera animating
210
- * @param forceAni Force animation on all grid images
211
- * @returns Promise when the transition is complete
212
- */
213
- reset(duration?: number, noCamAni?: boolean, forceAni?: boolean): Promise<MicrioImage[]>;
214
- /** Fly to the viewports of any markers containing a class name
215
- * @param tag The class name to match
216
- * @param duration Optional duration in ms
217
- * @param noZoom Don't zoom into the markers, just filter the images
218
- * @returns Promise when the transition is complete
219
- */
220
- flyToMarkers(tag?: string, duration?: number, noZoom?: boolean): Promise<MicrioImage[]>;
221
- /** Go back one step in the grid history
222
- * @param duration Optional duration for transition
223
- * @returns Promise when the transition is complete
224
- */
225
- back(duration?: number): Promise<void>;
226
- /** Open a grid image full size and set it as the main active image
227
- * @param img The image
228
- * @param opts Focus options
229
- * @returns Promise for when the transition completes
230
- */
231
- focus(img: MicrioImage | undefined, opts?: Models.Grid.FocusOptions): Promise<void>;
232
- /** Unfocusses any currently focussed image */
233
- blur(): void;
234
- /** Do an (external) action
235
- * @param action The action type enum or string
236
- * @param data Optional action data
237
- * @param duration Optional action duration
238
- */
239
- action(action: Enums.Grid.GridActionType | string, data?: string, duration?: number): void;
240
- /** Enlarge a specific image idx of the currently shown grid
241
- * @param idx The image index of the current grid
242
- * @param width The image target number of columns
243
- * @param height The image target number of rows
244
- * @returns Promise when the transition is completed
245
- */
246
- enlarge(idx: number, width: number, height?: number): Promise<MicrioImage[]>;
247
- /** Get the relative in-grid viewport of the image */
248
- getRelativeView(image: MicrioImage, view: Models.Camera.View): Models.Camera.View;
249
- }
250
- /**
251
- * Loads an image texture asynchronously. Adds the request to the queue
252
- * and returns a Promise that resolves with the TextureBitmap or rejects on error.
253
- * @param src The URL of the image to load.
254
- * @returns A Promise resolving to the loaded TextureBitmap.
255
- */
256
- export const loadTexture: (src: string) => Promise<TextureBitmap>;
257
112
  /**
258
113
  * Represents the virtual camera used to view a {@link MicrioImage}.
259
114
  * Provides methods for controlling the viewport (position, zoom, rotation),
@@ -810,6 +665,151 @@ declare module '@micrio/client' {
810
665
  /** Fades out the image smoothly or instantly. */
811
666
  fadeOut(direct?: boolean): void;
812
667
  }
668
+ /**
669
+ * Micrio grid display controller
670
+ * @author Marcel Duin <marcel@micr.io>
671
+ */
672
+ /**
673
+ * Controls the display and interaction logic for grid layouts.
674
+ * Instantiated on the primary {@link MicrioImage} if grid data is present.
675
+ * Accessed via `micrioImage.grid`.
676
+ */
677
+ export class Grid {
678
+ micrio: HTMLMicrioElement;
679
+ image: MicrioImage;
680
+ /** Array of {@link MicrioImage} instances currently part of the grid definition (loaded). */
681
+ readonly images: MicrioImage[];
682
+ /** Array of {@link MicrioImage} instances currently visible in the grid layout. */
683
+ current: MicrioImage[];
684
+ /** If true, the HTML grid overlay remains visible and interactive even when an image is focused. */
685
+ clickable: boolean;
686
+ /** Writable Svelte store holding the currently focused {@link MicrioImage} instance, or undefined if in grid view. */
687
+ readonly focussed: Writable<MicrioImage | undefined>;
688
+ /** Getter for the current value of the {@link focussed} store. */
689
+ get $focussed(): MicrioImage | undefined;
690
+ /** Writable Svelte store holding an array of {@link MicrioImage} instances whose markers should be displayed in the grid view. */
691
+ readonly markersShown: Writable<MicrioImage[]>;
692
+ /** Array storing the history of grid layouts for back navigation. */
693
+ history: Models.Grid.GridHistory[];
694
+ /** Writable Svelte store indicating the current depth in the grid history stack. */
695
+ depth: Writable<number>;
696
+ /** Default animation duration (seconds) when transitioning *into* a new layout or focused view. */
697
+ aniDurationIn: number;
698
+ /** Default animation duration (seconds) when transitioning *out* of a focused view or going back in history. */
699
+ aniDurationOut: number;
700
+ /** Delay (seconds) between individual image transitions for 'delayed' effects. */
701
+ transitionDelay: number;
702
+ /**
703
+ * The Grid constructor. Initializes the grid based on image settings.
704
+ * @param micrio The main HTMLMicrioElement instance.
705
+ * @param image The MicrioImage instance acting as the virtual container for the grid.
706
+ */
707
+ constructor(micrio: HTMLMicrioElement, image: MicrioImage);
708
+ /**
709
+ * Sets the grid layout based on an input string or array of image definitions.
710
+ * This is the main method for changing the grid's content and appearance.
711
+ *
712
+ * @param input The grid definition. Can be:
713
+ * - A semicolon-separated string following the format defined in `Grid.getString`.
714
+ * - An array of {@link MicrioImage} instances.
715
+ * - An array of objects `{image: MicrioImage, ...GridImageOptions}`.
716
+ * @param opts Options controlling the transition and layout.
717
+ * @returns A Promise that resolves with the array of currently displayed {@link MicrioImage} instances when the transition completes.
718
+ */
719
+ set(input?: string | MicrioImage[] | ({
720
+ image: MicrioImage;
721
+ } & Models.Grid.GridImageOptions)[], opts?: {
722
+ /** If true, does not add the previous layout to the history stack. */
723
+ noHistory?: boolean;
724
+ /** If true, keeps the HTML grid element in the DOM (used internally). */
725
+ keepGrid?: boolean;
726
+ /** If true, arranges images in a single horizontal row. */
727
+ horizontal?: boolean;
728
+ /** Overrides the default animation duration for the main grid view transition. */
729
+ duration?: number;
730
+ /** If provided, animates the main grid view to this viewport rectangle. */
731
+ view?: Models.Camera.View;
732
+ /** If true, skips the main grid camera animation. */
733
+ noCamAni?: boolean;
734
+ /** If true, forces area animation even for images not currently visible. */
735
+ forceAreaAni?: boolean;
736
+ /** If true, does not unfocus the currently focused image when setting a new layout. */
737
+ noBlur?: boolean;
738
+ /** If true, skips the fade-in animation for new images. */
739
+ noFade?: boolean;
740
+ /** Specifies the transition animation type (e.g., 'crossfade', 'slide-left', 'behind-delayed'). */
741
+ transition?: Models.Grid.GridSetTransition;
742
+ /** If true, forces animation even if duration is 0. */
743
+ forceAni?: boolean;
744
+ /** If true, limits individual image views to cover their grid cell. */
745
+ coverLimit?: boolean;
746
+ /** If true, sets the initial view of images to cover their grid cell (but doesn't enforce limit). */
747
+ cover?: boolean;
748
+ /** Scale factor (0-1) applied to each grid cell (creates margins). */
749
+ scale?: number;
750
+ /** Overrides the automatic calculation of grid columns. */
751
+ columns?: number;
752
+ }): Promise<MicrioImage[]>;
753
+ /**
754
+ * Parses an individual image grid string into a GridImage object.
755
+ * @param s The grid string for a single image.
756
+ * @returns The parsed `Models.Grid.GridImage` object.
757
+ */
758
+ getImage(s: string): Models.Grid.GridImage;
759
+ /**
760
+ * Converts an ImageInfo object and options back into the grid string format.
761
+ * @returns The grid encoded string for this image.
762
+ */
763
+ getString: (i: Models.ImageInfo.ImageInfo, opts?: Models.Grid.GridImageOptions) => string;
764
+ /** Fade out unused images in the grid
765
+ * @param images The images to hide
766
+ */
767
+ private removeImages;
768
+ /** Checks whether current viewed image is (part of) grid */
769
+ insideGrid(): boolean;
770
+ /** Reset the grid to its initial layout
771
+ * @param duration Duration in seconds
772
+ * @param noCamAni Don't do any camera animating
773
+ * @param forceAni Force animation on all grid images
774
+ * @returns Promise when the transition is complete
775
+ */
776
+ reset(duration?: number, noCamAni?: boolean, forceAni?: boolean): Promise<MicrioImage[]>;
777
+ /** Fly to the viewports of any markers containing a class name
778
+ * @param tag The class name to match
779
+ * @param duration Optional duration in ms
780
+ * @param noZoom Don't zoom into the markers, just filter the images
781
+ * @returns Promise when the transition is complete
782
+ */
783
+ flyToMarkers(tag?: string, duration?: number, noZoom?: boolean): Promise<MicrioImage[]>;
784
+ /** Go back one step in the grid history
785
+ * @param duration Optional duration for transition
786
+ * @returns Promise when the transition is complete
787
+ */
788
+ back(duration?: number): Promise<void>;
789
+ /** Open a grid image full size and set it as the main active image
790
+ * @param img The image
791
+ * @param opts Focus options
792
+ * @returns Promise for when the transition completes
793
+ */
794
+ focus(img: MicrioImage | undefined, opts?: Models.Grid.FocusOptions): Promise<void>;
795
+ /** Unfocusses any currently focussed image */
796
+ blur(): void;
797
+ /** Do an (external) action
798
+ * @param action The action type enum or string
799
+ * @param data Optional action data
800
+ * @param duration Optional action duration
801
+ */
802
+ action(action: Enums.Grid.GridActionType | string, data?: string, duration?: number): void;
803
+ /** Enlarge a specific image idx of the currently shown grid
804
+ * @param idx The image index of the current grid
805
+ * @param width The image target number of columns
806
+ * @param height The image target number of rows
807
+ * @returns Promise when the transition is completed
808
+ */
809
+ enlarge(idx: number, width: number, height?: number): Promise<MicrioImage[]>;
810
+ /** Get the relative in-grid viewport of the image */
811
+ getRelativeView(image: MicrioImage, view: Models.Camera.View): Models.Camera.View;
812
+ }
813
813
  /**
814
814
  * Video tour controller. Manages playback and camera animation for video tours
815
815
  * defined by a timeline of view rectangles and durations.
@@ -1489,7 +1489,7 @@ declare module '@micrio/client' {
1489
1489
  /** Positional audio asset */
1490
1490
  positionalAudio?: Assets.AudioLocation;
1491
1491
  /** Optional function that overrides all behavior */
1492
- onclick?: (m: Models.ImageData.Marker) => void;
1492
+ onclick?: (m: ImageData.Marker) => void;
1493
1493
  /** Additional options */
1494
1494
  data?: MarkerData;
1495
1495
  };
@@ -1875,7 +1875,7 @@ declare module '@micrio/client' {
1875
1875
  /** Custom icon lib */
1876
1876
  icons?: Assets.Image[];
1877
1877
  /** Multi-image marker tours */
1878
- markerTours?: Models.ImageData.MarkerTour[];
1878
+ markerTours?: ImageData.MarkerTour[];
1879
1879
  }
1880
1880
  interface WaypointInterface {
1881
1881
  el?: HTMLElement;
@@ -1925,7 +1925,7 @@ declare module '@micrio/client' {
1925
1925
  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');
1926
1926
  type GridSetTransition = ('crossfade' | 'behind' | 'behind-delayed' | 'appear-delayed');
1927
1927
  /** Virtual ImageInfo extension to support grid logic */
1928
- interface GridImage extends Partial<Models.ImageInfo.ImageInfo> {
1928
+ interface GridImage extends Partial<ImageInfo.ImageInfo> {
1929
1929
  size: [number, number?];
1930
1930
  area?: Camera.View;
1931
1931
  view?: Camera.View;
@@ -1946,7 +1946,7 @@ declare module '@micrio/client' {
1946
1946
  /** Transition duration in ms */
1947
1947
  duration?: number;
1948
1948
  /** Transition animation, defaults to crossfade */
1949
- transition?: Models.Grid.MarkerFocusTransition;
1949
+ transition?: Grid.MarkerFocusTransition;
1950
1950
  /** Set the target viewport immediately */
1951
1951
  noViewAni?: boolean;
1952
1952
  /** Animate the previously focussed image to this view during exit transition */
@@ -2036,11 +2036,11 @@ declare module '@micrio/client' {
2036
2036
  namespace State {
2037
2037
  /** Popover interface state type */
2038
2038
  interface PopoverType {
2039
- contentPage?: Models.ImageData.Menu;
2039
+ contentPage?: ImageData.Menu;
2040
2040
  image?: MicrioImage;
2041
- marker?: Models.ImageData.Marker;
2042
- markerTour?: Models.ImageData.MarkerTour;
2043
- gallery?: Models.Assets.Image[];
2041
+ marker?: ImageData.Marker;
2042
+ markerTour?: ImageData.MarkerTour;
2043
+ gallery?: Assets.Image[];
2044
2044
  galleryStart?: string;
2045
2045
  showLangSelect?: boolean;
2046
2046
  }
@@ -2056,6 +2056,214 @@ declare module '@micrio/client' {
2056
2056
  portrait: boolean;
2057
2057
  }
2058
2058
  }
2059
+ type MicrioEvent<T = any> = Event & {
2060
+ detail: T;
2061
+ };
2062
+ interface MicrioEventDetails {
2063
+ /** The main Micrio image is loaded and fully shown */
2064
+ 'show': HTMLMicrioElement;
2065
+ /** Before the ImageInfo settings are read, this event allows you to alter them */
2066
+ 'pre-info': ImageInfo.ImageInfo;
2067
+ /** Before the ImageData contents are read, this event allows you to alter it */
2068
+ 'pre-data': {
2069
+ [micrioId: string]: ImageData.ImageData;
2070
+ };
2071
+ /** The main Micrio element has initialized and is being printed */
2072
+ 'print': ImageInfo.ImageInfo;
2073
+ /** Individual image data is loaded and Micrio will start rendering */
2074
+ 'load': MicrioImage;
2075
+ /** The user has switched available languages */
2076
+ 'lang-switch': string;
2077
+ /** The camera has zoomed */
2078
+ 'zoom': {
2079
+ image: MicrioImage;
2080
+ view: Camera.View;
2081
+ };
2082
+ /** The camera has moved */
2083
+ 'move': {
2084
+ image: MicrioImage;
2085
+ view: Camera.View;
2086
+ };
2087
+ /** A frame has been drawn */
2088
+ 'draw': void;
2089
+ /** The <micr-io> element was resized */
2090
+ 'resize': DOMRect;
2091
+ /** The user has started panning */
2092
+ 'panstart': void;
2093
+ /** The user has stopped panning */
2094
+ 'panend': {
2095
+ duration: number;
2096
+ movedX: number;
2097
+ movedY: number;
2098
+ };
2099
+ /** The user has stopped pinching */
2100
+ 'pinchstart': void;
2101
+ /** The user has stopped pinching */
2102
+ 'pinchend': {
2103
+ duration: number;
2104
+ movedX: number;
2105
+ movedY: number;
2106
+ };
2107
+ /** A marker has been opened and the camera animation is starting */
2108
+ 'marker-open': ImageData.Marker;
2109
+ /** A marker has been fully opened and the camera is done, and popup shown */
2110
+ 'marker-opened': ImageData.Marker;
2111
+ /** A marker has been successfully closed */
2112
+ 'marker-closed': ImageData.Marker;
2113
+ /** A tour has been successfully started */
2114
+ 'tour-start': ImageData.Tour;
2115
+ /** A tour has been successfully stopped */
2116
+ 'tour-stop': ImageData.Tour;
2117
+ /** A tour's UI interface has automatically minimized */
2118
+ 'tour-minimize': ImageData.Tour;
2119
+ /** Fires for each marker step in a marker tour */
2120
+ 'tour-step': ImageData.MarkerTour;
2121
+ /** A multi-image tour is played/resumed */
2122
+ 'serialtour-play': ImageData.MarkerTour;
2123
+ /** A multi-image tour is paused */
2124
+ 'serialtour-pause': ImageData.MarkerTour;
2125
+ /** A video tour has started from the beginning (can be part of a marker tour) */
2126
+ 'videotour-start': ImageData.VideoTour;
2127
+ /** A video tour has ended or is aborted (can be part of a marker tour) */
2128
+ 'videotour-stop': ImageData.VideoTour;
2129
+ /** A video tour is played or resumed */
2130
+ 'videotour-play': void;
2131
+ /** A video tour is paused */
2132
+ 'videotour-pause': void;
2133
+ /** A video tour has ended */
2134
+ 'tour-ended': ImageData.VideoTour;
2135
+ /** When a video tour has custom events, they will be fired like this */
2136
+ 'tour-event': ImageData.Event;
2137
+ /** The audio controller has been successfully initialized and can play audio */
2138
+ 'audio-init': void;
2139
+ /** The audio has been muted */
2140
+ 'audio-mute': void;
2141
+ /** The audio has been unmuted */
2142
+ 'audio-unmute': void;
2143
+ /** Fires when there is autoplay audio or video which was disallowed by the browser */
2144
+ 'autoplay-blocked': void;
2145
+ /** Media has started playing */
2146
+ 'media-play': void;
2147
+ /** Media has stopped playing */
2148
+ 'media-pause': void;
2149
+ /** Media has ended */
2150
+ 'media-ended': void;
2151
+ /** A media timeupdate tick */
2152
+ 'timeupdate': number;
2153
+ /** A custom popover page was opened */
2154
+ 'page-open': ImageData.Menu;
2155
+ /** A custom popover page was closed */
2156
+ 'page-closed': ImageData.Menu;
2157
+ /** Triggers on album image change */
2158
+ 'gallery-show': number;
2159
+ /** The grid controller has initialized */
2160
+ 'grid-init': Grid;
2161
+ /** All images in the grid have loaded */
2162
+ 'grid-load': void;
2163
+ /** The grid layout has changed */
2164
+ 'grid-layout-set': Grid;
2165
+ /** The main grid view is activated */
2166
+ 'grid-focus': MicrioImage;
2167
+ /** The main grid has lost focus, i.e., navigated away */
2168
+ 'grid-blur': void;
2169
+ /** Split screen mode has started */
2170
+ 'splitscreen-start': MicrioImage;
2171
+ /** Split screen mode has stopped */
2172
+ 'splitscreen-stop': MicrioImage;
2173
+ /** When there is any user action, this event fires. Deferred and fires at a maximum rate of every 500ms */
2174
+ 'update': Array<string>;
2175
+ }
2176
+ type MicrioEventMap = {
2177
+ [K in keyof MicrioEventDetails]: MicrioEvent<MicrioEventDetails[K]>;
2178
+ };
2179
+ namespace Attributes {
2180
+ interface MicrioCustomAttributes {
2181
+ /** The image ID */
2182
+ 'id'?: string;
2183
+ /** The data language code to use. Default: 'en' */
2184
+ 'lang'?: string;
2185
+ /** For custom hosted Micrio images, specify the root URL. Default: Based on image */
2186
+ 'data-path'?: string;
2187
+ /** Set this to 'cover' to start the image using the full viewport. Default: undefined */
2188
+ 'data-inittype'?: string;
2189
+ /** The user cannot zoom out further than the full viewport. Default: undefined */
2190
+ 'data-coverlimit'?: boolean;
2191
+ /** Only start loading the image when it's been scrolled into the user's view. Default: false */
2192
+ 'lazyload'?: boolean;
2193
+ /** Do not load any metadata (markers, tours, etc). Default: false */
2194
+ 'data-skipmeta'?: boolean;
2195
+ /** Simulate an <img/> element. No logo, loader bar, and no event listeners. Default: false */
2196
+ 'data-static'?: boolean;
2197
+ /** Read and write deeplinks to opened tours and markers. Default: null */
2198
+ 'data-router'?: string;
2199
+ /** Sending user input as GA Events to any available GTag instance (does nothing if none). Default: true */
2200
+ 'data-gtag'?: boolean;
2201
+ /** Set the speed factor for camera animations. Default: 1 */
2202
+ 'data-camspeed'?: number;
2203
+ /** Can pan outside the image's limits. Default: false */
2204
+ 'data-freemove'?: boolean;
2205
+ /** Set the percentage (1=100%) of how far a user can zoom in. Default: 1 */
2206
+ 'data-zoomlimit'?: number;
2207
+ /** Set the initial viewport rectangle of the image. Default: [0,0,1,1] */
2208
+ 'data-view'?: number[];
2209
+ /** Set focus point of the image, treated as the center in case of image overflows. Default: [0.5, 0.5] */
2210
+ 'data-focus'?: number[];
2211
+ /** Keep drawing frames, even if there is no movement. Default: false */
2212
+ 'data-keeprendering'?: boolean;
2213
+ /** When turned off, high DPI screens will have its zoom limited to visually 100% of pixel size. Default: true */
2214
+ 'data-normalize-dpr'?: boolean;
2215
+ /** No event handlers will be set up, and the image will be non-interactive. Default: true */
2216
+ 'data-events'?: boolean;
2217
+ /** Use your keyboard to navigate through the image. Default: false */
2218
+ 'data-keys'?: boolean;
2219
+ /** Use trackpad/touchscreen pinching for zooming. Default: true */
2220
+ 'data-pinch-zoom'?: boolean;
2221
+ /** Use mousewheel/trackpad scrolling for zooming. Default: true */
2222
+ 'data-scroll-zoom'?: boolean;
2223
+ /** The user must press CTRL/CMD when zooming with the mousewheel. Default: false */
2224
+ 'data-control-zoom'?: boolean;
2225
+ /** Requires the user to use two fingers to pan the image on touch devices. Default: false */
2226
+ 'data-two-finger-pan'?: boolean;
2227
+ /** The user cannot zoom at all. Default: true */
2228
+ 'data-zooming'?: boolean;
2229
+ /** Use dragging and touch events for panning. Default: true */
2230
+ 'data-dragging'?: boolean;
2231
+ /** No HTML UI elements will be printed. Default: true */
2232
+ 'data-ui'?: boolean;
2233
+ /** No control buttons will be printed. Default: true */
2234
+ 'data-controls'?: boolean;
2235
+ /** Show a fullscreen switching button on supported platforms. Default: true */
2236
+ 'data-fullscreen'?: boolean;
2237
+ /** Show a social sharing link menu. Default: false */
2238
+ 'data-social'?: boolean;
2239
+ /** The Micrio logo is displayed. Default: true */
2240
+ 'data-logo'?: boolean;
2241
+ /** The optional Organisation logo (top right) will be hidden. Default: true */
2242
+ 'data-logo-org'?: boolean;
2243
+ /** No top menu bar will be printed. Default: true */
2244
+ 'data-toolbar'?: boolean;
2245
+ /** Show an image info panel with the title and description. Default: false */
2246
+ 'data-show-info'?: boolean;
2247
+ /** An interactive minimap will be shown. Default: false */
2248
+ 'data-minimap'?: boolean;
2249
+ /** The minimap will always be visible. Default: true */
2250
+ 'data-minimap-hide'?: boolean;
2251
+ /** The minimap height in pixels. Default: 160 */
2252
+ 'data-minimap-height'?: number;
2253
+ /** The minimap width in pixels. Default: 200 */
2254
+ 'data-minimap-width'?: number;
2255
+ /** All audio will be disabled if this attribute is present. */
2256
+ 'muted'?: boolean;
2257
+ /** The general sound volume for music/sfx (between 0 and 1). Default: 1 */
2258
+ 'volume'?: number;
2259
+ /** Fade music to this volume while other audio plays (between 0 and 1). Default: 0 */
2260
+ 'data-mutedvolume'?: number;
2261
+ /** Configuration for the grid which the viewer will use. */
2262
+ 'data-grid'?: string;
2263
+ /** Toggle limited rendering mode in WebAssembly. */
2264
+ 'data-limited'?: boolean;
2265
+ }
2266
+ }
2059
2267
  }
2060
2268
  /**
2061
2269
  * Handles WebGL postprocessing effects.
@@ -2297,6 +2505,12 @@ declare module '@micrio/client' {
2297
2505
  defaultSettings?: Partial<Models.ImageInfo.Settings>;
2298
2506
  /** Holds data for the current 360 space, if applicable (loaded via `data-space` attribute or API). */
2299
2507
  spaceData: Models.Spaces.Space | undefined;
2508
+ addEventListener<K extends keyof Models.MicrioEventMap>(type: K, listener: (this: HTMLMicrioElement, ev: Models.MicrioEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2509
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMicrioElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2510
+ addEventListener(type: string, listener: (this: HTMLMicrioElement, ev: Event) => any, options?: boolean | AddEventListenerOptions): void;
2511
+ removeEventListener<K extends keyof Models.MicrioEventMap>(type: K, listener: (this: HTMLMicrioElement, ev: Models.MicrioEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2512
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMicrioElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2513
+ removeEventListener(type: string, listener: (this: HTMLMicrioElement, ev: Event) => any, options?: boolean | EventListenerOptions): void;
2300
2514
  /** Destroys the Micrio instance, cleans up resources, and removes event listeners. */
2301
2515
  destroy(): void;
2302
2516
  /**
@@ -2386,102 +2600,102 @@ declare module '@micrio/client' {
2386
2600
  /** Cleans up resources when the parent Embed component is unmounted. */
2387
2601
  unmount(): void;
2388
2602
  }
2389
- }declare module "svelte/store" {
2390
- /** Callback to inform of a value updates.
2391
- */
2392
- export type Subscriber<T> = (value: T) => void;
2393
- /** Unsubscribes from value updates.
2394
- */
2395
- export type Unsubscriber = () => void;
2396
- /** Callback to update a value.
2397
- */
2398
- export type Updater<T> = (value: T) => T;
2399
- /** Cleanup logic callback. */
2400
- type Invalidator<T> = (value?: T) => void;
2401
- /** Start and stop notification callbacks.
2402
- * @internal
2403
- */
2404
- export type StartStopNotifier<T> = (set: Subscriber<T>) => Unsubscriber | void;
2405
- /** Readable interface for subscribing. See the main SvelteStore article on how to use it in Micrio. */
2406
- export interface Readable<T> {
2407
- /**
2408
- * Subscribe on value changes.
2409
- * @param run subscription callback
2410
- * @param invalidate cleanup callback
2411
- */
2412
- subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
2413
- }
2414
- /** Writable interface for both updating and subscribing. See the main SvelteStore article on how to use it in Micrio. */
2415
- export interface Writable<T> extends Readable<T> {
2416
- /**
2417
- * Set value and inform subscribers.
2418
- * @param value to set
2419
- */
2420
- set(this: void, value: T): void;
2421
- /**
2422
- * Update value using callback and inform subscribers.
2423
- * @param updater callback
2424
- */
2425
- update(this: void, updater: Updater<T>): void;
2426
- }
2427
- /**
2428
- * Creates a `Readable` store that allows reading by subscription.
2429
- * @internal
2430
- * @param value initial value
2431
- * @param {StartStopNotifier}start start and stop notifications for subscriptions
2432
- */
2433
- export function readable<T>(value?: T, start?: StartStopNotifier<T>): Readable<T>;
2434
- /**
2435
- * Create a `Writable` store that allows both updating and reading by subscription.
2436
- * @internal
2437
- * @param {*=}value initial value
2438
- * @param {StartStopNotifier=}start start and stop notifications for subscriptions
2439
- */
2440
- export function writable<T>(value?: T, start?: StartStopNotifier<T>): Writable<T>;
2441
- /** One or more `Readable`s.
2442
- * @internal
2443
- */
2444
- type Stores = Readable<any> | [Readable<any>, ...Array<Readable<any>>] | Array<Readable<any>>;
2445
- /** One or more values from `Readable` stores.
2446
- * @internal
2447
- */
2448
- type StoresValues<T> = T extends Readable<infer U> ? U : {
2449
- [K in keyof T]: T[K] extends Readable<infer U> ? U : never;
2450
- };
2451
- /**
2452
- * Derived value store by synchronizing one or more readable stores and
2453
- * applying an aggregation function over its input values.
2454
- *
2455
- * @internal
2456
- * @param stores - input stores
2457
- * @param fn - function callback that aggregates the values
2458
- * @param initial_value - when used asynchronously
2459
- */
2460
- export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>, set: (value: T) => void) => Unsubscriber | void, initial_value?: T): Readable<T>;
2461
- /**
2462
- * Derived value store by synchronizing one or more readable stores and
2463
- * applying an aggregation function over its input values.
2464
- *
2465
- * @internal
2466
- * @param stores - input stores
2467
- * @param fn - function callback that aggregates the values
2468
- * @param initial_value - initial value
2469
- */
2470
- export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>) => T, initial_value?: T): Readable<T>;
2471
- /**
2472
- * Derived value store by synchronizing one or more readable stores and
2473
- * applying an aggregation function over its input values.
2474
- *
2475
- * @internal
2476
- * @param stores - input stores
2477
- * @param fn - function callback that aggregates the values
2478
- */
2479
- export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>) => T): Readable<T>;
2480
- /**
2481
- * Get the current value from a store by subscribing and immediately unsubscribing.
2482
- * @internal
2483
- * @param store readable
2484
- */
2485
- export function get<T>(store: Readable<T>): T;
2486
-
2487
- }
2603
+ }declare module "svelte/store" {
2604
+ /** Callback to inform of a value updates.
2605
+ */
2606
+ export type Subscriber<T> = (value: T) => void;
2607
+ /** Unsubscribes from value updates.
2608
+ */
2609
+ export type Unsubscriber = () => void;
2610
+ /** Callback to update a value.
2611
+ */
2612
+ export type Updater<T> = (value: T) => T;
2613
+ /** Cleanup logic callback. */
2614
+ type Invalidator<T> = (value?: T) => void;
2615
+ /** Start and stop notification callbacks.
2616
+ * @internal
2617
+ */
2618
+ export type StartStopNotifier<T> = (set: Subscriber<T>) => Unsubscriber | void;
2619
+ /** Readable interface for subscribing. See the main SvelteStore article on how to use it in Micrio. */
2620
+ export interface Readable<T> {
2621
+ /**
2622
+ * Subscribe on value changes.
2623
+ * @param run subscription callback
2624
+ * @param invalidate cleanup callback
2625
+ */
2626
+ subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
2627
+ }
2628
+ /** Writable interface for both updating and subscribing. See the main SvelteStore article on how to use it in Micrio. */
2629
+ export interface Writable<T> extends Readable<T> {
2630
+ /**
2631
+ * Set value and inform subscribers.
2632
+ * @param value to set
2633
+ */
2634
+ set(this: void, value: T): void;
2635
+ /**
2636
+ * Update value using callback and inform subscribers.
2637
+ * @param updater callback
2638
+ */
2639
+ update(this: void, updater: Updater<T>): void;
2640
+ }
2641
+ /**
2642
+ * Creates a `Readable` store that allows reading by subscription.
2643
+ * @internal
2644
+ * @param value initial value
2645
+ * @param {StartStopNotifier}start start and stop notifications for subscriptions
2646
+ */
2647
+ export function readable<T>(value?: T, start?: StartStopNotifier<T>): Readable<T>;
2648
+ /**
2649
+ * Create a `Writable` store that allows both updating and reading by subscription.
2650
+ * @internal
2651
+ * @param {*=}value initial value
2652
+ * @param {StartStopNotifier=}start start and stop notifications for subscriptions
2653
+ */
2654
+ export function writable<T>(value?: T, start?: StartStopNotifier<T>): Writable<T>;
2655
+ /** One or more `Readable`s.
2656
+ * @internal
2657
+ */
2658
+ type Stores = Readable<any> | [Readable<any>, ...Array<Readable<any>>] | Array<Readable<any>>;
2659
+ /** One or more values from `Readable` stores.
2660
+ * @internal
2661
+ */
2662
+ type StoresValues<T> = T extends Readable<infer U> ? U : {
2663
+ [K in keyof T]: T[K] extends Readable<infer U> ? U : never;
2664
+ };
2665
+ /**
2666
+ * Derived value store by synchronizing one or more readable stores and
2667
+ * applying an aggregation function over its input values.
2668
+ *
2669
+ * @internal
2670
+ * @param stores - input stores
2671
+ * @param fn - function callback that aggregates the values
2672
+ * @param initial_value - when used asynchronously
2673
+ */
2674
+ export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>, set: (value: T) => void) => Unsubscriber | void, initial_value?: T): Readable<T>;
2675
+ /**
2676
+ * Derived value store by synchronizing one or more readable stores and
2677
+ * applying an aggregation function over its input values.
2678
+ *
2679
+ * @internal
2680
+ * @param stores - input stores
2681
+ * @param fn - function callback that aggregates the values
2682
+ * @param initial_value - initial value
2683
+ */
2684
+ export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>) => T, initial_value?: T): Readable<T>;
2685
+ /**
2686
+ * Derived value store by synchronizing one or more readable stores and
2687
+ * applying an aggregation function over its input values.
2688
+ *
2689
+ * @internal
2690
+ * @param stores - input stores
2691
+ * @param fn - function callback that aggregates the values
2692
+ */
2693
+ export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>) => T): Readable<T>;
2694
+ /**
2695
+ * Get the current value from a store by subscribing and immediately unsubscribing.
2696
+ * @internal
2697
+ * @param store readable
2698
+ */
2699
+ export function get<T>(store: Readable<T>): T;
2700
+
2701
+ }