Add apiOptionsSchemaGet

This commit is contained in:
toasted-nutbread 2019-12-14 16:40:05 -05:00
parent 50e0fbbb66
commit d2da4f7e62
2 changed files with 16 additions and 0 deletions

View File

@ -115,6 +115,13 @@ class Backend {
}
}
async getOptionsSchema() {
if (this.isPreparedPromise !== null) {
await this.isPreparedPromise;
}
return this.optionsSchema;
}
async getFullOptions() {
if (this.isPreparedPromise !== null) {
await this.isPreparedPromise;
@ -200,6 +207,10 @@ class Backend {
// Message handlers
_onApiOptionsSchemaGet() {
return this.getOptionsSchema();
}
_onApiOptionsGet({optionsContext}) {
return this.getOptions(optionsContext);
}
@ -692,6 +703,7 @@ class Backend {
}
Backend._messageHandlers = new Map([
['optionsSchemaGet', (self, ...args) => self._onApiOptionsSchemaGet(...args)],
['optionsGet', (self, ...args) => self._onApiOptionsGet(...args)],
['optionsGetFull', (self, ...args) => self._onApiOptionsGetFull(...args)],
['optionsSet', (self, ...args) => self._onApiOptionsSet(...args)],

View File

@ -17,6 +17,10 @@
*/
function apiOptionsSchemaGet() {
return _apiInvoke('optionsSchemaGet');
}
function apiOptionsGet(optionsContext) {
return _apiInvoke('optionsGet', {optionsContext});
}