From 51c4df30678a170b590be540656b987eccbb5b1d Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 5 Mar 2023 09:09:30 +0100 Subject: [PATCH 1/2] Add return type to createInitialState --- src/components/bridge-info-state.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/bridge-info-state.ts b/src/components/bridge-info-state.ts index 65798364..d1392658 100644 --- a/src/components/bridge-info-state.ts +++ b/src/components/bridge-info-state.ts @@ -35,6 +35,12 @@ export interface MSC2346Content extends MappingInfo { bridgebot: string; } +export interface InitialEvent { + type: string, + content: Record, + state_key: string, +} + interface Opts { /** * The name of the bridge implementation, ideally in Java package naming format: @@ -110,11 +116,11 @@ export class BridgeInfoStateSyncer { } } - public async createInitialState(roomId: string, bridgeMappingInfo: BridgeMappingInfo) { + public async createInitialState(roomId: string, bridgeMappingInfo: BridgeMappingInfo): Promise { const mapping = await this.opts.getMapping(roomId, bridgeMappingInfo); return { type: BridgeInfoStateSyncer.EventType, - content: this.createBridgeInfoContent(mapping), + content: this.createBridgeInfoContent(mapping) as unknown as Record, state_key: this.createStateKey(mapping), }; } From 1365987542d0b57e0c0b2790703ef67d8e375ab5 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 5 Mar 2023 09:21:39 +0100 Subject: [PATCH 2/2] Add changelog --- changelog.d/460.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/460.misc diff --git a/changelog.d/460.misc b/changelog.d/460.misc new file mode 100644 index 00000000..bbca4647 --- /dev/null +++ b/changelog.d/460.misc @@ -0,0 +1 @@ +Add return type to createInitialState