Skip to content

Commit 7ca9bac

Browse files
committed
Replace overload with casted return value
1 parent 25a9f82 commit 7ca9bac

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/embedded.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,7 @@ export class RoomWidgetClient extends MatrixClient {
314314
eventType: K,
315315
content: StateEvents[K],
316316
stateKey: string,
317-
): Promise<SendFutureResponse<F>>;
318-
// eslint-disable-next-line
319-
public async _unstable_sendStateFuture<K extends keyof StateEvents>(
320-
roomId: string,
321-
futureOpts: SendFutureRequestOpts,
322-
eventType: K,
323-
content: StateEvents[K],
324-
stateKey = "",
325-
): Promise<SendTimeoutFutureResponse | SendActionFutureResponse> {
317+
): Promise<SendFutureResponse<F>> {
326318
if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_FUTURES))) {
327319
throw Error("Server does not support the Futures API");
328320
}
@@ -336,9 +328,9 @@ export class RoomWidgetClient extends MatrixClient {
336328
isTimeoutFuture ? futureOpts.future_timeout : undefined,
337329
"future_group_id" in futureOpts ? futureOpts.future_group_id : undefined,
338330
);
339-
return isTimeoutFuture
331+
return <SendFutureResponse<F>>(isTimeoutFuture
340332
? this.validateSendTimeoutFutureResponse(response)
341-
: this.validateSendActionFutureResponse(response);
333+
: this.validateSendActionFutureResponse(response));
342334
}
343335

344336
private validateSendEventResponse(response: ISendEventFromWidgetResponseData): ISendEventResponse {

0 commit comments

Comments
 (0)