diff --git a/globals.native.d.ts b/globals.native.d.ts index 110e465ef7..79e8352eec 100644 --- a/globals.native.d.ts +++ b/globals.native.d.ts @@ -30,6 +30,7 @@ interface IWindow { setImmediate: typeof setImmediate; clearImmediate: typeof clearImmediate; addEventListener: Function; + removeEventListener: Function; } interface INavigator { diff --git a/react/features/base/color-scheme/ColorSchemeRegistry.ts b/react/features/base/color-scheme/ColorSchemeRegistry.ts index 3d23c1d57a..721b6c16a2 100644 --- a/react/features/base/color-scheme/ColorSchemeRegistry.ts +++ b/react/features/base/color-scheme/ColorSchemeRegistry.ts @@ -88,7 +88,7 @@ class ColorSchemeRegistry { _applyColorScheme( stateful: IStateful, componentName: string, - style: StyleType): StyleType { + style: StyleType | null): StyleType { let schemedStyle: any; if (Array.isArray(style)) { @@ -115,8 +115,8 @@ class ColorSchemeRegistry { // The value is another style object, we apply the same // transformation recursively. schemedStyle[styleName] - = this._applyColorScheme( // @ts-ignore - stateful, componentName, styleValue); + = this._applyColorScheme( + stateful, componentName, styleValue as StyleType); } else if (typeof styleValue === 'function') { // The value is a function, which indicates that it's a // dynamic, schemed color we need to resolve. diff --git a/react/features/base/conference/actions.ts b/react/features/base/conference/actions.ts index a0fa40d2ff..e3761ba443 100644 --- a/react/features/base/conference/actions.ts +++ b/react/features/base/conference/actions.ts @@ -98,34 +98,32 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[ JitsiConferenceEvents.AUTH_STATUS_CHANGED, (authEnabled: boolean, authLogin: string) => dispatch(authStatusChanged(authEnabled, authLogin))); conference.on( - JitsiConferenceEvents.CONFERENCE_FAILED, // @ts-ignore - (...args: any[]) => dispatch(conferenceFailed(conference, ...args))); + JitsiConferenceEvents.CONFERENCE_FAILED, + (err: string, ...args: any[]) => dispatch(conferenceFailed(conference, err, ...args))); conference.on( - JitsiConferenceEvents.CONFERENCE_JOINED, // @ts-ignore - (...args: any[]) => dispatch(conferenceJoined(conference, ...args))); + JitsiConferenceEvents.CONFERENCE_JOINED, + (..._args: any[]) => dispatch(conferenceJoined(conference))); conference.on( - JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET, // @ts-ignore - (...args: any[]) => dispatch(conferenceUniqueIdSet(conference, ...args))); + JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET, + (..._args: any[]) => dispatch(conferenceUniqueIdSet(conference))); conference.on( - JitsiConferenceEvents.CONFERENCE_JOIN_IN_PROGRESS, // @ts-ignore - (...args: any[]) => dispatch(conferenceJoinInProgress(conference, ...args))); + JitsiConferenceEvents.CONFERENCE_JOIN_IN_PROGRESS, + (..._args: any[]) => dispatch(conferenceJoinInProgress(conference))); conference.on( JitsiConferenceEvents.CONFERENCE_LEFT, - (...args: any[]) => { + (..._args: any[]) => { dispatch(conferenceTimestampChanged(0)); - - // @ts-ignore - dispatch(conferenceLeft(conference, ...args)); + dispatch(conferenceLeft(conference)); }); - conference.on(JitsiConferenceEvents.SUBJECT_CHANGED, // @ts-ignore - (...args: any[]) => dispatch(conferenceSubjectChanged(...args))); + conference.on(JitsiConferenceEvents.SUBJECT_CHANGED, + (subject: string) => dispatch(conferenceSubjectChanged(subject))); - conference.on(JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP, // @ts-ignore - (...args: any[]) => dispatch(conferenceTimestampChanged(...args))); + conference.on(JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP, + (timestamp: number) => dispatch(conferenceTimestampChanged(timestamp))); conference.on( - JitsiConferenceEvents.KICKED, // @ts-ignore - (...args: any[]) => dispatch(kickedOut(conference, ...args))); + JitsiConferenceEvents.KICKED, + (participant: any) => dispatch(kickedOut(conference, participant))); conference.on( JitsiConferenceEvents.PARTICIPANT_KICKED, @@ -136,8 +134,8 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[ (jitsiParticipant: IJitsiParticipant) => dispatch(participantSourcesUpdated(jitsiParticipant))); conference.on( - JitsiConferenceEvents.LOCK_STATE_CHANGED, // @ts-ignore - (...args: any[]) => dispatch(lockStateChanged(conference, ...args))); + JitsiConferenceEvents.LOCK_STATE_CHANGED, + (locked: boolean) => dispatch(lockStateChanged(conference, locked))); // Dispatches into features/base/media follow: @@ -220,12 +218,12 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[ }); conference.on( - JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, // @ts-ignore - (...args: any[]) => dispatch(endpointMessageReceived(...args))); + JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, + (participant: Object, json: Object) => dispatch(endpointMessageReceived(participant, json))); conference.on( - JitsiConferenceEvents.NON_PARTICIPANT_MESSAGE_RECEIVED, // @ts-ignore - (...args: any[]) => dispatch(nonParticipantMessageReceived(...args))); + JitsiConferenceEvents.NON_PARTICIPANT_MESSAGE_RECEIVED, + (id: string, json: Object) => dispatch(nonParticipantMessageReceived(id, json))); conference.on( JitsiConferenceEvents.USER_JOINED, @@ -234,15 +232,15 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[ JitsiConferenceEvents.USER_LEFT, (_id: string, user: any) => commonUserLeftHandling({ dispatch }, conference, user)); conference.on( - JitsiConferenceEvents.USER_ROLE_CHANGED, // @ts-ignore - (...args: any[]) => dispatch(participantRoleChanged(...args))); + JitsiConferenceEvents.USER_ROLE_CHANGED, + (id: string, role: string) => dispatch(participantRoleChanged(id, role))); conference.on( - JitsiConferenceEvents.USER_STATUS_CHANGED, // @ts-ignore - (...args: any[]) => dispatch(participantPresenceChanged(...args))); + JitsiConferenceEvents.USER_STATUS_CHANGED, + (id: string, presence: string) => dispatch(participantPresenceChanged(id, presence))); conference.on( - JitsiE2ePingEvents.E2E_RTT_CHANGED, // @ts-ignore - (...args: any[]) => dispatch(e2eRttChanged(...args))); + JitsiE2ePingEvents.E2E_RTT_CHANGED, + (participant: Object, rtt: number) => dispatch(e2eRttChanged(participant, rtt))); conference.on( JitsiConferenceEvents.BOT_TYPE_CHANGED, @@ -633,7 +631,7 @@ export function endConference() { * participant: JitsiParticipant * }} */ -export function kickedOut(conference: Object, participant: Object) { +export function kickedOut(conference: IJitsiConference, participant: Object) { return { type: KICKED_OUT, conference, @@ -673,7 +671,7 @@ export function leaveConference() { * locked: boolean * }} */ -export function lockStateChanged(conference: Object, locked: boolean) { +export function lockStateChanged(conference: IJitsiConference, locked: boolean) { return { type: LOCK_STATE_CHANGED, conference, @@ -692,7 +690,7 @@ export function lockStateChanged(conference: Object, locked: boolean) { * json: Object * }} */ -export function nonParticipantMessageReceived(id: String, json: Object) { +export function nonParticipantMessageReceived(id: string, json: Object) { return { type: NON_PARTICIPANT_MESSAGE_RECEIVED, id, diff --git a/react/features/base/conference/middleware.any.ts b/react/features/base/conference/middleware.any.ts index 306ff3542d..bfbb089ac4 100644 --- a/react/features/base/conference/middleware.any.ts +++ b/react/features/base/conference/middleware.any.ts @@ -67,7 +67,7 @@ import logger from './logger'; /** * Handler for before unload event. */ -let beforeUnloadHandler: Function | undefined; +let beforeUnloadHandler: (() => void) | undefined; /** * Implements the middleware of the feature base/conference. @@ -295,7 +295,6 @@ function _conferenceJoined({ dispatch, getState }: IStore, next: Function, actio dispatch(overwriteConfig({ disableFocus: false })); } - // @ts-ignore window.addEventListener(disableBeforeUnloadHandlers ? 'unload' : 'beforeunload', beforeUnloadHandler); if (requireDisplayName @@ -513,7 +512,6 @@ function _removeUnloadHandler(getState: IStore['getState']) { if (typeof beforeUnloadHandler !== 'undefined') { const { disableBeforeUnloadHandlers = false } = getState()['features/base/config']; - // @ts-ignore window.removeEventListener(disableBeforeUnloadHandlers ? 'unload' : 'beforeunload', beforeUnloadHandler); beforeUnloadHandler = undefined; } diff --git a/react/features/base/lib-jitsi-meet/functions.any.ts b/react/features/base/lib-jitsi-meet/functions.any.ts index 882be13d11..8ffe1c5267 100644 --- a/react/features/base/lib-jitsi-meet/functions.any.ts +++ b/react/features/base/lib-jitsi-meet/functions.any.ts @@ -2,7 +2,6 @@ import { IStateful } from '../app/types'; import { ConnectionFailedError } from '../connection/actions.any'; import { toState } from '../redux/functions'; -// @ts-ignore import JitsiMeetJS from './_'; diff --git a/react/features/base/react/components/web/Watermarks.tsx b/react/features/base/react/components/web/Watermarks.tsx index 9c9a8c620b..04c03eca7a 100644 --- a/react/features/base/react/components/web/Watermarks.tsx +++ b/react/features/base/react/components/web/Watermarks.tsx @@ -168,10 +168,10 @@ class Watermarks extends Component { maxWidth: 140, maxHeight: 70, position: _logoLink ? 'static' : 'absolute' - }; + } as const; reactElement = (
); if (_logoLink) { diff --git a/react/features/base/sounds/components/SoundCollection.ts b/react/features/base/sounds/components/SoundCollection.ts index 57b60c9442..b6a3ce8cbc 100644 --- a/react/features/base/sounds/components/SoundCollection.ts +++ b/react/features/base/sounds/components/SoundCollection.ts @@ -57,7 +57,7 @@ class SoundCollection extends Component { sounds.push( React.createElement( Audio, { - key, // @ts-ignore + key, setRef: this._setRef.bind(this, soundId), src, loop: options?.loop diff --git a/react/features/chat/middleware.ts b/react/features/chat/middleware.ts index 066959bc3e..eafb4bd180 100644 --- a/react/features/chat/middleware.ts +++ b/react/features/chat/middleware.ts @@ -35,8 +35,6 @@ import { showToolbox } from '../toolbox/actions'; import { ADD_MESSAGE, CLOSE_CHAT, OPEN_CHAT, SEND_MESSAGE, SET_IS_POLL_TAB_FOCUSED } from './actionTypes'; import { addMessage, clearMessages, closeChat } from './actions.any'; -// eslint-disable-next-line lines-around-comment -// @ts-ignore import { ChatPrivacyDialog } from './components'; import { INCOMING_MSG_SOUND_ID, diff --git a/react/features/mobile/call-integration/reducer.ts b/react/features/mobile/call-integration/reducer.ts index 37b982fd02..92c0cfb586 100644 --- a/react/features/mobile/call-integration/reducer.ts +++ b/react/features/mobile/call-integration/reducer.ts @@ -1,10 +1,7 @@ import ReducerRegistry from '../../base/redux/ReducerRegistry'; import { set } from '../../base/redux/functions'; -// @ts-ignore import CallKit from './CallKit'; -// eslint-disable-next-line lines-around-comment -// @ts-ignore import ConnectionService from './ConnectionService'; import { _SET_CALL_INTEGRATION_SUBSCRIPTIONS } from './actionTypes'; diff --git a/react/features/recording/components/Recording/LocalRecordingManager.web.ts b/react/features/recording/components/Recording/LocalRecordingManager.web.ts index 840e2e0784..1e379b9d18 100644 --- a/react/features/recording/components/Recording/LocalRecordingManager.web.ts +++ b/react/features/recording/components/Recording/LocalRecordingManager.web.ts @@ -138,9 +138,7 @@ const LocalRecordingManager: ILocalRecordingManager = { async saveRecording(recordingData, filename) { // @ts-ignore const blob = await fixWebmDuration(new Blob(recordingData, { type: this.mediaType })); - - // @ts-ignore - const url = window.URL.createObjectURL(blob); + const url = URL.createObjectURL(blob); const a = document.createElement('a'); const extension = this.mediaType.slice(this.mediaType.indexOf('/') + 1, this.mediaType.indexOf(';')); @@ -249,7 +247,6 @@ const LocalRecordingManager: ILocalRecordingManager = { }); document.title = currentTitle; - // @ts-ignore const isBrowser = gdmStream.getVideoTracks()[0].getSettings().displaySurface === 'browser'; if (!isBrowser || (supportsCaptureHandle // @ts-ignore diff --git a/react/features/room-lock/actions.ts b/react/features/room-lock/actions.ts index 4993b42d36..4bf62910e5 100644 --- a/react/features/room-lock/actions.ts +++ b/react/features/room-lock/actions.ts @@ -7,8 +7,6 @@ import { conferenceLeft, setPassword } from '../base/conference/actions'; import { JITSI_CONFERENCE_URL_KEY } from '../base/conference/constants'; import { IJitsiConference } from '../base/conference/reducer'; import { hideDialog, openDialog } from '../base/dialog/actions'; -// eslint-disable-next-line lines-around-comment -// @ts-ignore import { SecurityDialog } from '../security/components/security-dialog'; import PasswordRequiredPrompt from './components/PasswordRequiredPrompt'; diff --git a/react/features/salesforce/actions.ts b/react/features/salesforce/actions.ts index a8015fcf8a..54a23d65ba 100644 --- a/react/features/salesforce/actions.ts +++ b/react/features/salesforce/actions.ts @@ -7,7 +7,6 @@ import { SALESFORCE_LINK_NOTIFICATION_ID } from '../notifications/constants'; -// @ts-ignore import { SalesforceLinkDialog } from './components'; import { isSalesforceEnabled } from './functions'; diff --git a/react/features/security/actions.ts b/react/features/security/actions.ts index 0334c09f34..e371bc81a0 100644 --- a/react/features/security/actions.ts +++ b/react/features/security/actions.ts @@ -1,7 +1,6 @@ import { IStore } from '../app/types'; import { toggleDialog } from '../base/dialog/actions'; -// @ts-ignore import { SecurityDialog } from './components/security-dialog'; /** diff --git a/react/features/shared-video/actions.any.ts b/react/features/shared-video/actions.any.ts index 6ea21af3b9..5eba10bbbd 100644 --- a/react/features/shared-video/actions.any.ts +++ b/react/features/shared-video/actions.any.ts @@ -4,8 +4,6 @@ import { openDialog } from '../base/dialog/actions'; import { getLocalParticipant } from '../base/participants/functions'; import { RESET_SHARED_VIDEO_STATUS, SET_SHARED_VIDEO_STATUS } from './actionTypes'; -// eslint-disable-next-line lines-around-comment -// @ts-ignore import { SharedVideoDialog } from './components'; /** diff --git a/react/features/videosipgw/middleware.ts b/react/features/videosipgw/middleware.ts index d16ea0ba00..dfd814ea19 100644 --- a/react/features/videosipgw/middleware.ts +++ b/react/features/videosipgw/middleware.ts @@ -39,9 +39,7 @@ MiddlewareRegistry.register(({ dispatch }) => next => action => { conference.on( JitsiConferenceEvents.VIDEO_SIP_GW_AVAILABILITY_CHANGED, - - // @ts-ignore - (...args) => dispatch(_availabilityChanged(...args))); + (status: string) => dispatch(_availabilityChanged(status))); conference.on( JitsiConferenceEvents.VIDEO_SIP_GW_SESSION_STATE_CHANGED, (event: ISipSessionChangedEvent) => {