Browse Source

ref(TS) Convert some Abstract classes to TS (#13117)

factor2
Robert Pintilii 2 years ago
parent
commit
b942ce9378
No account linked to committer's email address

react/features/connection-indicator/components/AbstractConnectionIndicator.js → react/features/connection-indicator/components/AbstractConnectionIndicator.ts View File

1
-// @flow
2
-
3
 import { Component } from 'react';
1
 import { Component } from 'react';
4
 
2
 
3
+import { IReduxState } from '../../app/types';
5
 import { getVirtualScreenshareParticipantOwnerId } from '../../base/participants/functions';
4
 import { getVirtualScreenshareParticipantOwnerId } from '../../base/participants/functions';
6
 import statsEmitter from '../statsEmitter';
5
 import statsEmitter from '../statsEmitter';
7
 
6
 
18
 /**
17
 /**
19
  * The type of the React {@code Component} props of {@link ConnectionIndicator}.
18
  * The type of the React {@code Component} props of {@link ConnectionIndicator}.
20
  */
19
  */
21
-export type Props = {
20
+export interface IProps {
22
 
21
 
23
     /**
22
     /**
24
      * How long the connection indicator should remain displayed before hiding.
23
      * How long the connection indicator should remain displayed before hiding.
25
      */
24
      */
26
-    _autoHideTimeout: number,
25
+    _autoHideTimeout: number;
27
 
26
 
28
     /**
27
     /**
29
      * Whether or not the statistics are for screen share.
28
      * Whether or not the statistics are for screen share.
30
      */
29
      */
31
-    _isVirtualScreenshareParticipant: boolean,
30
+    _isVirtualScreenshareParticipant: boolean;
32
 
31
 
33
     /**
32
     /**
34
-     * The ID of the participant associated with the displayed connection indication and
35
-     * stats.
33
+     * Custom icon style.
36
      */
34
      */
37
-    participantId: string,
35
+    iconStyle?: Object;
38
 
36
 
39
     /**
37
     /**
40
-     * Custom icon style.
38
+     * The ID of the participant associated with the displayed connection indication and
39
+     * stats.
41
      */
40
      */
42
-    iconStyle?: Object
43
-};
41
+    participantId: string;
42
+}
44
 
43
 
45
 /**
44
 /**
46
  * The type of the React {@code Component} state of {@link ConnectionIndicator}.
45
  * The type of the React {@code Component} state of {@link ConnectionIndicator}.
47
  */
46
  */
48
-export type State = {
47
+export interface IState {
49
 
48
 
50
     /**
49
     /**
51
      * Whether or not a CSS class should be applied to the root for hiding the
50
      * Whether or not a CSS class should be applied to the root for hiding the
52
      * connection indicator. By default the indicator should start out hidden
51
      * connection indicator. By default the indicator should start out hidden
53
      * because the current connection status is not known at mount.
52
      * because the current connection status is not known at mount.
54
      */
53
      */
55
-    showIndicator: boolean,
54
+    showIndicator: boolean;
56
 
55
 
57
     /**
56
     /**
58
      * Cache of the stats received from subscribing to stats emitting. The keys
57
      * Cache of the stats received from subscribing to stats emitting. The keys
59
      * should be the name of the stat. With each stat update, updates stats are
58
      * should be the name of the stat. With each stat update, updates stats are
60
      * mixed in with cached stats and a new stats object is set in state.
59
      * mixed in with cached stats and a new stats object is set in state.
61
      */
60
      */
62
-    stats: Object
63
-};
61
+    stats: {
62
+        percent?: number;
63
+    };
64
+}
64
 
65
 
65
 /**
66
 /**
66
  * Implements a React {@link Component} which displays the current connection
67
  * Implements a React {@link Component} which displays the current connection
68
  *
69
  *
69
  * @augments {Component}
70
  * @augments {Component}
70
  */
71
  */
71
-class AbstractConnectionIndicator<P: Props, S: State> extends Component<P, S> {
72
+class AbstractConnectionIndicator<P extends IProps, S extends IState> extends Component<P, S> {
72
     /**
73
     /**
73
      * The timeout for automatically hiding the indicator.
74
      * The timeout for automatically hiding the indicator.
74
      */
75
      */
75
-    autoHideTimeout: ?TimeoutID;
76
+    autoHideTimeout: number | undefined;
76
 
77
 
77
     /**
78
     /**
78
      * Initializes a new {@code ConnectionIndicator} instance.
79
      * Initializes a new {@code ConnectionIndicator} instance.
103
      * @inheritdoc
104
      * @inheritdoc
104
      * returns {void}
105
      * returns {void}
105
      */
106
      */
106
-    componentDidUpdate(prevProps: Props) {
107
+    componentDidUpdate(prevProps: IProps) {
107
         const prevParticipantId = this._getRealParticipantId(prevProps);
108
         const prevParticipantId = this._getRealParticipantId(prevProps);
108
         const participantId = this._getRealParticipantId(this.props);
109
         const participantId = this._getRealParticipantId(this.props);
109
 
110
 
123
     componentWillUnmount() {
124
     componentWillUnmount() {
124
         statsEmitter.unsubscribeToClientStats(this._getRealParticipantId(this.props), this._onStatsUpdated);
125
         statsEmitter.unsubscribeToClientStats(this._getRealParticipantId(this.props), this._onStatsUpdated);
125
 
126
 
126
-        clearTimeout(this.autoHideTimeout);
127
+        clearTimeout(this.autoHideTimeout ?? 0);
127
     }
128
     }
128
 
129
 
129
     /**
130
     /**
132
      * @param {Props} props - The props where to extract the data from.
133
      * @param {Props} props - The props where to extract the data from.
133
      * @returns {string | undefined } The resolved participant ID.
134
      * @returns {string | undefined } The resolved participant ID.
134
      */
135
      */
135
-    _getRealParticipantId(props: Props) {
136
+    _getRealParticipantId(props: IProps) {
136
         if (props._isVirtualScreenshareParticipant) {
137
         if (props._isVirtualScreenshareParticipant) {
137
             return getVirtualScreenshareParticipantOwnerId(props.participantId);
138
             return getVirtualScreenshareParticipantOwnerId(props.participantId);
138
         }
139
         }
140
         return props.participantId;
141
         return props.participantId;
141
     }
142
     }
142
 
143
 
143
-    _onStatsUpdated: (Object) => void;
144
-
145
     /**
144
     /**
146
      * Callback invoked when new connection stats associated with the passed in
145
      * Callback invoked when new connection stats associated with the passed in
147
      * user ID are available. Will update the component's display of current
146
      * user ID are available. Will update the component's display of current
151
      * @private
150
      * @private
152
      * @returns {void}
151
      * @returns {void}
153
      */
152
      */
154
-    _onStatsUpdated(stats = {}) {
153
+    _onStatsUpdated(stats = { connectionQuality: undefined }) {
155
         // Rely on React to batch setState actions.
154
         // Rely on React to batch setState actions.
156
         const { connectionQuality } = stats;
155
         const { connectionQuality } = stats;
157
         const newPercentageState = typeof connectionQuality === 'undefined'
156
         const newPercentageState = typeof connectionQuality === 'undefined'
166
             stats: newStats
165
             stats: newStats
167
         });
166
         });
168
 
167
 
169
-        this._updateIndicatorAutoHide(newStats.percent);
168
+        this._updateIndicatorAutoHide(newStats.percent ?? 0);
170
     }
169
     }
171
 
170
 
172
     /**
171
     /**
177
      * @private
176
      * @private
178
      * @returns {void}
177
      * @returns {void}
179
      */
178
      */
180
-    _updateIndicatorAutoHide(percent) {
179
+    _updateIndicatorAutoHide(percent: number) {
181
         if (percent < INDICATOR_DISPLAY_THRESHOLD) {
180
         if (percent < INDICATOR_DISPLAY_THRESHOLD) {
182
-            clearTimeout(this.autoHideTimeout);
181
+            clearTimeout(this.autoHideTimeout ?? 0);
183
             this.autoHideTimeout = undefined;
182
             this.autoHideTimeout = undefined;
184
 
183
 
185
             this.setState({
184
             this.setState({
190
             // is needed if the percent is below the threshold and there is an
189
             // is needed if the percent is below the threshold and there is an
191
             // autoHideTimeout set.
190
             // autoHideTimeout set.
192
         } else {
191
         } else {
193
-            this.autoHideTimeout = setTimeout(() => {
192
+            this.autoHideTimeout = window.setTimeout(() => {
194
                 this.setState({
193
                 this.setState({
195
                     showIndicator: false
194
                     showIndicator: false
196
                 });
195
                 });
205
  *
204
  *
206
  * @param {Object} state - The Redux state.
205
  * @param {Object} state - The Redux state.
207
  * @private
206
  * @private
208
- * @returns {Props}
207
+ * @returns {IProps}
209
  */
208
  */
210
-export function mapStateToProps(state: Object) {
209
+export function mapStateToProps(state: IReduxState) {
211
     return {
210
     return {
212
         _autoHideTimeout: state['features/base/config'].connectionIndicators?.autoHideTimeout ?? defaultAutoHideTimeout
211
         _autoHideTimeout: state['features/base/config'].connectionIndicators?.autoHideTimeout ?? defaultAutoHideTimeout
213
     };
212
     };

+ 1
- 2
react/features/connection-indicator/components/native/ConnectionIndicator.tsx View File

24
     isTrackStreamingStatusInterrupted
24
     isTrackStreamingStatusInterrupted
25
 } from '../../functions';
25
 } from '../../functions';
26
 import AbstractConnectionIndicator, {
26
 import AbstractConnectionIndicator, {
27
-    type Props as AbstractProps,
27
+    IProps as AbstractProps,
28
     mapStateToProps as _abstractMapStateToProps
28
     mapStateToProps as _abstractMapStateToProps
29
-    // @ts-ignore
30
 } from '../AbstractConnectionIndicator';
29
 } from '../AbstractConnectionIndicator';
31
 
30
 
32
 import {
31
 import {

+ 29
- 34
react/features/connection-indicator/components/web/ConnectionIndicator.tsx View File

18
     getTrackByMediaTypeAndParticipant,
18
     getTrackByMediaTypeAndParticipant,
19
     getVirtualScreenshareParticipantTrack
19
     getVirtualScreenshareParticipantTrack
20
 } from '../../../base/tracks/functions';
20
 } from '../../../base/tracks/functions';
21
+import { ITrack } from '../../../base/tracks/types';
21
 import {
22
 import {
22
     isTrackStreamingStatusInactive,
23
     isTrackStreamingStatusInactive,
23
     isTrackStreamingStatusInterrupted
24
     isTrackStreamingStatusInterrupted
24
 } from '../../functions';
25
 } from '../../functions';
25
 import AbstractConnectionIndicator, {
26
 import AbstractConnectionIndicator, {
26
-    type Props as AbstractProps,
27
-    type State as AbstractState,
27
+    IProps as AbstractProps,
28
+    IState as AbstractState,
28
     INDICATOR_DISPLAY_THRESHOLD,
29
     INDICATOR_DISPLAY_THRESHOLD,
29
     mapStateToProps as _abstractMapStateToProps
30
     mapStateToProps as _abstractMapStateToProps
30
-
31
-    // @ts-ignore
32
 } from '../AbstractConnectionIndicator';
31
 } from '../AbstractConnectionIndicator';
33
 
32
 
34
 // @ts-ignore
33
 // @ts-ignore
77
 /**
76
 /**
78
  * The type of the React {@code Component} props of {@link ConnectionIndicator}.
77
  * The type of the React {@code Component} props of {@link ConnectionIndicator}.
79
  */
78
  */
80
-type Props = AbstractProps & WithTranslation & {
79
+interface IProps extends AbstractProps, WithTranslation {
81
 
80
 
82
     /**
81
     /**
83
      * Disable/enable inactive indicator.
82
      * Disable/enable inactive indicator.
84
      */
83
      */
85
     _connectionIndicatorInactiveDisabled: boolean;
84
     _connectionIndicatorInactiveDisabled: boolean;
86
 
85
 
86
+    /**
87
+     * Whether the connection status is inactive.
88
+     */
89
+    _isConnectionStatusInactive: boolean;
90
+
91
+    /**
92
+     * Whether the connection status is interrupted.
93
+     */
94
+    _isConnectionStatusInterrupted?: boolean;
95
+
87
     /**
96
     /**
88
      * Whether the indicator popover is disabled.
97
      * Whether the indicator popover is disabled.
89
      */
98
      */
90
     _popoverDisabled: boolean;
99
     _popoverDisabled: boolean;
91
 
100
 
101
+    /**
102
+     * The participant's video track;.
103
+     */
104
+    _videoTrack?: ITrack;
105
+
92
     /**
106
     /**
93
      * Whether or not the component should ignore setting a visibility class for
107
      * Whether or not the component should ignore setting a visibility class for
94
      * hiding the component when the connection quality is not strong.
108
      * hiding the component when the connection quality is not strong.
98
     /**
112
     /**
99
      * The audio SSRC of this client.
113
      * The audio SSRC of this client.
100
      */
114
      */
101
-    audioSsrc: number;
115
+    audioSsrc?: number;
102
 
116
 
103
     /**
117
     /**
104
      * An object containing the CSS classes.
118
      * An object containing the CSS classes.
126
      * should display.
140
      * should display.
127
      */
141
      */
128
     statsPopoverPosition: string;
142
     statsPopoverPosition: string;
129
-};
143
+}
130
 
144
 
131
 interface IState extends AbstractState {
145
 interface IState extends AbstractState {
132
 
146
 
133
     /**
147
     /**
134
-     * Whether popover is ivisible or not.
148
+     * Whether popover is visible or not.
135
      */
149
      */
136
     popoverVisible: boolean;
150
     popoverVisible: boolean;
137
 }
151
 }
188
  *
202
  *
189
  * @augments {Component}
203
  * @augments {Component}
190
  */
204
  */
191
-class ConnectionIndicator extends AbstractConnectionIndicator<Props, IState> {
205
+class ConnectionIndicator extends AbstractConnectionIndicator<IProps, IState> {
192
     /**
206
     /**
193
      * Initializes a new {@code ConnectionIndicator} instance.
207
      * Initializes a new {@code ConnectionIndicator} instance.
194
      *
208
      *
195
      * @param {Object} props - The read-only properties with which the new
209
      * @param {Object} props - The read-only properties with which the new
196
      * instance is to be initialized.
210
      * instance is to be initialized.
197
      */
211
      */
198
-    constructor(props: Props) {
212
+    constructor(props: IProps) {
199
         super(props);
213
         super(props);
200
 
214
 
201
-        // @ts-ignore
202
         this.state = {
215
         this.state = {
203
             showIndicator: false,
216
             showIndicator: false,
204
             stats: {},
217
             stats: {},
215
      * @returns {ReactElement}
228
      * @returns {ReactElement}
216
      */
229
      */
217
     render() {
230
     render() {
218
-        // @ts-ignore
219
         const { enableStatsDisplay, participantId, statsPopoverPosition, classes, t } = this.props;
231
         const { enableStatsDisplay, participantId, statsPopoverPosition, classes, t } = this.props;
220
         const visibilityClass = this._getVisibilityClass();
232
         const visibilityClass = this._getVisibilityClass();
221
 
233
 
222
-        // @ts-ignore
223
         if (this.props._popoverDisabled) {
234
         if (this.props._popoverDisabled) {
224
             return this._renderIndicator();
235
             return this._renderIndicator();
225
         }
236
         }
228
             <Popover
239
             <Popover
229
                 className = { clsx(classes.container, visibilityClass) }
240
                 className = { clsx(classes.container, visibilityClass) }
230
                 content = { <ConnectionIndicatorContent
241
                 content = { <ConnectionIndicatorContent
231
-
232
-                    // @ts-ignore
233
                     inheritedStats = { this.state.stats }
242
                     inheritedStats = { this.state.stats }
234
                     participantId = { participantId } /> }
243
                     participantId = { participantId } /> }
235
                 disablePopover = { !enableStatsDisplay }
244
                 disablePopover = { !enableStatsDisplay }
255
      */
264
      */
256
     _getConnectionColorClass() {
265
     _getConnectionColorClass() {
257
         // TODO We currently do not have logic to emit and handle stats changes for tracks.
266
         // TODO We currently do not have logic to emit and handle stats changes for tracks.
258
-        // @ts-ignore
259
         const { percent } = this.state.stats;
267
         const { percent } = this.state.stats;
260
 
268
 
261
         const {
269
         const {
262
             _isConnectionStatusInactive,
270
             _isConnectionStatusInactive,
263
             _isConnectionStatusInterrupted,
271
             _isConnectionStatusInterrupted,
264
             _connectionIndicatorInactiveDisabled
272
             _connectionIndicatorInactiveDisabled
265
-
266
-            // @ts-ignore
267
         } = this.props;
273
         } = this.props;
268
 
274
 
269
         if (_isConnectionStatusInactive) {
275
         if (_isConnectionStatusInactive) {
304
      * @returns {string}
310
      * @returns {string}
305
      */
311
      */
306
     _getVisibilityClass() {
312
     _getVisibilityClass() {
307
-        // @ts-ignore
308
         const { _isConnectionStatusInactive, _isConnectionStatusInterrupted, classes } = this.props;
313
         const { _isConnectionStatusInactive, _isConnectionStatusInterrupted, classes } = this.props;
309
 
314
 
310
-        // @ts-ignore
311
         return this.state.showIndicator
315
         return this.state.showIndicator
312
-
313
-            // @ts-ignore
314
             || this.props.alwaysVisible
316
             || this.props.alwaysVisible
315
             || _isConnectionStatusInterrupted
317
             || _isConnectionStatusInterrupted
316
             || _isConnectionStatusInactive
318
             || _isConnectionStatusInactive
324
      * @returns {void}
326
      * @returns {void}
325
      */
327
      */
326
     _onHidePopover() {
328
     _onHidePopover() {
327
-        // @ts-ignore
328
         this.setState({ popoverVisible: false });
329
         this.setState({ popoverVisible: false });
329
     }
330
     }
330
 
331
 
335
      * @returns {void}
336
      * @returns {void}
336
      */
337
      */
337
     _onShowPopover() {
338
     _onShowPopover() {
338
-        // @ts-ignore
339
         this.setState({ popoverVisible: true });
339
         this.setState({ popoverVisible: true });
340
     }
340
     }
341
 
341
 
353
             _videoTrack,
353
             _videoTrack,
354
             classes,
354
             classes,
355
             iconSize
355
             iconSize
356
-
357
-            // @ts-ignore
358
         } = this.props;
356
         } = this.props;
359
 
357
 
360
         return (
358
         return (
376
  * Maps part of the Redux state to the props of this component.
374
  * Maps part of the Redux state to the props of this component.
377
  *
375
  *
378
  * @param {Object} state - The Redux state.
376
  * @param {Object} state - The Redux state.
379
- * @param {Props} ownProps - The own props of the component.
380
- * @returns {Props}
377
+ * @param {IProps} ownProps - The own props of the component.
378
+ * @returns {IProps}
381
  */
379
  */
382
-export function _mapStateToProps(state: IReduxState, ownProps: Props) {
380
+export function _mapStateToProps(state: IReduxState, ownProps: IProps) {
383
     const { participantId } = ownProps;
381
     const { participantId } = ownProps;
384
     const tracks = state['features/base/tracks'];
382
     const tracks = state['features/base/tracks'];
385
     const participant = participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
383
     const participant = participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
397
         _connectionIndicatorInactiveDisabled:
395
         _connectionIndicatorInactiveDisabled:
398
             Boolean(state['features/base/config'].connectionIndicators?.inactiveDisabled),
396
             Boolean(state['features/base/config'].connectionIndicators?.inactiveDisabled),
399
         _isVirtualScreenshareParticipant: isScreenShareParticipant(participant),
397
         _isVirtualScreenshareParticipant: isScreenShareParticipant(participant),
400
-        _popoverDisabled: state['features/base/config'].connectionIndicators?.disableDetails,
398
+        _popoverDisabled: Boolean(state['features/base/config'].connectionIndicators?.disableDetails),
401
         _isConnectionStatusInactive,
399
         _isConnectionStatusInactive,
402
         _isConnectionStatusInterrupted,
400
         _isConnectionStatusInterrupted,
403
         _videoTrack
401
         _videoTrack
404
     };
402
     };
405
 }
403
 }
406
 
404
 
407
-export default translate(connect(_mapStateToProps)(
408
-
409
-    // @ts-ignore
410
-    withStyles(styles)(ConnectionIndicator)));
405
+export default connect(_mapStateToProps)(translate(withStyles(styles)(ConnectionIndicator)));

+ 3
- 1
react/features/dropbox/functions.native.ts View File

28
 /**
28
 /**
29
  * Gets a new access token based on the refresh token.
29
  * Gets a new access token based on the refresh token.
30
  *
30
  *
31
+ * @param {string} _appKey - The dropbox appKey.
32
+ * @param {string} _rToken - The refresh token.
31
  * @returns {Promise}
33
  * @returns {Promise}
32
  */
34
  */
33
-export function getNewAccessToken() {
35
+export function getNewAccessToken(_appKey: string, _rToken: string) {
34
     return _authorizeDropbox();
36
     return _authorizeDropbox();
35
 }
37
 }
36
 
38
 

react/features/filmstrip/components/AbstractRaisedHandIndicator.js → react/features/filmstrip/components/AbstractRaisedHandIndicator.ts View File

1
-// @flow
1
+import React, { Component } from 'react';
2
 
2
 
3
-import { Component } from 'react';
3
+import { IReduxState } from '../../app/types';
4
+import { getParticipantById, hasRaisedHand } from '../../base/participants/functions';
4
 
5
 
5
-import { getParticipantById, hasRaisedHand } from '../../base/participants';
6
-
7
-export type Props = {
6
+export interface IProps {
8
 
7
 
9
     /**
8
     /**
10
-     * The participant id who we want to render the raised hand indicator
11
-     * for.
9
+     * True if the hand is raised for this participant.
12
      */
10
      */
13
-    participantId: string,
11
+    _raisedHand?: boolean;
14
 
12
 
15
     /**
13
     /**
16
-     * True if the hand is raised for this participant.
14
+     * The participant id who we want to render the raised hand indicator
15
+     * for.
17
      */
16
      */
18
-    _raisedHand?: boolean
17
+    participantId: string;
19
 }
18
 }
20
 
19
 
21
 /**
20
 /**
22
  * Implements an abstract class for the RaisedHandIndicator component.
21
  * Implements an abstract class for the RaisedHandIndicator component.
23
  */
22
  */
24
-export default class AbstractRaisedHandIndicator<P: Props>
23
+export default class AbstractRaisedHandIndicator<P extends IProps>
25
     extends Component<P> {
24
     extends Component<P> {
26
 
25
 
27
     /**
26
     /**
42
      *
41
      *
43
      * @returns {React$Element<*>}
42
      * @returns {React$Element<*>}
44
      */
43
      */
45
-    _renderIndicator: () => React$Element<*>;
44
+    _renderIndicator: () => React.ReactElement;
46
 
45
 
47
 }
46
 }
48
 
47
 
50
  * Maps part of the Redux state to the props of this component.
49
  * Maps part of the Redux state to the props of this component.
51
  *
50
  *
52
  * @param {Object} state - The Redux state.
51
  * @param {Object} state - The Redux state.
53
- * @param {Props} ownProps - The own props of the component.
52
+ * @param {IProps} ownProps - The own props of the component.
54
  * @returns {Object}
53
  * @returns {Object}
55
  */
54
  */
56
-export function _mapStateToProps(state: Object, ownProps: Props): Object {
55
+export function _mapStateToProps(state: IReduxState, ownProps: IProps) {
57
     const participant = getParticipantById(state, ownProps.participantId);
56
     const participant = getParticipantById(state, ownProps.participantId);
58
 
57
 
59
     return {
58
     return {

+ 2
- 2
react/features/filmstrip/components/web/ThumbnailTopIndicators.tsx View File

104
     if (isVirtualScreenshareParticipant) {
104
     if (isVirtualScreenshareParticipant) {
105
         return (
105
         return (
106
             <div className = { styles.container }>
106
             <div className = { styles.container }>
107
-                {!_connectionIndicatorDisabled
107
+                {!_connectionIndicatorDisabled // @ts-ignore
108
                     && <ConnectionIndicator
108
                     && <ConnectionIndicator
109
                         alwaysVisible = { showConnectionIndicator }
109
                         alwaysVisible = { showConnectionIndicator }
110
                         enableStatsDisplay = { true }
110
                         enableStatsDisplay = { true }
124
                 iconSize = { _indicatorIconSize }
124
                 iconSize = { _indicatorIconSize }
125
                 participantId = { participantId }
125
                 participantId = { participantId }
126
                 tooltipPosition = { tooltipPosition } />
126
                 tooltipPosition = { tooltipPosition } />
127
-            {!_connectionIndicatorDisabled
127
+            {!_connectionIndicatorDisabled // @ts-ignore
128
                 && <ConnectionIndicator
128
                 && <ConnectionIndicator
129
                     alwaysVisible = { showConnectionIndicator }
129
                     alwaysVisible = { showConnectionIndicator }
130
                     enableStatsDisplay = { true }
130
                     enableStatsDisplay = { true }

react/features/overlay/components/web/AbstractPageReloadOverlay.js → react/features/overlay/components/web/AbstractPageReloadOverlay.tsx View File

1
-// @flow
2
-
1
+// @ts-ignore
3
 import { randomInt } from '@jitsi/js-utils/random';
2
 import { randomInt } from '@jitsi/js-utils/random';
4
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
5
-import type { Dispatch } from 'redux';
4
+import { WithTranslation } from 'react-i18next';
6
 
5
 
7
-import {
8
-    createPageReloadScheduledEvent,
9
-    sendAnalytics
10
-} from '../../../analytics';
11
-import { reloadNow } from '../../../app/actions';
6
+import { createPageReloadScheduledEvent } from '../../../analytics/AnalyticsEvents';
7
+import { sendAnalytics } from '../../../analytics/functions';
8
+import { reloadNow } from '../../../app/actions.web';
9
+import { IReduxState, IStore } from '../../../app/types';
12
 import {
10
 import {
13
     isFatalJitsiConferenceError,
11
     isFatalJitsiConferenceError,
14
     isFatalJitsiConnectionError
12
     isFatalJitsiConnectionError
15
-} from '../../../base/lib-jitsi-meet/functions';
13
+} from '../../../base/lib-jitsi-meet/functions.web';
16
 import logger from '../../logger';
14
 import logger from '../../logger';
17
 
15
 
16
+// @ts-ignore
18
 import ReloadButton from './ReloadButton';
17
 import ReloadButton from './ReloadButton';
19
 
18
 
20
-declare var APP: Object;
21
-
22
 /**
19
 /**
23
  * The type of the React {@code Component} props of
20
  * The type of the React {@code Component} props of
24
  * {@link AbstractPageReloadOverlay}.
21
  * {@link AbstractPageReloadOverlay}.
25
  */
22
  */
26
-export type Props = {
23
+export interface IProps extends WithTranslation {
27
 
24
 
28
     /**
25
     /**
29
      * The details is an object containing more information about the connection
26
      * The details is an object containing more information about the connection
30
      * failed (shard changes, was the computer suspended, etc.).
27
      * failed (shard changes, was the computer suspended, etc.).
31
      */
28
      */
32
-    details: Object,
29
+    details: Object;
33
 
30
 
34
-    dispatch: Dispatch<any>,
31
+    /**
32
+     * Redux dispatch function.
33
+     */
34
+    dispatch: IStore['dispatch'];
35
 
35
 
36
     /**
36
     /**
37
      * The error that caused the display of the overlay.
37
      * The error that caused the display of the overlay.
38
      */
38
      */
39
-    error: Error,
39
+    error: Error;
40
 
40
 
41
     /**
41
     /**
42
      * The indicator which determines whether the reload was caused by network
42
      * The indicator which determines whether the reload was caused by network
43
      * failure.
43
      * failure.
44
      */
44
      */
45
-    isNetworkFailure: boolean,
45
+    isNetworkFailure: boolean;
46
 
46
 
47
     /**
47
     /**
48
      * The reason for the error that will cause the reload.
48
      * The reason for the error that will cause the reload.
49
      * NOTE: Used by PageReloadOverlay only.
49
      * NOTE: Used by PageReloadOverlay only.
50
      */
50
      */
51
-    reason: string,
52
-
53
-    /**
54
-     * The function to translate human-readable text.
55
-     */
56
-    t: Function
57
-};
51
+    reason: string;
52
+}
58
 
53
 
59
 /**
54
 /**
60
  * The type of the React {@code Component} state of
55
  * The type of the React {@code Component} state of
61
  * {@link AbstractPageReloadOverlay}.
56
  * {@link AbstractPageReloadOverlay}.
62
  */
57
  */
63
-type State = {
58
+interface IState {
64
 
59
 
65
     /**
60
     /**
66
      * The translation key for the title of the overlay.
61
      * The translation key for the title of the overlay.
67
      */
62
      */
68
-    message: string,
63
+    message: string;
69
 
64
 
70
     /**
65
     /**
71
      * Current value(time) of the timer.
66
      * Current value(time) of the timer.
72
      */
67
      */
73
-    timeLeft: number,
68
+    timeLeft: number;
74
 
69
 
75
     /**
70
     /**
76
      * How long the overlay dialog will be displayed before the conference will
71
      * How long the overlay dialog will be displayed before the conference will
77
      * be reloaded.
72
      * be reloaded.
78
      */
73
      */
79
-    timeoutSeconds: number,
74
+    timeoutSeconds: number;
80
 
75
 
81
     /**
76
     /**
82
      * The translation key for the title of the overlay.
77
      * The translation key for the title of the overlay.
83
      */
78
      */
84
-    title: string
85
-};
79
+    title: string;
80
+}
86
 
81
 
87
 /**
82
 /**
88
  * Implements an abstract React {@link Component} for the page reload overlays.
83
  * Implements an abstract React {@link Component} for the page reload overlays.
89
  *
84
  *
90
  * FIXME: This is not really an abstract class as some components and functions are very web specific.
85
  * FIXME: This is not really an abstract class as some components and functions are very web specific.
91
  */
86
  */
92
-export default class AbstractPageReloadOverlay<P: Props>
93
-    extends Component<P, State> {
87
+export default class AbstractPageReloadOverlay<P extends IProps>
88
+    extends Component<P, IState> {
94
 
89
 
95
     /**
90
     /**
96
      * Determines whether this overlay needs to be rendered (according to a
91
      * Determines whether this overlay needs to be rendered (according to a
100
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
95
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
101
      * {@code false}, otherwise.
96
      * {@code false}, otherwise.
102
      */
97
      */
103
-    static needsRender(state: Object) {
98
+    static needsRender(state: IReduxState) {
104
         const { error: conferenceError } = state['features/base/conference'];
99
         const { error: conferenceError } = state['features/base/conference'];
105
         const { error: configError } = state['features/base/config'];
100
         const { error: configError } = state['features/base/config'];
106
         const { error: connectionError } = state['features/base/connection'];
101
         const { error: connectionError } = state['features/base/connection'];
115
         return jitsiConnectionError || jitsiConferenceError || configError;
110
         return jitsiConnectionError || jitsiConferenceError || configError;
116
     }
111
     }
117
 
112
 
118
-    _interval: ?IntervalID;
113
+    _interval: number | undefined;
119
 
114
 
120
     /**
115
     /**
121
      * Initializes a new AbstractPageReloadOverlay instance.
116
      * Initializes a new AbstractPageReloadOverlay instance.
164
         // because the log queue is not flushed before "fabric terminated" is
159
         // because the log queue is not flushed before "fabric terminated" is
165
         // sent to the backed.
160
         // sent to the backed.
166
         // FIXME: We should dispatch action for this.
161
         // FIXME: We should dispatch action for this.
167
-        if (typeof APP !== 'undefined') {
168
-            if (APP.conference && APP.conference._room) {
169
-                APP.conference._room.sendApplicationLog(JSON.stringify({
170
-                    name: 'page.reload',
171
-                    label: this.props.reason
172
-                }));
173
-            }
162
+        if (typeof APP !== 'undefined' && APP.conference?._room) {
163
+            APP.conference._room.sendApplicationLog(JSON.stringify({
164
+                name: 'page.reload',
165
+                label: this.props.reason
166
+            }));
174
         }
167
         }
175
 
168
 
176
         sendAnalytics(createPageReloadScheduledEvent(
169
         sendAnalytics(createPageReloadScheduledEvent(
183
                 this.state.timeoutSeconds} seconds.`);
176
                 this.state.timeoutSeconds} seconds.`);
184
 
177
 
185
         this._interval
178
         this._interval
186
-            = setInterval(
179
+            = window.setInterval(
187
                 () => {
180
                 () => {
188
                     if (this.state.timeLeft === 0) {
181
                     if (this.state.timeLeft === 0) {
189
                         if (this._interval) {
182
                         if (this._interval) {
268
  *     reason: string
261
  *     reason: string
269
  * }}
262
  * }}
270
  */
263
  */
271
-export function abstractMapStateToProps(state: Object) {
264
+export function abstractMapStateToProps(state: IReduxState) {
272
     const { error: configError } = state['features/base/config'];
265
     const { error: configError } = state['features/base/config'];
273
     const { error: connectionError } = state['features/base/connection'];
266
     const { error: connectionError } = state['features/base/connection'];
274
     const { fatalError } = state['features/overlay'];
267
     const { fatalError } = state['features/overlay'];
290
     }
283
     }
291
 
284
 
292
     return {
285
     return {
293
-        details: fatalError && fatalError.details,
286
+        details: fatalError?.details,
294
         error: fatalError,
287
         error: fatalError,
295
         isNetworkFailure:
288
         isNetworkFailure:
296
             fatalError === configError || fatalError === connectionError,
289
             fatalError === configError || fatalError === connectionError,

react/features/overlay/components/web/AbstractSuspendedOverlay.js → react/features/overlay/components/web/AbstractSuspendedOverlay.ts View File

1
-// @flow
2
-
3
 import { Component } from 'react';
1
 import { Component } from 'react';
2
+import { WithTranslation } from 'react-i18next';
3
+
4
+import { IReduxState } from '../../../app/types';
4
 
5
 
5
 /**
6
 /**
6
  * The type of the React {@code Component} props of
7
  * The type of the React {@code Component} props of
7
  * {@link AbstractSuspendedOverlay}.
8
  * {@link AbstractSuspendedOverlay}.
8
  */
9
  */
9
-type Props = {
10
-
11
-    /**
12
-     * The function to translate human-readable text.
13
-     */
14
-    t: Function
15
-};
10
+type Props = WithTranslation;
16
 
11
 
17
 /**
12
 /**
18
  * Implements a React {@link Component} for suspended overlay. Shown when a
13
  * Implements a React {@link Component} for suspended overlay. Shown when a
27
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
22
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
28
      * {@code false}, otherwise.
23
      * {@code false}, otherwise.
29
      */
24
      */
30
-    static needsRender(state: Object) {
25
+    static needsRender(state: IReduxState) {
31
         return state['features/power-monitor']?.suspendDetected;
26
         return state['features/power-monitor']?.suspendDetected;
32
     }
27
     }
33
 }
28
 }

react/features/overlay/components/web/AbstractUserMediaPermissionsOverlay.js → react/features/overlay/components/web/AbstractUserMediaPermissionsOverlay.ts View File

1
-// @flow
2
-
3
 import { Component } from 'react';
1
 import { Component } from 'react';
2
+import { WithTranslation } from 'react-i18next';
3
+
4
+import { IReduxState } from '../../../app/types';
4
 
5
 
5
 /**
6
 /**
6
  * The type of the React {@code Component} props of
7
  * The type of the React {@code Component} props of
7
  * {@link AbstractUserMediaPermissionsOverlay}.
8
  * {@link AbstractUserMediaPermissionsOverlay}.
8
  */
9
  */
9
-type Props = {
10
+interface IProps extends WithTranslation {
10
 
11
 
11
     /**
12
     /**
12
      * The browser which is used currently. The text is different for every
13
      * The browser which is used currently. The text is different for every
13
      * browser.
14
      * browser.
14
      */
15
      */
15
-    browser: string,
16
-
17
-    /**
18
-     * The function to translate human-readable text.
19
-     */
20
-    t: Function
21
-};
16
+    browser: string;
17
+}
22
 
18
 
23
 /**
19
 /**
24
  * Implements a React {@link Component} for overlay with guidance how to proceed
20
  * Implements a React {@link Component} for overlay with guidance how to proceed
25
  * with gUM prompt.
21
  * with gUM prompt.
26
  */
22
  */
27
 export default class AbstractUserMediaPermissionsOverlay
23
 export default class AbstractUserMediaPermissionsOverlay
28
-    extends Component<Props> {
24
+    extends Component<IProps> {
29
     /**
25
     /**
30
      * Determines whether this overlay needs to be rendered (according to a
26
      * Determines whether this overlay needs to be rendered (according to a
31
      * specific redux state). Called by {@link OverlayContainer}.
27
      * specific redux state). Called by {@link OverlayContainer}.
34
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
30
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
35
      * {@code false}, otherwise.
31
      * {@code false}, otherwise.
36
      */
32
      */
37
-    static needsRender(state: Object) {
33
+    static needsRender(state: IReduxState) {
38
         return state['features/overlay'].isMediaPermissionPromptVisible;
34
         return state['features/overlay'].isMediaPermissionPromptVisible;
39
     }
35
     }
40
 }
36
 }
48
  *     browser: string
44
  *     browser: string
49
  * }}
45
  * }}
50
  */
46
  */
51
-export function abstractMapStateToProps(state: Object) {
47
+export function abstractMapStateToProps(state: IReduxState) {
52
     const { browser } = state['features/overlay'];
48
     const { browser } = state['features/overlay'];
53
 
49
 
54
     return {
50
     return {

+ 5
- 1
react/features/overlay/reducer.ts View File

6
 
6
 
7
 export interface IOverlayState {
7
 export interface IOverlayState {
8
     browser?: string;
8
     browser?: string;
9
-    fatalError?: Error;
9
+    fatalError?: {
10
+        details: Object;
11
+        message?: string;
12
+        name?: string;
13
+    };
10
     isMediaPermissionPromptVisible?: boolean;
14
     isMediaPermissionPromptVisible?: boolean;
11
 }
15
 }
12
 
16
 

+ 1
- 1
react/features/recording/actions.any.ts View File

350
  * @param {boolean} onlySelf - Whether to only record the local streams.
350
  * @param {boolean} onlySelf - Whether to only record the local streams.
351
  * @returns {Object}
351
  * @returns {Object}
352
  */
352
  */
353
-export function startLocalVideoRecording(onlySelf: boolean) {
353
+export function startLocalVideoRecording(onlySelf?: boolean) {
354
     return {
354
     return {
355
         type: START_LOCAL_RECORDING,
355
         type: START_LOCAL_RECORDING,
356
         onlySelf
356
         onlySelf

react/features/recording/components/Recording/AbstractStartRecordingDialog.js → react/features/recording/components/Recording/AbstractStartRecordingDialog.ts View File

1
-// @flow
2
-
3
 import { Component } from 'react';
1
 import { Component } from 'react';
2
+import { WithTranslation } from 'react-i18next';
4
 
3
 
5
-import {
6
-    createRecordingDialogEvent,
7
-    sendAnalytics
8
-} from '../../../analytics';
4
+import { createRecordingDialogEvent } from '../../../analytics/AnalyticsEvents';
5
+import { sendAnalytics } from '../../../analytics/functions';
6
+import { IReduxState, IStore } from '../../../app/types';
7
+import { IJitsiConference } from '../../../base/conference/reducer';
9
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
8
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
10
-import {
11
-    getDropboxData,
12
-    getNewAccessToken,
13
-    isEnabled as isDropboxEnabled,
14
-    updateDropboxToken
15
-} from '../../../dropbox';
16
-import { NOTIFICATION_TIMEOUT_TYPE, showErrorNotification } from '../../../notifications';
17
-import { toggleRequestingSubtitles } from '../../../subtitles';
9
+import { updateDropboxToken } from '../../../dropbox/actions';
10
+import { getDropboxData, getNewAccessToken, isEnabled as isDropboxEnabled } from '../../../dropbox/functions.any';
11
+import { showErrorNotification } from '../../../notifications/actions';
12
+import { NOTIFICATION_TIMEOUT_TYPE } from '../../../notifications/constants';
13
+import { toggleRequestingSubtitles } from '../../../subtitles/actions';
18
 import { setSelectedRecordingService, startLocalVideoRecording } from '../../actions';
14
 import { setSelectedRecordingService, startLocalVideoRecording } from '../../actions';
19
 import { RECORDING_TYPES } from '../../constants';
15
 import { RECORDING_TYPES } from '../../constants';
20
 import { supportsLocalRecording } from '../../functions';
16
 import { supportsLocalRecording } from '../../functions';
21
 
17
 
22
-export type Props = {
18
+export interface IProps extends WithTranslation {
23
 
19
 
24
     /**
20
     /**
25
-     * Requests subtitles when recording is turned on.
21
+     * The app key for the dropbox authentication.
26
      */
22
      */
27
-    _autoCaptionOnRecord: boolean,
23
+    _appKey: string;
28
 
24
 
29
     /**
25
     /**
30
-     * The {@code JitsiConference} for the current conference.
26
+     * Requests subtitles when recording is turned on.
31
      */
27
      */
32
-    _conference: Object,
28
+    _autoCaptionOnRecord: boolean;
33
 
29
 
34
     /**
30
     /**
35
-     * The app key for the dropbox authentication.
31
+     * The {@code JitsiConference} for the current conference.
36
      */
32
      */
37
-    _appKey: string,
33
+    _conference: IJitsiConference;
38
 
34
 
39
     /**
35
     /**
40
      * Whether to show file recordings service, even if integrations
36
      * Whether to show file recordings service, even if integrations
41
      * are enabled.
37
      * are enabled.
42
      */
38
      */
43
-    _fileRecordingsServiceEnabled: boolean,
39
+    _fileRecordingsServiceEnabled: boolean;
44
 
40
 
45
     /**
41
     /**
46
      * Whether to show the possibility to share file recording with other people (e.g. Meeting participants), based on
42
      * Whether to show the possibility to share file recording with other people (e.g. Meeting participants), based on
47
      * the actual implementation on the backend.
43
      * the actual implementation on the backend.
48
      */
44
      */
49
-    _fileRecordingsServiceSharingEnabled: boolean,
45
+    _fileRecordingsServiceSharingEnabled: boolean;
50
 
46
 
51
     /**
47
     /**
52
      * If true the dropbox integration is enabled, otherwise - disabled.
48
      * If true the dropbox integration is enabled, otherwise - disabled.
53
      */
49
      */
54
-    _isDropboxEnabled: boolean,
50
+    _isDropboxEnabled: boolean;
55
 
51
 
56
     /**
52
     /**
57
      * Whether or not local recording is enabled.
53
      * Whether or not local recording is enabled.
58
      */
54
      */
59
-    _localRecordingEnabled: boolean,
55
+    _localRecordingEnabled: boolean;
60
 
56
 
61
     /**
57
     /**
62
      * The dropbox refresh token.
58
      * The dropbox refresh token.
63
      */
59
      */
64
-    _rToken: string,
60
+    _rToken: string;
65
 
61
 
66
     /**
62
     /**
67
      * Whether or not the local participant is screensharing.
63
      * Whether or not the local participant is screensharing.
68
      */
64
      */
69
-    _screensharing: boolean,
65
+    _screensharing: boolean;
70
 
66
 
71
     /**
67
     /**
72
      * Whether or not the screenshot capture feature is enabled.
68
      * Whether or not the screenshot capture feature is enabled.
73
      */
69
      */
74
-    _screenshotCaptureEnabled: boolean,
75
-
76
-    /**
77
-     * Access token's expiration date as UNIX timestamp.
78
-     */
79
-    _tokenExpireDate?: number,
70
+    _screenshotCaptureEnabled: boolean;
80
 
71
 
81
     /**
72
     /**
82
      * The dropbox access token.
73
      * The dropbox access token.
83
      */
74
      */
84
-    _token: string,
75
+    _token: string;
85
 
76
 
86
     /**
77
     /**
87
-     * The redux dispatch function.
78
+     * Access token's expiration date as UNIX timestamp.
88
      */
79
      */
89
-    dispatch: Function,
80
+    _tokenExpireDate?: number;
90
 
81
 
91
     /**
82
     /**
92
-     * Invoked to obtain translated strings.
83
+     * The redux dispatch function.
93
      */
84
      */
94
-    t: Function
85
+    dispatch: IStore['dispatch'];
95
 }
86
 }
96
 
87
 
97
-type State = {
88
+interface IState {
98
 
89
 
99
     /**
90
     /**
100
      * <tt>true</tt> if we have valid oauth token.
91
      * <tt>true</tt> if we have valid oauth token.
101
      */
92
      */
102
-    isTokenValid: boolean,
93
+    isTokenValid: boolean;
103
 
94
 
104
     /**
95
     /**
105
      * <tt>true</tt> if we are in process of validating the oauth token.
96
      * <tt>true</tt> if we are in process of validating the oauth token.
106
      */
97
      */
107
-    isValidating: boolean,
98
+    isValidating: boolean;
99
+
100
+    /**
101
+     * Whether the local recording should record just the local user streams.
102
+     */
103
+    localRecordingOnlySelf?: boolean;
108
 
104
 
109
     /**
105
     /**
110
      * The currently selected recording service of type: RECORDING_TYPES.
106
      * The currently selected recording service of type: RECORDING_TYPES.
111
      */
107
      */
112
-    selectedRecordingService: ?string,
108
+    selectedRecordingService?: string;
113
 
109
 
114
     /**
110
     /**
115
      * True if the user requested the service to share the recording with others.
111
      * True if the user requested the service to share the recording with others.
116
      */
112
      */
117
-    sharingEnabled: boolean,
113
+    sharingEnabled: boolean;
118
 
114
 
119
     /**
115
     /**
120
      * Number of MiB of available space in user's Dropbox account.
116
      * Number of MiB of available space in user's Dropbox account.
121
      */
117
      */
122
-    spaceLeft: ?number,
118
+    spaceLeft?: number;
123
 
119
 
124
     /**
120
     /**
125
      * The display name of the user's Dropbox account.
121
      * The display name of the user's Dropbox account.
126
      */
122
      */
127
-    userName: ?string
128
-};
123
+    userName?: string;
124
+}
129
 
125
 
130
 /**
126
 /**
131
  * Component for the recording start dialog.
127
  * Component for the recording start dialog.
132
  */
128
  */
133
-class AbstractStartRecordingDialog extends Component<Props, State> {
129
+class AbstractStartRecordingDialog extends Component<IProps, IState> {
134
     /**
130
     /**
135
      * Initializes a new {@code StartRecordingDialog} instance.
131
      * Initializes a new {@code StartRecordingDialog} instance.
136
      *
132
      *
137
      * @inheritdoc
133
      * @inheritdoc
138
      */
134
      */
139
-    constructor(props: Props) {
135
+    constructor(props: IProps) {
140
         super(props);
136
         super(props);
141
 
137
 
142
         // Bind event handler so it is only bound once for every instance.
138
         // Bind event handler so it is only bound once for every instance.
191
      * @inheritdoc
187
      * @inheritdoc
192
      * @returns {void}
188
      * @returns {void}
193
      */
189
      */
194
-    componentDidUpdate(prevProps: Props) {
190
+    componentDidUpdate(prevProps: IProps) {
195
         if (this.props._token !== prevProps._token) {
191
         if (this.props._token !== prevProps._token) {
196
             this._onTokenUpdated();
192
             this._onTokenUpdated();
197
         }
193
         }
198
     }
194
     }
199
 
195
 
200
-    _areIntegrationsEnabled: () => boolean;
201
-
202
     /**
196
     /**
203
      * Returns true if the integrations with third party services are enabled
197
      * Returns true if the integrations with third party services are enabled
204
      * and false otherwise.
198
      * and false otherwise.
210
         return this.props._isDropboxEnabled;
204
         return this.props._isDropboxEnabled;
211
     }
205
     }
212
 
206
 
213
-    _onSharingSettingChanged: () => void;
214
-
215
     /**
207
     /**
216
      * Callback to handle sharing setting change from the dialog.
208
      * Callback to handle sharing setting change from the dialog.
217
      *
209
      *
223
         });
215
         });
224
     }
216
     }
225
 
217
 
226
-    _onLocalRecordingSelfChange: () => void;
227
-
228
     /**
218
     /**
229
      * Callback to handle local recording only self setting change.
219
      * Callback to handle local recording only self setting change.
230
      *
220
      *
236
         });
226
         });
237
     }
227
     }
238
 
228
 
239
-    _onSelectedRecordingServiceChanged: (string) => void;
240
-
241
     /**
229
     /**
242
      * Handles selected recording service changes.
230
      * Handles selected recording service changes.
243
      *
231
      *
245
      * service.
233
      * service.
246
      * @returns {void}
234
      * @returns {void}
247
      */
235
      */
248
-    _onSelectedRecordingServiceChanged(selectedRecordingService) {
236
+    _onSelectedRecordingServiceChanged(selectedRecordingService: string) {
249
         this.setState({ selectedRecordingService }, () => {
237
         this.setState({ selectedRecordingService }, () => {
250
             this.props.dispatch(setSelectedRecordingService(selectedRecordingService));
238
             this.props.dispatch(setSelectedRecordingService(selectedRecordingService));
251
         });
239
         });
268
                 isTokenValid: false,
256
                 isTokenValid: false,
269
                 isValidating: false
257
                 isValidating: false
270
             });
258
             });
271
-        } else {
259
+        } else { // @ts-ignore
272
             if (_tokenExpireDate && Date.now() > new Date(_tokenExpireDate)) {
260
             if (_tokenExpireDate && Date.now() > new Date(_tokenExpireDate)) {
273
                 getNewAccessToken(_appKey, _rToken)
261
                 getNewAccessToken(_appKey, _rToken)
274
-                    .then(resp => dispatch(updateDropboxToken(resp.token, resp.rToken, resp.expireDate)));
262
+                    .then((resp: { expireDate: number; rToken: string; token: string; }) =>
263
+                        dispatch(updateDropboxToken(resp.token, resp.rToken, resp.expireDate)));
275
 
264
 
276
                 return;
265
                 return;
277
             }
266
             }
297
         }
286
         }
298
     }
287
     }
299
 
288
 
300
-    _onSubmit: () => boolean;
301
-
302
     /**
289
     /**
303
      * Starts a file recording session.
290
      * Starts a file recording session.
304
      *
291
      *
316
             dispatch
303
             dispatch
317
         } = this.props;
304
         } = this.props;
318
         let appData;
305
         let appData;
319
-        const attributes = {};
306
+        const attributes: {
307
+            type?: string;
308
+        } = {};
320
 
309
 
321
         switch (this.state.selectedRecordingService) {
310
         switch (this.state.selectedRecordingService) {
322
         case RECORDING_TYPES.DROPBOX: {
311
         case RECORDING_TYPES.DROPBOX: {
374
         return true;
363
         return true;
375
     }
364
     }
376
 
365
 
377
-    _toggleScreenshotCapture:() => void;
378
-
379
     /**
366
     /**
380
      * Toggles screenshot capture feature.
367
      * Toggles screenshot capture feature.
381
      *
368
      *
391
      * @protected
378
      * @protected
392
      * @returns {React$Component}
379
      * @returns {React$Component}
393
      */
380
      */
394
-    _renderDialogContent: () => React$Component<*>;
381
+    _renderDialogContent: () => React.Component;
395
 }
382
 }
396
 
383
 
397
 /**
384
 /**
412
  *     _token: string
399
  *     _token: string
413
  * }}
400
  * }}
414
  */
401
  */
415
-export function mapStateToProps(state: Object) {
402
+export function mapStateToProps(state: IReduxState) {
416
     const {
403
     const {
417
         transcription,
404
         transcription,
418
         recordingService,
405
         recordingService,
419
-        dropbox = {},
406
+        dropbox = { appKey: undefined },
420
         localRecording
407
         localRecording
421
     } = state['features/base/config'];
408
     } = state['features/base/config'];
422
 
409
 

Loading…
Cancel
Save