Plugin

The default plugin.

Interface: IPlugin.

This interface must be used in each plugin because the plugin status is required to embed the plugin in the portal.

Variables

status

Stores the plugin status (active or hide).

Type: PluginStatus

Example: "active"

onLoadCallback

Stores callback which will be executed when uploading the plugin to the portal.

Type: func

Methods and their description

updateStatus

Update the plugin status.

Parameters:

NameTypeExampleDescription
statusPluginStatus"active"Defines a new plugin status (active or hide).

getStatus

Get the plugin status.

setOnLoadCallback

Sets the onLoadCallback variable to the plugin.

Parameters:

NameTypeExampleDescription
callbackfucncallbackDefines callback which will be executed when uploading the plugin to the portal.

Example

import {type IPlugin, PluginStatus} from "@onlyoffice/docspace-plugin-sdk"

class Plugin implements IPlugin {
  status: PluginStatus = PluginStatus.active
  onLoadCallback = async () => {}

  updateStatus = (status: PluginStatus) => {
    this.status = status
  }

  getStatus = () => {
    return this.status
  }

  setOnLoadCallback = (callback: () => Promise<void>) => {
    this.onLoadCallback = callback
  }
}

Get Help

  • If you have any questions about ONLYOFFICE DocSpace, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).