Interface: IPreloadService

Preload service to retrieve document data prior to the viewer call and store in cache

Extends

Methods

abort()

abort(viewerCollection): Promise<void>

Aborts documents in cache which are not loaded and not in the predetermined preload

Parameters

viewerCollection: IViewerCollection

the viewerCollection used to know what viewer is being loaded

Returns

Promise<void>


off()

off(eventType, handler?, once?): void

Unregisters an event handler

Parameters

eventType: PreloadServiceEventType

Event to unregister from

handler?: EventHandler

Event handler function. If not passed in, it removes all event handlers.

once?: boolean

Boolean indicating if the event handler was registered as a one-time event handler (Defaults to false)

Returns

void

Inherited from

IEventEmitter.off


on()

on(eventType, handler): void

Registers an event handler

Parameters

eventType: PreloadServiceEventType

Event to listen for

handler: EventHandler

Event handler function

Returns

void

Inherited from

IEventEmitter.on


once()

once(eventType, handler): void

Registers an event handler that is only run once

Parameters

eventType: PreloadServiceEventType

Event to listen for

handler: EventHandler

Event handler function

Returns

void

Inherited from

IEventEmitter.once


prepareDocuments()

prepareDocuments(queuePointer): Promise<void>

Prepares documents to be viewed in the future by requesting document data, calling conversion, and pre-retrieving converted content, creating OIDocuments and loading them.

Parameters

queuePointer: IQueuePointer

The queue pointer to prepare documents for

Returns

Promise<void>

Promise that is resolved once all preparation tasks have completed


prepareQueue()

prepareQueue(queuePointer, options?): Promise<void>

Prepares documents to be viewed in the future by requesting document data, calling conversion, and pre-retrieving converted content, creating OIDocuments and loading them.

Parameters

queuePointer: IQueuePointer

The queue pointer to prepare documents for

options?: IPrepareQueueOptions

Options used to fine-tune how document preparation runs

Returns

Promise<void>

Promise that is resolved once all preparation tasks have completed


prepareViewerQueue()

prepareViewerQueue(viewerCollection, cancellationToken?): Promise<void>

Prepares documents to be viewed in the future by requesting document data, calling conversion, and pre-retrieving converted content, creating OIDocuments and loading them.

Parameters

viewerCollection: IViewerCollection

The viewerCollection used to check for item load transforms

cancellationToken?: ICancellationToken

Token used to cancel in-progress document preparation

Returns

Promise<void>

Promise that is resolved once all preparation tasks have completed