Quellcode durchsuchen

ref(TS) Convert some features to TS (#12454)

factor2
Robert Pintilii vor 3 Jahren
Ursprung
Commit
6dedc7fb1a
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 2
- 3
react/features/authentication/actions.web.ts Datei anzeigen

@@ -5,9 +5,8 @@ import { hideDialog, openDialog } from '../base/dialog/actions';
5 5
 import {
6 6
     CANCEL_LOGIN
7 7
 } from './actionTypes';
8
-// eslint-disable-next-line lines-around-comment
9
-// @ts-ignore
10
-import { LoginDialog, WaitForOwnerDialog } from './components';
8
+import LoginDialog from './components/web/LoginDialog';
9
+import WaitForOwnerDialog from './components/web/WaitForOwnerDialog';
11 10
 
12 11
 export * from './actions.any';
13 12
 

+ 0
- 4
react/features/av-moderation/middleware.ts Datei anzeigen

@@ -18,8 +18,6 @@ import StateListenerRegistry from '../base/redux/StateListenerRegistry';
18 18
 import { playSound, registerSound, unregisterSound } from '../base/sounds/actions';
19 19
 import { hideNotification, showNotification } from '../notifications/actions';
20 20
 import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
21
-// eslint-disable-next-line lines-around-comment
22
-// @ts-ignore
23 21
 import { muteLocal } from '../video-menu/actions.any';
24 22
 
25 23
 import {
@@ -60,8 +58,6 @@ import {
60 58
 } from './functions';
61 59
 import { ASKED_TO_UNMUTE_FILE } from './sounds';
62 60
 
63
-declare const APP: any;
64
-
65 61
 MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
66 62
     const { type } = action;
67 63
     const { conference } = getConferenceState(getState());

+ 1
- 0
react/features/base/conference/reducer.ts Datei anzeigen

@@ -48,6 +48,7 @@ export interface IJitsiConference {
48 48
     enableAVModeration: Function;
49 49
     end: Function;
50 50
     getBreakoutRooms: Function;
51
+    getLocalParticipantProperty: Function;
51 52
     getLocalTracks: Function;
52 53
     grantOwner: Function;
53 54
     isAVModerationSupported: Function;

+ 3
- 3
react/features/base/dialog/actions.ts Datei anzeigen

@@ -22,7 +22,7 @@ import { isDialogOpen } from './functions';
22 22
  *     component: (React.Component | undefined)
23 23
  * }}
24 24
  */
25
-export function hideDialog(component?: ComponentType) {
25
+export function hideDialog(component?: ComponentType<any>) {
26 26
     return {
27 27
         type: HIDE_DIALOG,
28 28
         component
@@ -54,7 +54,7 @@ export function hideSheet() {
54 54
  *     componentProps: (Object | undefined)
55 55
  * }}
56 56
  */
57
-export function openDialog(component: ComponentType, componentProps?: Object) {
57
+export function openDialog(component: ComponentType<any>, componentProps?: Object) {
58 58
     return {
59 59
         type: OPEN_DIALOG,
60 60
         component,
@@ -92,7 +92,7 @@ export function openSheet(component: ComponentType, componentProps?: Object) {
92 92
  * specified {@code component}.
93 93
  * @returns {Function}
94 94
  */
95
-export function toggleDialog(component: ComponentType, componentProps?: Object) {
95
+export function toggleDialog(component: ComponentType<any>, componentProps?: Object) {
96 96
     return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
97 97
         if (isDialogOpen(getState, component)) {
98 98
             dispatch(hideDialog(component));

+ 0
- 3
react/features/speaker-stats/actions.native.js Datei anzeigen

@@ -1,3 +0,0 @@
1
-// @flow
2
-
3
-export * from './actions.any';

react/features/speaker-stats/actions.any.js → react/features/speaker-stats/actions.ts Datei anzeigen

@@ -1,5 +1,3 @@
1
-// @flow
2
-
3 1
 import {
4 2
     INIT_REORDER_STATS,
5 3
     INIT_SEARCH,
@@ -55,7 +53,7 @@ export function updateStats(stats: Object) {
55 53
  * @param {Object} participantIds - Participant ids.
56 54
  * @returns {Object}
57 55
  */
58
-export function updateSortedSpeakerStatsIds(participantIds: Array<string>) {
56
+export function updateSortedSpeakerStatsIds(participantIds?: Array<string>) {
59 57
     return {
60 58
         type: UPDATE_SORTED_SPEAKER_STATS_IDS,
61 59
         participantIds

+ 0
- 3
react/features/speaker-stats/actions.web.js Datei anzeigen

@@ -1,3 +0,0 @@
1
-// @flow
2
-
3
-export * from './actions.any';

+ 1
- 1
react/features/speaker-stats/components/AbstractSpeakerStatsList.js Datei anzeigen

@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
5 5
 import { useDispatch, useSelector } from 'react-redux';
6 6
 
7 7
 import { getLocalParticipant } from '../../base/participants';
8
-import { initUpdateStats } from '../actions.any';
8
+import { initUpdateStats } from '../actions';
9 9
 import {
10 10
     SPEAKER_STATS_RELOAD_INTERVAL
11 11
 } from '../constants';

+ 3
- 3
react/features/speaker-stats/components/web/SpeakerStats.tsx Datei anzeigen

@@ -6,8 +6,6 @@ import { makeStyles } from 'tss-react/mui';
6 6
 import { IReduxState } from '../../../app/types';
7 7
 import Dialog from '../../../base/ui/components/web/Dialog';
8 8
 import { escapeRegexp } from '../../../base/util/helpers';
9
-// eslint-disable-next-line lines-around-comment
10
-// @ts-ignore
11 9
 import { initSearch, resetSearchCriteria, toggleFaceExpressions } from '../../actions';
12 10
 import {
13 11
     DISPLAY_SWITCH_BREAKPOINT,
@@ -107,7 +105,9 @@ const SpeakerStats = () => {
107 105
     useEffect(() => {
108 106
         showFaceExpressions && !displaySwitch && dispatch(toggleFaceExpressions());
109 107
     }, [ clientWidth ]);
110
-    useEffect(() => () => dispatch(resetSearchCriteria()), []);
108
+    useEffect(() => () => {
109
+        dispatch(resetSearchCriteria());
110
+    }, []);
111 111
 
112 112
     return (
113 113
         <Dialog

+ 0
- 2
react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx Datei anzeigen

@@ -1,4 +1,3 @@
1
-/* eslint-disable lines-around-comment */
2 1
 import { Theme } from '@mui/material';
3 2
 import React, { useCallback, useState } from 'react';
4 3
 import { useTranslation } from 'react-i18next';
@@ -10,7 +9,6 @@ import { IconSearch } from '../../../base/icons/svg';
10 9
 import { getFieldValue } from '../../../base/react/functions';
11 10
 import { withPixelLineHeight } from '../../../base/styles/functions.web';
12 11
 import { MOBILE_BREAKPOINT } from '../../constants';
13
-// @ts-ignore
14 12
 import { isSpeakerStatsSearchDisabled } from '../../functions';
15 13
 
16 14
 const useStyles = makeStyles()((theme: Theme) => {

react/features/speaker-stats/functions.js → react/features/speaker-stats/functions.ts Datei anzeigen

@@ -1,40 +1,37 @@
1
-// @flow
2
-
3 1
 import _ from 'lodash';
4 2
 
5
-import {
6
-    PARTICIPANT_ROLE,
7
-    getParticipantById
8
-} from '../base/participants';
3
+import { IReduxState } from '../app/types';
4
+import { PARTICIPANT_ROLE } from '../base/participants/constants';
5
+import { getParticipantById } from '../base/participants/functions';
9 6
 
10 7
 /**
11 8
  * Checks if the speaker stats search is disabled.
12 9
  *
13
- * @param {*} state - The redux state.
10
+ * @param {IReduxState} state - The redux state.
14 11
  * @returns {boolean} - True if the speaker stats search is disabled and false otherwise.
15 12
  */
16
-export function isSpeakerStatsSearchDisabled(state: Object) {
17
-    return state['features/base/config']?.speakerStats.disableSearch;
13
+export function isSpeakerStatsSearchDisabled(state: IReduxState) {
14
+    return state['features/base/config']?.speakerStats?.disableSearch;
18 15
 }
19 16
 
20 17
 /**
21 18
  * Checks if the speaker stats is disabled.
22 19
  *
23
- * @param {*} state - The redux state.
20
+ * @param {IReduxState} state - The redux state.
24 21
  * @returns {boolean} - True if the speaker stats search is disabled and false otherwise.
25 22
  */
26
-export function isSpeakerStatsDisabled(state: Object) {
23
+export function isSpeakerStatsDisabled(state: IReduxState) {
27 24
     return state['features/base/config']?.speakerStats?.disabled;
28 25
 }
29 26
 
30 27
 /**
31 28
  * Gets whether participants in speaker stats should be ordered or not, and with what priority.
32 29
  *
33
- * @param {*} state - The redux state.
30
+ * @param {IReduxState} state - The redux state.
34 31
  * @returns {Array<string>} - The speaker stats order array or an empty array.
35 32
  */
36
-export function getSpeakerStatsOrder(state: Object) {
37
-    return state['features/base/config']?.speakerStats.order ?? [
33
+export function getSpeakerStatsOrder(state: IReduxState) {
34
+    return state['features/base/config']?.speakerStats?.order ?? [
38 35
         'role',
39 36
         'name',
40 37
         'hasLeft'
@@ -44,42 +41,42 @@ export function getSpeakerStatsOrder(state: Object) {
44 41
 /**
45 42
  * Gets speaker stats.
46 43
  *
47
- * @param {*} state - The redux state.
44
+ * @param {IReduxState} state - The redux state.
48 45
  * @returns {Object} - The speaker stats.
49 46
  */
50
-export function getSpeakerStats(state: Object) {
47
+export function getSpeakerStats(state: IReduxState) {
51 48
     return state['features/speaker-stats']?.stats ?? {};
52 49
 }
53 50
 
54 51
 /**
55 52
  * Gets speaker stats search criteria.
56 53
  *
57
- * @param {*} state - The redux state.
54
+ * @param {IReduxState} state - The redux state.
58 55
  * @returns {string | null} - The search criteria.
59 56
  */
60
-export function getSearchCriteria(state: Object) {
57
+export function getSearchCriteria(state: IReduxState) {
61 58
     return state['features/speaker-stats']?.criteria;
62 59
 }
63 60
 
64 61
 /**
65 62
  * Gets if speaker stats reorder is pending.
66 63
  *
67
- * @param {*} state - The redux state.
64
+ * @param {IReduxState} state - The redux state.
68 65
  * @returns {boolean} - The pending reorder flag.
69 66
  */
70
-export function getPendingReorder(state: Object) {
67
+export function getPendingReorder(state: IReduxState) {
71 68
     return state['features/speaker-stats']?.pendingReorder ?? false;
72 69
 }
73 70
 
74 71
 /**
75 72
  * Get sorted speaker stats ids based on a configuration setting.
76 73
  *
77
- * @param {Object} state - The redux state.
74
+ * @param {IReduxState} state - The redux state.
78 75
  * @param {Object} stats - The current speaker stats.
79 76
  * @returns {Object} - Ordered speaker stats ids.
80 77
  * @public
81 78
  */
82
-export function getSortedSpeakerStatsIds(state: Object, stats: Object) {
79
+export function getSortedSpeakerStatsIds(state: IReduxState, stats: Object) {
83 80
     const orderConfig = getSpeakerStatsOrder(state);
84 81
 
85 82
     if (orderConfig) {
@@ -98,7 +95,7 @@ export function getSortedSpeakerStatsIds(state: Object, stats: Object) {
98 95
      * @param {Object} nextParticipant - The second participant for comparison.
99 96
      * @returns {number} - The sort order of the two participants.
100 97
      */
101
-    function compareFn(currentParticipant, nextParticipant) {
98
+    function compareFn(currentParticipant: any, nextParticipant: any) {
102 99
         if (orderConfig.includes('hasLeft')) {
103 100
             if (nextParticipant.hasLeft() && !currentParticipant.hasLeft()) {
104 101
                 return -1;
@@ -139,13 +136,13 @@ export function getSortedSpeakerStatsIds(state: Object, stats: Object) {
139 136
 /**
140 137
  * Enhance speaker stats to include data needed for ordering.
141 138
  *
142
- * @param {Object} state - The redux state.
139
+ * @param {IReduxState} state - The redux state.
143 140
  * @param {Object} stats - Speaker stats.
144 141
  * @param {Array<string>} orderConfig - Ordering configuration.
145 142
  * @returns {Object} - Enhanced speaker stats.
146 143
  * @public
147 144
  */
148
-function getEnhancedStatsForOrdering(state, stats, orderConfig) {
145
+function getEnhancedStatsForOrdering(state: IReduxState, stats: any, orderConfig?: string[]) {
149 146
     if (!orderConfig) {
150 147
         return stats;
151 148
     }
@@ -166,14 +163,14 @@ function getEnhancedStatsForOrdering(state, stats, orderConfig) {
166 163
 /**
167 164
  * Filter stats by search criteria.
168 165
  *
169
- * @param {Object} state - The redux state.
166
+ * @param {IReduxState} state - The redux state.
170 167
  * @param {Object | undefined} stats - The unfiltered stats.
171 168
  *
172 169
  * @returns {Object} - Filtered speaker stats.
173 170
  * @public
174 171
  */
175
-export function filterBySearchCriteria(state: Object, stats: ?Object) {
176
-    const filteredStats = _.cloneDeep(stats ?? getSpeakerStats(state));
172
+export function filterBySearchCriteria(state: IReduxState, stats?: Object) {
173
+    const filteredStats: any = _.cloneDeep(stats ?? getSpeakerStats(state));
177 174
     const criteria = getSearchCriteria(state);
178 175
 
179 176
     if (criteria !== null) {
@@ -194,14 +191,14 @@ export function filterBySearchCriteria(state: Object, stats: ?Object) {
194 191
 /**
195 192
  * Reset the hidden speaker stats.
196 193
  *
197
- * @param {Object} state - The redux state.
194
+ * @param {IReduxState} state - The redux state.
198 195
  * @param {Object | undefined} stats - The unfiltered stats.
199 196
  *
200 197
  * @returns {Object} - Speaker stats.
201 198
  * @public
202 199
  */
203
-export function resetHiddenStats(state: Object, stats: ?Object) {
204
-    const resetStats = _.cloneDeep(stats ?? getSpeakerStats(state));
200
+export function resetHiddenStats(state: IReduxState, stats?: Object) {
201
+    const resetStats: any = _.cloneDeep(stats ?? getSpeakerStats(state));
205 202
 
206 203
     for (const id in resetStats) {
207 204
         if (resetStats[id].hidden) {

react/features/speaker-stats/middleware.js → react/features/speaker-stats/middleware.ts Datei anzeigen

@@ -1,12 +1,10 @@
1
-// @flow
2
-
3 1
 import {
4 2
     PARTICIPANT_JOINED,
5 3
     PARTICIPANT_KICKED,
6 4
     PARTICIPANT_LEFT,
7 5
     PARTICIPANT_UPDATED
8 6
 } from '../base/participants/actionTypes';
9
-import { MiddlewareRegistry } from '../base/redux';
7
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
10 8
 
11 9
 import {
12 10
     INIT_SEARCH,

+ 2
- 2
react/features/subtitles/actions.any.ts Datei anzeigen

@@ -95,12 +95,12 @@ export function setRequestingSubtitles(enabled: boolean) {
95 95
 /**
96 96
  * Signals that the local user has selected language for the translation.
97 97
  *
98
- * @param {boolean} value - The selected language for translation.
98
+ * @param {string} value - The selected language for translation.
99 99
  * @returns {{
100 100
  *      type: UPDATE_TRANSLATION_LANGUAGE
101 101
  * }}
102 102
  */
103
-export function updateTranslationLanguage(value: boolean) {
103
+export function updateTranslationLanguage(value: string) {
104 104
     return {
105 105
         type: UPDATE_TRANSLATION_LANGUAGE,
106 106
         value

react/features/subtitles/actions.native.js → react/features/subtitles/actions.native.ts Datei anzeigen


react/features/subtitles/actions.web.js → react/features/subtitles/actions.web.ts Datei anzeigen

@@ -1,3 +1,4 @@
1
+import { IStore } from '../app/types';
1 2
 import { toggleDialog } from '../base/dialog/actions';
2 3
 
3 4
 import LanguageSelectorDialogWeb from './components/LanguageSelectorDialog.web';
@@ -12,7 +13,7 @@ export * from './actions.any';
12 13
  * }}
13 14
  */
14 15
 export function toggleLanguageSelectorDialog() {
15
-    return function(dispatch: (Object) => Object) {
16
+    return function(dispatch: IStore['dispatch']) {
16 17
         dispatch(toggleDialog(LanguageSelectorDialogWeb));
17 18
     };
18 19
 }

react/features/subtitles/logger.js → react/features/subtitles/logger.ts Datei anzeigen

@@ -1,5 +1,3 @@
1
-// @flow
2
-
3 1
 import { getLogger } from '../base/logging/functions';
4 2
 
5 3
 export default getLogger('features/subtitles');

react/features/subtitles/middleware.js → react/features/subtitles/middleware.ts Datei anzeigen

@@ -1,7 +1,8 @@
1
-// @flow
2 1
 import i18next from 'i18next';
2
+import { AnyAction } from 'redux';
3 3
 
4
-import { MiddlewareRegistry } from '../base/redux';
4
+import { IStore } from '../app/types';
5
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
5 6
 
6 7
 import {
7 8
     ENDPOINT_MESSAGE_RECEIVED,
@@ -81,7 +82,7 @@ MiddlewareRegistry.register(store => next => action => {
81 82
  * @private
82 83
  * @returns {Object} The value returned by {@code next(action)}.
83 84
  */
84
-function _endpointMessageReceived({ dispatch, getState }, next, action) {
85
+function _endpointMessageReceived({ dispatch, getState }: IStore, next: Function, action: AnyAction) {
85 86
     const { json } = action;
86 87
 
87 88
     if (!(json
@@ -93,7 +94,7 @@ function _endpointMessageReceived({ dispatch, getState }, next, action) {
93 94
     const state = getState();
94 95
     const translationLanguage
95 96
         = state['features/base/conference'].conference
96
-            .getLocalParticipantProperty(P_NAME_TRANSLATION_LANGUAGE);
97
+            ?.getLocalParticipantProperty(P_NAME_TRANSLATION_LANGUAGE);
97 98
 
98 99
     try {
99 100
         const transcriptMessageID = json.message_id;
@@ -125,7 +126,7 @@ function _endpointMessageReceived({ dispatch, getState }, next, action) {
125 126
             // We update the previous transcript message with the same
126 127
             // message ID or adds a new transcript message if it does not
127 128
             // exist in the map.
128
-            const newTranscriptMessage = {
129
+            const newTranscriptMessage: any = {
129 130
                 ...state['features/subtitles']._transcriptMessages
130 131
                         .get(transcriptMessageID)
131 132
                     || { participantName }
@@ -173,19 +174,19 @@ function _endpointMessageReceived({ dispatch, getState }, next, action) {
173 174
  * @private
174 175
  * @returns {void}
175 176
  */
176
-function _requestingSubtitlesChange({ getState }) {
177
+function _requestingSubtitlesChange({ getState }: IStore) {
177 178
     const state = getState();
178 179
     const { _language } = state['features/subtitles'];
179 180
     const { conference } = state['features/base/conference'];
180 181
 
181 182
     const requestingSubtitles = _language !== 'transcribing.subtitlesOff';
182 183
 
183
-    conference.setLocalParticipantProperty(
184
+    conference?.setLocalParticipantProperty(
184 185
         P_NAME_REQUESTING_TRANSCRIPTION,
185 186
         requestingSubtitles);
186 187
 
187 188
     if (requestingSubtitles) {
188
-        conference.setLocalParticipantProperty(
189
+        conference?.setLocalParticipantProperty(
189 190
             P_NAME_TRANSLATION_LANGUAGE,
190 191
             _language.replace('translation-languages:', ''));
191 192
     }
@@ -200,11 +201,11 @@ function _requestingSubtitlesChange({ getState }) {
200 201
  * @private
201 202
  * @returns {void}
202 203
  */
203
-function _requestingSubtitlesSet({ getState }, enabled: boolean) {
204
+function _requestingSubtitlesSet({ getState }: IStore, enabled: boolean) {
204 205
     const state = getState();
205 206
     const { conference } = state['features/base/conference'];
206 207
 
207
-    conference.setLocalParticipantProperty(
208
+    conference?.setLocalParticipantProperty(
208 209
         P_NAME_REQUESTING_TRANSCRIPTION,
209 210
         enabled);
210 211
 }
@@ -219,15 +220,15 @@ function _requestingSubtitlesSet({ getState }, enabled: boolean) {
219 220
  * @returns {void}
220 221
  */
221 222
 function _setClearerOnTranscriptMessage(
222
-        dispatch,
223
-        transcriptMessageID,
224
-        transcriptMessage) {
223
+        dispatch: IStore['dispatch'],
224
+        transcriptMessageID: string,
225
+        transcriptMessage: { clearTimeOut?: number; }) {
225 226
     if (transcriptMessage.clearTimeOut) {
226 227
         clearTimeout(transcriptMessage.clearTimeOut);
227 228
     }
228 229
 
229 230
     transcriptMessage.clearTimeOut
230
-        = setTimeout(
231
+        = window.setTimeout(
231 232
             () => dispatch(removeTranscriptMessage(transcriptMessageID)),
232 233
             REMOVE_AFTER_MS);
233 234
 }

react/features/transcribing/actions.js → react/features/transcribing/actions.ts Datei anzeigen

@@ -1,11 +1,6 @@
1
-// @flow
2
-
3
-import {
4
-    NOTIFICATION_TIMEOUT_TYPE,
5
-    hideNotification,
6
-    showErrorNotification,
7
-    showNotification
8
-} from '../notifications';
1
+import { IStore } from '../app/types';
2
+import { hideNotification, showErrorNotification, showNotification } from '../notifications/actions';
3
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
9 4
 
10 5
 import {
11 6
     SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
@@ -69,7 +64,7 @@ export function potentialTranscriberJoined(participantId: string) {
69 64
  * @returns {Function}
70 65
  */
71 66
 export function showPendingTranscribingNotification() {
72
-    return async (dispatch: Function) => {
67
+    return async (dispatch: IStore['dispatch']) => {
73 68
         const notification = await dispatch(showNotification({
74 69
             descriptionKey: 'transcribing.pending',
75 70
             titleKey: 'dialog.transcribing'
@@ -92,7 +87,7 @@ export function showPendingTranscribingNotification() {
92 87
  *     uid: number
93 88
  * }}
94 89
  */
95
-export function setPendingTranscribingNotificationUid(uid: ?number) {
90
+export function setPendingTranscribingNotificationUid(uid?: string) {
96 91
     return {
97 92
         type: SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
98 93
         uid
@@ -106,7 +101,7 @@ export function setPendingTranscribingNotificationUid(uid: ?number) {
106 101
  * @returns {Function}
107 102
  */
108 103
 export function hidePendingTranscribingNotification() {
109
-    return (dispatch: Function, getState: Function) => {
104
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
110 105
         const { pendingNotificationUid } = getState()['features/transcribing'];
111 106
 
112 107
         if (pendingNotificationUid) {

react/features/transcribing/middleware.js → react/features/transcribing/middleware.ts Datei anzeigen

@@ -1,13 +1,11 @@
1
-// @flow
2
-
3
-import { MiddlewareRegistry } from '../base/redux';
4
-import { toggleRequestingSubtitles } from '../subtitles';
5
-
6 1
 import {
7 2
     HIDDEN_PARTICIPANT_JOINED,
8 3
     HIDDEN_PARTICIPANT_LEFT,
9 4
     PARTICIPANT_UPDATED
10
-} from './../base/participants';
5
+} from '../base/participants/actionTypes';
6
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
7
+import { toggleRequestingSubtitles } from '../subtitles/actions.any';
8
+
11 9
 import {
12 10
     _TRANSCRIBER_JOINED,
13 11
     _TRANSCRIBER_LEFT

+ 1
- 1
react/features/transcribing/reducer.ts Datei anzeigen

@@ -62,7 +62,7 @@ export interface ITranscribingState {
62 62
     isDialing: boolean;
63 63
     isTerminating: boolean;
64 64
     isTranscribing: boolean;
65
-    pendingNotificationUid?: number;
65
+    pendingNotificationUid?: string;
66 66
     potentialTranscriberJIDs: string[];
67 67
     transcriberJID?: string | null;
68 68
 }

react/features/video-menu/actions.any.js → react/features/video-menu/actions.any.ts Datei anzeigen

@@ -1,32 +1,24 @@
1
-// @flow
1
+// @ts-ignore
2 2
 import { getLogger } from '@jitsi/logger';
3
-import type { Dispatch } from 'redux';
4 3
 
4
+// @ts-expect-error
5 5
 import UIEvents from '../../../service/UI/UIEvents';
6 6
 import {
7 7
     AUDIO_MUTE,
8 8
     VIDEO_MUTE,
9 9
     createRemoteMuteConfirmedEvent,
10
-    createToolbarEvent,
11
-    sendAnalytics
12
-} from '../analytics';
10
+    createToolbarEvent
11
+} from '../analytics/AnalyticsEvents';
12
+import { sendAnalytics } from '../analytics/functions';
13
+import { IStore } from '../app/types';
13 14
 import { rejectParticipantAudio, rejectParticipantVideo, showModeratedNotification } from '../av-moderation/actions';
14 15
 import { shouldShowModeratedNotification } from '../av-moderation/functions';
15
-import {
16
-    MEDIA_TYPE,
17
-    VIDEO_MUTISM_AUTHORITY,
18
-    setAudioMuted,
19
-    setVideoMuted
20
-} from '../base/media';
21
-import {
22
-    getLocalParticipant,
23
-    getRemoteParticipants,
24
-    muteRemoteParticipant
25
-} from '../base/participants';
26
-import { toggleScreensharing } from '../base/tracks';
27
-import { isModerationNotificationDisplayed } from '../notifications';
28
-
29
-declare var APP: Object;
16
+import { setAudioMuted, setVideoMuted } from '../base/media/actions';
17
+import { MEDIA_TYPE, MediaType, VIDEO_MUTISM_AUTHORITY } from '../base/media/constants';
18
+import { muteRemoteParticipant } from '../base/participants/actions';
19
+import { getLocalParticipant, getRemoteParticipants } from '../base/participants/functions';
20
+import { toggleScreensharing } from '../base/tracks/actions';
21
+import { isModerationNotificationDisplayed } from '../notifications/functions';
30 22
 
31 23
 const logger = getLogger(__filename);
32 24
 
@@ -38,8 +30,8 @@ const logger = getLogger(__filename);
38 30
  * @param {boolean} stopScreenSharing - Whether or not to stop the screensharing.
39 31
  * @returns {Function}
40 32
  */
41
-export function muteLocal(enable: boolean, mediaType: MEDIA_TYPE, stopScreenSharing: boolean = false) {
42
-    return (dispatch: Dispatch<any>, getState: Function) => {
33
+export function muteLocal(enable: boolean, mediaType: MediaType, stopScreenSharing = false) {
34
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
43 35
         const isAudio = mediaType === MEDIA_TYPE.AUDIO;
44 36
 
45 37
         if (!isAudio && mediaType !== MEDIA_TYPE.VIDEO) {
@@ -78,8 +70,8 @@ export function muteLocal(enable: boolean, mediaType: MEDIA_TYPE, stopScreenShar
78 70
  * @param {MEDIA_TYPE} mediaType - The type of the media channel to mute.
79 71
  * @returns {Function}
80 72
  */
81
-export function muteRemote(participantId: string, mediaType: MEDIA_TYPE) {
82
-    return (dispatch: Dispatch<any>) => {
73
+export function muteRemote(participantId: string, mediaType: MediaType) {
74
+    return (dispatch: IStore['dispatch']) => {
83 75
         if (mediaType !== MEDIA_TYPE.AUDIO && mediaType !== MEDIA_TYPE.VIDEO) {
84 76
             logger.error(`Unsupported media type: ${mediaType}`);
85 77
 
@@ -97,10 +89,10 @@ export function muteRemote(participantId: string, mediaType: MEDIA_TYPE) {
97 89
  * @param {MEDIA_TYPE} mediaType - The media type to mute.
98 90
  * @returns {Function}
99 91
  */
100
-export function muteAllParticipants(exclude: Array<string>, mediaType: MEDIA_TYPE) {
101
-    return (dispatch: Dispatch<any>, getState: Function) => {
92
+export function muteAllParticipants(exclude: Array<string>, mediaType: MediaType) {
93
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
102 94
         const state = getState();
103
-        const localId = getLocalParticipant(state).id;
95
+        const localId = getLocalParticipant(state)?.id ?? '';
104 96
 
105 97
         if (!exclude.includes(localId)) {
106 98
             dispatch(muteLocal(true, mediaType, mediaType !== MEDIA_TYPE.AUDIO));

react/features/video-menu/actions.native.js → react/features/video-menu/actions.native.ts Datei anzeigen


react/features/video-menu/actions.web.js → react/features/video-menu/actions.web.ts Datei anzeigen

@@ -1,4 +1,3 @@
1
-// @flow
2 1
 import { SHOW_CONNECTION_INFO } from '../base/connection/actionTypes';
3 2
 
4 3
 export * from './actions.any';

Laden…
Abbrechen
Speichern