textmode.js / plugins / TextmodePlugin
Interface: TextmodePlugin
A plugin interface for extending the functionality of a Textmodifier instance.
Create plugins by implementing this interface.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
name | readonly | string | Unique name for the plugin. |
Methods
install()
ts
install(textmodifier, context): void | (() => void);Called when the plugin is installed on a Textmodifier instance.
Installation must finish synchronously; awaited work belongs in the preSetup hook. Register hooks and extensions through TextmodePluginContext. Resources the plugin allocates for itself are released by the returned cleanup function, which the host stores and invokes exactly once during rollback or teardown.
Parameters
| Parameter | Type | Description |
|---|---|---|
textmodifier | Textmodifier | The Textmodifier instance the plugin is being installed on. |
context | TextmodePluginContext | A host-provided context exposing the Textmodifier runtime and plugin hook registration methods. |
Returns
void | (() => void)
An optional cleanup function that releases the plugin's own resources.