Skip to main content

Document Viewer API

Type Aliases

BaseOptions

Ƭ BaseOptions: Object

Type declaration

NameTypeDescription
grantPermissions?"read" | "write"Android only: The type of permission to grant to the receiving app that will open the document. This only has effect if you're viewing a file that lives in the app's sandboxed storage.
headerTitle?stringiOS only: The title to display in the header of the document viewer. If not provided, the filename will be used.
mimeType?stringOptional, but recommended: the mimetype of the document. This will help the Android OS to find the right app(s) to open the document.
presentationStyle?PresentationStyleiOS only - Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen. Defaults to pageSheet.

OptionsViewBookmark

Ƭ OptionsViewBookmark: BaseOptions & { bookmark: string }

BaseOptions with the bookmark data from the DocumentPicker module. Obtain the bookmark using the "open" mode, with requestLongTermAccess flag set to true.

A bookmark enables long-term access to a file.


OptionsViewUri

Ƭ OptionsViewUri: BaseOptions & { uri: string }

BaseOptions with the uri of the document to view


PresentationStyle

Ƭ PresentationStyle: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen" | undefined

iOS only. Configure the presentation style of the picker.


ViewDocumentOptions

Ƭ ViewDocumentOptions: OptionsViewBookmark | OptionsViewUri

options for viewing a document

If you're trying to open a file that you have long-term permission to access, you should use the bookmark option (provided by the DocumentPicker module).

Functions

viewDocument

viewDocument(data): Promise<null>

Parameters

NameType
dataViewDocumentOptions

Returns

Promise<null>