diff --git a/src/embedded.ts b/src/embedded.ts index d1b84ce2fa1..229ef3c2650 100644 --- a/src/embedded.ts +++ b/src/embedded.ts @@ -26,7 +26,7 @@ import { } from "matrix-widget-api"; import { MatrixEvent, IEvent, IContent, EventStatus } from "./models/event"; -import { ISendEventResponse } from "./@types/requests"; +import { ISendEventResponse, ISendFutureRequestOpts, ISendFutureResponse } from "./@types/requests"; import { EventType } from "./@types/event"; import { logger } from "./logger"; import { @@ -248,7 +248,20 @@ export class RoomWidgetClient extends MatrixClient { throw new Error(`Unknown room: ${roomIdOrAlias}`); } - protected async encryptAndSendEvent(room: Room, event: MatrixEvent): Promise { + protected async encryptAndSendEvent(room: Room, event: MatrixEvent): Promise; + protected async encryptAndSendEvent( + room: Room, + event: MatrixEvent, + futureOpts: F, + ): Promise>; + protected async encryptAndSendEvent( + room: Room, + event: MatrixEvent, + futureOpts?: F, + ): Promise> { + if (futureOpts) { + throw new Error("Future sending via widgets is not implemented"); + } let response: ISendEventFromWidgetResponseData; try { response = await this.widgetApi.sendRoomEvent(event.getType(), event.getContent(), room.roomId);