From 3581aceb5a671307979a20f0deab44856fda1126 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 21 Dec 2022 15:25:08 +0000 Subject: [PATCH] Addd ResolvedConfigOptions back --- src/config/Config.ts | 8 ++++++-- src/config/ConfigOptions.ts | 11 ++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/config/Config.ts b/src/config/Config.ts index 940c26ea..cabd460b 100644 --- a/src/config/Config.ts +++ b/src/config/Config.ts @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { DEFAULT_CONFIG, ConfigOptions } from "./ConfigOptions"; +import { + DEFAULT_CONFIG, + ConfigOptions, + ResolvedConfigOptions, +} from "./ConfigOptions"; export class Config { private static internalInstance: Config; @@ -48,7 +52,7 @@ export class Config { return Config.get().default_server_config["m.homeserver"].server_name; } - public config?: ConfigOptions; + public config?: ResolvedConfigOptions; private initPromise?: Promise; } diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index 45ecb44d..f8f3ba1b 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -22,6 +22,15 @@ export interface ConfigOptions { // Describes the default homeserver to use. The same format as Element Web // (without identity servers as we don't use them). + default_server_config?: { + ["m.homeserver"]: { + base_url: string; + server_name: string; + }; + }; +} + +export interface ResolvedConfigOptions extends ConfigOptions { default_server_config: { ["m.homeserver"]: { base_url: string; @@ -30,7 +39,7 @@ export interface ConfigOptions { }; } -export const DEFAULT_CONFIG: ConfigOptions = { +export const DEFAULT_CONFIG: ResolvedConfigOptions = { default_server_config: { ["m.homeserver"]: { base_url: "http://localhost:8008",