Skip to content

Commit 51c4df3

Browse files
committed
Add return type to createInitialState
1 parent 0d43d99 commit 51c4df3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/bridge-info-state.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ export interface MSC2346Content extends MappingInfo {
3535
bridgebot: string;
3636
}
3737

38+
export interface InitialEvent {
39+
type: string,
40+
content: Record<string, unknown>,
41+
state_key: string,
42+
}
43+
3844
interface Opts<BridgeMappingInfo> {
3945
/**
4046
* The name of the bridge implementation, ideally in Java package naming format:
@@ -110,11 +116,11 @@ export class BridgeInfoStateSyncer<BridgeMappingInfo> {
110116
}
111117
}
112118

113-
public async createInitialState(roomId: string, bridgeMappingInfo: BridgeMappingInfo) {
119+
public async createInitialState(roomId: string, bridgeMappingInfo: BridgeMappingInfo): Promise<InitialEvent> {
114120
const mapping = await this.opts.getMapping(roomId, bridgeMappingInfo);
115121
return {
116122
type: BridgeInfoStateSyncer.EventType,
117-
content: this.createBridgeInfoContent(mapping),
123+
content: this.createBridgeInfoContent(mapping) as unknown as Record<string, unknown>,
118124
state_key: this.createStateKey(mapping),
119125
};
120126
}

0 commit comments

Comments
 (0)