소스 검색

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

factor2
Robert Pintilii 3 년 전
부모
커밋
7a9f51b01b
No account linked to committer's email address

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

@@ -27,6 +27,7 @@ interface IWindow {
27 27
     clearTimeout: typeof clearTimeout;
28 28
     setImmediate: typeof setImmediate;
29 29
     clearImmediate: typeof clearImmediate;
30
+    addEventListener: Function;
30 31
 }
31 32
 
32 33
 interface INavigator {

+ 1
- 0
react/features/base/conference/reducer.ts 파일 보기

@@ -58,6 +58,7 @@ export interface IJitsiConference {
58 58
     isCallstatsEnabled: Function;
59 59
     isEndConferenceSupported: Function;
60 60
     isLobbySupported: Function;
61
+    isSIPCallingSupported: Function;
61 62
     isStartAudioMuted: Function;
62 63
     isStartVideoMuted: Function;
63 64
     join: Function;

+ 3
- 0
react/features/base/config/configType.ts 파일 보기

@@ -342,6 +342,7 @@ export interface IConfig {
342 342
     iAmRecorder?: boolean;
343 343
     iAmSipGateway?: boolean;
344 344
     inviteAppName?: string | null;
345
+    jaasActuatorUrl?: string;
345 346
     jaasFeedbackMetadataURL?: string;
346 347
     jaasTokenUrl?: string;
347 348
     lastNLimits?: {
@@ -391,6 +392,7 @@ export interface IConfig {
391 392
         hideMuteAllButton?: boolean;
392 393
     };
393 394
     pcStatsInterval?: number;
395
+    peopleSearchUrl?: string;
394 396
     preferH264?: boolean;
395 397
     preferredTranscribeLanguage?: string;
396 398
     prejoinConfig?: {
@@ -427,6 +429,7 @@ export interface IConfig {
427 429
         mode?: 'always' | 'recording';
428 430
     };
429 431
     serviceUrl?: string;
432
+    sipInviteUrl?: string;
430 433
     speakerStats?: {
431 434
         disableSearch?: boolean;
432 435
         disabled?: boolean;

react/features/external-api/middleware.js → react/features/external-api/middleware.ts 파일 보기

@@ -1,13 +1,12 @@
1
-// @flow
2
-
1
+// @ts-expect-error
3 2
 import { getJitsiMeetTransport } from '../../../modules/transport';
4 3
 import {
5 4
     CONFERENCE_FAILED,
6 5
     CONFERENCE_JOINED,
7 6
     DATA_CHANNEL_OPENED,
8 7
     KICKED_OUT
9
-} from '../base/conference';
10
-import { SET_CONFIG } from '../base/config';
8
+} from '../base/conference/actionTypes';
9
+import { SET_CONFIG } from '../base/config/actionTypes';
11 10
 import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices/actionTypes';
12 11
 import { JitsiConferenceErrors } from '../base/lib-jitsi-meet';
13 12
 import {
@@ -16,21 +15,21 @@ import {
16 15
     PARTICIPANT_KICKED,
17 16
     PARTICIPANT_LEFT,
18 17
     PARTICIPANT_ROLE_CHANGED,
19
-    SET_LOADABLE_AVATAR_URL,
18
+    SET_LOADABLE_AVATAR_URL
19
+} from '../base/participants/actionTypes';
20
+import {
20 21
     getDominantSpeakerParticipant,
21 22
     getLocalParticipant,
22 23
     getParticipantById
23
-} from '../base/participants';
24
-import { MiddlewareRegistry } from '../base/redux';
25
-import { getBaseUrl } from '../base/util';
26
-import { appendSuffix } from '../display-name';
27
-import { SUBMIT_FEEDBACK_ERROR, SUBMIT_FEEDBACK_SUCCESS } from '../feedback';
28
-import { SET_FILMSTRIP_VISIBLE } from '../filmstrip';
24
+} from '../base/participants/functions';
25
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
26
+import { getBaseUrl } from '../base/util/helpers';
27
+import { appendSuffix } from '../display-name/functions';
28
+import { SUBMIT_FEEDBACK_ERROR, SUBMIT_FEEDBACK_SUCCESS } from '../feedback/actionTypes';
29
+import { SET_FILMSTRIP_VISIBLE } from '../filmstrip/actionTypes';
29 30
 
30 31
 import './subscriber';
31 32
 
32
-declare var APP: Object;
33
-
34 33
 /**
35 34
  * The middleware of the feature {@code external-api}.
36 35
  *
@@ -103,8 +102,8 @@ MiddlewareRegistry.register(store => next => action => {
103 102
         const state = store.getState();
104 103
         const { defaultLocalDisplayName } = state['features/base/config'];
105 104
         const { room } = state['features/base/conference'];
106
-        const { loadableAvatarUrl, name, id, email } = getLocalParticipant(state);
107
-        const breakoutRoom = APP.conference.roomName.toString() !== room.toLowerCase();
105
+        const { loadableAvatarUrl, name, id, email } = getLocalParticipant(state) ?? {};
106
+        const breakoutRoom = APP.conference.roomName.toString() !== room?.toLowerCase();
108 107
 
109 108
         // we use APP.conference.roomName as we do not update state['features/base/conference'].room when
110 109
         // moving between rooms in case of breakout rooms and it stays always with the name of the main room
@@ -114,7 +113,7 @@ MiddlewareRegistry.register(store => next => action => {
114 113
             {
115 114
                 displayName: name,
116 115
                 formattedDisplayName: appendSuffix(
117
-                    name,
116
+                    name ?? '',
118 117
                     defaultLocalDisplayName
119 118
                 ),
120 119
                 avatarURL: loadableAvatarUrl,
@@ -132,7 +131,7 @@ MiddlewareRegistry.register(store => next => action => {
132 131
     case KICKED_OUT:
133 132
         APP.API.notifyKickedOut(
134 133
             {
135
-                id: getLocalParticipant(store.getState()).id,
134
+                id: getLocalParticipant(store.getState())?.id,
136 135
                 local: true
137 136
             },
138 137
             { id: action.participant ? action.participant.getId() : undefined }
@@ -142,7 +141,7 @@ MiddlewareRegistry.register(store => next => action => {
142 141
     case NOTIFY_CAMERA_ERROR:
143 142
         if (action.error) {
144 143
             APP.API.notifyOnCameraError(
145
-              action.error.name, action.error.message);
144
+                action.error.name, action.error.message);
146 145
         }
147 146
         break;
148 147
 

react/features/external-api/subscriber.js → react/features/external-api/subscriber.ts 파일 보기

@@ -1,11 +1,7 @@
1
-// @flow
2
-
3
-import { getLocalParticipant } from '../base/participants';
4
-import { StateListenerRegistry } from '../base/redux';
5
-import { appendSuffix } from '../display-name';
6
-import { shouldDisplayTileView } from '../video-layout';
7
-
8
-declare var APP: Object;
1
+import { getLocalParticipant } from '../base/participants/functions';
2
+import StateListenerRegistry from '../base/redux/StateListenerRegistry';
3
+import { appendSuffix } from '../display-name/functions';
4
+import { shouldDisplayTileView } from '../video-layout/functions';
9 5
 
10 6
 /**
11 7
  * StateListenerRegistry provides a reliable way of detecting changes to

react/features/jaas/actions.any.js → react/features/jaas/actions.any.ts 파일 보기

@@ -1,4 +1,4 @@
1
-// @flow
1
+import { IStore } from '../app/types';
2 2
 
3 3
 import { SET_DETAILS } from './actionTypes';
4 4
 import { getVpaasTenant, sendGetDetailsRequest } from './functions';
@@ -10,7 +10,7 @@ import logger from './logger';
10 10
  * @param {Object} details - The customer details object.
11 11
  * @returns {Object}
12 12
  */
13
-function setCustomerDetails(details) {
13
+function setCustomerDetails(details: Object) {
14 14
     return {
15 15
         type: SET_DETAILS,
16 16
         payload: details
@@ -23,7 +23,7 @@ function setCustomerDetails(details) {
23 23
  * @returns {Function}
24 24
  */
25 25
 export function getCustomerDetails() {
26
-    return async function(dispatch: Function, getState: Function) {
26
+    return async function(dispatch: IStore['dispatch'], getState: IStore['getState']) {
27 27
         const state = getState();
28 28
         const baseUrl = state['features/base/config'].jaasActuatorUrl || 'https://api-vo-pilot.jitsi.net/jaas-actuator';
29 29
         const appId = getVpaasTenant(state);

react/features/jaas/actions.native.js → react/features/jaas/actions.native.ts 파일 보기


react/features/jaas/actions.web.js → react/features/jaas/actions.web.ts 파일 보기

@@ -1,8 +1,7 @@
1
-// @flow
1
+import { IStore } from '../app/types';
2
+import { openDialog } from '../base/dialog/actions';
2 3
 
3
-import { openDialog } from '../base/dialog';
4
-
5
-import { PremiumFeatureDialog } from './components';
4
+import PremiumFeatureDialog from './components/web/PremiumFeatureDialog';
6 5
 import { isFeatureDisabled } from './functions';
7 6
 
8 7
 /**
@@ -13,7 +12,7 @@ import { isFeatureDisabled } from './functions';
13 12
  * @returns {Function}
14 13
  */
15 14
 export function maybeShowPremiumFeatureDialog(feature: string) {
16
-    return function(dispatch: Function, getState: Function) {
15
+    return function(dispatch: IStore['dispatch'], getState: IStore['getState']) {
17 16
         if (isFeatureDisabled(getState(), feature)) {
18 17
             dispatch(openDialog(PremiumFeatureDialog));
19 18
 

react/features/jaas/middleware.any.js → react/features/jaas/middleware.any.ts 파일 보기

@@ -1,6 +1,8 @@
1
-import { createVpaasConferenceJoinedEvent, sendAnalytics } from '../analytics';
1
+import { createVpaasConferenceJoinedEvent } from '../analytics/AnalyticsEvents';
2
+import { sendAnalytics } from '../analytics/functions';
3
+import { IReduxState } from '../app/types';
2 4
 import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
3
-import { MiddlewareRegistry } from '../base/redux';
5
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
4 6
 
5 7
 import { getVpaasTenant, isVpaasMeeting } from './functions';
6 8
 
@@ -29,7 +31,7 @@ MiddlewareRegistry.register(store => next => async action => {
29 31
  * @param {Store} state - The app state.
30 32
  * @returns {Function}
31 33
  */
32
-function _maybeTrackVpaasConferenceJoin(state) {
34
+function _maybeTrackVpaasConferenceJoin(state: IReduxState) {
33 35
     if (isVpaasMeeting(state)) {
34 36
         sendAnalytics(createVpaasConferenceJoinedEvent(
35 37
             getVpaasTenant(state)));

react/features/jaas/middleware.native.js → react/features/jaas/middleware.native.ts 파일 보기


react/features/jaas/middleware.web.js → react/features/jaas/middleware.web.ts 파일 보기

@@ -1,10 +1,10 @@
1
-import { redirectToStaticPage } from '../app/actions';
1
+import { redirectToStaticPage } from '../app/actions.web';
2 2
 import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
3 3
 import {
4 4
     JitsiConferenceErrors,
5 5
     JitsiConferenceEvents
6 6
 } from '../base/lib-jitsi-meet';
7
-import { MiddlewareRegistry } from '../base/redux';
7
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
8 8
 
9 9
 import { SET_DETAILS } from './actionTypes';
10 10
 import { STATUSES } from './constants';
@@ -27,7 +27,7 @@ MiddlewareRegistry.register(store => next => async action => {
27 27
         }
28 28
 
29 29
         conference.on(
30
-            JitsiConferenceEvents.CONFERENCE_ERROR, (errorType, errorMsg) => {
30
+            JitsiConferenceEvents.CONFERENCE_ERROR, (errorType: string, errorMsg: string) => {
31 31
                 errorType === JitsiConferenceErrors.SETTINGS_ERROR && logger.error(errorMsg);
32 32
             });
33 33
         break;

react/features/recording/actions.any.js → react/features/recording/actions.any.ts 파일 보기

@@ -1,17 +1,17 @@
1
-// @flow
2
-
3
-import { getMeetingRegion, getRecordingSharingUrl } from '../base/config';
1
+import { IStore } from '../app/types';
2
+import { getMeetingRegion, getRecordingSharingUrl } from '../base/config/functions';
4 3
 import JitsiMeetJS, { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
5
-import { getLocalParticipant, getParticipantDisplayName } from '../base/participants';
4
+import { getLocalParticipant, getParticipantDisplayName } from '../base/participants/functions';
6 5
 import { copyText } from '../base/util/copyText';
7 6
 import { getVpaasTenant, isVpaasMeeting } from '../jaas/functions';
8 7
 import {
9
-    NOTIFICATION_TIMEOUT_TYPE,
10 8
     hideNotification,
11 9
     showErrorNotification,
12 10
     showNotification,
13 11
     showWarningNotification
14
-} from '../notifications';
12
+} from '../notifications/actions';
13
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
14
+import { INotificationProps } from '../notifications/types';
15 15
 
16 16
 import {
17 17
     CLEAR_RECORDING_SESSIONS,
@@ -31,8 +31,6 @@ import {
31 31
 } from './functions';
32 32
 import logger from './logger';
33 33
 
34
-declare var APP: Object;
35
-
36 34
 /**
37 35
  * Clears the data of every recording sessions.
38 36
  *
@@ -70,7 +68,7 @@ export function setHighlightMomentButtonState(disabled: boolean) {
70 68
  * @returns {Function}
71 69
  */
72 70
 export function hidePendingRecordingNotification(streamType: string) {
73
-    return (dispatch: Function, getState: Function) => {
71
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
74 72
         const { pendingNotificationUids } = getState()['features/recording'];
75 73
         const pendingNotificationUid = pendingNotificationUids[streamType];
76 74
 
@@ -108,7 +106,7 @@ export function setLiveStreamKey(streamKey: string) {
108 106
  * @returns {Function}
109 107
  */
110 108
 export function showPendingRecordingNotification(streamType: string) {
111
-    return async (dispatch: Function) => {
109
+    return async (dispatch: IStore['dispatch']) => {
112 110
         const isLiveStreaming
113 111
             = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
114 112
         const dialogProps = isLiveStreaming ? {
@@ -209,13 +207,13 @@ export function showStoppedRecordingNotification(streamType: string, participant
209 207
  */
210 208
 export function showStartedRecordingNotification(
211 209
         mode: string,
212
-        initiator: Object | string,
210
+        initiator: { getId: Function; } | string,
213 211
         sessionId: string) {
214 212
     return async (dispatch: Function, getState: Function) => {
215 213
         const state = getState();
216 214
         const initiatorId = getResourceId(initiator);
217 215
         const participantName = getParticipantDisplayName(state, initiatorId);
218
-        let dialogProps = {
216
+        let dialogProps: INotificationProps = {
219 217
             descriptionKey: participantName ? 'liveStreaming.onBy' : 'liveStreaming.on',
220 218
             descriptionArguments: { name: participantName },
221 219
             titleKey: 'dialog.liveStreaming'
@@ -223,7 +221,7 @@ export function showStartedRecordingNotification(
223 221
 
224 222
         if (mode !== JitsiMeetJS.constants.recording.mode.STREAM) {
225 223
             const recordingSharingUrl = getRecordingSharingUrl(state);
226
-            const iAmRecordingInitiator = getLocalParticipant(state).id === initiatorId;
224
+            const iAmRecordingInitiator = getLocalParticipant(state)?.id === initiatorId;
227 225
 
228 226
             dialogProps = {
229 227
                 customActionHandler: undefined,
@@ -278,7 +276,7 @@ export function showStartedRecordingNotification(
278 276
  *     sessionData: Object
279 277
  * }}
280 278
  */
281
-export function updateRecordingSessionData(session: Object) {
279
+export function updateRecordingSessionData(session: any) {
282 280
     const status = session.getStatus();
283 281
     const timestamp
284 282
         = status === JitsiRecordingConstants.status.ON
@@ -327,7 +325,7 @@ export function setSelectedRecordingService(selectedRecordingService: string) {
327 325
  *     uid: number
328 326
  * }}
329 327
  */
330
-function _setPendingRecordingNotificationUid(uid: ?number, streamType: string) {
328
+function _setPendingRecordingNotificationUid(uid: string | undefined, streamType: string) {
331 329
     return {
332 330
         type: SET_PENDING_RECORDING_NOTIFICATION_UID,
333 331
         streamType,
@@ -341,7 +339,7 @@ function _setPendingRecordingNotificationUid(uid: ?number, streamType: string) {
341 339
  * @param {boolean} onlySelf - Whether to only record the local streams.
342 340
  * @returns {Object}
343 341
  */
344
-export function startLocalVideoRecording(onlySelf) {
342
+export function startLocalVideoRecording(onlySelf: boolean) {
345 343
     return {
346 344
         type: START_LOCAL_RECORDING,
347 345
         onlySelf

react/features/recording/actions.native.js → react/features/recording/actions.native.ts 파일 보기

@@ -1,7 +1,10 @@
1
-import { openSheet } from '../base/dialog';
1
+import { IStore } from '../app/types';
2
+import { openSheet } from '../base/dialog/actions';
2 3
 import JitsiMeetJS from '../base/lib-jitsi-meet';
3
-import { NOTIFICATION_TIMEOUT_TYPE, showNotification } from '../notifications';
4
+import { showNotification } from '../notifications/actions';
5
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
4 6
 
7
+// @ts-ignore
5 8
 import HighlightDialog from './components/Recording/native/HighlightDialog';
6 9
 
7 10
 export * from './actions.any';
@@ -12,7 +15,7 @@ export * from './actions.any';
12 15
  * @returns {Function}
13 16
  */
14 17
 export function openHighlightDialog() {
15
-    return (dispatch: Function) => {
18
+    return (dispatch: IStore['dispatch']) => {
16 19
         dispatch(openSheet(HighlightDialog));
17 20
     };
18 21
 }
@@ -26,7 +29,7 @@ export function openHighlightDialog() {
26 29
  * @returns {showNotification}
27 30
  */
28 31
 export function showRecordingLimitNotification(streamType: string) {
29
-    return (dispatch: Function, getState: Function) => {
32
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
30 33
         const isLiveStreaming = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
31 34
         let descriptionKey, titleKey;
32 35
 

react/features/recording/actions.web.js → react/features/recording/actions.web.tsx 파일 보기

@@ -1,10 +1,10 @@
1
-// @flow
2
-
3 1
 import React from 'react';
4 2
 
5 3
 import JitsiMeetJS from '../base/lib-jitsi-meet';
6
-import { NOTIFICATION_TIMEOUT_TYPE, showNotification } from '../notifications';
4
+import { showNotification } from '../notifications/actions';
5
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
7 6
 
7
+// @ts-ignore
8 8
 import { RecordingLimitNotificationDescription } from './components';
9 9
 
10 10
 export * from './actions.any';

react/features/recording/components/Recording/AbstractStopRecordingDialog.js → react/features/recording/components/Recording/AbstractStopRecordingDialog.ts 파일 보기

@@ -1,13 +1,11 @@
1
-// @flow
2
-
3 1
 import { Component } from 'react';
4 2
 
5
-import {
6
-    createRecordingDialogEvent,
7
-    sendAnalytics
8
-} from '../../../analytics';
3
+import { createRecordingDialogEvent } from '../../../analytics/AnalyticsEvents';
4
+import { sendAnalytics } from '../../../analytics/functions';
5
+import { IReduxState } from '../../../app/types';
6
+import { IJitsiConference } from '../../../base/conference/reducer';
9 7
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
10
-import { setVideoMuted } from '../../../base/media';
8
+import { setVideoMuted } from '../../../base/media/actions';
11 9
 import { stopLocalVideoRecording } from '../../actions';
12 10
 import { getActiveSession } from '../../functions';
13 11
 
@@ -17,38 +15,38 @@ import LocalRecordingManager from './LocalRecordingManager';
17 15
  * The type of the React {@code Component} props of
18 16
  * {@link AbstractStopRecordingDialog}.
19 17
  */
20
-export type Props = {
18
+export interface IProps {
21 19
 
22 20
     /**
23 21
      * The {@code JitsiConference} for the current conference.
24 22
      */
25
-    _conference: Object,
23
+    _conference: IJitsiConference;
26 24
 
27 25
     /**
28 26
      * The redux representation of the recording session to be stopped.
29 27
      */
30
-    _fileRecordingSession: Object,
28
+    _fileRecordingSession: Object;
31 29
 
32 30
     /**
33 31
      * Whether the recording is a local recording or not.
34 32
      */
35
-    _localRecording: boolean,
33
+    _localRecording: boolean;
36 34
 
37 35
     /**
38 36
      * The redux dispatch function.
39 37
      */
40
-    dispatch: Function,
38
+    dispatch: Function;
41 39
 
42 40
     /**
43 41
      * The user trying to stop the video while local recording is running.
44 42
      */
45
-    localRecordingVideoStop?: boolean,
43
+    localRecordingVideoStop?: boolean;
46 44
 
47 45
     /**
48 46
      * Invoked to obtain translated strings.
49 47
      */
50
-    t: Function
51
-};
48
+    t: Function;
49
+}
52 50
 
53 51
 /**
54 52
  * Abstract React Component for getting confirmation to stop a file recording
@@ -56,7 +54,7 @@ export type Props = {
56 54
  *
57 55
  * @augments Component
58 56
  */
59
-export default class AbstractStopRecordingDialog<P: Props>
57
+export default class AbstractStopRecordingDialog<P extends IProps>
60 58
     extends Component<P> {
61 59
     /**
62 60
      * Initializes a new {@code AbstrStopRecordingDialog} instance.
@@ -71,8 +69,6 @@ export default class AbstractStopRecordingDialog<P: Props>
71 69
         this._toggleScreenshotCapture = this._toggleScreenshotCapture.bind(this);
72 70
     }
73 71
 
74
-    _onSubmit: () => boolean;
75
-
76 72
     /**
77 73
      * Stops the recording session.
78 74
      *
@@ -90,7 +86,7 @@ export default class AbstractStopRecordingDialog<P: Props>
90 86
         } else {
91 87
             const { _fileRecordingSession } = this.props;
92 88
 
93
-            if (_fileRecordingSession) {
89
+            if (_fileRecordingSession) { // @ts-ignore
94 90
                 this.props._conference.stopRecording(_fileRecordingSession.id);
95 91
                 this._toggleScreenshotCapture();
96 92
             }
@@ -99,8 +95,6 @@ export default class AbstractStopRecordingDialog<P: Props>
99 95
         return true;
100 96
     }
101 97
 
102
-    _toggleScreenshotCapture: () => void;
103
-
104 98
     /**
105 99
      * Toggles screenshot capture feature.
106 100
      *
@@ -122,7 +116,7 @@ export default class AbstractStopRecordingDialog<P: Props>
122 116
  *     _fileRecordingSession: Object
123 117
  * }}
124 118
  */
125
-export function _mapStateToProps(state: Object) {
119
+export function _mapStateToProps(state: IReduxState) {
126 120
     return {
127 121
         _conference: state['features/base/conference'].conference,
128 122
         _fileRecordingSession:

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

@@ -3,11 +3,20 @@ import { IStore } from '../../../app/types';
3 3
 interface ILocalRecordingManager {
4 4
     addAudioTrackToLocalRecording: (track: any) => void;
5 5
     isRecordingLocally: () => boolean;
6
-    startLocalRecording: (store: IStore) => void;
6
+    selfRecording: {
7
+        on: boolean;
8
+        withVideo: boolean;
9
+    };
10
+    startLocalRecording: (store: IStore, onlySelf: boolean) => void;
7 11
     stopLocalRecording: () => void;
8 12
 }
9 13
 
10 14
 const LocalRecordingManager: ILocalRecordingManager = {
15
+    selfRecording: {
16
+        on: false,
17
+        withVideo: false
18
+    },
19
+
11 20
     /**
12 21
      * Adds audio track to the recording stream.
13 22
      *

react/features/recording/functions.js → react/features/recording/functions.ts 파일 보기

@@ -1,11 +1,14 @@
1
-// @flow
2
-
1
+import { IReduxState } from '../app/types';
3 2
 import { isMobileBrowser } from '../base/environment/utils';
4 3
 import { isJwtFeatureEnabled } from '../base/jwt/functions';
5 4
 import { JitsiRecordingConstants, browser } from '../base/lib-jitsi-meet';
6
-import { getLocalParticipant, getRemoteParticipants, isLocalParticipantModerator } from '../base/participants';
5
+import {
6
+    getLocalParticipant,
7
+    getRemoteParticipants,
8
+    isLocalParticipantModerator
9
+} from '../base/participants/functions';
7 10
 import { isInBreakoutRoom } from '../breakout-rooms/functions';
8
-import { isEnabled as isDropboxEnabled } from '../dropbox';
11
+import { isEnabled as isDropboxEnabled } from '../dropbox/functions';
9 12
 import { extractFqnFromPath } from '../dynamic-branding/functions.any';
10 13
 
11 14
 import LocalRecordingManager from './components/Recording/LocalRecordingManager';
@@ -20,7 +23,7 @@ import logger from './logger';
20 23
  * @param {string} mode - Find an active recording session of the given mode.
21 24
  * @returns {Object|undefined}
22 25
  */
23
-export function getActiveSession(state: Object, mode: string) {
26
+export function getActiveSession(state: IReduxState, mode: string) {
24 27
     const { sessionDatas } = state['features/recording'];
25 28
     const { status: statusConstants } = JitsiRecordingConstants;
26 29
 
@@ -37,7 +40,7 @@ export function getActiveSession(state: Object, mode: string) {
37 40
  * @param {number} size - The size in MB of the recorded video.
38 41
  * @returns {number} - The estimated duration in minutes.
39 42
  */
40
-export function getRecordingDurationEstimation(size: ?number) {
43
+export function getRecordingDurationEstimation(size?: number | null) {
41 44
     return Math.floor((size || 0) / 10);
42 45
 }
43 46
 
@@ -49,7 +52,7 @@ export function getRecordingDurationEstimation(size: ?number) {
49 52
  * @param {string} id - The ID of the recording session to find.
50 53
  * @returns {Object|undefined}
51 54
  */
52
-export function getSessionById(state: Object, id: string) {
55
+export function getSessionById(state: IReduxState, id: string) {
53 56
     return state['features/recording'].sessionDatas.find(
54 57
         sessionData => sessionData.id === id);
55 58
 }
@@ -81,7 +84,7 @@ export async function getRecordingLink(url: string, recordingSessionId: string,
81 84
  * @param {Object} state - The redux state to search in.
82 85
  * @returns {string}
83 86
  */
84
-export function isSavingRecordingOnDropbox(state: Object) {
87
+export function isSavingRecordingOnDropbox(state: IReduxState) {
85 88
     return isDropboxEnabled(state)
86 89
         && state['features/recording'].selectedRecordingService === RECORDING_TYPES.DROPBOX;
87 90
 }
@@ -92,7 +95,7 @@ export function isSavingRecordingOnDropbox(state: Object) {
92 95
  * @param {Object} state - The redux state to search in.
93 96
  * @returns {string}
94 97
  */
95
-export function isHighlightMeetingMomentDisabled(state: Object) {
98
+export function isHighlightMeetingMomentDisabled(state: IReduxState) {
96 99
     return state['features/recording'].disableHighlightMeetingMoment;
97 100
 }
98 101
 
@@ -105,7 +108,7 @@ export function isHighlightMeetingMomentDisabled(state: Object) {
105 108
  * @param {string} mode - The recording mode to get status for.
106 109
  * @returns {string|undefined}
107 110
  */
108
-export function getSessionStatusToShow(state: Object, mode: string): ?string {
111
+export function getSessionStatusToShow(state: IReduxState, mode: string): string | undefined {
109 112
     const recordingSessions = state['features/recording'].sessionDatas;
110 113
     let status;
111 114
 
@@ -149,7 +152,7 @@ export function supportsLocalRecording() {
149 152
  *    visible: boolean
150 153
  * }}
151 154
  */
152
-export function getRecordButtonProps(state: Object): ?string {
155
+export function getRecordButtonProps(state: IReduxState) {
153 156
     let visible;
154 157
 
155 158
     // a button can be disabled/enabled if enableFeaturesBasedOnToken
@@ -197,7 +200,7 @@ export function getRecordButtonProps(state: Object): ?string {
197 200
  * @param {Object | string} recorder - A participant or it's resource.
198 201
  * @returns {string|undefined}
199 202
  */
200
-export function getResourceId(recorder: string | Object) {
203
+export function getResourceId(recorder: string | { getId: Function; }) {
201 204
     if (recorder) {
202 205
         return typeof recorder === 'string'
203 206
             ? recorder
@@ -211,12 +214,12 @@ export function getResourceId(recorder: string | Object) {
211 214
  * @param  {Object} state - Redux state.
212 215
  * @returns {boolean} - True if sent, false otherwise.
213 216
  */
214
-export async function sendMeetingHighlight(state: Object) {
217
+export async function sendMeetingHighlight(state: IReduxState) {
215 218
     const { webhookProxyUrl: url } = state['features/base/config'];
216 219
     const { conference } = state['features/base/conference'];
217 220
     const { jwt } = state['features/base/jwt'];
218 221
     const { connection } = state['features/base/connection'];
219
-    const jid = connection.getJid();
222
+    const jid = connection?.getJid();
220 223
     const localParticipant = getLocalParticipant(state);
221 224
 
222 225
     const headers = {
@@ -226,10 +229,10 @@ export async function sendMeetingHighlight(state: Object) {
226 229
 
227 230
     const reqBody = {
228 231
         meetingFqn: extractFqnFromPath(state),
229
-        sessionId: conference.getMeetingUniqueId(),
232
+        sessionId: conference?.getMeetingUniqueId(),
230 233
         submitted: Date.now(),
231
-        participantId: localParticipant.jwtId,
232
-        participantName: localParticipant.name,
234
+        participantId: localParticipant?.jwtId,
235
+        participantName: localParticipant?.name,
233 236
         participantJid: jid
234 237
     };
235 238
 
@@ -259,7 +262,7 @@ export async function sendMeetingHighlight(state: Object) {
259 262
  * @param {Object} state - Redux state.
260 263
  * @returns {boolean}
261 264
  */
262
-function isRemoteParticipantRecordingLocally(state) {
265
+function isRemoteParticipantRecordingLocally(state: IReduxState) {
263 266
     const participants = getRemoteParticipants(state);
264 267
 
265 268
     // eslint-disable-next-line prefer-const

react/features/recording/logger.js → react/features/recording/logger.ts 파일 보기

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

react/features/recording/middleware.js → react/features/recording/middleware.ts 파일 보기

@@ -1,27 +1,27 @@
1
-/* @flow */
2
-
3
-
4
-import {
5
-    createRecordingEvent,
6
-    sendAnalytics
7
-} from '../analytics';
8
-import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
9
-import { CONFERENCE_JOIN_IN_PROGRESS, getCurrentConference } from '../base/conference';
1
+import { createRecordingEvent } from '../analytics/AnalyticsEvents';
2
+import { sendAnalytics } from '../analytics/functions';
3
+import { IStore } from '../app/types';
4
+import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app/actionTypes';
5
+import { CONFERENCE_JOIN_IN_PROGRESS } from '../base/conference/actionTypes';
6
+import { getCurrentConference } from '../base/conference/functions';
10 7
 import JitsiMeetJS, {
11 8
     JitsiConferenceEvents,
12 9
     JitsiRecordingConstants
13 10
 } from '../base/lib-jitsi-meet';
14
-import { MEDIA_TYPE } from '../base/media';
15
-import { getParticipantDisplayName, updateLocalRecordingStatus } from '../base/participants';
16
-import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
11
+import { MEDIA_TYPE } from '../base/media/constants';
12
+import { updateLocalRecordingStatus } from '../base/participants/actions';
13
+import { getParticipantDisplayName } from '../base/participants/functions';
14
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
15
+import StateListenerRegistry from '../base/redux/StateListenerRegistry';
17 16
 import {
18 17
     playSound,
19 18
     registerSound,
20 19
     stopSound,
21 20
     unregisterSound
22
-} from '../base/sounds';
23
-import { TRACK_ADDED } from '../base/tracks';
24
-import { NOTIFICATION_TIMEOUT_TYPE, showErrorNotification, showNotification } from '../notifications';
21
+} from '../base/sounds/actions';
22
+import { TRACK_ADDED } from '../base/tracks/actionTypes';
23
+import { showErrorNotification, showNotification } from '../notifications/actions';
24
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
25 25
 
26 26
 import { RECORDING_SESSION_UPDATED, START_LOCAL_RECORDING, STOP_LOCAL_RECORDING } from './actionTypes';
27 27
 import {
@@ -54,9 +54,6 @@ import {
54 54
     RECORDING_ON_SOUND_FILE
55 55
 } from './sounds';
56 56
 
57
-declare var APP: Object;
58
-declare var interfaceConfig: Object;
59
-
60 57
 /**
61 58
  * StateListenerRegistry provides a reliable way to detect the leaving of a
62 59
  * conference, where we need to clean up the recording sessions.
@@ -119,7 +116,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
119 116
 
120 117
         conference.on(
121 118
             JitsiConferenceEvents.RECORDER_STATE_CHANGED,
122
-            recorderSession => {
119
+            (recorderSession: any) => {
123 120
                 if (recorderSession) {
124 121
                     recorderSession.getID() && dispatch(updateRecordingSessionData(recorderSession));
125 122
                     recorderSession.getError() && _showRecordingErrorNotification(recorderSession, dispatch);
@@ -156,7 +153,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
156 153
             if (typeof APP !== 'undefined') {
157 154
                 APP.API.notifyRecordingStatusChanged(true, 'local');
158 155
             }
159
-        } catch (err) {
156
+        } catch (err: any) {
160 157
             logger.error('Capture failed', err);
161 158
 
162 159
             let descriptionKey = 'recording.error';
@@ -213,16 +210,16 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
213 210
 
214 211
         const updatedSessionData
215 212
             = getSessionById(getState(), action.sessionData.id);
216
-        const { initiator, mode, terminator } = updatedSessionData;
213
+        const { initiator, mode = '', terminator } = updatedSessionData ?? {};
217 214
         const { PENDING, OFF, ON } = JitsiRecordingConstants.status;
218 215
 
219
-        if (updatedSessionData.status === PENDING
216
+        if (updatedSessionData?.status === PENDING
220 217
             && (!oldSessionData || oldSessionData.status !== PENDING)) {
221 218
             dispatch(showPendingRecordingNotification(mode));
222
-        } else if (updatedSessionData.status !== PENDING) {
219
+        } else if (updatedSessionData?.status !== PENDING) {
223 220
             dispatch(hidePendingRecordingNotification(mode));
224 221
 
225
-            if (updatedSessionData.status === ON) {
222
+            if (updatedSessionData?.status === ON) {
226 223
 
227 224
                 // We receive 2 updates of the session status ON. The first one is from jibri when it joins.
228 225
                 // The second one is from jicofo which will deliever the initiator value. Since the start
@@ -256,7 +253,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
256 253
                         APP.API.notifyRecordingStatusChanged(true, mode);
257 254
                     }
258 255
                 }
259
-            } else if (updatedSessionData.status === OFF
256
+            } else if (updatedSessionData?.status === OFF
260 257
                 && (!oldSessionData || oldSessionData.status !== OFF)) {
261 258
                 if (terminator) {
262 259
                     dispatch(
@@ -266,7 +263,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
266 263
 
267 264
                 let duration = 0, soundOff, soundOn;
268 265
 
269
-                if (oldSessionData && oldSessionData.timestamp) {
266
+                if (oldSessionData?.timestamp) {
270 267
                     duration
271 268
                         = (Date.now() / 1000) - oldSessionData.timestamp;
272 269
                 }
@@ -319,7 +316,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
319 316
  * @param {Dispatch} dispatch - The Redux Dispatch function.
320 317
  * @returns {void}
321 318
  */
322
-function _showRecordingErrorNotification(recorderSession, dispatch) {
319
+function _showRecordingErrorNotification(recorderSession: any, dispatch: IStore['dispatch']) {
323 320
     const mode = recorderSession.getMode();
324 321
     const error = recorderSession.getError();
325 322
     const isStreamMode = mode === JitsiMeetJS.constants.recording.mode.STREAM;

+ 3
- 3
react/features/recording/reducer.ts 파일 보기

@@ -19,18 +19,18 @@ const DEFAULT_STATE = {
19 19
 interface ISessionData {
20 20
     error?: Error;
21 21
     id?: string;
22
-    initiator?: Object;
22
+    initiator?: { getId: Function; };
23 23
     liveStreamViewURL?: string;
24 24
     mode?: string;
25 25
     status?: string;
26
-    terminator?: Object;
26
+    terminator?: { getId: Function; };
27 27
     timestamp?: number;
28 28
 }
29 29
 
30 30
 export interface IRecordingState {
31 31
     disableHighlightMeetingMoment: boolean;
32 32
     pendingNotificationUids: {
33
-        [key: string]: number | undefined;
33
+        [key: string]: string | undefined;
34 34
     };
35 35
     selectedRecordingService: string;
36 36
     sessionDatas: Array<ISessionData>;

react/features/recording/sounds.js → react/features/recording/sounds.ts 파일 보기


+ 1
- 1
react/features/welcome/constants.tsx 파일 보기

@@ -3,7 +3,7 @@
3 3
 import React from 'react';
4 4
 
5 5
 import { IconCalendar, IconGear, IconRestore } from '../base/icons/svg';
6
-import BaseTheme from '../base/ui/components/BaseTheme.native';
6
+import BaseTheme from '../base/ui/components/BaseTheme';
7 7
 
8 8
 // @ts-ignore
9 9
 import TabIcon from './components/TabIcon';

+ 1
- 0
webpack.config.js 파일 보기

@@ -217,6 +217,7 @@ function getConfig(options = {}) {
217 217
             extensions: [
218 218
                 '.web.js',
219 219
                 '.web.ts',
220
+                '.web.tsx',
220 221
 
221 222
                 // Typescript:
222 223
                 '.tsx',

Loading…
취소
저장