Improve types for sendStateEvent
(#12331)
This commit is contained in:
parent
4a05de485e
commit
2cbf92860b
17 changed files with 89 additions and 44 deletions
|
@ -18,6 +18,7 @@ import { Page } from "@playwright/test";
|
|||
|
||||
import { test, expect } from "../../element-web-test";
|
||||
import { ElementAppPage } from "../../pages/ElementAppPage";
|
||||
import type { Container } from "../../../src/stores/widgets/types";
|
||||
|
||||
test.describe("Room Header", () => {
|
||||
test.use({
|
||||
|
@ -227,7 +228,7 @@ test.describe("Room Header", () => {
|
|||
{
|
||||
widgets: {
|
||||
[id]: {
|
||||
container: "top",
|
||||
container: "top" as Container,
|
||||
index: 1,
|
||||
width: 100,
|
||||
height: 0,
|
||||
|
|
|
@ -31,6 +31,7 @@ import type {
|
|||
Visibility,
|
||||
UploadOpts,
|
||||
Upload,
|
||||
StateEvents,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { Credentials } from "../plugins/homeserver";
|
||||
|
||||
|
@ -407,7 +408,7 @@ export class Client {
|
|||
const client = await this.prepareClient();
|
||||
return client.evaluate(
|
||||
async (client, { roomId, eventType, content, stateKey }) => {
|
||||
return client.sendStateEvent(roomId, eventType, content, stateKey);
|
||||
return client.sendStateEvent(roomId, eventType as keyof StateEvents, content, stateKey);
|
||||
},
|
||||
{ roomId, eventType, content, stateKey },
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue