Skip to content

PluginFiles

current():
| OpenedFile
| undefined;

The workbook open now, as it was opened; undefined while none is. Read it when the opened event comes, to know what was opened and from where.

| OpenedFile | undefined


fetch(origin): Promise<
| RemoteFile
| null>;

Fetches a file again through the source its origin names, which may be another plugin’s, so open can open it. Resolves null when the person cancels, or when it can’t: the source isn’t in this editor, has no fetch, or failed, which the editor has then said.

Parameter Type
origin FileOrigin

Promise< | RemoteFile | null>


open(file): Promise<boolean>;

Opens a file as if picked from a source, for files found some other way (a recent-files list, a link). Resolves whether it opened.

Parameter Type
file RemoteFile

Promise<boolean>


registerSource(source): () => void;

Adds a source to the Open and “Save a copy” menus; returns a function that removes it.

Parameter Type
source FileSource

() => void