Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Settings

A manager for a specific plugin's settings. A namespace for Settings statics.

Hierarchy

  • Settings

Implements

Index

Constructors

constructor

Properties

Private _changed

_changed: Signal<this, void> = new Signal<this, void>(this)

Private _isDisposed

_isDisposed: boolean = false

id

id: string

The plugin name.

registry

The setting registry instance used as a back-end for these settings.

Accessors

changed

  • get changed(): ISignal<this, void>
  • A signal that emits when the plugin's settings have changed.

    Returns ISignal<this, void>

composite

  • get composite(): ReadonlyJSONObject
  • The composite of user settings and extension defaults.

    Returns ReadonlyJSONObject

isDisposed

  • get isDisposed(): boolean

plugin

raw

  • get raw(): string

schema

user

  • get user(): ReadonlyJSONObject

version

  • get version(): string
  • The published version of the NPM package containing these settings.

    Returns string

Methods

Private _onPluginChanged

  • _onPluginChanged(sender: any, plugin: string): void
  • Handle plugin changes in the setting registry.

    Parameters

    • sender: any
    • plugin: string

    Returns void

annotatedDefaults

  • annotatedDefaults(): string

default

  • default(key: string): JSONValue | undefined
  • Calculate the default value of a setting by iterating through the schema.

    Parameters

    • key: string

      The name of the setting whose default value is calculated.

    Returns JSONValue | undefined

    A calculated default JSON value for a specific setting.

dispose

  • dispose(): void

get

  • get(key: string): object
  • Get an individual setting.

    Parameters

    • key: string

      The name of the setting being retrieved.

    Returns object

    The setting value.

    Notes

    This method returns synchronously because it uses a cached copy of the plugin settings that is synchronized with the registry.

remove

  • remove(key: string): Promise<void>
  • 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.

save

  • save(raw: string): Promise<void>

set

  • set(key: string, value: JSONValue): Promise<void>
  • Set a single setting.

    Parameters

    • key: string

      The name of the setting being set.

    • value: JSONValue

      The value of the setting.

    Returns Promise<void>

    A promise that resolves when the setting has been saved.

    Notes

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

validate

  • validate(raw: string): IError[] | null
  • Validates raw settings with comments.

    Parameters

    • raw: string

      The JSON with comments string being validated.

    Returns IError[] | null

    A list of errors or null if valid.

Generated using TypeDoc