Skip to content

PluginContext

Property Type Description
commands PluginCommands -
editor EditorHandle The same handle the host has: open, save, getWorkbook, subscribe, status, origin…
files PluginFiles -
limits object The editor’s limits, so a source can refuse a file it won’t open before downloading it.
limits.maxFileBytes number -
signal AbortSignal Aborted when the editor is destroyed, or the plugin is stopped after failing; pass it to fetches and listeners.
storage PluginStorage A small key–value store kept in this browser for this plugin: recent files, the last folder.
ui PluginUI -
on(listener): () => void;

What the editor does, as onEvent hears it. Returns an unsubscribe function.

Parameter Type
listener (event) => void

() => void


text(text): string;

Text in the editor’s language as it is now, for the plugin’s own DOM in dialogs and panels.

Parameter Type
text PluginText

string