Last date modified: 2025-Jul-02

Interface: IPreviewApi

The preview API is designed for consumption by the Fluid Item List application and exposes specific APIs used to power the Document Preview Panel.

Extends

Methods

off()

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

Unregisters an event handler

Parameters

eventType: PreviewApiEventType

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: PreviewApiEventType

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: PreviewApiEventType

Event to listen for

handler: EventHandler

Event handler function

Returns

void

Inherited from

IEventEmitter.once


popin()

popin(): Promise<void>

Pops in the IViewerCollection from the popup window back into the preview iframe on the Fluid Item List page

Returns

Promise<void>

A promise that resolves when the viewer collection is popped in


popout()

popout(): Promise<void>

Pops out the IViewerCollection from the preview iframe on the Fluid Item List page and loads it in a new popup window

Returns

Promise<void>

A promise that resolves when the viewer collection is popped out


setDocument()

setDocument(documentArtifactId?): Promise<void>

Sets the selected document and loads it in the main IViewerCollection

If the supplied document artifact ID is not present in the current queue, the application will create a new queue with that document in it before loading the document and delete the prior queue. If no document artifact ID is passed to this method, the application will show a placeholder instead of a document.

Parameters

documentArtifactId?: number

Artifact ID of the selected document (If no document has been selected, undefined should be passed or the parameter should be omitted.)

Returns

Promise<void>

A promise that resolves when the document has been shown to the user


setQueue()

setQueue(documentArtifactIds, selectedDocumentArtifactId?): Promise<void>

Sets the queue of documents that are currently displayed on the Fluid Item List page and loads the selected document in the main IViewerCollection

If the supplied selected document artifact ID is not present in the array of document IDs passed in, the application will show a placeholder instead of a document. If the supplied document artifact IDs array is empty, the selected document artifact ID parameter may be omitted.

After setting the queue using the supplied document IDs, the prior queue of documents is deleted.

Parameters

documentArtifactIds: number[]

Array of document artifact IDs for the documents visible on the Fluid Item List page

selectedDocumentArtifactId?: number

Artifact ID of the selected document (If no document is selected, undefined should be passed or the parameter should be omitted.)

Returns

Promise<void>

A promise that resolves when the queue has been updated

Return to top of the page
Feedback