소스 검색

ref(TS) Improve TS (#13355)

factor2
Robert Pintilii 2 년 전
부모
커밋
59f1ee1e1e
No account linked to committer's email address

+ 1
- 0
globals.native.d.ts 파일 보기

@@ -30,6 +30,7 @@ interface IWindow {
30 30
     setImmediate: typeof setImmediate;
31 31
     clearImmediate: typeof clearImmediate;
32 32
     addEventListener: Function;
33
+    removeEventListener: Function;
33 34
 }
34 35
 
35 36
 interface INavigator {

+ 3
- 3
react/features/base/color-scheme/ColorSchemeRegistry.ts 파일 보기

@@ -88,7 +88,7 @@ class ColorSchemeRegistry {
88 88
     _applyColorScheme(
89 89
             stateful: IStateful,
90 90
             componentName: string,
91
-            style: StyleType): StyleType {
91
+            style: StyleType | null): StyleType {
92 92
         let schemedStyle: any;
93 93
 
94 94
         if (Array.isArray(style)) {
@@ -115,8 +115,8 @@ class ColorSchemeRegistry {
115 115
                     // The value is another style object, we apply the same
116 116
                     // transformation recursively.
117 117
                     schemedStyle[styleName]
118
-                        = this._applyColorScheme( // @ts-ignore
119
-                            stateful, componentName, styleValue);
118
+                        = this._applyColorScheme(
119
+                            stateful, componentName, styleValue as StyleType);
120 120
                 } else if (typeof styleValue === 'function') {
121 121
                     // The value is a function, which indicates that it's a
122 122
                     // dynamic, schemed color we need to resolve.

+ 31
- 33
react/features/base/conference/actions.ts 파일 보기

@@ -98,34 +98,32 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[
98 98
         JitsiConferenceEvents.AUTH_STATUS_CHANGED,
99 99
         (authEnabled: boolean, authLogin: string) => dispatch(authStatusChanged(authEnabled, authLogin)));
100 100
     conference.on(
101
-        JitsiConferenceEvents.CONFERENCE_FAILED, // @ts-ignore
102
-        (...args: any[]) => dispatch(conferenceFailed(conference, ...args)));
101
+        JitsiConferenceEvents.CONFERENCE_FAILED,
102
+        (err: string, ...args: any[]) => dispatch(conferenceFailed(conference, err, ...args)));
103 103
     conference.on(
104
-        JitsiConferenceEvents.CONFERENCE_JOINED, // @ts-ignore
105
-        (...args: any[]) => dispatch(conferenceJoined(conference, ...args)));
104
+        JitsiConferenceEvents.CONFERENCE_JOINED,
105
+        (..._args: any[]) => dispatch(conferenceJoined(conference)));
106 106
     conference.on(
107
-        JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET, // @ts-ignore
108
-        (...args: any[]) => dispatch(conferenceUniqueIdSet(conference, ...args)));
107
+        JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET,
108
+        (..._args: any[]) => dispatch(conferenceUniqueIdSet(conference)));
109 109
     conference.on(
110
-        JitsiConferenceEvents.CONFERENCE_JOIN_IN_PROGRESS, // @ts-ignore
111
-        (...args: any[]) => dispatch(conferenceJoinInProgress(conference, ...args)));
110
+        JitsiConferenceEvents.CONFERENCE_JOIN_IN_PROGRESS,
111
+        (..._args: any[]) => dispatch(conferenceJoinInProgress(conference)));
112 112
     conference.on(
113 113
         JitsiConferenceEvents.CONFERENCE_LEFT,
114
-        (...args: any[]) => {
114
+        (..._args: any[]) => {
115 115
             dispatch(conferenceTimestampChanged(0));
116
-
117
-            // @ts-ignore
118
-            dispatch(conferenceLeft(conference, ...args));
116
+            dispatch(conferenceLeft(conference));
119 117
         });
120
-    conference.on(JitsiConferenceEvents.SUBJECT_CHANGED, // @ts-ignore
121
-        (...args: any[]) => dispatch(conferenceSubjectChanged(...args)));
118
+    conference.on(JitsiConferenceEvents.SUBJECT_CHANGED,
119
+        (subject: string) => dispatch(conferenceSubjectChanged(subject)));
122 120
 
123
-    conference.on(JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP, // @ts-ignore
124
-        (...args: any[]) => dispatch(conferenceTimestampChanged(...args)));
121
+    conference.on(JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP,
122
+        (timestamp: number) => dispatch(conferenceTimestampChanged(timestamp)));
125 123
 
126 124
     conference.on(
127
-        JitsiConferenceEvents.KICKED, // @ts-ignore
128
-        (...args: any[]) => dispatch(kickedOut(conference, ...args)));
125
+        JitsiConferenceEvents.KICKED,
126
+        (participant: any) => dispatch(kickedOut(conference, participant)));
129 127
 
130 128
     conference.on(
131 129
         JitsiConferenceEvents.PARTICIPANT_KICKED,
@@ -136,8 +134,8 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[
136 134
         (jitsiParticipant: IJitsiParticipant) => dispatch(participantSourcesUpdated(jitsiParticipant)));
137 135
 
138 136
     conference.on(
139
-        JitsiConferenceEvents.LOCK_STATE_CHANGED, // @ts-ignore
140
-        (...args: any[]) => dispatch(lockStateChanged(conference, ...args)));
137
+        JitsiConferenceEvents.LOCK_STATE_CHANGED,
138
+        (locked: boolean) => dispatch(lockStateChanged(conference, locked)));
141 139
 
142 140
     // Dispatches into features/base/media follow:
143 141
 
@@ -220,12 +218,12 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[
220 218
         });
221 219
 
222 220
     conference.on(
223
-        JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, // @ts-ignore
224
-        (...args: any[]) => dispatch(endpointMessageReceived(...args)));
221
+        JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
222
+        (participant: Object, json: Object) => dispatch(endpointMessageReceived(participant, json)));
225 223
 
226 224
     conference.on(
227
-        JitsiConferenceEvents.NON_PARTICIPANT_MESSAGE_RECEIVED, // @ts-ignore
228
-        (...args: any[]) => dispatch(nonParticipantMessageReceived(...args)));
225
+        JitsiConferenceEvents.NON_PARTICIPANT_MESSAGE_RECEIVED,
226
+        (id: string, json: Object) => dispatch(nonParticipantMessageReceived(id, json)));
229 227
 
230 228
     conference.on(
231 229
         JitsiConferenceEvents.USER_JOINED,
@@ -234,15 +232,15 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[
234 232
         JitsiConferenceEvents.USER_LEFT,
235 233
         (_id: string, user: any) => commonUserLeftHandling({ dispatch }, conference, user));
236 234
     conference.on(
237
-        JitsiConferenceEvents.USER_ROLE_CHANGED, // @ts-ignore
238
-        (...args: any[]) => dispatch(participantRoleChanged(...args)));
235
+        JitsiConferenceEvents.USER_ROLE_CHANGED,
236
+        (id: string, role: string) => dispatch(participantRoleChanged(id, role)));
239 237
     conference.on(
240
-        JitsiConferenceEvents.USER_STATUS_CHANGED, // @ts-ignore
241
-        (...args: any[]) => dispatch(participantPresenceChanged(...args)));
238
+        JitsiConferenceEvents.USER_STATUS_CHANGED,
239
+        (id: string, presence: string) => dispatch(participantPresenceChanged(id, presence)));
242 240
 
243 241
     conference.on(
244
-        JitsiE2ePingEvents.E2E_RTT_CHANGED, // @ts-ignore
245
-        (...args: any[]) => dispatch(e2eRttChanged(...args)));
242
+        JitsiE2ePingEvents.E2E_RTT_CHANGED,
243
+        (participant: Object, rtt: number) => dispatch(e2eRttChanged(participant, rtt)));
246 244
 
247 245
     conference.on(
248 246
         JitsiConferenceEvents.BOT_TYPE_CHANGED,
@@ -633,7 +631,7 @@ export function endConference() {
633 631
  *     participant: JitsiParticipant
634 632
  * }}
635 633
  */
636
-export function kickedOut(conference: Object, participant: Object) {
634
+export function kickedOut(conference: IJitsiConference, participant: Object) {
637 635
     return {
638 636
         type: KICKED_OUT,
639 637
         conference,
@@ -673,7 +671,7 @@ export function leaveConference() {
673 671
  *     locked: boolean
674 672
  * }}
675 673
  */
676
-export function lockStateChanged(conference: Object, locked: boolean) {
674
+export function lockStateChanged(conference: IJitsiConference, locked: boolean) {
677 675
     return {
678 676
         type: LOCK_STATE_CHANGED,
679 677
         conference,
@@ -692,7 +690,7 @@ export function lockStateChanged(conference: Object, locked: boolean) {
692 690
  *      json: Object
693 691
  * }}
694 692
  */
695
-export function nonParticipantMessageReceived(id: String, json: Object) {
693
+export function nonParticipantMessageReceived(id: string, json: Object) {
696 694
     return {
697 695
         type: NON_PARTICIPANT_MESSAGE_RECEIVED,
698 696
         id,

+ 1
- 3
react/features/base/conference/middleware.any.ts 파일 보기

@@ -67,7 +67,7 @@ import logger from './logger';
67 67
 /**
68 68
  * Handler for before unload event.
69 69
  */
70
-let beforeUnloadHandler: Function | undefined;
70
+let beforeUnloadHandler: (() => void) | undefined;
71 71
 
72 72
 /**
73 73
  * Implements the middleware of the feature base/conference.
@@ -295,7 +295,6 @@ function _conferenceJoined({ dispatch, getState }: IStore, next: Function, actio
295 295
         dispatch(overwriteConfig({ disableFocus: false }));
296 296
     }
297 297
 
298
-    // @ts-ignore
299 298
     window.addEventListener(disableBeforeUnloadHandlers ? 'unload' : 'beforeunload', beforeUnloadHandler);
300 299
 
301 300
     if (requireDisplayName
@@ -513,7 +512,6 @@ function _removeUnloadHandler(getState: IStore['getState']) {
513 512
     if (typeof beforeUnloadHandler !== 'undefined') {
514 513
         const { disableBeforeUnloadHandlers = false } = getState()['features/base/config'];
515 514
 
516
-        // @ts-ignore
517 515
         window.removeEventListener(disableBeforeUnloadHandlers ? 'unload' : 'beforeunload', beforeUnloadHandler);
518 516
         beforeUnloadHandler = undefined;
519 517
     }

+ 0
- 1
react/features/base/lib-jitsi-meet/functions.any.ts 파일 보기

@@ -2,7 +2,6 @@ import { IStateful } from '../app/types';
2 2
 import { ConnectionFailedError } from '../connection/actions.any';
3 3
 import { toState } from '../redux/functions';
4 4
 
5
-// @ts-ignore
6 5
 import JitsiMeetJS from './_';
7 6
 
8 7
 

+ 2
- 2
react/features/base/react/components/web/Watermarks.tsx 파일 보기

@@ -168,10 +168,10 @@ class Watermarks extends Component<IProps, State> {
168 168
                 maxWidth: 140,
169 169
                 maxHeight: 70,
170 170
                 position: _logoLink ? 'static' : 'absolute'
171
-            };
171
+            } as const;
172 172
 
173 173
             reactElement = (<div
174
-                className = { className } // @ts-ignore
174
+                className = { className }
175 175
                 style = { style } />);
176 176
 
177 177
             if (_logoLink) {

+ 1
- 1
react/features/base/sounds/components/SoundCollection.ts 파일 보기

@@ -57,7 +57,7 @@ class SoundCollection extends Component<IProps> {
57 57
             sounds.push(
58 58
                 React.createElement(
59 59
                     Audio, {
60
-                        key, // @ts-ignore
60
+                        key,
61 61
                         setRef: this._setRef.bind(this, soundId),
62 62
                         src,
63 63
                         loop: options?.loop

+ 0
- 2
react/features/chat/middleware.ts 파일 보기

@@ -35,8 +35,6 @@ import { showToolbox } from '../toolbox/actions';
35 35
 
36 36
 import { ADD_MESSAGE, CLOSE_CHAT, OPEN_CHAT, SEND_MESSAGE, SET_IS_POLL_TAB_FOCUSED } from './actionTypes';
37 37
 import { addMessage, clearMessages, closeChat } from './actions.any';
38
-// eslint-disable-next-line lines-around-comment
39
-// @ts-ignore
40 38
 import { ChatPrivacyDialog } from './components';
41 39
 import {
42 40
     INCOMING_MSG_SOUND_ID,

+ 0
- 3
react/features/mobile/call-integration/reducer.ts 파일 보기

@@ -1,10 +1,7 @@
1 1
 import ReducerRegistry from '../../base/redux/ReducerRegistry';
2 2
 import { set } from '../../base/redux/functions';
3 3
 
4
-// @ts-ignore
5 4
 import CallKit from './CallKit';
6
-// eslint-disable-next-line lines-around-comment
7
-// @ts-ignore
8 5
 import ConnectionService from './ConnectionService';
9 6
 import { _SET_CALL_INTEGRATION_SUBSCRIPTIONS } from './actionTypes';
10 7
 

+ 1
- 4
react/features/recording/components/Recording/LocalRecordingManager.web.ts 파일 보기

@@ -138,9 +138,7 @@ const LocalRecordingManager: ILocalRecordingManager = {
138 138
     async saveRecording(recordingData, filename) {
139 139
         // @ts-ignore
140 140
         const blob = await fixWebmDuration(new Blob(recordingData, { type: this.mediaType }));
141
-
142
-        // @ts-ignore
143
-        const url = window.URL.createObjectURL(blob);
141
+        const url = URL.createObjectURL(blob);
144 142
         const a = document.createElement('a');
145 143
 
146 144
         const extension = this.mediaType.slice(this.mediaType.indexOf('/') + 1, this.mediaType.indexOf(';'));
@@ -249,7 +247,6 @@ const LocalRecordingManager: ILocalRecordingManager = {
249 247
             });
250 248
             document.title = currentTitle;
251 249
 
252
-            // @ts-ignore
253 250
             const isBrowser = gdmStream.getVideoTracks()[0].getSettings().displaySurface === 'browser';
254 251
 
255 252
             if (!isBrowser || (supportsCaptureHandle // @ts-ignore

+ 0
- 2
react/features/room-lock/actions.ts 파일 보기

@@ -7,8 +7,6 @@ import { conferenceLeft, setPassword } from '../base/conference/actions';
7 7
 import { JITSI_CONFERENCE_URL_KEY } from '../base/conference/constants';
8 8
 import { IJitsiConference } from '../base/conference/reducer';
9 9
 import { hideDialog, openDialog } from '../base/dialog/actions';
10
-// eslint-disable-next-line lines-around-comment
11
-// @ts-ignore
12 10
 import { SecurityDialog } from '../security/components/security-dialog';
13 11
 
14 12
 import PasswordRequiredPrompt from './components/PasswordRequiredPrompt';

+ 0
- 1
react/features/salesforce/actions.ts 파일 보기

@@ -7,7 +7,6 @@ import {
7 7
     SALESFORCE_LINK_NOTIFICATION_ID
8 8
 } from '../notifications/constants';
9 9
 
10
-// @ts-ignore
11 10
 import { SalesforceLinkDialog } from './components';
12 11
 import { isSalesforceEnabled } from './functions';
13 12
 

+ 0
- 1
react/features/security/actions.ts 파일 보기

@@ -1,7 +1,6 @@
1 1
 import { IStore } from '../app/types';
2 2
 import { toggleDialog } from '../base/dialog/actions';
3 3
 
4
-// @ts-ignore
5 4
 import { SecurityDialog } from './components/security-dialog';
6 5
 
7 6
 /**

+ 0
- 2
react/features/shared-video/actions.any.ts 파일 보기

@@ -4,8 +4,6 @@ import { openDialog } from '../base/dialog/actions';
4 4
 import { getLocalParticipant } from '../base/participants/functions';
5 5
 
6 6
 import { RESET_SHARED_VIDEO_STATUS, SET_SHARED_VIDEO_STATUS } from './actionTypes';
7
-// eslint-disable-next-line lines-around-comment
8
-// @ts-ignore
9 7
 import { SharedVideoDialog } from './components';
10 8
 
11 9
 /**

+ 1
- 3
react/features/videosipgw/middleware.ts 파일 보기

@@ -39,9 +39,7 @@ MiddlewareRegistry.register(({ dispatch }) => next => action => {
39 39
 
40 40
         conference.on(
41 41
             JitsiConferenceEvents.VIDEO_SIP_GW_AVAILABILITY_CHANGED,
42
-
43
-            // @ts-ignore
44
-            (...args) => dispatch(_availabilityChanged(...args)));
42
+            (status: string) => dispatch(_availabilityChanged(status)));
45 43
         conference.on(
46 44
             JitsiConferenceEvents.VIDEO_SIP_GW_SESSION_STATE_CHANGED,
47 45
             (event: ISipSessionChangedEvent) => {

Loading…
취소
저장