HTMLMicrioElement state controller (micrio.state)

Manages the global application state associated with the main <micr-io> element. Provides Svelte stores for reactive UI updates and methods for state serialization.

Properties

marker: Writable<Marker> = ...

Writable Svelte store holding the marker object currently opened in the main active image, or undefined if none is open.

markerHoverId: Writable<string> = ...

Writable Svelte store holding the ID of the marker currently being hovered over.

popover: Writable<PopoverType> = ...

Writable Svelte store holding the data for the currently displayed popover (custom page or gallery). See Models.State.PopoverType.

popup: Writable<Marker> = ...

Writable Svelte store holding the marker object whose popup is currently displayed.

Writable Svelte store holding the currently active tour object (VideoTour or MarkerTour), or undefined if no tour is active.

ui: {
    controls: Writable<boolean>;
    hidden: Writable<boolean>;
    zoom: Writable<boolean>;
} = ...

UI state stores.

Type declaration

  • controls: Writable<boolean>

    Writable store controlling the visibility of the main UI controls (bottom right).

  • hidden: Writable<boolean>

    Writable store controlling the visibility of all UI elements (e.g., for fullscreen or specific modes).

  • zoom: Writable<boolean>

    Writable store controlling the visibility of zoom buttons.

Accessors

Methods

  • Gets the current state of the Micrio viewer as a serializable JSON object. This object captures the active image(s), viewports, open markers, active tour, and media playback states, allowing the exact state to be restored later or elsewhere.

    Returns MicrioStateJSON

    The current state as a MicrioStateJSON object, or undefined if no image is loaded.

    const currentState = micrio.state.get();
    // Store or transmit `currentState`
  • Sets the Micrio viewer state from a previously saved MicrioStateJSON object. This will attempt to restore the active image, viewports, open markers, active tour, and media playback states.

    Parameters

    Returns Promise<void>

    const savedState = // ... load state object ...
    micrio.state.set(savedState);