PluginSettings
Since Plugin API: 1.0.0
Plugin settings proxy for a specific plugin
Signature
interface PluginSettings { get<T>(key: string): T | undefined; set(key: string, value: unknown): Promise<void>; getAll(): Readonly<Record<string, unknown>>; getStored(key: string): unknown; unset(key: string): Promise<void>; reset(): Promise<void>; open(): Promise<void>; onChange(handler: (change: PluginSettingsChange) => void): PluginSettingsSubscription;}Members
| Name | Type | Required | Description |
|---|---|---|---|
get |
(key: string) => T | undefined |
yes | - |
set |
(key: string, value: unknown) => Promise<void> |
yes | - |
getAll |
() => Readonly<Record<string, unknown>> |
yes | - |
getStored |
(key: string) => unknown |
yes | Read the unvalidated durable value for migration or recovery. |
unset |
(key: string) => Promise<void> |
yes | Remove one durable value and reveal the schema default. |
reset |
() => Promise<void> |
yes | Remove every durable value and reveal all schema defaults. |
open |
() => Promise<void> |
yes | Open Settings in the current main window directly to this plugin’s settings page. |
onChange |
(handler: (change: PluginSettingsChange) => void) => PluginSettingsSubscription |
yes | - |