PluginSettings
A plugin’s settings for the current user, such as preferences, kept outside models.
Values are stored as JSON, as JSON.stringify writes them, so get returns a copy.
Changes are saved right away and are not undoable. A plugin’s settings can take up to
1 MiB of JSON.
const segments = context.settings.get("segments", 24);context.settings.set("segments", segments * 2);Methods
Section titled “Methods”Call Signature
Section titled “Call Signature”get<
T>(key):T|undefined
Returns the value stored under key, or undefined when there is none.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”T | undefined
Call Signature
Section titled “Call Signature”get<
T>(key,defaultValue):T
Returns the value stored under key, or defaultValue when there is none.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
defaultValue
Section titled “defaultValue”T
Returns
Section titled “Returns”T
set(
key,value):void
Stores a JSON value under key; undefined removes it.
Parameters
Section titled “Parameters”string
unknown
Returns
Section titled “Returns”void