Protected setter for the configuration of the Dock3Provider.
This does not save the configuration in storage nor notify the dock about the change.
Use updateConfig
method to update the configuration and save it.
This should only be used internally in a saveConfig
override if super.saveConfig
is not called.
Returns a promise that resolves when the Dock3Provider is ready. This is useful to ensure that the dock is fully initialized before performing any operations. The promise will resolve when the dock sends the 'ready' action.
Called on startup to load the current configuration of the Dock3Provider.
If you've overridden the saveConfig
method, this should load the configuration from your storage.
By default it will load the configuration from local storage. This can be overriden to prevent loading from local storage.
The current configuration of the Dock3Provider.
class MyDock3Provider extends Dock3Provider {
async loadConfig(): Promise<Dock3Config> {
// Do not load from local storage, return the default config
return this.config;
}
}
class MyDock3Provider extends Dock3Provider {
async loadConfig(): Promise<Dock3Config> {
// Load from a custom storage
const configFromStorage = await myCustomStorage.getDockConfig();
// Update local config to ensure it is used.
if (configFromStorage) {
this.config = configFromStorage;
}
return this.config;
}
}
Called whenever the configuration is updated, this method saves the configuration to the storage.
This should not be called directly, if you need to update the configuration, use updateConfig
method instead.
Updates the configuration of the Dock3Provider.
This method updates the configuration, notifies the dock about the change and saves the new configuration to storage (via saveConfig
).
Static
getRest
...args: [config: Dock3Config, channel: Dock3ChannelProvider]
Read-only access to the current configuration of the Dock3Provider.