Skip to content

DocumentPicker

Presents a document picker.

Use this to present a picker that allows opening a document from Files app or exporting a document to Files app. When opening a document, the picker will prompt you to select one or more documents after which you will get the path for the documents. Use the FileManager to read the content of these files. When exporting a document, the picker will ask you to select a destination to store the document.

+open

Opens a document.

Presents a picker that promps for opening a document from the Files app. When fulfilled the returned promise will provide the paths for the selected documents. Use an instance of FileManager to read the contents of the files.

static open(types: [string]): Promise<[string]>

+export

Exports a file to a document.

Exports the file to a document with. A picker prompting for a destination to export the document to is presented.

static export(path: string): Promise<[string]>

+exportString

Exports a string to a document.

Exports a string to a new file. The name of the file can optionally be specified. A picker prompting for a destination to export the document to is presented.

static exportString(content: string, name: string): Promise<[string]>

+exportImage

Exports an image.

Exports an image to a new file. The name of the file can optionally be specified. A picker prompting for a destination to export the document to is presented.

static exportImage(image: Image, name: string): Promise<[string]>