Interface: ConfigProvider
Defined in: config/types.ts:99
A source of configuration documents.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
name | readonly | string | The unique name of the provider. save({ to }) uses it. | config/types.ts:101 |
Methods
load()
ts
load(signal): Promise<ConfigDocument | null>;Defined in: config/types.ts:103
Gets the document, or null if the source has no document.
Parameters
| Parameter | Type |
|---|---|
signal | AbortSignal |
Returns
Promise<ConfigDocument | null>
save()?
ts
optional save(document, signal): Promise<void>;Defined in: config/types.ts:105
Writes the document. A provider without this function cannot save.
Parameters
| Parameter | Type |
|---|---|
document | ConfigDocument |
signal | AbortSignal |
Returns
Promise<void>
subscribe()?
ts
optional subscribe(onChange, onError?): () => void;Defined in: config/types.ts:110
Sends each new document from the source. Sends each error of a change to onError. Returns a function that stops the subscription.
Parameters
| Parameter | Type |
|---|---|
onChange | (document) => void |
onError? | (error) => void |
Returns
() => void