Skip to content

openrv-web / Plugin

Interface: Plugin ​

Defined in: plugin/types.ts:96

Every plugin module must export a default object satisfying this interface.

Properties ​

manifest ​

readonly manifest: PluginManifest

Defined in: plugin/types.ts:98

Static manifest metadata

Methods ​

activate() ​

activate(context): void | Promise<void>

Defined in: plugin/types.ts:110

Activate the plugin: register all contributions with the host. Called after init() and after all dependencies are active.

Parameters ​

context ​

PluginContext

Returns ​

void | Promise<void>


deactivate()? ​

optional deactivate(context): void | Promise<void>

Defined in: plugin/types.ts:116

Deactivate the plugin: withdraw contributions. The plugin may be re-activated later.

Parameters ​

context ​

PluginContext

Returns ​

void | Promise<void>


dispose()? ​

optional dispose(context): void | Promise<void>

Defined in: plugin/types.ts:122

Final cleanup. Release all resources. Called once; the plugin cannot be reactivated after this.

Parameters ​

context ​

PluginContext

Returns ​

void | Promise<void>


getState()? ​

optional getState(): unknown

Defined in: plugin/types.ts:128

Serialize plugin state for hot-reload preservation. Called before the plugin is disposed during a hot-reload cycle.

Returns ​

unknown


init()? ​

optional init(context): void | Promise<void>

Defined in: plugin/types.ts:104

One-time initialization. Allocate resources, validate environment. Throwing here prevents the plugin from activating.

Parameters ​

context ​

PluginContext

Returns ​

void | Promise<void>


restoreState()? ​

optional restoreState(state): void

Defined in: plugin/types.ts:134

Restore state after hot-reload. Called after the new version is activated with the state from getState().

Parameters ​

state ​

unknown

Returns ​

void

Released under the MIT License.