Improving typings

This PR solves a number of issues (but not all) found when enabling the rule ESLint rule "@typescript-eslint/no-unsafe-call" in the front.
This commit is contained in:
David Négrier
2022-05-07 22:43:48 +02:00
parent aea8f92e68
commit e710c441b1
4 changed files with 41 additions and 31 deletions
+1 -2
View File
@@ -3,8 +3,7 @@ import { POSTHOG_API_KEY, POSTHOG_URL } from "../Enum/EnvironmentVariable";
declare let window: any;
class AnalyticsClient {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private posthogPromise: Promise<any> | undefined;
private posthogPromise: Promise<typeof import("posthog-js").default> | undefined;
constructor() {
if (POSTHOG_API_KEY && POSTHOG_URL) {
+6 -5
View File
@@ -30,7 +30,7 @@ interface JitsiApi {
addListener: (type: string, callback: Function) => void;
removeListener: (type: string, callback: Function) => void;
getParticipantsInfo(): { displayName: string; participantId: string }[];
dispose: () => void;
}
@@ -275,10 +275,11 @@ class JitsiFactory {
}
private onDominantSpeakerChanged(data: { id: string }): void {
userIsJitsiDominantSpeakerStore.set(
//@ts-ignore
data.id === this.getCurrentParticipantId(this.jitsiApi?.getParticipantsInfo())
);
if (this.jitsiApi) {
userIsJitsiDominantSpeakerStore.set(
data.id === this.getCurrentParticipantId(this.jitsiApi.getParticipantsInfo())
);
}
}
private onParticipantsCountChange(): void {