Improve types for sendEvent
(#12335)
This commit is contained in:
parent
4941327c78
commit
ef2bd7ae04
26 changed files with 209 additions and 99 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue