Improve types for sendEvent (#12335)

This commit is contained in:
Michael Telatynski 2024-03-25 12:48:48 +00:00 committed by GitHub
parent 4941327c78
commit ef2bd7ae04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 209 additions and 99 deletions

View file

@ -16,7 +16,8 @@ limitations under the License.
import React from "react";
import { logger } from "matrix-js-sdk/src/logger";
import { IContent, MatrixClient } from "matrix-js-sdk/src/matrix";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import { RoomMessageEventContent } from "matrix-js-sdk/src/types";
import EditorModel from "./model";
import { Type } from "./parts";
@ -63,9 +64,9 @@ export async function runSlashCommand(
args: string | undefined,
roomId: string,
threadId: string | null,
): Promise<[content: IContent | null, success: boolean]> {
): Promise<[content: RoomMessageEventContent | null, success: boolean]> {
const result = cmd.run(matrixClient, roomId, threadId, args);
let messageContent: IContent | null = null;
let messageContent: RoomMessageEventContent | null = null;
let error: any = result.error;
if (result.promise) {
try {