MainButtonPlugin

The plugin that is embedded in the main button.

Interface: IMainButtonPlugin.

Variables

mainButtonItems

Stores a collection of elements where the keys are the key parameters from the MainButtonItem objects. A list for embedding into the main button menu is generated based on this collection.

Type: collection of IMainButtonItem

Methods and their description

addMainButtonItem

Add a new main button item.

Parameters:

NameTypeExampleDescription
mainButtonItemsIMainButtonItemDefines a main button item.

getMainButtonItems

Get all the main button items.

updateMainButtonItem

Update the main button item.

Parameters:

NameTypeExampleDescription
mainButtonItemsIMainButtonItemDefines a new main button item.

Example

import {type IMainButtonItem, type IMainButtonPlugin} from "@onlyoffice/docspace-plugin-sdk"

class Plugin implements IMainButtonPlugin {
  mainButtonItems = new Map<string, IMainButtonItem>()

  addMainButtonItem = (item: IMainButtonItem): void => {
    this.mainButtonItems.set(item.key, item)
  }

  getMainButtonItems = (): Map<string, IMainButtonItem> => {
    return this.mainButtonItems
  }

  updateMainButtonItem = (item: IMainButtonItem): void => {
    this.mainButtonItems.set(item.key, item)
  }
}

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).