Skip to content

Interface: ConfigProvider ​

Defined in: config/types.ts:99

A source of configuration documents.

Properties ​

PropertyModifierTypeDescriptionDefined in
namereadonlystringThe 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 ​

ParameterType
signalAbortSignal

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 ​

ParameterType
documentConfigDocument
signalAbortSignal

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 ​

ParameterType
onChange(document) => void
onError?(error) => void

Returns ​

() => void