PluginSettingsComponentBase.importFromJson method
PluginSettingsComponentBase › importFromJson
Replaces every setting with the ones in a JSON record, such as oneexportToJson produced, and saves them.The record is read the way
data.json is: legacy converters and the transformer run, a setting it lacks takes its default, and an unknown key is ignored. The settings in use are kept as a recovery copy first, when the data handler keeps them.Signature:
importFromJson(json: string, context?: unknown): Promise<PluginSettingsImportResult>Parameters:
| Parameter | Type | Description |
|---|---|---|
| json | string | The JSON text. |
| context? | unknown | The save context passed to the saveSettings event. |
Returns: Promise<PluginSettingsImportResult> — The unknown keys and the settings whose imported value fails validation.