PluginFiles
Methods
Section titled “Methods”current()
Section titled “current()”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.
Returns
Section titled “Returns”| OpenedFile
| undefined
fetch()
Section titled “fetch()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
origin |
FileOrigin |
Returns
Section titled “Returns”Promise<
| RemoteFile
| null>
open()
Section titled “open()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file |
RemoteFile |
Returns
Section titled “Returns”Promise<boolean>
registerSource()
Section titled “registerSource()”registerSource(source): () => void;Adds a source to the Open and “Save a copy” menus; returns a function that removes it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
FileSource |
Returns
Section titled “Returns”() => void