Improve typing around event emitter handlers (#7816)

This commit is contained in:
Michael Telatynski 2022-02-22 12:18:08 +00:00 committed by GitHub
parent 213b32bf14
commit 7fa01ffb06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 548 additions and 471 deletions

View file

@ -16,8 +16,8 @@ limitations under the License.
import url from 'url';
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixClient, ClientEvent } from "matrix-js-sdk/src/client";
import type { MatrixClient } from "matrix-js-sdk/src/client";
import type { MatrixEvent } from "matrix-js-sdk/src/models/event";
import type { Room } from "matrix-js-sdk/src/models/room";
import SdkConfig from '../SdkConfig';
@ -59,15 +59,15 @@ export class IntegrationManagers {
startWatching(): void {
this.stopWatching();
this.client = MatrixClientPeg.get();
this.client.on("accountData", this.onAccountData);
this.client.on("WellKnown.client", this.setupHomeserverManagers);
this.client.on(ClientEvent.AccountData, this.onAccountData);
this.client.on(ClientEvent.ClientWellKnown, this.setupHomeserverManagers);
this.compileManagers();
}
stopWatching(): void {
if (!this.client) return;
this.client.removeListener("accountData", this.onAccountData);
this.client.removeListener("WellKnown.client", this.setupHomeserverManagers);
this.client.removeListener(ClientEvent.AccountData, this.onAccountData);
this.client.removeListener(ClientEvent.ClientWellKnown, this.setupHomeserverManagers);
}
private compileManagers() {