Skip to content

components/plugin-settings-component

Component that manages plugin settings: data, persistence, validation, and events.

This is the single public-facing settings API for plugin authors. All settings logic (load, save, validate, transform, clone) is handled directly by this component — no separate manager class is needed.

Class Description
PluginSettingsComponentBase Base class for plugin settings components. Manages settings data, persistence, validation, and events. Plugin authors extend this class and pass their settings class as PluginSettingsComponentBaseConstructorParams.pluginSettingsClass, whose default-constructed instance supplies the defaults.
PluginSettingsImportError Thrown by PluginSettingsComponentBase.importFromJson when the text is not a JSON object. Nothing was changed.
Interface Description
PluginSettingsComponentBaseConstructorParams Constructor parameters for PluginSettingsComponentBase.
PluginSettingsComponentBaseOnSaveSettingsParams Parameters for PluginSettingsComponentBase.onSaveSettings.
PluginSettingsImportResult The outcome of PluginSettingsComponentBase.importFromJson.
PluginSettingsState A snapshot of plugin settings state, including raw input values, effective (validated) values, and per-property validation messages.
Type Description
ReadonlyPluginSettings Readonly version of PluginSettings.
ReadonlyPluginSettingsState Readonly version of PluginSettingsState for use in event callbacks and public getters.
SettingsValidator A validator function for a settings property.
Variable Description
LIBRARY_RECORD_KEY The data.json key of the record this library keeps beside a plugin’s own settings, such as the command switches. A wire format between plugin versions and devices: the record is a plain JSON object, and its entries are only ever added.