Просмотр исходного кода

ref(TS) Convert more base files to TS (#12222)

factor2
Robert Pintilii 2 лет назад
Родитель
Сommit
0bccda2c9e
Аккаунт пользователя с таким Email не найден

react/features/base/app/actions.js → react/features/base/app/actions.ts Просмотреть файл

1
-// @flow
2
-
3
-import type { Dispatch } from 'redux';
1
+import { IStore } from '../../app/types';
4
 
2
 
5
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
6
 
4
 
7
-declare var APP;
8
-
9
 /**
5
 /**
10
  * Signals that a specific App will mount (in the terms of React).
6
  * Signals that a specific App will mount (in the terms of React).
11
  *
7
  *
16
  * }}
12
  * }}
17
  */
13
  */
18
 export function appWillMount(app: Object) {
14
 export function appWillMount(app: Object) {
19
-    return (dispatch: Dispatch<any>) => {
15
+    return (dispatch: IStore['dispatch']) => {
20
         // TODO There was a redux action creator appInit which I did not like
16
         // TODO There was a redux action creator appInit which I did not like
21
         // because we already had the redux action creator appWillMount and,
17
         // because we already had the redux action creator appWillMount and,
22
         // respectively, the redux action APP_WILL_MOUNT. So I set out to remove
18
         // respectively, the redux action APP_WILL_MOUNT. So I set out to remove

react/features/base/app/functions.js → react/features/base/app/functions.ts Просмотреть файл

1
-// @flow
1
+import { toState } from '../redux/functions';
2
 
2
 
3
-import { toState } from '../redux';
3
+import { IStateful } from './types';
4
 
4
 
5
 /**
5
 /**
6
  * Gets the value of a specific React {@code Component} prop of the currently
6
  * Gets the value of a specific React {@code Component} prop of the currently
7
  * mounted {@link App}.
7
  * mounted {@link App}.
8
  *
8
  *
9
- * @param {Function|Object} stateful - The redux store or {@code getState}
9
+ * @param {IStateful} stateful - The redux store or {@code getState}
10
  * function.
10
  * function.
11
  * @param {string} propName - The name of the React {@code Component} prop of
11
  * @param {string} propName - The name of the React {@code Component} prop of
12
  * the currently mounted {@code App} to get.
12
  * the currently mounted {@code App} to get.
13
  * @returns {*} The value of the specified React {@code Component} prop of the
13
  * @returns {*} The value of the specified React {@code Component} prop of the
14
  * currently mounted {@code App}.
14
  * currently mounted {@code App}.
15
  */
15
  */
16
-export function getAppProp(stateful: Function | Object, propName: string) {
16
+export function getAppProp(stateful: IStateful, propName: string) {
17
     const state = toState(stateful)['features/base/app'];
17
     const state = toState(stateful)['features/base/app'];
18
 
18
 
19
     if (state) {
19
     if (state) {

react/features/base/app/logger.js → react/features/base/app/logger.ts Просмотреть файл

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

+ 1
- 1
react/features/base/app/reducer.ts Просмотреть файл

3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
4
 
4
 
5
 export interface IAppState {
5
 export interface IAppState {
6
-    app?: Object | undefined;
6
+    app?: any;
7
 }
7
 }
8
 
8
 
9
 ReducerRegistry.register<IAppState>('features/base/app', (state = {}, action): IAppState => {
9
 ReducerRegistry.register<IAppState>('features/base/app', (state = {}, action): IAppState => {

+ 1
- 1
react/features/base/config/configType.ts Просмотреть файл

425
     };
425
     };
426
     serviceUrl?: string;
426
     serviceUrl?: string;
427
     speakerStatsOrder?: Array<'role' | 'name' | 'hasLeft'>;
427
     speakerStatsOrder?: Array<'role' | 'name' | 'hasLeft'>;
428
-    startAudioMuted?: boolean;
428
+    startAudioMuted?: number;
429
     startAudioOnly?: boolean;
429
     startAudioOnly?: boolean;
430
     startLastN?: number;
430
     startLastN?: number;
431
     startScreenSharing?: boolean;
431
     startScreenSharing?: boolean;

react/features/base/devices/middleware.js → react/features/base/devices/middleware.ts Просмотреть файл

1
-/* global APP */
1
+import { AnyAction } from 'redux';
2
 
2
 
3
+/* eslint-disable lines-around-comment */
4
+// @ts-ignore
3
 import UIEvents from '../../../../service/UI/UIEvents';
5
 import UIEvents from '../../../../service/UI/UIEvents';
4
-import { processExternalDeviceRequest } from '../../device-selection';
5
-import {
6
-    NOTIFICATION_TIMEOUT_TYPE,
7
-    showNotification,
8
-    showWarningNotification
9
-} from '../../notifications';
6
+import { IStore } from '../../app/types';
7
+import { processExternalDeviceRequest } from '../../device-selection/functions';
8
+import { showNotification, showWarningNotification } from '../../notifications/actions';
9
+import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
10
+// @ts-ignore
10
 import { replaceAudioTrackById, replaceVideoTrackById, setDeviceStatusWarning } from '../../prejoin/actions';
11
 import { replaceAudioTrackById, replaceVideoTrackById, setDeviceStatusWarning } from '../../prejoin/actions';
12
+// @ts-ignore
11
 import { isPrejoinPageVisible } from '../../prejoin/functions';
13
 import { isPrejoinPageVisible } from '../../prejoin/functions';
12
-import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
14
+import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes';
13
 import JitsiMeetJS, { JitsiMediaDevicesEvents, JitsiTrackErrors } from '../lib-jitsi-meet';
15
 import JitsiMeetJS, { JitsiMediaDevicesEvents, JitsiTrackErrors } from '../lib-jitsi-meet';
14
-import { MiddlewareRegistry } from '../redux';
15
-import { updateSettings } from '../settings';
16
+import MiddlewareRegistry from '../redux/MiddlewareRegistry';
17
+import { updateSettings } from '../settings/actions';
18
+
16
 
19
 
17
 import {
20
 import {
18
     CHECK_AND_NOTIFY_FOR_NEW_DEVICE,
21
     CHECK_AND_NOTIFY_FOR_NEW_DEVICE,
35
     setAudioOutputDeviceId
38
     setAudioOutputDeviceId
36
 } from './functions';
39
 } from './functions';
37
 import logger from './logger';
40
 import logger from './logger';
41
+import { IDevicesState } from './reducer';
38
 
42
 
39
 const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
43
 const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
40
     microphone: {
44
     microphone: {
57
 /**
61
 /**
58
  * A listener for device permissions changed reported from lib-jitsi-meet.
62
  * A listener for device permissions changed reported from lib-jitsi-meet.
59
  */
63
  */
60
-let permissionsListener;
64
+let permissionsListener: Function | undefined;
61
 
65
 
62
 /**
66
 /**
63
  * Logs the current device list.
67
  * Logs the current device list.
65
  * @param {Object} deviceList - Whatever is returned by {@link groupDevicesByKind}.
69
  * @param {Object} deviceList - Whatever is returned by {@link groupDevicesByKind}.
66
  * @returns {string}
70
  * @returns {string}
67
  */
71
  */
68
-function logDeviceList(deviceList) {
69
-    const devicesToStr = list => list.map(device => `\t\t${device.label}[${device.deviceId}]`).join('\n');
72
+function logDeviceList(deviceList: IDevicesState['availableDevices']) {
73
+    const devicesToStr = (list?: MediaDeviceInfo[]) =>
74
+        list?.map(device => `\t\t${device.label}[${device.deviceId}]`).join('\n');
70
     const audioInputs = devicesToStr(deviceList.audioInput);
75
     const audioInputs = devicesToStr(deviceList.audioInput);
71
     const audioOutputs = devicesToStr(deviceList.audioOutput);
76
     const audioOutputs = devicesToStr(deviceList.audioOutput);
72
     const videoInputs = devicesToStr(deviceList.videoInput);
77
     const videoInputs = devicesToStr(deviceList.videoInput);
87
 MiddlewareRegistry.register(store => next => action => {
92
 MiddlewareRegistry.register(store => next => action => {
88
     switch (action.type) {
93
     switch (action.type) {
89
     case APP_WILL_MOUNT: {
94
     case APP_WILL_MOUNT: {
90
-        const _permissionsListener = permissions => {
95
+        const _permissionsListener = (permissions: Object) => {
91
             store.dispatch(devicePermissionsChanged(permissions));
96
             store.dispatch(devicePermissionsChanged(permissions));
92
         };
97
         };
93
         const { mediaDevices } = JitsiMeetJS;
98
         const { mediaDevices } = JitsiMeetJS;
214
  * @private
219
  * @private
215
  * @returns {Object} The value returned by {@code next(action)}.
220
  * @returns {Object} The value returned by {@code next(action)}.
216
  */
221
  */
217
-function _processPendingRequests({ dispatch, getState }, next, action) {
222
+function _processPendingRequests({ dispatch, getState }: IStore, next: Function, action: AnyAction) {
218
     const result = next(action);
223
     const result = next(action);
219
     const state = getState();
224
     const state = getState();
220
     const { pendingRequests } = state['features/base/devices'];
225
     const { pendingRequests } = state['features/base/devices'];
223
         return result;
228
         return result;
224
     }
229
     }
225
 
230
 
226
-    pendingRequests.forEach(request => {
231
+    pendingRequests.forEach((request: any) => {
227
         processExternalDeviceRequest(
232
         processExternalDeviceRequest(
228
             dispatch,
233
             dispatch,
229
             getState,
234
             getState,
248
  * @private
253
  * @private
249
  * @returns {void}
254
  * @returns {void}
250
  */
255
  */
251
-function _checkAndNotifyForNewDevice(store, newDevices, oldDevices) {
256
+function _checkAndNotifyForNewDevice(store: IStore, newDevices: MediaDeviceInfo[], oldDevices: MediaDeviceInfo[]) {
252
     const { dispatch } = store;
257
     const { dispatch } = store;
253
 
258
 
254
     // let's intersect both newDevices and oldDevices and handle thew newly
259
     // let's intersect both newDevices and oldDevices and handle thew newly
260
     // we group devices by groupID which normally is the grouping by physical device
265
     // we group devices by groupID which normally is the grouping by physical device
261
     // plugging in headset we provide normally two device, one input and one output
266
     // plugging in headset we provide normally two device, one input and one output
262
     // and we want to show only one notification for this physical audio device
267
     // and we want to show only one notification for this physical audio device
263
-    const devicesGroupBy = onlyNewDevices.reduce((accumulated, value) => {
268
+    const devicesGroupBy: {
269
+        [key: string]: MediaDeviceInfo[];
270
+    } = onlyNewDevices.reduce((accumulated: any, value) => {
264
         accumulated[value.groupId] = accumulated[value.groupId] || [];
271
         accumulated[value.groupId] = accumulated[value.groupId] || [];
265
         accumulated[value.groupId].push(value);
272
         accumulated[value.groupId].push(value);
266
 
273
 
314
  * @returns {boolean} - Returns true in order notifications to be dismissed.
321
  * @returns {boolean} - Returns true in order notifications to be dismissed.
315
  * @private
322
  * @private
316
  */
323
  */
317
-function _useDevice({ dispatch }, devices) {
324
+function _useDevice({ dispatch }: IStore, devices: MediaDeviceInfo[]) {
318
     devices.forEach(device => {
325
     devices.forEach(device => {
319
         switch (device.kind) {
326
         switch (device.kind) {
320
         case 'videoinput': {
327
         case 'videoinput': {

react/features/base/jwt/actions.js → react/features/base/jwt/actions.ts Просмотреть файл

1
-// @flow
2
-
3
 import { SET_JWT } from './actionTypes';
1
 import { SET_JWT } from './actionTypes';
4
 
2
 
5
 /**
3
 /**
11
  *     jwt: (string|undefined)
9
  *     jwt: (string|undefined)
12
  * }}
10
  * }}
13
  */
11
  */
14
-export function setJWT(jwt: ?string) {
12
+export function setJWT(jwt?: string) {
15
     return {
13
     return {
16
         type: SET_JWT,
14
         type: SET_JWT,
17
         jwt
15
         jwt

react/features/base/jwt/constants.js → react/features/base/jwt/constants.ts Просмотреть файл


react/features/base/lastn/actions.js → react/features/base/lastn/actions.ts Просмотреть файл

1
-// @flow
2
-
3
 import { SET_LAST_N } from './actionTypes';
1
 import { SET_LAST_N } from './actionTypes';
4
 
2
 
5
 /**
3
 /**

react/features/base/lastn/functions.js → react/features/base/lastn/functions.ts Просмотреть файл

7
  * @param {number} channelLastN - LastN value set for the whole conference.
7
  * @param {number} channelLastN - LastN value set for the whole conference.
8
  * @returns {number} LastN value applicable to the quality level specified.
8
  * @returns {number} LastN value applicable to the quality level specified.
9
  */
9
  */
10
-export function getLastNForQualityLevel(qualityLevel, channelLastN) {
10
+export function getLastNForQualityLevel(qualityLevel: number, channelLastN: number) {
11
     let lastN = channelLastN;
11
     let lastN = channelLastN;
12
 
12
 
13
     const videoQualityLevels = Object.values(VIDEO_QUALITY_LEVELS);
13
     const videoQualityLevels = Object.values(VIDEO_QUALITY_LEVELS);
15
     for (const lvl in videoQualityLevels) {
15
     for (const lvl in videoQualityLevels) {
16
         if (videoQualityLevels.hasOwnProperty(lvl)
16
         if (videoQualityLevels.hasOwnProperty(lvl)
17
             && qualityLevel === videoQualityLevels[lvl]
17
             && qualityLevel === videoQualityLevels[lvl]
18
-            && lvl > 1) {
19
-            lastN = Math.floor(channelLastN / Math.pow(2, lvl - 1));
18
+            && Number(lvl) > 1) {
19
+            lastN = Math.floor(channelLastN / Math.pow(2, Number(lvl) - 1));
20
         }
20
         }
21
     }
21
     }
22
 
22
 
30
  * @param {Object} lastNLimits - The Object to be verified.
30
  * @param {Object} lastNLimits - The Object to be verified.
31
  * @returns {undefined|Map<number, number>}
31
  * @returns {undefined|Map<number, number>}
32
  */
32
  */
33
-export function validateLastNLimits(lastNLimits) {
33
+export function validateLastNLimits(lastNLimits: any) {
34
     // Checks if only numbers are used
34
     // Checks if only numbers are used
35
     if (typeof lastNLimits !== 'object'
35
     if (typeof lastNLimits !== 'object'
36
         || !Object.keys(lastNLimits).length
36
         || !Object.keys(lastNLimits).length
64
  * @returns {number|undefined} - A "last N" number if there was a corresponding "last N" value matched with the number
64
  * @returns {number|undefined} - A "last N" number if there was a corresponding "last N" value matched with the number
65
  * of participants or {@code undefined} otherwise.
65
  * of participants or {@code undefined} otherwise.
66
  */
66
  */
67
-export function limitLastN(participantsCount, lastNLimits) {
67
+export function limitLastN(participantsCount: number, lastNLimits: Map<number, number>) {
68
     if (!lastNLimits || !lastNLimits.keys) {
68
     if (!lastNLimits || !lastNLimits.keys) {
69
         return undefined;
69
         return undefined;
70
     }
70
     }

react/features/base/lastn/logger.js → react/features/base/lastn/logger.ts Просмотреть файл

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

react/features/base/lastn/middleware.js → react/features/base/lastn/middleware.ts Просмотреть файл

1
-// @flow
2
-
3
 import debounce from 'lodash/debounce';
1
 import debounce from 'lodash/debounce';
4
 
2
 
3
+import { IStore } from '../../app/types';
5
 import { SET_FILMSTRIP_ENABLED } from '../../filmstrip/actionTypes';
4
 import { SET_FILMSTRIP_ENABLED } from '../../filmstrip/actionTypes';
6
 import { SELECT_LARGE_VIDEO_PARTICIPANT } from '../../large-video/actionTypes';
5
 import { SELECT_LARGE_VIDEO_PARTICIPANT } from '../../large-video/actionTypes';
7
 import { APP_STATE_CHANGED } from '../../mobile/background/actionTypes';
6
 import { APP_STATE_CHANGED } from '../../mobile/background/actionTypes';
22
     getParticipantById,
21
     getParticipantById,
23
     getParticipantCount
22
     getParticipantCount
24
 } from '../participants/functions';
23
 } from '../participants/functions';
25
-import { MiddlewareRegistry } from '../redux';
24
+import MiddlewareRegistry from '../redux/MiddlewareRegistry';
25
+// eslint-disable-next-line lines-around-comment
26
+// @ts-ignore
26
 import { isLocalVideoTrackDesktop } from '../tracks/functions';
27
 import { isLocalVideoTrackDesktop } from '../tracks/functions';
27
 
28
 
28
 import { setLastN } from './actions';
29
 import { setLastN } from './actions';
36
  * @private
37
  * @private
37
  * @returns {void}
38
  * @returns {void}
38
  */
39
  */
39
-const _updateLastN = debounce(({ dispatch, getState }) => {
40
+const _updateLastN = debounce(({ dispatch, getState }: IStore) => {
40
     const state = getState();
41
     const state = getState();
41
     const { conference } = state['features/base/conference'];
42
     const { conference } = state['features/base/conference'];
42
 
43
 
61
     let lastNSelected = config.startLastN ?? (config.channelLastN ?? -1);
62
     let lastNSelected = config.startLastN ?? (config.channelLastN ?? -1);
62
 
63
 
63
     // Apply last N limit based on the # of participants and config settings.
64
     // Apply last N limit based on the # of participants and config settings.
65
+    // @ts-ignore
64
     const limitedLastN = limitLastN(participantCount, lastNLimits);
66
     const limitedLastN = limitLastN(participantCount, lastNLimits);
65
 
67
 
66
     if (limitedLastN !== undefined) {
68
     if (limitedLastN !== undefined) {
81
         // view since we make an exception only for screenshare when in audio-only mode. If the user unpins
83
         // view since we make an exception only for screenshare when in audio-only mode. If the user unpins
82
         // the screenshare, lastN will be set to 0 here. It will be set to 1 if screenshare has been auto pinned.
84
         // the screenshare, lastN will be set to 0 here. It will be set to 1 if screenshare has been auto pinned.
83
         if (!tileViewEnabled && largeVideoParticipant && !largeVideoParticipant.local) {
85
         if (!tileViewEnabled && largeVideoParticipant && !largeVideoParticipant.local) {
84
-            lastNSelected = (remoteScreenShares || []).includes(largeVideoParticipantId) ? 1 : 0;
86
+            lastNSelected = (remoteScreenShares || []).includes(largeVideoParticipantId ?? '') ? 1 : 0;
85
         } else {
87
         } else {
86
             lastNSelected = 0;
88
             lastNSelected = 0;
87
         }
89
         }

react/features/base/participants/middleware.js → react/features/base/participants/middleware.ts Просмотреть файл

1
-// @flow
2
-
3
 import i18n from 'i18next';
1
 import i18n from 'i18next';
4
 import { batch } from 'react-redux';
2
 import { batch } from 'react-redux';
5
 
3
 
4
+// @ts-ignore
6
 import UIEvents from '../../../../service/UI/UIEvents';
5
 import UIEvents from '../../../../service/UI/UIEvents';
6
+import { IStore } from '../../app/types';
7
 import { approveParticipant } from '../../av-moderation/actions';
7
 import { approveParticipant } from '../../av-moderation/actions';
8
 import { UPDATE_BREAKOUT_ROOMS } from '../../breakout-rooms/actionTypes';
8
 import { UPDATE_BREAKOUT_ROOMS } from '../../breakout-rooms/actionTypes';
9
 import { getBreakoutRooms } from '../../breakout-rooms/functions';
9
 import { getBreakoutRooms } from '../../breakout-rooms/functions';
10
 import { toggleE2EE } from '../../e2ee/actions';
10
 import { toggleE2EE } from '../../e2ee/actions';
11
 import { MAX_MODE } from '../../e2ee/constants';
11
 import { MAX_MODE } from '../../e2ee/constants';
12
+import { showNotification } from '../../notifications/actions';
12
 import {
13
 import {
13
     LOCAL_RECORDING_NOTIFICATION_ID,
14
     LOCAL_RECORDING_NOTIFICATION_ID,
14
     NOTIFICATION_TIMEOUT_TYPE,
15
     NOTIFICATION_TIMEOUT_TYPE,
15
-    RAISE_HAND_NOTIFICATION_ID,
16
-    showNotification
17
-} from '../../notifications';
16
+    RAISE_HAND_NOTIFICATION_ID
17
+} from '../../notifications/constants';
18
 import { isForceMuted } from '../../participants-pane/functions';
18
 import { isForceMuted } from '../../participants-pane/functions';
19
-import { CALLING, INVITED } from '../../presence-status';
19
+import { CALLING, INVITED } from '../../presence-status/constants';
20
 import { RAISE_HAND_SOUND_ID } from '../../reactions/constants';
20
 import { RAISE_HAND_SOUND_ID } from '../../reactions/constants';
21
-import { RECORDING_OFF_SOUND_ID, RECORDING_ON_SOUND_ID } from '../../recording';
22
-import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
23
-import {
24
-    CONFERENCE_WILL_JOIN,
25
-    forEachConference,
26
-    getCurrentConference
27
-} from '../conference';
28
-import { SET_CONFIG } from '../config';
21
+import { RECORDING_OFF_SOUND_ID, RECORDING_ON_SOUND_ID } from '../../recording/constants';
22
+import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes';
23
+import { CONFERENCE_WILL_JOIN } from '../conference/actionTypes';
24
+import { forEachConference, getCurrentConference } from '../conference/functions';
25
+import { IJitsiConference } from '../conference/reducer';
26
+import { SET_CONFIG } from '../config/actionTypes';
29
 import { getDisableRemoveRaisedHandOnFocus } from '../config/functions.any';
27
 import { getDisableRemoveRaisedHandOnFocus } from '../config/functions.any';
30
 import { JitsiConferenceEvents } from '../lib-jitsi-meet';
28
 import { JitsiConferenceEvents } from '../lib-jitsi-meet';
31
-import { MEDIA_TYPE } from '../media';
32
-import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
33
-import { playSound, registerSound, unregisterSound } from '../sounds';
29
+import { MEDIA_TYPE } from '../media/constants';
30
+import MiddlewareRegistry from '../redux/MiddlewareRegistry';
31
+import StateListenerRegistry from '../redux/StateListenerRegistry';
32
+import { playSound, registerSound, unregisterSound } from '../sounds/actions';
34
 
33
 
35
 import {
34
 import {
36
     DOMINANT_SPEAKER_CHANGED,
35
     DOMINANT_SPEAKER_CHANGED,
79
 } from './functions';
78
 } from './functions';
80
 import logger from './logger';
79
 import logger from './logger';
81
 import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds';
80
 import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds';
82
-import './subscriber';
81
+import { IJitsiParticipant } from './types';
83
 
82
 
84
-declare var APP: Object;
83
+import './subscriber';
85
 
84
 
86
 /**
85
 /**
87
  * Middleware that captures CONFERENCE_JOINED and CONFERENCE_LEFT actions and
86
  * Middleware that captures CONFERENCE_JOINED and CONFERENCE_LEFT actions and
128
         const participant = getDominantSpeakerParticipant(state);
127
         const participant = getDominantSpeakerParticipant(state);
129
 
128
 
130
         if (
129
         if (
131
-            participant
132
-            && participant.local
130
+            participant?.local
133
             && hasRaisedHand(participant)
131
             && hasRaisedHand(participant)
134
             && action.level > LOWER_HAND_AUDIO_LEVEL
132
             && action.level > LOWER_HAND_AUDIO_LEVEL
135
             && !getDisableRemoveRaisedHandOnFocus(state)
133
             && !getDisableRemoveRaisedHandOnFocus(state)
142
     case GRANT_MODERATOR: {
140
     case GRANT_MODERATOR: {
143
         const { conference } = store.getState()['features/base/conference'];
141
         const { conference } = store.getState()['features/base/conference'];
144
 
142
 
145
-        conference.grantOwner(action.id);
143
+        conference?.grantOwner(action.id);
146
         break;
144
         break;
147
     }
145
     }
148
 
146
 
149
     case KICK_PARTICIPANT: {
147
     case KICK_PARTICIPANT: {
150
         const { conference } = store.getState()['features/base/conference'];
148
         const { conference } = store.getState()['features/base/conference'];
151
 
149
 
152
-        conference.kickParticipant(action.id);
150
+        conference?.kickParticipant(action.id);
153
         break;
151
         break;
154
     }
152
     }
155
 
153
 
164
             // participant is uniquely identified by the very fact that there is
162
             // participant is uniquely identified by the very fact that there is
165
             // only one local participant.
163
             // only one local participant.
166
 
164
 
167
-            id: localId,
165
+            id: localId ?? '',
168
             local: true,
166
             local: true,
169
             raisedHandTimestamp
167
             raisedHandTimestamp
170
         }));
168
         }));
171
 
169
 
172
         store.dispatch(raiseHandUpdateQueue({
170
         store.dispatch(raiseHandUpdateQueue({
173
-            id: localId,
171
+            id: localId ?? '',
174
             raisedHandTimestamp
172
             raisedHandTimestamp
175
         }));
173
         }));
176
 
174
 
188
         const { deploymentInfo } = state['features/base/config'];
186
         const { deploymentInfo } = state['features/base/config'];
189
 
187
 
190
         // if there userRegion set let's use it for the local participant
188
         // if there userRegion set let's use it for the local participant
191
-        if (deploymentInfo && deploymentInfo.userRegion) {
189
+        if (deploymentInfo?.userRegion) {
192
             const localId = getLocalParticipant(state)?.id;
190
             const localId = getLocalParticipant(state)?.id;
193
 
191
 
194
-            store.dispatch(participantUpdated({
195
-                id: localId,
196
-                local: true,
197
-                region: deploymentInfo.userRegion
198
-            }));
192
+            if (localId) {
193
+                store.dispatch(participantUpdated({
194
+                    id: localId,
195
+                    local: true,
196
+                    region: deploymentInfo.userRegion
197
+                }));
198
+            }
199
         }
199
         }
200
 
200
 
201
         return result;
201
         return result;
207
         const localId = getLocalParticipant(state)?.id;
207
         const localId = getLocalParticipant(state)?.id;
208
         const { localRecording } = state['features/base/config'];
208
         const { localRecording } = state['features/base/config'];
209
 
209
 
210
-        if (localRecording?.notifyAllParticipants && !onlySelf) {
210
+        if (localRecording?.notifyAllParticipants && !onlySelf && localId) {
211
             store.dispatch(participantUpdated({
211
             store.dispatch(participantUpdated({
212
                 // XXX Only the local participant is allowed to update without
212
                 // XXX Only the local participant is allowed to update without
213
                 // stating the JitsiConference instance (i.e. participant property
213
                 // stating the JitsiConference instance (i.e. participant property
227
     case MUTE_REMOTE_PARTICIPANT: {
227
     case MUTE_REMOTE_PARTICIPANT: {
228
         const { conference } = store.getState()['features/base/conference'];
228
         const { conference } = store.getState()['features/base/conference'];
229
 
229
 
230
-        conference.muteParticipant(action.id, action.mediaType);
230
+        conference?.muteParticipant(action.id, action.mediaType);
231
         break;
231
         break;
232
     }
232
     }
233
 
233
 
319
         if (breakoutRoom) {
319
         if (breakoutRoom) {
320
             const rooms = getBreakoutRooms(state);
320
             const rooms = getBreakoutRooms(state);
321
             const roomCounter = state['features/breakout-rooms'].roomCounter;
321
             const roomCounter = state['features/breakout-rooms'].roomCounter;
322
-            const newRooms = {};
322
+            const newRooms: any = {};
323
 
323
 
324
             Object.entries(rooms).forEach(([ key, r ]) => {
324
             Object.entries(rooms).forEach(([ key, r ]) => {
325
                 const participants = r?.participants || {};
325
                 const participants = r?.participants || {};
393
     /* listener */ ({ leaving }, { dispatch, getState }) => {
393
     /* listener */ ({ leaving }, { dispatch, getState }) => {
394
         const state = getState();
394
         const state = getState();
395
         const localParticipant = getLocalParticipant(state);
395
         const localParticipant = getLocalParticipant(state);
396
-        let id;
396
+        let id: string;
397
 
397
 
398
         if (!localParticipant
398
         if (!localParticipant
399
                 || (id = localParticipant.id)
399
                 || (id = localParticipant.id)
421
     state => state['features/base/conference'].conference,
421
     state => state['features/base/conference'].conference,
422
     (conference, store) => {
422
     (conference, store) => {
423
         if (conference) {
423
         if (conference) {
424
-            const propertyHandlers = {
425
-                'e2ee.enabled': (participant, value) => _e2eeUpdated(store, conference, participant.getId(), value),
426
-                'features_e2ee': (participant, value) =>
424
+            const propertyHandlers: {
425
+                [key: string]: Function;
426
+            } = {
427
+                'e2ee.enabled': (participant: IJitsiParticipant, value: string) =>
428
+                    _e2eeUpdated(store, conference, participant.getId(), value),
429
+                'features_e2ee': (participant: IJitsiParticipant, value: boolean) =>
427
                     store.dispatch(participantUpdated({
430
                     store.dispatch(participantUpdated({
428
                         conference,
431
                         conference,
429
                         id: participant.getId(),
432
                         id: participant.getId(),
430
                         e2eeSupported: value
433
                         e2eeSupported: value
431
                     })),
434
                     })),
432
-                'features_jigasi': (participant, value) =>
435
+                'features_jigasi': (participant: IJitsiParticipant, value: boolean) =>
433
                     store.dispatch(participantUpdated({
436
                     store.dispatch(participantUpdated({
434
                         conference,
437
                         conference,
435
                         id: participant.getId(),
438
                         id: participant.getId(),
436
                         isJigasi: value
439
                         isJigasi: value
437
                     })),
440
                     })),
438
-                'features_screen-sharing': (participant, value) => // eslint-disable-line no-unused-vars
441
+                // eslint-disable-next-line @typescript-eslint/no-unused-vars
442
+                'features_screen-sharing': (participant: IJitsiParticipant, value: string) =>
439
                     store.dispatch(participantUpdated({
443
                     store.dispatch(participantUpdated({
440
                         conference,
444
                         conference,
441
                         id: participant.getId(),
445
                         id: participant.getId(),
442
                         features: { 'screen-sharing': true }
446
                         features: { 'screen-sharing': true }
443
                     })),
447
                     })),
444
-                'localRecording': (participant, value) =>
448
+                'localRecording': (participant: IJitsiParticipant, value: string) =>
445
                     _localRecordingUpdated(store, conference, participant.getId(), value),
449
                     _localRecordingUpdated(store, conference, participant.getId(), value),
446
-                'raisedHand': (participant, value) =>
450
+                'raisedHand': (participant: IJitsiParticipant, value: string) =>
447
                     _raiseHandUpdated(store, conference, participant.getId(), value),
451
                     _raiseHandUpdated(store, conference, participant.getId(), value),
448
-                'region': (participant, value) =>
452
+                'region': (participant: IJitsiParticipant, value: string) =>
449
                     store.dispatch(participantUpdated({
453
                     store.dispatch(participantUpdated({
450
                         conference,
454
                         conference,
451
                         id: participant.getId(),
455
                         id: participant.getId(),
452
                         region: value
456
                         region: value
453
                     })),
457
                     })),
454
-                'remoteControlSessionStatus': (participant, value) =>
458
+                'remoteControlSessionStatus': (participant: IJitsiParticipant, value: boolean) =>
455
                     store.dispatch(participantUpdated({
459
                     store.dispatch(participantUpdated({
456
                         conference,
460
                         conference,
457
                         id: participant.getId(),
461
                         id: participant.getId(),
460
             };
464
             };
461
 
465
 
462
             // update properties for the participants that are already in the conference
466
             // update properties for the participants that are already in the conference
463
-            conference.getParticipants().forEach(participant => {
467
+            conference.getParticipants().forEach((participant: any) => {
464
                 Object.keys(propertyHandlers).forEach(propertyName => {
468
                 Object.keys(propertyHandlers).forEach(propertyName => {
465
                     const value = participant.getProperty(propertyName);
469
                     const value = participant.getProperty(propertyName);
466
 
470
 
467
                     if (value !== undefined) {
471
                     if (value !== undefined) {
468
-                        propertyHandlers[propertyName](participant, value);
472
+                        propertyHandlers[propertyName as keyof typeof propertyHandlers](participant, value);
469
                     }
473
                     }
470
                 });
474
                 });
471
             });
475
             });
473
             // We joined a conference
477
             // We joined a conference
474
             conference.on(
478
             conference.on(
475
                 JitsiConferenceEvents.PARTICIPANT_PROPERTY_CHANGED,
479
                 JitsiConferenceEvents.PARTICIPANT_PROPERTY_CHANGED,
476
-                (participant, propertyName, oldValue, newValue) => {
480
+                (participant: IJitsiParticipant, propertyName: string, oldValue: string, newValue: string) => {
477
                     if (propertyHandlers.hasOwnProperty(propertyName)) {
481
                     if (propertyHandlers.hasOwnProperty(propertyName)) {
478
                         propertyHandlers[propertyName](participant, newValue);
482
                         propertyHandlers[propertyName](participant, newValue);
479
                     }
483
                     }
480
                 });
484
                 });
481
         } else {
485
         } else {
482
-            const localParticipantId = getLocalParticipant(store.getState).id;
486
+            const localParticipantId = getLocalParticipant(store.getState)?.id;
483
 
487
 
484
             // We left the conference, the local participant must be updated.
488
             // We left the conference, the local participant must be updated.
485
-            _e2eeUpdated(store, conference, localParticipantId, false);
486
-            _raiseHandUpdated(store, conference, localParticipantId, 0);
489
+            _e2eeUpdated(store, conference, localParticipantId ?? '', false);
490
+            _raiseHandUpdated(store, conference, localParticipantId ?? '', 0);
487
         }
491
         }
488
     }
492
     }
489
 );
493
 );
497
  * @param {boolean} newValue - The new value of the E2EE enabled status.
501
  * @param {boolean} newValue - The new value of the E2EE enabled status.
498
  * @returns {void}
502
  * @returns {void}
499
  */
503
  */
500
-function _e2eeUpdated({ getState, dispatch }, conference, participantId, newValue) {
504
+function _e2eeUpdated({ getState, dispatch }: IStore, conference: IJitsiConference,
505
+        participantId: string, newValue: string | boolean) {
501
     const e2eeEnabled = newValue === 'true';
506
     const e2eeEnabled = newValue === 'true';
502
     const { e2ee = {} } = getState()['features/base/config'];
507
     const { e2ee = {} } = getState()['features/base/config'];
503
 
508
 
530
  * @private
535
  * @private
531
  * @returns {Object} The value returned by {@code next(action)}.
536
  * @returns {Object} The value returned by {@code next(action)}.
532
  */
537
  */
533
-function _localParticipantJoined({ getState, dispatch }, next, action) {
538
+function _localParticipantJoined({ getState, dispatch }: IStore, next: Function, action: any) {
534
     const result = next(action);
539
     const result = next(action);
535
 
540
 
536
     const settings = getState()['features/base/settings'];
541
     const settings = getState()['features/base/settings'];
537
 
542
 
543
+    // @ts-ignore
538
     dispatch(localParticipantJoined({
544
     dispatch(localParticipantJoined({
539
         avatarURL: settings.avatarURL,
545
         avatarURL: settings.avatarURL,
540
         email: settings.email,
546
         email: settings.email,
555
  * @private
561
  * @private
556
  * @returns {Object} The value returned by {@code next(action)}.
562
  * @returns {Object} The value returned by {@code next(action)}.
557
  */
563
  */
558
-function _localParticipantLeft({ dispatch }, next, action) {
564
+function _localParticipantLeft({ dispatch }: IStore, next: Function, action: any) {
559
     const result = next(action);
565
     const result = next(action);
560
 
566
 
561
     dispatch(localParticipantLeft());
567
     dispatch(localParticipantLeft());
572
  * @private
578
  * @private
573
  * @returns {void}
579
  * @returns {void}
574
  */
580
  */
575
-function _maybePlaySounds({ getState, dispatch }, action) {
581
+function _maybePlaySounds({ getState, dispatch }: IStore, action: any) {
576
     const state = getState();
582
     const state = getState();
577
     const { startAudioMuted } = state['features/base/config'];
583
     const { startAudioMuted } = state['features/base/config'];
578
     const { soundsParticipantJoined: joinSound, soundsParticipantLeft: leftSound } = state['features/base/settings'];
584
     const { soundsParticipantJoined: joinSound, soundsParticipantLeft: leftSound } = state['features/base/settings'];
617
  * @private
623
  * @private
618
  * @returns {Object} The value returned by {@code next(action)}.
624
  * @returns {Object} The value returned by {@code next(action)}.
619
  */
625
  */
620
-function _participantJoinedOrUpdated(store, next, action) {
626
+function _participantJoinedOrUpdated(store: IStore, next: Function, action: any) {
621
     const { dispatch, getState } = store;
627
     const { dispatch, getState } = store;
622
     const { overwrittenNameList } = store.getState()['features/base/participants'];
628
     const { overwrittenNameList } = store.getState()['features/base/participants'];
623
     const { participant: {
629
     const { participant: {
639
             const rHand = parseInt(raisedHandTimestamp, 10);
645
             const rHand = parseInt(raisedHandTimestamp, 10);
640
 
646
 
641
             // Send raisedHand signalling only if there is a change
647
             // Send raisedHand signalling only if there is a change
642
-            if (conference && rHand !== getLocalParticipant(getState()).raisedHandTimestamp) {
648
+            if (conference && rHand !== getLocalParticipant(getState())?.raisedHandTimestamp) {
643
                 conference.setLocalParticipantProperty('raisedHand', rHand);
649
                 conference.setLocalParticipantProperty('raisedHand', rHand);
644
             }
650
             }
645
         }
651
         }
657
 
663
 
658
             // Send localRecording signalling only if there is a change
664
             // Send localRecording signalling only if there is a change
659
             if (conference
665
             if (conference
660
-                && localRecording !== getLocalParticipant(getState()).localRecording) {
666
+                && localRecording !== getLocalParticipant(getState())?.localRecording) {
661
                 conference.setLocalParticipantProperty('localRecording', localRecording);
667
                 conference.setLocalParticipantProperty('localRecording', localRecording);
662
             }
668
             }
663
         }
669
         }
673
         const { disableThirdPartyRequests } = getState()['features/base/config'];
679
         const { disableThirdPartyRequests } = getState()['features/base/config'];
674
 
680
 
675
         if (!disableThirdPartyRequests && (avatarURL || email || id || name)) {
681
         if (!disableThirdPartyRequests && (avatarURL || email || id || name)) {
676
-            const participantId = !id && local ? getLocalParticipant(getState()).id : id;
682
+            const participantId = !id && local ? getLocalParticipant(getState())?.id : id;
677
             const updatedParticipant = getParticipantById(getState(), participantId);
683
             const updatedParticipant = getParticipantById(getState(), participantId);
678
 
684
 
679
-            getFirstLoadableAvatarUrl(updatedParticipant, store)
680
-                .then(urlData => {
681
-                    dispatch(setLoadableAvatarUrl(participantId, urlData?.src, urlData?.isUsingCORS));
685
+            getFirstLoadableAvatarUrl(updatedParticipant ?? { id: '' }, store)
686
+                .then((urlData?: { isUsingCORS: boolean; src: string; }) => {
687
+                    dispatch(setLoadableAvatarUrl(participantId, urlData?.src ?? '', Boolean(urlData?.isUsingCORS)));
682
                 });
688
                 });
683
         }
689
         }
684
     }
690
     }
703
  * @param {boolean} newValue - The new value of the local recording status.
709
  * @param {boolean} newValue - The new value of the local recording status.
704
  * @returns {void}
710
  * @returns {void}
705
  */
711
  */
706
-function _localRecordingUpdated({ dispatch, getState }, conference, participantId, newValue) {
712
+function _localRecordingUpdated({ dispatch, getState }: IStore, conference: IJitsiConference,
713
+        participantId: string, newValue: string) {
707
     const state = getState();
714
     const state = getState();
708
 
715
 
709
     dispatch(participantUpdated({
716
     dispatch(participantUpdated({
732
  * @param {boolean} newValue - The new value of the raise hand status.
739
  * @param {boolean} newValue - The new value of the raise hand status.
733
  * @returns {void}
740
  * @returns {void}
734
  */
741
  */
735
-function _raiseHandUpdated({ dispatch, getState }, conference, participantId, newValue) {
742
+function _raiseHandUpdated({ dispatch, getState }: IStore, conference: IJitsiConference,
743
+        participantId: string, newValue: string | number) {
736
     let raisedHandTimestamp;
744
     let raisedHandTimestamp;
737
 
745
 
738
     switch (newValue) {
746
     switch (newValue) {
744
         raisedHandTimestamp = Date.now();
752
         raisedHandTimestamp = Date.now();
745
         break;
753
         break;
746
     default:
754
     default:
747
-        raisedHandTimestamp = parseInt(newValue, 10);
755
+        raisedHandTimestamp = parseInt(`${newValue}`, 10);
748
     }
756
     }
749
     const state = getState();
757
     const state = getState();
750
 
758
 
811
  * @private
819
  * @private
812
  * @returns {void}
820
  * @returns {void}
813
  */
821
  */
814
-function _registerSounds({ dispatch }) {
822
+function _registerSounds({ dispatch }: IStore) {
815
     dispatch(
823
     dispatch(
816
         registerSound(PARTICIPANT_JOINED_SOUND_ID, PARTICIPANT_JOINED_FILE));
824
         registerSound(PARTICIPANT_JOINED_SOUND_ID, PARTICIPANT_JOINED_FILE));
817
     dispatch(registerSound(PARTICIPANT_LEFT_SOUND_ID, PARTICIPANT_LEFT_FILE));
825
     dispatch(registerSound(PARTICIPANT_LEFT_SOUND_ID, PARTICIPANT_LEFT_FILE));
824
  * @private
832
  * @private
825
  * @returns {void}
833
  * @returns {void}
826
  */
834
  */
827
-function _unregisterSounds({ dispatch }) {
835
+function _unregisterSounds({ dispatch }: IStore) {
828
     dispatch(unregisterSound(PARTICIPANT_JOINED_SOUND_ID));
836
     dispatch(unregisterSound(PARTICIPANT_JOINED_SOUND_ID));
829
     dispatch(unregisterSound(PARTICIPANT_LEFT_SOUND_ID));
837
     dispatch(unregisterSound(PARTICIPANT_LEFT_SOUND_ID));
830
 }
838
 }

+ 5
- 0
react/features/base/participants/types.ts Просмотреть файл

5
     connectionStatus?: string;
5
     connectionStatus?: string;
6
     displayName?: string;
6
     displayName?: string;
7
     dominantSpeaker?: boolean;
7
     dominantSpeaker?: boolean;
8
+    e2eeEnabled?: boolean;
8
     e2eeSupported?: boolean;
9
     e2eeSupported?: boolean;
9
     email?: string;
10
     email?: string;
10
     features?: {
11
     features?: {
42
     userSelectedMicDeviceId?: string;
43
     userSelectedMicDeviceId?: string;
43
     userSelectedMicDeviceLabel?: string;
44
     userSelectedMicDeviceLabel?: string;
44
 }
45
 }
46
+
47
+export interface IJitsiParticipant {
48
+    getId: () => string;
49
+}

+ 4
- 4
react/features/base/sounds/actions.ts Просмотреть файл

68
  * which was used in {@link registerSound} to register the sound).
68
  * which was used in {@link registerSound} to register the sound).
69
  * @returns {Function}
69
  * @returns {Function}
70
  */
70
  */
71
-export function playSound(soundId: string): Object {
71
+export function playSound(soundId: string) {
72
     return (dispatch: Function, getState: Function) => {
72
     return (dispatch: Function, getState: Function) => {
73
         const disabledSounds = getDisabledSounds(getState());
73
         const disabledSounds = getDisabledSounds(getState());
74
 
74
 
103
  * }}
103
  * }}
104
  */
104
  */
105
 export function registerSound(
105
 export function registerSound(
106
-        soundId: string, soundName: string, options: Object = {}): Object {
106
+        soundId: string, soundName: string, options: Object = {}) {
107
     return {
107
     return {
108
         type: REGISTER_SOUND,
108
         type: REGISTER_SOUND,
109
         soundId,
109
         soundId,
122
  *     soundId: string
122
  *     soundId: string
123
  * }}
123
  * }}
124
  */
124
  */
125
-export function stopSound(soundId: string): Object {
125
+export function stopSound(soundId: string) {
126
     return {
126
     return {
127
         type: STOP_SOUND,
127
         type: STOP_SOUND,
128
         soundId
128
         soundId
141
  *     soundId: string
141
  *     soundId: string
142
  * }}
142
  * }}
143
  */
143
  */
144
-export function unregisterSound(soundId: string): Object {
144
+export function unregisterSound(soundId: string) {
145
     return {
145
     return {
146
         type: UNREGISTER_SOUND,
146
         type: UNREGISTER_SOUND,
147
         soundId
147
         soundId

react/features/device-selection/functions.js → react/features/device-selection/functions.ts Просмотреть файл

1
-// @flow
2
-
3
-import type { Dispatch } from 'redux';
4
-
1
+import { IStore } from '../app/types';
2
+import { IStateful } from '../base/app/types';
5
 import {
3
 import {
6
     addPendingDeviceRequest,
4
     addPendingDeviceRequest,
7
-    areDeviceLabelsInitialized,
8
-    getAudioOutputDeviceId,
9
     getAvailableDevices,
5
     getAvailableDevices,
10
-    getDeviceIdByLabel,
11
-    groupDevicesByKind,
12
     setAudioInputDeviceAndUpdateSettings,
6
     setAudioInputDeviceAndUpdateSettings,
13
     setAudioOutputDevice,
7
     setAudioOutputDevice,
14
     setVideoInputDeviceAndUpdateSettings
8
     setVideoInputDeviceAndUpdateSettings
15
-} from '../base/devices';
9
+} from '../base/devices/actions';
10
+import {
11
+    areDeviceLabelsInitialized,
12
+    getAudioOutputDeviceId,
13
+    getDeviceIdByLabel,
14
+    groupDevicesByKind
15
+} from '../base/devices/functions';
16
 import { isIosMobileBrowser } from '../base/environment/utils';
16
 import { isIosMobileBrowser } from '../base/environment/utils';
17
 import JitsiMeetJS from '../base/lib-jitsi-meet';
17
 import JitsiMeetJS from '../base/lib-jitsi-meet';
18
-import { toState } from '../base/redux';
18
+import { toState } from '../base/redux/functions';
19
 import {
19
 import {
20
     getUserSelectedCameraDeviceId,
20
     getUserSelectedCameraDeviceId,
21
     getUserSelectedMicDeviceId,
21
     getUserSelectedMicDeviceId,
22
     getUserSelectedOutputDeviceId
22
     getUserSelectedOutputDeviceId
23
-} from '../base/settings';
23
+} from '../base/settings/functions.any';
24
 
24
 
25
 /**
25
 /**
26
  * Returns the properties for the device selection dialog from Redux state.
26
  * Returns the properties for the device selection dialog from Redux state.
27
  *
27
  *
28
- * @param {(Function|Object)} stateful -The (whole) redux state, or redux's
28
+ * @param {IStateful} stateful -The (whole) redux state, or redux's
29
  * {@code getState} function to be used to retrieve the state.
29
  * {@code getState} function to be used to retrieve the state.
30
  * @param {boolean} isDisplayedOnWelcomePage - Indicates whether the device selection dialog is displayed on the
30
  * @param {boolean} isDisplayedOnWelcomePage - Indicates whether the device selection dialog is displayed on the
31
  * welcome page or not.
31
  * welcome page or not.
32
  * @returns {Object} - The properties for the device selection dialog.
32
  * @returns {Object} - The properties for the device selection dialog.
33
  */
33
  */
34
-export function getDeviceSelectionDialogProps(stateful: Object | Function, isDisplayedOnWelcomePage) {
34
+export function getDeviceSelectionDialogProps(stateful: IStateful, isDisplayedOnWelcomePage: boolean) {
35
     // On mobile Safari because of https://bugs.webkit.org/show_bug.cgi?id=179363#c30, the old track is stopped
35
     // On mobile Safari because of https://bugs.webkit.org/show_bug.cgi?id=179363#c30, the old track is stopped
36
     // by the browser when a new track is created for preview. That's why we are disabling all previews.
36
     // by the browser when a new track is created for preview. That's why we are disabling all previews.
37
     const disablePreviews = isIosMobileBrowser();
37
     const disablePreviews = isIosMobileBrowser();
96
  * @returns {boolean} - True if the request has been processed and false otherwise.
96
  * @returns {boolean} - True if the request has been processed and false otherwise.
97
  */
97
  */
98
 export function processExternalDeviceRequest( // eslint-disable-line max-params
98
 export function processExternalDeviceRequest( // eslint-disable-line max-params
99
-        dispatch: Dispatch<any>,
100
-        getState: Function,
101
-        request: Object,
99
+        dispatch: IStore['dispatch'],
100
+        getState: IStore['getState'],
101
+        request: any,
102
         responseCallback: Function) {
102
         responseCallback: Function) {
103
     if (request.type !== 'devices') {
103
     if (request.type !== 'devices') {
104
         return false;
104
         return false;
119
     case 'isMultipleAudioInputSupported':
119
     case 'isMultipleAudioInputSupported':
120
         responseCallback(JitsiMeetJS.isMultipleAudioInputSupported());
120
         responseCallback(JitsiMeetJS.isMultipleAudioInputSupported());
121
         break;
121
         break;
122
-    case 'getCurrentDevices':
123
-        dispatch(getAvailableDevices()).then(devices => {
122
+    case 'getCurrentDevices': // @ts-ignore
123
+        dispatch(getAvailableDevices()).then((devices: MediaDeviceInfo[]) => {
124
             if (areDeviceLabelsInitialized(state)) {
124
             if (areDeviceLabelsInitialized(state)) {
125
-                const deviceDescriptions = {
125
+                const deviceDescriptions: any = {
126
                     audioInput: undefined,
126
                     audioInput: undefined,
127
                     audioOutput: undefined,
127
                     audioOutput: undefined,
128
                     videoInput: undefined
128
                     videoInput: undefined
164
         });
164
         });
165
 
165
 
166
         break;
166
         break;
167
-    case 'getAvailableDevices':
168
-        dispatch(getAvailableDevices()).then(devices => {
167
+    case 'getAvailableDevices': // @ts-ignore
168
+        dispatch(getAvailableDevices()).then((devices: MediaDeviceInfo[]) => {
169
             if (areDeviceLabelsInitialized(state)) {
169
             if (areDeviceLabelsInitialized(state)) {
170
                 responseCallback(groupDevicesByKind(devices));
170
                 responseCallback(groupDevicesByKind(devices));
171
             } else {
171
             } else {

+ 3
- 0
react/features/notifications/actions.ts Просмотреть файл

92
 interface INotificationProps {
92
 interface INotificationProps {
93
     appearance?: string;
93
     appearance?: string;
94
     concatText?: boolean;
94
     concatText?: boolean;
95
+    customActionHandler?: Function[];
96
+    customActionNameKey?: string[];
95
     description?: string;
97
     description?: string;
96
     descriptionKey?: string;
98
     descriptionKey?: string;
97
     icon?: string;
99
     icon?: string;
100
+    title?: string;
98
     titleArguments?: {
101
     titleArguments?: {
99
         [key: string]: string;
102
         [key: string]: string;
100
     };
103
     };

Загрузка…
Отмена
Сохранить