The default concrete implementation of a setting registry.

Hierarchy

  • SettingRegistry

Implements

Constructors

Properties

_load: any

Load a plugin into the registry.

_pluginChanged: any
_preload: any

Preload a list of plugins and fail gracefully.

_ready: any
_save: any

Save a plugin in the registry.

_transform: any

Transform the plugin if necessary.

_transformers: any
_unloadedPlugins: any
_validate: any

Validate and preload a plugin, compose the composite data.

connector: IDataConnector<IPlugin, string, string, string>

The data connector used by the setting registry.

plugins: {
    [name: string]: IPlugin;
}

The collection of setting registry plugins.

Type declaration

schema: ISchema

The schema of the setting registry.

validator: ISchemaValidator

The schema validator used by the setting registry.

Accessors

  • get pluginChanged(): ISignal<this, string>
  • A signal that emits the name of a plugin when its settings change.

    Returns ISignal<this, string>

Methods

  • Get an individual setting.

    Parameters

    • plugin: string

      The name of the plugin whose settings are being retrieved.

    • key: string

      The name of the setting being retrieved.

    Returns Promise<{
        composite: PartialJSONValue;
        user: PartialJSONValue;
    }>

    A promise that resolves when the setting is retrieved.

  • Load a plugin's settings into the setting registry.

    Parameters

    • plugin: string

      The name of the plugin whose settings are being loaded.

    • Optional forceTransform: boolean

      An optional parameter to force replay the transforms methods.

    Returns Promise<ISettingRegistry.ISettings>

    A promise that resolves with a plugin settings object or rejects if the plugin is not found.

  • Reload a plugin's settings into the registry even if they already exist.

    Parameters

    • plugin: string

      The name of the plugin whose settings are being reloaded.

    Returns Promise<ISettingRegistry.ISettings>

    A promise that resolves with a plugin settings object or rejects with a list of ISchemaValidator.IError objects if it fails.

  • Remove a single setting in the registry.

    Parameters

    • plugin: string

      The name of the plugin whose setting is being removed.

    • key: string

      The name of the setting being removed.

    Returns Promise<void>

    A promise that resolves when the setting is removed.

  • Set a single setting in the registry.

    Parameters

    • plugin: string

      The name of the plugin whose setting is being set.

    • key: string

      The name of the setting being set.

    • value: JSONValue

      The value of the setting being set.

    Returns Promise<void>

    A promise that resolves when the setting has been saved.

  • Register a plugin transform function to act on a specific plugin.

    Parameters

    • plugin: string

      The name of the plugin whose settings are transformed.

    • transforms: {
          compose: Transform;
          fetch: Transform;
      }

      The transform functions applied to the plugin.

    Returns IDisposable

    A disposable that removes the transforms from the registry.

    Notes

    • compose transformations: The registry automatically overwrites a plugin's default values with user overrides, but a plugin may instead wish to merge values. This behavior can be accomplished in a compose transformation.
    • fetch transformations: The registry uses the plugin data that is fetched from its connector. If a plugin wants to override, e.g. to update its schema with dynamic defaults, a fetch transformation can be applied.
  • Upload a plugin's settings.

    Parameters

    • plugin: string

      The name of the plugin whose settings are being set.

    • raw: string

      The raw plugin settings being uploaded.

    Returns Promise<void>

    A promise that resolves when the settings have been saved.

Generated using TypeDoc