Skip to content

textmode.js / plugins / TextmodePlugin

Interface: TextmodePlugin

A plugin interface for extending the functionality of a Textmodifier instance.

Create plugins by implementing this interface.

Properties

PropertyModifierTypeDescription
namereadonlystringUnique 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

ParameterTypeDescription
textmodifierTextmodifierThe Textmodifier instance the plugin is being installed on.
contextTextmodePluginContextA 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.

Example