Interface: PanelModel
Defined in: panel/model.ts:48
A model of the settings panel that has no dependency on a UI library.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
groups | readonly | readonly PanelGroup[] | The groups with the current values. Each read makes a new snapshot. | panel/model.ts:50 |
Methods
exportJson()
ts
exportJson(): string;Defined in: panel/model.ts:56
Return the configuration document as formatted JSON.
Returns
string
importJson()
ts
importJson(text): boolean;Defined in: panel/model.ts:58
Import a configuration document from JSON text. Returns false if the text is not valid JSON.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
boolean
reset()
ts
reset(): void;Defined in: panel/model.ts:54
Remove all changes.
Returns
void
set()
ts
set(path, value): boolean;Defined in: panel/model.ts:52
Set the value at the path section.field. Returns false if the value is not valid.
Parameters
| Parameter | Type |
|---|---|
path | string |
value | unknown |
Returns
boolean
subscribe()
ts
subscribe(listener): () => void;Defined in: panel/model.ts:60
Call the listener after each configuration change. Returns a function that removes the listener.
Parameters
| Parameter | Type |
|---|---|
listener | () => void |
Returns
() => void