Skip to content

Commit 8defc83

Browse files
committed
Appease the linter
1 parent baa1b4e commit 8defc83

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

src/WidgetApi.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ export class WidgetApi extends EventEmitter {
338338
return this.transport.send<IModalWidgetReturnData>(WidgetApiFromWidgetAction.CloseModalWidget, data).then();
339339
}
340340

341-
public sendRoomEvent(eventType: string, content: unknown, roomId?: string): Promise<ISendEventFromWidgetResponseData> {
341+
public sendRoomEvent(
342+
eventType: string,
343+
content: unknown,
344+
roomId?: string,
345+
): Promise<ISendEventFromWidgetResponseData> {
342346
return this.transport.send<ISendEventFromWidgetRequestData, ISendEventFromWidgetResponseData>(
343347
WidgetApiFromWidgetAction.SendEvent,
344348
{type: eventType, content, room_id: roomId},
@@ -357,7 +361,12 @@ export class WidgetApi extends EventEmitter {
357361
);
358362
}
359363

360-
public readRoomEvents(eventType: string, limit = 25, msgtype?: string, roomIds?: (string | Symbols.AnyRoom)[]): Promise<unknown> {
364+
public readRoomEvents(
365+
eventType: string,
366+
limit = 25,
367+
msgtype?: string,
368+
roomIds?: (string | Symbols.AnyRoom)[],
369+
): Promise<unknown> {
361370
const data: IReadEventFromWidgetRequestData = {type: eventType, msgtype: msgtype, limit};
362371
if (roomIds) {
363372
if (roomIds.includes(Symbols.AnyRoom)) {
@@ -372,8 +381,17 @@ export class WidgetApi extends EventEmitter {
372381
).then(r => r.events);
373382
}
374383

375-
public readStateEvents(eventType: string, limit = 25, stateKey?: string, roomIds?: (string | Symbols.AnyRoom)[]): Promise<unknown> {
376-
const data: IReadEventFromWidgetRequestData = {type: eventType, state_key: stateKey === undefined ? true : stateKey, limit};
384+
public readStateEvents(
385+
eventType: string,
386+
limit = 25,
387+
stateKey?: string,
388+
roomIds?: (string | Symbols.AnyRoom)[],
389+
): Promise<unknown> {
390+
const data: IReadEventFromWidgetRequestData = {
391+
type: eventType,
392+
state_key: stateKey === undefined ? true : stateKey,
393+
limit,
394+
};
377395
if (roomIds) {
378396
if (roomIds.includes(Symbols.AnyRoom)) {
379397
data.room_ids = Symbols.AnyRoom;

src/driver/WidgetDriver.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ export abstract class WidgetDriver {
6666
* details of that event.
6767
* @throws Rejected when the event could not be sent.
6868
*/
69-
public sendEvent(eventType: string, content: unknown, stateKey: string = null, roomId: string = null): Promise<ISendEventDetails> {
69+
public sendEvent(
70+
eventType: string,
71+
content: unknown,
72+
stateKey: string = null,
73+
roomId: string = null,
74+
): Promise<ISendEventDetails> {
7075
return Promise.reject(new Error("Failed to override function"));
7176
}
7277

@@ -85,7 +90,12 @@ export abstract class WidgetDriver {
8590
* to look within, possibly containing Symbols.AnyRoom to denote all known rooms.
8691
* @returns {Promise<*[]>} Resolves to the room events, or an empty array.
8792
*/
88-
public readRoomEvents(eventType: string, msgtype: string | undefined, limit: number, roomIds: string[] = null): Promise<unknown[]> {
93+
public readRoomEvents(
94+
eventType: string,
95+
msgtype: string | undefined,
96+
limit: number,
97+
roomIds: string[] = null,
98+
): Promise<unknown[]> {
8999
return Promise.resolve([]);
90100
}
91101

@@ -104,7 +114,12 @@ export abstract class WidgetDriver {
104114
* to look within, possibly containing Symbols.AnyRoom to denote all known rooms.
105115
* @returns {Promise<*[]>} Resolves to the state events, or an empty array.
106116
*/
107-
public readStateEvents(eventType: string, stateKey: string | undefined, limit: number, roomIds: string[] = null): Promise<unknown[]> {
117+
public readStateEvents(
118+
eventType: string,
119+
stateKey: string | undefined,
120+
limit: number,
121+
roomIds: string[] = null,
122+
): Promise<unknown[]> {
108123
return Promise.resolve([]);
109124
}
110125

src/interfaces/SendEventAction.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { IWidgetApiRequest, IWidgetApiRequestData } from "./IWidgetApiRequest";
1818
import { WidgetApiFromWidgetAction, WidgetApiToWidgetAction } from "./WidgetApiAction";
1919
import { IWidgetApiResponseData } from "./IWidgetApiResponse";
2020
import { IRoomEvent } from "./IRoomEvent";
21-
import { Symbols } from "../Symbols";
2221

2322
export interface ISendEventFromWidgetRequestData extends IWidgetApiRequestData {
2423
state_key?: string; // eslint-disable-line camelcase

0 commit comments

Comments
 (0)