Extend MindDrop's features.
Property | Type | Description |
---|---|---|
id* | string | The extension ID, must be unique accross the app. |
enabled* | boolean | Indicates whether the extension is enabled or not. |
topics* | string[] | The IDs of the topics for which this extension is enabled. |
name* | string | The extension's name as displayed to users. |
description* | string | A short description of the extension which will be displayed to users. |
scopes* | ('app' | 'topic')[] | The scopes within which the extension operates.
|
onRun* | function | Called when the app initializes the extension on startup. See below for details. |
onInstall | function | Called when the extension is installed. See below for details. |
onEnable | function | Called when the extension is enabled globally. See below for details. |
onEnableTopics | function | Called when the extension is enabled for given topics. See below for details. |
onUpdate | function | Called when the extension has been updated. See below for details. |
onDisable | function | Called when the extension is disabled globally. See below for details. |
onDisableTopics | function | Called when the extension is disabled for given topics. See below for details. |
onUninstanll | function | Called when the extension is uninstalled. See below for details. |
MindDrop extensions are defined using a set of lifecycle methods. The app calls these methods at given stages of the extension's life or in response to certain events.
The main extension method called when the app initializes the extension on startup. Use to set up event listeners, register drop types, register views, etc...
onRun(core: Core) => void
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |
Called once when the extension is installed. Directly followed by a call to onEnable
.
onInstall(core: Core) => Promise<void>
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |
Called once when the extension is enabled globally. Called directly after onInstall
, but can also be called independently at a later stage if the extension was temporarily disabled.
onEnable(core: Core) => void
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |
Called when the extension is enabled in given topics.
onEnableTopics(core: Core, topics: Topic[]) => Promise<void>
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |
topics* | Topic[] | The topics for which the extension was enabled. |
Called once when the extension has been updated to a new version. Directly followed by a call to onEnable
.
onUpdate(core: Core) => Promise<void>
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |
Called once when the extension is deenabled globally. Called directly before onUninstall
, but can also be called independently if the user disables the extension without uninstalling it.
onDisable(core: Core) => Promise<void>
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |
Called when the extension is disabled in given topics.
onDisableTopics(core: Core) => Promise<void>
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |
topics* | Topic[] | The topics for which the extension was disabled. |
Called once when the extension is uninstalled. Use to clean up any data stored by your extension. Always directly preceeded by a call to onDisable
.
onUninstall(core: Core) => void
Argument | Type | Description |
---|---|---|
core* | Core | A MindDrop core instance. |