Skip to content

Documentation / @finchart/core / index / ConfigurablePluginApi

Interface: ConfigurablePluginApi<Options> ​

Defined in: packages/core/src/primitives/plugin.ts:63

A plugin's API when its options can be given again. Without this, changing one option means tearing the plugin down and remounting it — for the drawing toolbox, that means erasing every line the user drew. The shape of the patch differs per plugin, so it's a type parameter.

The merge is one level deep. Only the given fields change, and a given field is replaced wholesale — calling applyOptions({ format: { x } }) and then { format: { y } } makes x disappear. { key: undefined } resets to the default (different from omitting the key).

Calling this after cleanup throws — succeeding silently would make the caller think the option took effect and wait forever for the screen to update. This is an opt-in contract: a plugin that's allowed to freeze at install time stays a plain PluginApi.

Extends ​

Type Parameters ​

Options ​

Options

Properties ​

disposed ​

readonly disposed: boolean

Defined in: packages/core/src/primitives/plugin.ts:30

Inherited from ​

PluginApi.disposed

Methods ​

applyOptions() ​

applyOptions(patch): void

Defined in: packages/core/src/primitives/plugin.ts:64

Parameters ​

patch ​

Partial<Options>

Returns ​

void


dispose() ​

dispose(): void

Defined in: packages/core/src/primitives/plugin.ts:29

Returns ​

void

Inherited from ​

PluginApi.dispose