An interface for manipulating the settings of a specific plugin.

interface ISettings<O> {
    changed: ISignal<ISettingRegistry.ISettings<O>, void>;
    composite: O;
    id: string;
    isDisposed: boolean;
    plugin: IPlugin;
    raw: string;
    schema: ISchema;
    user: O;
    version: string;
    annotatedDefaults(): string;
    default(key): undefined | PartialJSONValue;
    dispose(): void;
    get(key): {
        composite: undefined | ReadonlyPartialJSONValue;
        user: undefined | ReadonlyPartialJSONValue;
    };
    remove(key): Promise<void>;
    save(raw): Promise<void>;
    set(key, value): Promise<void>;
    validate(raw): null | ISchemaValidator.IError[];
}

Type Parameters

Hierarchy

Implemented by

Properties

A signal that emits when the plugin's settings have changed.

composite: O

The composite of user settings and extension defaults.

id: string

The plugin's ID.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

plugin: IPlugin
raw: string

The plugin settings raw text value.

schema: ISchema

The plugin's schema.

user: O

The user settings.

version: string

The published version of the NPM package containing these settings.

Methods

  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

  • Get an individual setting.

    Parameters

    • key: string

      The name of the setting being retrieved.

    Returns {
        composite: undefined | ReadonlyPartialJSONValue;
        user: undefined | ReadonlyPartialJSONValue;
    }

    The setting value.

    • composite: undefined | ReadonlyPartialJSONValue
    • user: undefined | ReadonlyPartialJSONValue
  • Remove a single setting.

    Parameters

    • key: string

      The name of the setting being removed.

    Returns Promise<void>

    A promise that resolves when the setting is removed.

    Notes

    This function is asynchronous because it writes to the setting registry.