Skip to content

Commit 2f74779

Browse files
authored
Merge pull request #1772 from matrix-org/t3chguy/ts/12
Convert SearchResult, InteractiveAuth, PushProcessor and Scheduler to TS
2 parents 7b03839 + 69ba326 commit 2f74779

File tree

10 files changed

+784
-671
lines changed

10 files changed

+784
-671
lines changed

src/@types/PushRules.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ export interface ISenderNotificationPermissionCondition
9090
key: string;
9191
}
9292

93-
export type PushRuleCondition = IPushRuleCondition<string>
94-
| IEventMatchCondition
93+
// XXX: custom conditions are possible but always fail, and break the typescript discriminated union so ignore them here
94+
// IPushRuleCondition<Exclude<string, ConditionKind>> unfortunately does not resolve this at the time of writing.
95+
export type PushRuleCondition = IEventMatchCondition
9596
| IContainsDisplayNameCondition
9697
| IRoomMemberCountCondition
9798
| ISenderNotificationPermissionCondition;

src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import * as utils from './utils';
3030
import { sleep } from './utils';
3131
import { Group } from "./models/group";
3232
import { Direction, EventTimeline } from "./models/event-timeline";
33-
import { PushAction, PushProcessor } from "./pushprocessor";
33+
import { IActionsObject, PushProcessor } from "./pushprocessor";
3434
import { AutoDiscovery } from "./autodiscovery";
3535
import * as olmlib from "./crypto/olmlib";
3636
import { decodeBase64, encodeBase64 } from "./crypto/olmlib";
@@ -4342,7 +4342,7 @@ export class MatrixClient extends EventEmitter {
43424342
* @param {MatrixEvent} event The event to get push actions for.
43434343
* @return {module:pushprocessor~PushAction} A dict of actions to perform.
43444344
*/
4345-
public getPushActionsForEvent(event: MatrixEvent): PushAction {
4345+
public getPushActionsForEvent(event: MatrixEvent): IActionsObject {
43464346
if (!event.getPushActions()) {
43474347
event.setPushActions(this.pushProcessor.actionsForEvent(event));
43484348
}

0 commit comments

Comments
 (0)