Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IViewerInstance

Instance of a viewer type that can be used view a document

The viewer instance belongs to a particular IViewerCollection, which controls which items to load

Hierarchy

  • IViewerInstance

Index

Properties

id

id: string

ID of the instance

isBootstrapped

isBootstrapped: boolean

Whether or not the viewer instance has been bootstrapped

name

name: string

Name of the viewer instance

type

Viewer type

Methods

activate

  • activate(): Promise<void>
  • Activate lifecycle method that is invoked when the instance is becoming the IViewerCollection's active viewer

    Returns Promise<void>

    Promise that is resolved once activation is complete.

bootstrap

  • Bootstrap lifecycle method for one-time setup of the viewer instance.

    This method is called after the instance's DOM element has been setup, but before any documents are loaded.

    Parameters

    • elementId: string

      ID of the viewer instance's DOM element

    • collection: IViewerCollection

      The viewer collection the instance belongs to

    Returns Promise<void>

    Promise that is resolved once bootstrapping is complete.

canDeactivate

  • canDeactivate(): boolean
  • CanDeactivate lifecycle method that is invoked when the IViewerCollection needs to determine if it is safe to unload a document

    Returns boolean

    Whether or not it is safe to load a new item, deactivate the viewer, or teardown the viewer.

deactivate

  • deactivate(): Promise<void>
  • Deactivate lifecycle method that is invoked when the instance is no longer the IViewerCollection's active viewer

    Returns Promise<void>

    Promise that is resolved once deactivation is complete.

load

  • load(item: IQueueItem): Promise<void>
  • Load lifecycle method that is invoked when the viewer instance should load a document from the queue

    Parameters

    • item: IQueueItem

      Item to be loaded and displayed to the user

    Returns Promise<void>

    Promise that is resolved once the item has been loaded.

reload

  • reload(): Promise<void>
  • Reload lifecycle method that is invoked when the viewer instance should refresh all of it's data before reloading the current queue item

    Returns Promise<void>

    Promise that is resolved once the reload is complete.

teardown

  • teardown(): Promise<void>
  • Teardown lifecycle method for one-time teardown of the viewer instance.

    This method is called when the IViewerCollection is being torn down.

    Returns Promise<void>

    Promise that is resolved once teardown is complete.