Fix more type definitions
This commit is contained in:
parent
f929d2ee5f
commit
02e72d8b04
11 changed files with 32 additions and 33 deletions
|
@ -16,8 +16,8 @@ limitations under the License.
|
|||
|
||||
import EventEmitter from 'events';
|
||||
import { IWidget } from 'matrix-widget-api';
|
||||
import MatrixEvent from "matrix-js-sdk/src/models/event";
|
||||
import {WidgetType} from "../widgets/WidgetType";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { WidgetType } from "../widgets/WidgetType";
|
||||
|
||||
/**
|
||||
* Acts as a place to get & set widget state, storing local echo state and
|
||||
|
|
|
@ -51,7 +51,7 @@ import ThemeWatcher from "../../settings/watchers/ThemeWatcher";
|
|||
import {getCustomTheme} from "../../theme";
|
||||
import CountlyAnalytics from "../../CountlyAnalytics";
|
||||
import { ElementWidgetCapabilities } from "./ElementWidgetCapabilities";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { MatrixEvent, IEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { ELEMENT_CLIENT_ID } from "../../identifiers";
|
||||
import { getUserLanguage } from "../../languageHandler";
|
||||
|
||||
|
@ -415,7 +415,7 @@ export class StopGapWidget extends EventEmitter {
|
|||
private feedEvent(ev: MatrixEvent) {
|
||||
if (!this.messaging) return;
|
||||
|
||||
const raw = ev.event;
|
||||
const raw = ev.event as IEvent;
|
||||
this.messaging.feedEvent(raw).catch(e => {
|
||||
console.error("Error sending event to widget: ", e);
|
||||
});
|
||||
|
|
|
@ -145,7 +145,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||
return {roomId, eventId: r.event_id};
|
||||
}
|
||||
|
||||
public async readRoomEvents(eventType: string, msgtype: string | undefined, limit: number): Promise<MatrixEvent[]> {
|
||||
public async readRoomEvents(eventType: string, msgtype: string | undefined, limit: number): Promise<object[]> {
|
||||
limit = limit > 0 ? Math.min(limit, 25) : 25; // arbitrary choice
|
||||
|
||||
const client = MatrixClientPeg.get();
|
||||
|
@ -167,9 +167,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||
return results.map(e => e.event);
|
||||
}
|
||||
|
||||
public async readStateEvents(
|
||||
eventType: string, stateKey: string | undefined, limit: number,
|
||||
): Promise<MatrixEvent[]> {
|
||||
public async readStateEvents(eventType: string, stateKey: string | undefined, limit: number): Promise<object[]> {
|
||||
limit = limit > 0 ? Math.min(limit, 100) : 100; // arbitrary choice
|
||||
|
||||
const client = MatrixClientPeg.get();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue