Skip to content

openrv-web / Plugin

Interface: Plugin

Defined in: plugin/types.ts:95

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

Properties

manifest

readonly manifest: PluginManifest

Defined in: plugin/types.ts:97

Static manifest metadata

Methods

activate()

activate(context): void | Promise<void>

Defined in: plugin/types.ts:109

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:115

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:121

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:127

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:103

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:133

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.