api.settings
Interface for handling settings and properties stored in localStorage
settings.get(namespace, key, [defaultValue]) ⇒ *
Get a value for a specific setting. Return null, or default value when specified when not existing.
Param | Type | Default | Description |
---|---|---|---|
namespace | String |
Plugin name, or namespace of saved setting value | |
key | String |
Key where setting is saved | |
[defaultValue] | * |
`null` |
Default return value if key is not found in namespace |
settings.set(namespace, key, value) ⇒ boolean
Set a value for a specific setting, transformed into JSON. Returns true on success, false on failure.
Param | Type | Description |
---|---|---|
namespace | String |
Plugin name or custom namespace where to save setting |
key | String |
Which key to use to save setting value |
value | * |
Value of setting |
settings.delete(namespace, key) ⇒ boolean
Delete a specific setting. Returns true on success, false on failure.
Param | Type |
---|---|
namespace | String |
key | String |
settings.getAllSettings(namespace) ⇒ *
Retrieve all settings stored. Returns false on failure, object on success.
Param | Type | Description |
---|---|---|
namespace | String |
Plugin name or custom namespace where to save setting |