Explorar el Código

ref: move all prop type declaration to flow

For the most part the changes are taking the "static propTypes" declaration off
of components and declaring them as Flow types. Sometimes to support flow some
method signatures had to be added. There are some exceptions in which more had
to be done to tame the beast:
- AbstractVideoTrack: put in additional truthy checks for videoTrack.
- Video: add truthy checks for the _videoElement ref.
- shouldRenderVideoTrack function: Some component could pass null for the
  videoTrack argument and Flow wanted that called out explicitly.
- DisplayName: Add a truthy check for the input ref before acting on it.
- NumbersList: Move array checks inline for Flow to comprehend array methods
  could be called. Add type checks in the Object.entries loop as the value is
  assumed to be a mixed type by Flow.
- AbstractToolbarButton: add additional truthy check for passed in type.
efficient_tiling
Leonard Kim hace 6 años
padre
commit
486e8e35d9
Se han modificado 77 ficheros con 2731 adiciones y 2372 borrados
  1. 15
    17
      react/features/audio-level-indicator/components/AudioLevelIndicator.js
  2. 73
    50
      react/features/authentication/components/LoginDialog.native.js
  3. 22
    22
      react/features/base/dialog/components/DialogContainer.js
  4. 58
    34
      react/features/base/media/components/AbstractVideoTrack.js
  5. 46
    49
      react/features/base/media/components/native/Video.js
  6. 4
    8
      react/features/base/media/components/native/VideoTrack.js
  7. 42
    34
      react/features/base/media/components/web/Video.js
  8. 24
    24
      react/features/base/media/components/web/VideoTrack.js
  9. 1
    1
      react/features/base/media/functions.js
  10. 63
    53
      react/features/base/popover/components/Popover.web.js
  11. 0
    1
      react/features/base/react/components/AbstractContainer.js
  12. 28
    26
      react/features/base/react/components/native/Link.js
  13. 0
    7
      react/features/base/react/components/web/Container.js
  14. 14
    16
      react/features/base/react/components/web/InlineDialogFailure.js
  15. 111
    93
      react/features/base/react/components/web/MultiSelectAutocomplete.js
  16. 55
    17
      react/features/base/react/components/web/Watermarks.js
  17. 8
    15
      react/features/base/responsive-ui/components/AspectRatioAware.js
  18. 116
    92
      react/features/connection-indicator/components/ConnectionIndicator.js
  19. 109
    108
      react/features/connection-stats/components/ConnectionStatsTable.js
  20. 33
    23
      react/features/deep-linking/components/DeepLinkingMobilePage.web.js
  21. 52
    29
      react/features/desktop-picker/components/DesktopPicker.js
  22. 30
    31
      react/features/desktop-picker/components/DesktopPickerPane.js
  23. 44
    39
      react/features/desktop-picker/components/DesktopSourcePreview.js
  24. 27
    14
      react/features/device-selection/components/AudioInputPreview.js
  25. 26
    20
      react/features/device-selection/components/AudioOutputPreview.js
  26. 51
    49
      react/features/device-selection/components/DeviceSelector.web.js
  27. 20
    20
      react/features/device-selection/components/VideoInputPreview.js
  28. 71
    53
      react/features/display-name/components/DisplayName.web.js
  29. 41
    31
      react/features/display-name/components/DisplayNamePrompt.web.js
  30. 81
    51
      react/features/feedback/components/FeedbackDialog.web.js
  31. 14
    14
      react/features/filmstrip/components/web/AudioMutedIndicator.js
  32. 46
    46
      react/features/filmstrip/components/web/BaseIndicator.js
  33. 20
    21
      react/features/filmstrip/components/web/DominantSpeakerIndicator.js
  34. 14
    14
      react/features/filmstrip/components/web/ModeratorIndicator.js
  35. 18
    20
      react/features/filmstrip/components/web/RaisedHandIndicator.js
  36. 14
    14
      react/features/filmstrip/components/web/VideoMutedIndicator.js
  37. 72
    64
      react/features/invite/components/AddPeopleDialog.web.js
  38. 19
    19
      react/features/invite/components/dial-in-info-page/NoRoomError.web.js
  39. 19
    19
      react/features/invite/components/dial-in-summary/ConferenceID.web.js
  40. 68
    44
      react/features/invite/components/dial-in-summary/DialInSummary.web.js
  41. 44
    43
      react/features/invite/components/dial-in-summary/NumbersList.web.js
  42. 25
    25
      react/features/invite/components/info-dialog/DialInNumber.web.js
  43. 106
    73
      react/features/invite/components/info-dialog/InfoDialog.web.js
  44. 51
    43
      react/features/invite/components/info-dialog/PasswordForm.web.js
  45. 1
    1
      react/features/invite/functions.js
  46. 20
    19
      react/features/keyboard-shortcuts/components/KeyboardShortcutsDialog.web.js
  47. 13
    16
      react/features/mobile/network-activity/components/NetworkActivityIndicator.js
  48. 56
    72
      react/features/overlay/components/AbstractPageReloadOverlay.js
  49. 15
    17
      react/features/overlay/components/AbstractSuspendedOverlay.js
  50. 22
    26
      react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js
  51. 28
    37
      react/features/overlay/components/FilmstripOnlyOverlayFrame.js
  52. 31
    21
      react/features/overlay/components/OverlayFrame.web.js
  53. 19
    28
      react/features/overlay/components/ReloadButton.js
  54. 41
    41
      react/features/presence-status/components/PresenceLabel.js
  55. 49
    36
      react/features/recording/components/LiveStream/StreamKeyPicker.web.js
  56. 29
    34
      react/features/remote-control/components/RemoteControlAuthorizationDialog.js
  57. 32
    30
      react/features/remote-video-menu/components/KickButton.js
  58. 38
    36
      react/features/remote-video-menu/components/MuteButton.js
  59. 31
    26
      react/features/remote-video-menu/components/MuteRemoteParticipantDialog.web.js
  60. 33
    31
      react/features/remote-video-menu/components/RemoteControlButton.js
  61. 20
    20
      react/features/remote-video-menu/components/RemoteVideoMenu.js
  62. 32
    32
      react/features/remote-video-menu/components/RemoteVideoMenuButton.js
  63. 36
    28
      react/features/remote-video-menu/components/VolumeSlider.js
  64. 13
    20
      react/features/room-lock/components/PasswordRequiredPrompt.native.js
  65. 36
    18
      react/features/room-lock/components/PasswordRequiredPrompt.web.js
  66. 16
    16
      react/features/room-lock/components/RoomLockPrompt.native.js
  67. 31
    23
      react/features/speaker-stats/components/SpeakerStats.js
  68. 26
    26
      react/features/speaker-stats/components/SpeakerStatsItem.js
  69. 14
    14
      react/features/speaker-stats/components/SpeakerStatsLabels.js
  70. 19
    19
      react/features/speaker-stats/components/TimeElapsed.js
  71. 52
    46
      react/features/toolbox/components/AbstractToolbarButton.js
  72. 34
    30
      react/features/toolbox/components/web/OverflowMenuButton.js
  73. 30
    27
      react/features/toolbox/components/web/OverflowMenuProfileItem.js
  74. 22
    22
      react/features/toolbox/components/web/ToolbarButton.js
  75. 13
    17
      react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js
  76. 49
    37
      react/features/video-quality/components/VideoQualitySlider.web.js
  77. 35
    20
      react/features/welcome/components/LocalVideoTrackUnderlay.native.js

+ 15
- 17
react/features/audio-level-indicator/components/AudioLevelIndicator.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 /**
@@ -14,26 +15,23 @@ const AUDIO_LEVEL_DOTS = 5;
14 15
 const CENTER_DOT_INDEX = Math.floor(AUDIO_LEVEL_DOTS / 2);
15 16
 
16 17
 /**
17
- * Creates a ReactElement responsible for drawing audio levels.
18
- *
19
- * @extends {Component}
18
+ * The type of the React {@code Component} props of {@link AudioLevelIndicator}.
20 19
  */
21
-class AudioLevelIndicator extends Component {
20
+type Props = {
21
+
22 22
     /**
23
-     * {@code AudioLevelIndicator}'s property types.
24
-     *
25
-     * @static
23
+     * The current audio level to display. The value should be a number between
24
+     * 0 and 1.
26 25
      */
27
-    static propTypes = {
28
-        /**
29
-         * The current audio level to display. The value should be a number
30
-         * between 0 and 1.
31
-         *
32
-         * @type {number}
33
-         */
34
-        audioLevel: PropTypes.number
35
-    };
26
+    audioLevel: number
27
+};
36 28
 
29
+/**
30
+ * Creates a ReactElement responsible for drawing audio levels.
31
+ *
32
+ * @extends {Component}
33
+ */
34
+class AudioLevelIndicator extends Component<Props> {
37 35
     /**
38 36
      * Implements React's {@link Component#render()}.
39 37
      *

+ 73
- 50
react/features/authentication/components/LoginDialog.native.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { Text, TextInput, View } from 'react-native';
4 5
 import { connect as reduxConnect } from 'react-redux';
@@ -11,6 +12,65 @@ import { JitsiConnectionErrors } from '../../base/lib-jitsi-meet';
11 12
 import { authenticateAndUpgradeRole, cancelLogin } from '../actions';
12 13
 import styles from './styles';
13 14
 
15
+/**
16
+ * The type of the React {@link Component} props of {@link LoginDialog}.
17
+ */
18
+type Props = {
19
+
20
+    /**
21
+     * {@link JitsiConference} that needs authentication - will hold a valid
22
+     * value in XMPP login + guest access mode.
23
+     */
24
+    _conference: Object,
25
+
26
+    /**
27
+     * The server hosts specified in the global config.
28
+     */
29
+    _configHosts: Object,
30
+
31
+    /**
32
+     * Indicates if the dialog should display "connecting" status message.
33
+     */
34
+    _connecting: boolean,
35
+
36
+    /**
37
+     * The error which occurred during login/authentication.
38
+     */
39
+    _error: Object,
40
+
41
+    /**
42
+     * The progress in the floating range between 0 and 1 of the authenticating
43
+     * and upgrading the role of the local participant/user.
44
+     */
45
+    _progress: number,
46
+
47
+    /**
48
+     * Redux store dispatch method.
49
+     */
50
+    dispatch: Dispatch<*>,
51
+
52
+    /**
53
+     * Invoked to obtain translated strings.
54
+     */
55
+    t: Function
56
+};
57
+
58
+/**
59
+ * The type of the React {@link Component} state of {@link LoginDialog}.
60
+ */
61
+type State = {
62
+
63
+    /**
64
+     * The user entered password for the conference.
65
+     */
66
+    password: string,
67
+
68
+    /**
69
+     * The user entered local participant name.
70
+     */
71
+    username: string
72
+};
73
+
14 74
 /**
15 75
  * Dialog asks user for username and password.
16 76
  *
@@ -38,58 +98,14 @@ import styles from './styles';
38 98
  * See {@link https://github.com/jitsi/jicofo#secure-domain} for a description
39 99
  * of the configuration parameters.
40 100
  */
41
-class LoginDialog extends Component {
42
-    /**
43
-     * LoginDialog component's property types.
44
-     *
45
-     * @static
46
-     */
47
-    static propTypes = {
48
-        /**
49
-         * {@link JitsiConference} that needs authentication - will hold a valid
50
-         * value in XMPP login + guest access mode.
51
-         */
52
-        _conference: PropTypes.object,
53
-
54
-        /**
55
-         *
56
-         */
57
-        _configHosts: PropTypes.object,
58
-
59
-        /**
60
-         * Indicates if the dialog should display "connecting" status message.
61
-         */
62
-        _connecting: PropTypes.bool,
63
-
64
-        /**
65
-         * The error which occurred during login/authentication.
66
-         */
67
-        _error: PropTypes.object,
68
-
69
-        /**
70
-         * The progress in the floating range between 0 and 1 of the
71
-         * authenticating and upgrading the role of the local participant/user.
72
-         */
73
-        _progress: PropTypes.number,
74
-
75
-        /**
76
-         * Redux store dispatch method.
77
-         */
78
-        dispatch: PropTypes.func,
79
-
80
-        /**
81
-         * Invoked to obtain translated strings.
82
-         */
83
-        t: PropTypes.func
84
-    };
85
-
101
+class LoginDialog extends Component<Props, State> {
86 102
     /**
87 103
      * Initializes a new LoginDialog instance.
88 104
      *
89 105
      * @param {Object} props - The read-only properties with which the new
90 106
      * instance is to be initialized.
91 107
      */
92
-    constructor(props) {
108
+    constructor(props: Props) {
93 109
         super(props);
94 110
 
95 111
         this.state = {
@@ -119,7 +135,7 @@ class LoginDialog extends Component {
119 135
         } = this.props;
120 136
 
121 137
         let messageKey;
122
-        let messageOptions;
138
+        const messageOptions = {};
123 139
 
124 140
         if (progress && progress < 1) {
125 141
             messageKey = 'connection.FETCH_SESSION_ID';
@@ -142,7 +158,6 @@ class LoginDialog extends Component {
142 158
                 }
143 159
             } else if (name) {
144 160
                 messageKey = 'dialog.connectErrorWithMsg';
145
-                messageOptions || (messageOptions = {});
146 161
                 messageOptions.msg = `${name} ${error.message}`;
147 162
             }
148 163
         }
@@ -170,7 +185,7 @@ class LoginDialog extends Component {
170 185
                     <Text style = { styles.dialogText }>
171 186
                         {
172 187
                             messageKey
173
-                                ? t(messageKey, messageOptions || {})
188
+                                ? t(messageKey, messageOptions)
174 189
                                 : connecting
175 190
                                     ? t('connection.CONNECTING')
176 191
                                     : ''
@@ -181,6 +196,8 @@ class LoginDialog extends Component {
181 196
         );
182 197
     }
183 198
 
199
+    _onUsernameChange: (string) => void;
200
+
184 201
     /**
185 202
      * Called when user edits the username.
186 203
      *
@@ -194,6 +211,8 @@ class LoginDialog extends Component {
194 211
         });
195 212
     }
196 213
 
214
+    _onPasswordChange: (string) => void;
215
+
197 216
     /**
198 217
      * Called when user edits the password.
199 218
      *
@@ -207,6 +226,8 @@ class LoginDialog extends Component {
207 226
         });
208 227
     }
209 228
 
229
+    _onCancel: () => void;
230
+
210 231
     /**
211 232
      * Notifies this LoginDialog that it has been dismissed by cancel.
212 233
      *
@@ -217,6 +238,8 @@ class LoginDialog extends Component {
217 238
         this.props.dispatch(cancelLogin());
218 239
     }
219 240
 
241
+    _onLogin: () => void;
242
+
220 243
     /**
221 244
      * Notifies this LoginDialog that the login button (OK) has been pressed by
222 245
      * the user.

+ 22
- 22
react/features/base/dialog/components/DialogContainer.js Ver fichero

@@ -1,35 +1,35 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
5 6
 /**
6
- * Implements a DialogContainer responsible for showing all dialogs. We will
7
- * need a separate container so we can handle multiple dialogs by showing them
8
- * simultaneously or queuing them.
7
+ * The type of the React {@code Component} props of {@link DialogContainer}.
9 8
  */
10
-export class DialogContainer extends Component {
9
+type Props = {
10
+
11 11
     /**
12
-     * DialogContainer component's property types.
13
-     *
14
-     * @static
12
+     * The component to render.
15 13
      */
16
-    static propTypes = {
17
-        /**
18
-         * The component to render.
19
-         */
20
-        _component: PropTypes.func,
14
+    _component: Function,
21 15
 
22
-        /**
23
-         * The props to pass to the component that will be rendered.
24
-         */
25
-        _componentProps: PropTypes.object,
16
+    /**
17
+     * The props to pass to the component that will be rendered.
18
+     */
19
+    _componentProps: Object,
26 20
 
27
-        /**
28
-         * True if the UI is in a compact state where we don't show dialogs.
29
-         */
30
-        _reducedUI: PropTypes.bool
31
-    };
21
+    /**
22
+     * True if the UI is in a compact state where we don't show dialogs.
23
+     */
24
+    _reducedUI: boolean
25
+};
32 26
 
27
+/**
28
+ * Implements a DialogContainer responsible for showing all dialogs. We will
29
+ * need a separate container so we can handle multiple dialogs by showing them
30
+ * simultaneously or queuing them.
31
+ */
32
+export class DialogContainer extends Component<Props> {
33 33
     /**
34 34
      * Implements React's {@link Component#render()}.
35 35
      *

+ 58
- 34
react/features/base/media/components/AbstractVideoTrack.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { trackVideoStarted } from '../../tracks';
@@ -7,50 +8,70 @@ import { shouldRenderVideoTrack } from '../functions';
7 8
 import { Video } from './_';
8 9
 
9 10
 /**
10
- * Implements a React {@link Component} that renders video element for a
11
- * specific video track.
12
- *
13
- * @abstract
11
+ * The type of the React {@code Component} props of {@link AbstractVideoTrack}.
14 12
  */
15
-export default class AbstractVideoTrack extends Component {
13
+export type Props = {
14
+
16 15
     /**
17
-     * AbstractVideoTrack component's property types.
18
-     *
19
-     * @static
16
+     * The Redux dispatch function.
20 17
      */
21
-    static propTypes = {
22
-        dispatch: PropTypes.func,
18
+    dispatch: Dispatch<*>,
23 19
 
24
-        /**
25
-         * Callback to invoke when the {@link Video} of
26
-         * {@code AbstractVideoTrack} is clicked/pressed.
27
-         */
28
-        onPress: PropTypes.func,
20
+    /**
21
+     * Callback to invoke when the {@link Video} of {@code AbstractVideoTrack}
22
+     * is clicked/pressed.
23
+     */
24
+    onPress?: Function,
25
+
26
+    /**
27
+     * The Redux representation of the participant's video track.
28
+     */
29
+    videoTrack?: Object,
30
+
31
+    /**
32
+     * Whether or not video should be rendered after knowing video playback has
33
+     * started.
34
+     */
35
+    waitForVideoStarted?: boolean,
29 36
 
30
-        videoTrack: PropTypes.object,
37
+    /**
38
+     * The z-order of the Video of AbstractVideoTrack in the stacking space of
39
+     * all Videos. For more details, refer to the zOrder property of the Video
40
+     * class for React Native.
41
+     */
42
+    zOrder?: number,
31 43
 
32
-        waitForVideoStarted: PropTypes.bool,
44
+    /**
45
+     * Indicates whether zooming (pinch to zoom and/or drag) is enabled.
46
+     */
47
+    zoomEnabled?: boolean
48
+};
33 49
 
34
-        /**
35
-         * The z-order of the Video of AbstractVideoTrack in the stacking space
36
-         * of all Videos. For more details, refer to the zOrder property of the
37
-         * Video class for React Native.
38
-         */
39
-        zOrder: PropTypes.number,
50
+/**
51
+ * The type of the React {@code Component} state of {@link AbstractVideoTrack}.
52
+ */
53
+type State = {
40 54
 
41
-        /**
42
-         * Indicates whether zooming (pinch to zoom and/or drag) is enabled.
43
-         */
44
-        zoomEnabled: PropTypes.bool
45
-    };
55
+    /**
56
+     * The Redux representation of the participant's video track.
57
+     */
58
+    videoTrack: Object | null
59
+};
46 60
 
61
+/**
62
+ * Implements a React {@link Component} that renders video element for a
63
+ * specific video track.
64
+ *
65
+ * @abstract
66
+ */
67
+export default class AbstractVideoTrack<P: Props> extends Component<P, State> {
47 68
     /**
48 69
      * Initializes a new AbstractVideoTrack instance.
49 70
      *
50 71
      * @param {Object} props - The read-only properties with which the new
51 72
      * instance is to be initialized.
52 73
      */
53
-    constructor(props) {
74
+    constructor(props: P) {
54 75
         super(props);
55 76
 
56 77
         this.state = {
@@ -69,7 +90,7 @@ export default class AbstractVideoTrack extends Component {
69 90
      * receive.
70 91
      * @returns {void}
71 92
      */
72
-    componentWillReceiveProps(nextProps) {
93
+    componentWillReceiveProps(nextProps: P) {
73 94
         const oldValue = this.state.videoTrack;
74 95
         const newValue = _falsy2null(nextProps.videoTrack);
75 96
 
@@ -88,7 +109,7 @@ export default class AbstractVideoTrack extends Component {
88 109
         const { videoTrack } = this.state;
89 110
         let render;
90 111
 
91
-        if (this.props.waitForVideoStarted) {
112
+        if (this.props.waitForVideoStarted && videoTrack) {
92 113
             // That's the complex case: we have to wait for onPlaying before we
93 114
             // render videoTrack. The complexity comes from the fact that
94 115
             // onPlaying will come after we render videoTrack.
@@ -110,14 +131,15 @@ export default class AbstractVideoTrack extends Component {
110 131
             render = shouldRenderVideoTrack(videoTrack, false);
111 132
         }
112 133
 
113
-        const stream
114
-            = render ? videoTrack.jitsiTrack.getOriginalStream() : null;
134
+        const stream = render && videoTrack
135
+            ? videoTrack.jitsiTrack.getOriginalStream() : null;
115 136
 
116 137
         // Actual zoom is currently only enabled if the stream is a desktop
117 138
         // stream.
118 139
         const zoomEnabled
119 140
             = this.props.zoomEnabled
120 141
                 && stream
142
+                && videoTrack
121 143
                 && videoTrack.videoType === 'desktop';
122 144
 
123 145
         return (
@@ -131,6 +153,8 @@ export default class AbstractVideoTrack extends Component {
131 153
         );
132 154
     }
133 155
 
156
+    _onVideoPlaying: () => void;
157
+
134 158
     /**
135 159
      * Handler for case when video starts to play.
136 160
      *

+ 46
- 49
react/features/base/media/components/native/Video.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { RTCView } from 'react-native-webrtc';
6 5
 
@@ -10,59 +9,57 @@ import styles from './styles';
10 9
 import VideoTransform from './VideoTransform';
11 10
 
12 11
 /**
13
- * The React Native {@link Component} which is similar to Web's
14
- * {@code HTMLVideoElement} and wraps around react-native-webrtc's
15
- * {@link RTCView}.
12
+ * The type of the React {@code Component} props of {@link Video}.
16 13
  */
17
-export default class Video extends Component<*> {
14
+type Props = {
15
+    mirror: boolean,
16
+
17
+    onPlaying: Function,
18
+
19
+    /**
20
+     * Callback to invoke when the {@code Video} is clicked/pressed.
21
+     */
22
+    onPress: Function,
23
+
24
+    stream: Object,
25
+
18 26
     /**
19
-     * {@code Video} component's property types.
27
+     * Similarly to the CSS property z-index, specifies the z-order of this
28
+     * Video in the stacking space of all Videos. When Videos overlap,
29
+     * zOrder determines which one covers the other. A Video with a larger
30
+     * zOrder generally covers a Video with a lower one.
20 31
      *
21
-     * @static
32
+     * Non-overlapping Videos may safely share a z-order (because one does
33
+     * not have to cover the other).
34
+     *
35
+     * The support for zOrder is platform-dependent and/or
36
+     * implementation-specific. Thus, specifying a value for zOrder is to be
37
+     * thought of as giving a hint rather than as imposing a requirement.
38
+     * For example, video renderers such as Video are commonly implemented
39
+     * using OpenGL and OpenGL views may have different numbers of layers in
40
+     * their stacking space. Android has three: a layer bellow the window
41
+     * (aka default), a layer bellow the window again but above the previous
42
+     * layer (aka media overlay), and above the window. Consequently, it is
43
+     * advisable to limit the number of utilized layers in the stacking
44
+     * space to the minimum sufficient for the desired display. For example,
45
+     * a video call application usually needs a maximum of two zOrder
46
+     * values: 0 for the remote video(s) which appear in the background, and
47
+     * 1 for the local video(s) which appear above the remote video(s).
22 48
      */
23
-    static propTypes = {
24
-        mirror: PropTypes.bool,
25
-
26
-        onPlaying: PropTypes.func,
27
-
28
-        /**
29
-         * Callback to invoke when the {@code Video} is clicked/pressed.
30
-         */
31
-        onPress: PropTypes.func,
32
-
33
-        stream: PropTypes.object,
34
-
35
-        /**
36
-         * Similarly to the CSS property z-index, specifies the z-order of this
37
-         * Video in the stacking space of all Videos. When Videos overlap,
38
-         * zOrder determines which one covers the other. A Video with a larger
39
-         * zOrder generally covers a Video with a lower one.
40
-         *
41
-         * Non-overlapping Videos may safely share a z-order (because one does
42
-         * not have to cover the other).
43
-         *
44
-         * The support for zOrder is platform-dependent and/or
45
-         * implementation-specific. Thus, specifying a value for zOrder is to be
46
-         * thought of as giving a hint rather than as imposing a requirement.
47
-         * For example, video renderers such as Video are commonly implemented
48
-         * using OpenGL and OpenGL views may have different numbers of layers in
49
-         * their stacking space. Android has three: a layer bellow the window
50
-         * (aka default), a layer bellow the window again but above the previous
51
-         * layer (aka media overlay), and above the window. Consequently, it is
52
-         * advisable to limit the number of utilized layers in the stacking
53
-         * space to the minimum sufficient for the desired display. For example,
54
-         * a video call application usually needs a maximum of two zOrder
55
-         * values: 0 for the remote video(s) which appear in the background, and
56
-         * 1 for the local video(s) which appear above the remote video(s).
57
-         */
58
-        zOrder: PropTypes.number,
59
-
60
-        /**
61
-         * Indicates whether zooming (pinch to zoom and/or drag) is enabled.
62
-         */
63
-        zoomEnabled: PropTypes.bool
64
-    };
49
+    zOrder: number,
65 50
 
51
+    /**
52
+     * Indicates whether zooming (pinch to zoom and/or drag) is enabled.
53
+     */
54
+    zoomEnabled: boolean
55
+};
56
+
57
+/**
58
+ * The React Native {@link Component} which is similar to Web's
59
+ * {@code HTMLVideoElement} and wraps around react-native-webrtc's
60
+ * {@link RTCView}.
61
+ */
62
+export default class Video extends Component<Props> {
66 63
     /**
67 64
      * React Component method that executes once component is mounted.
68 65
      *

+ 4
- 8
react/features/base/media/components/native/VideoTrack.js Ver fichero

@@ -1,8 +1,11 @@
1
+/* @flow */
2
+
1 3
 import React from 'react';
2 4
 import { View } from 'react-native';
3 5
 import { connect } from 'react-redux';
4 6
 
5 7
 import AbstractVideoTrack from '../AbstractVideoTrack';
8
+import type { Props } from '../AbstractVideoTrack';
6 9
 import styles from './styles';
7 10
 
8 11
 /**
@@ -10,14 +13,7 @@ import styles from './styles';
10 13
  *
11 14
  * @extends AbstractVideoTrack
12 15
  */
13
-class VideoTrack extends AbstractVideoTrack {
14
-    /**
15
-     * VideoTrack component's property types.
16
-     *
17
-     * @static
18
-     */
19
-    static propTypes = AbstractVideoTrack.propTypes
20
-
16
+class VideoTrack extends AbstractVideoTrack<Props> {
21 17
     /**
22 18
      * Renders the video element for the associated video track.
23 19
      *

+ 42
- 34
react/features/base/media/components/web/Video.js Ver fichero

@@ -1,12 +1,42 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
5
+/**
6
+ * The type of the React {@code Component} props of {@link Video}.
7
+ */
8
+type Props = {
9
+
10
+    /**
11
+     * CSS classes to add to the video element.
12
+     */
13
+    className: string,
14
+
15
+    /**
16
+     * The value of the id attribute of the video. Used by the torture tests to
17
+     * locate video elements.
18
+     */
19
+    id: string,
20
+
21
+    /**
22
+     * Optional callback to invoke once the video starts playing.
23
+     */
24
+    onVideoPlaying: Function,
25
+
26
+    /**
27
+     * The JitsiLocalTrack to display.
28
+     */
29
+    videoTrack: ?Object
30
+};
31
+
4 32
 /**
5 33
  * Component that renders a video element for a passed in video track.
6 34
  *
7 35
  * @extends Component
8 36
  */
9
-class Video extends Component {
37
+class Video extends Component<Props> {
38
+    _videoElement: ?Object;
39
+
10 40
     /**
11 41
      * Default values for {@code Video} component's properties.
12 42
      *
@@ -18,41 +48,13 @@ class Video extends Component {
18 48
         id: ''
19 49
     };
20 50
 
21
-    /**
22
-     * {@code Video} component's property types.
23
-     *
24
-     * @static
25
-     */
26
-    static propTypes = {
27
-        /**
28
-         * CSS classes to add to the video element.
29
-         */
30
-        className: PropTypes.string,
31
-
32
-        /**
33
-         * The value of the id attribute of the video. Used by the torture tests
34
-         * to locate video elements.
35
-         */
36
-        id: PropTypes.string,
37
-
38
-        /**
39
-         * Optional callback to invoke once the video starts playing.
40
-         */
41
-        onVideoPlaying: PropTypes.func,
42
-
43
-        /**
44
-         * The JitsiLocalTrack to display.
45
-         */
46
-        videoTrack: PropTypes.object
47
-    };
48
-
49 51
     /**
50 52
      * Initializes a new {@code Video} instance.
51 53
      *
52 54
      * @param {Object} props - The read-only properties with which the new
53 55
      * instance is to be initialized.
54 56
      */
55
-    constructor(props) {
57
+    constructor(props: Props) {
56 58
         super(props);
57 59
 
58 60
         /**
@@ -78,8 +80,10 @@ class Video extends Component {
78 80
      * @returns {void}
79 81
      */
80 82
     componentDidMount() {
81
-        this._videoElement.volume = 0;
82
-        this._videoElement.onplaying = this._onVideoPlaying;
83
+        if (this._videoElement) {
84
+            this._videoElement.volume = 0;
85
+            this._videoElement.onplaying = this._onVideoPlaying;
86
+        }
83 87
 
84 88
         this._attachTrack(this.props.videoTrack);
85 89
     }
@@ -104,7 +108,7 @@ class Video extends Component {
104 108
      * @returns {boolean} - False is always returned to blackbox this component.
105 109
      * from React.
106 110
      */
107
-    shouldComponentUpdate(nextProps) {
111
+    shouldComponentUpdate(nextProps: Props) {
108 112
         const currentJitsiTrack = this.props.videoTrack
109 113
             && this.props.videoTrack.jitsiTrack;
110 114
         const nextJitsiTrack = nextProps.videoTrack
@@ -167,6 +171,8 @@ class Video extends Component {
167 171
         }
168 172
     }
169 173
 
174
+    _onVideoPlaying: () => void;
175
+
170 176
     /**
171 177
      * Invokes the onvideoplaying callback if defined.
172 178
      *
@@ -179,6 +185,8 @@ class Video extends Component {
179 185
         }
180 186
     }
181 187
 
188
+    _setVideoElement: () => void;
189
+
182 190
     /**
183 191
      * Sets an instance variable for the component's video element so it can be
184 192
      * referenced later for attaching and detaching a JitsiLocalTrack.

+ 24
- 24
react/features/base/media/components/web/VideoTrack.js Ver fichero

@@ -1,51 +1,49 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
5 6
 import AbstractVideoTrack from '../AbstractVideoTrack';
7
+import type { Props as AbstractVideoTrackProps } from '../AbstractVideoTrack';
6 8
 
7 9
 import Video from './Video';
8 10
 
11
+/**
12
+ * The type of the React {@code Component} props of {@link VideoTrack}.
13
+ */
14
+type Props = {
15
+    ...AbstractVideoTrackProps,
16
+
17
+    /**
18
+     * CSS classes to add to the video element.
19
+     */
20
+    className: string,
21
+
22
+    /**
23
+     * The value of the id attribute of the video. Used by the torture tests
24
+     * to locate video elements.
25
+     */
26
+    id: string
27
+};
28
+
9 29
 /**
10 30
  * Component that renders a video element for a passed in video track and
11 31
  * notifies the store when the video has started playing.
12 32
  *
13 33
  * @extends AbstractVideoTrack
14 34
  */
15
-class VideoTrack extends AbstractVideoTrack {
35
+class VideoTrack extends AbstractVideoTrack<Props> {
16 36
     /**
17 37
      * Default values for {@code VideoTrack} component's properties.
18 38
      *
19 39
      * @static
20 40
      */
21 41
     static defaultProps = {
22
-        ...AbstractVideoTrack.defaultProps,
23
-
24 42
         className: '',
25 43
 
26 44
         id: ''
27 45
     };
28 46
 
29
-    /**
30
-     * {@code VideoTrack} component's property types.
31
-     *
32
-     * @static
33
-     */
34
-    static propTypes = {
35
-        ...AbstractVideoTrack.propTypes,
36
-
37
-        /**
38
-         * CSS classes to add to the video element.
39
-         */
40
-        className: PropTypes.string,
41
-
42
-        /**
43
-         * The value of the id attribute of the video. Used by the torture tests
44
-         * to locate video elements.
45
-         */
46
-        id: PropTypes.string
47
-    };
48
-
49 47
     /**
50 48
      * Renders the video element.
51 49
      *
@@ -62,6 +60,8 @@ class VideoTrack extends AbstractVideoTrack {
62 60
                 videoTrack = { this.props.videoTrack } />
63 61
         );
64 62
     }
63
+
64
+    _onVideoPlaying: () => void;
65 65
 }
66 66
 
67 67
 export default connect()(VideoTrack);

+ 1
- 1
react/features/base/media/functions.js Ver fichero

@@ -58,7 +58,7 @@ export function isVideoMutedByUser(stateful: Function | Object) {
58 58
  * otherwise, false.
59 59
  */
60 60
 export function shouldRenderVideoTrack(
61
-        videoTrack: { muted: boolean, videoStarted: boolean },
61
+        videoTrack: ?{ muted: boolean, videoStarted: boolean },
62 62
         waitForVideoStarted: boolean) {
63 63
     return (
64 64
         videoTrack

+ 63
- 53
react/features/base/popover/components/Popover.web.js Ver fichero

@@ -1,5 +1,6 @@
1
+/* @flow */
2
+
1 3
 import InlineDialog from '@atlaskit/inline-dialog';
2
-import PropTypes from 'prop-types';
3 4
 import React, { Component } from 'react';
4 5
 
5 6
 /**
@@ -28,13 +29,68 @@ function _mapPositionToPaddingClass(position = 'left') {
28 29
     return DIALOG_TO_PADDING_POSITION[position.split(' ')[0]];
29 30
 }
30 31
 
32
+/**
33
+ * The type of the React {@code Component} props of {@link Popover}.
34
+ */
35
+type Props = {
36
+
37
+    /**
38
+     * A child React Element to use as the trigger for showing the dialog.
39
+     */
40
+    children: React$Node,
41
+
42
+    /**
43
+     * Additional CSS classnames to apply to the root of the {@code Popover}
44
+     * component.
45
+     */
46
+    className: string,
47
+
48
+    /**
49
+     * The ReactElement to display within the dialog.
50
+     */
51
+    content: Object,
52
+
53
+    /**
54
+     * Whether displaying of the popover should be prevented.
55
+     */
56
+    disablePopover: boolean,
57
+
58
+    /**
59
+     * An id attribute to apply to the root of the {@code Popover}
60
+     * component.
61
+     */
62
+    id: string,
63
+
64
+    /**
65
+     * Callback to invoke when the popover has opened.
66
+     */
67
+    onPopoverOpen: Function,
68
+
69
+    /**
70
+     * From which side of the dialog trigger the dialog should display. The
71
+     * value will be passed to {@code InlineDialog}.
72
+     */
73
+    position: string
74
+};
75
+
76
+/**
77
+ * The type of the React {@code Component} state of {@link Popover}.
78
+ */
79
+type State = {
80
+
81
+    /**
82
+     * Whether or not the {@code InlineDialog} should be displayed.
83
+     */
84
+    showDialog: boolean
85
+};
86
+
31 87
 /**
32 88
  * Implements a React {@code Component} for showing an {@code InlineDialog} on
33 89
  * mouseenter of the trigger and contents, and hiding the dialog on mouseleave.
34 90
  *
35 91
  * @extends Component
36 92
  */
37
-class Popover extends Component {
93
+class Popover extends Component<Props, State> {
38 94
     /**
39 95
      * Default values for {@code Popover} component's properties.
40 96
      *
@@ -45,66 +101,16 @@ class Popover extends Component {
45 101
         id: ''
46 102
     };
47 103
 
48
-    /**
49
-     * {@code Popover} component's property types.
50
-     *
51
-     * @static
52
-     */
53
-    static propTypes = {
54
-        /**
55
-         * A child React Element to use as the trigger for showing the dialog.
56
-         */
57
-        children: PropTypes.object,
58
-
59
-        /**
60
-         * Additional CSS classnames to apply to the root of the {@code Popover}
61
-         * component.
62
-         */
63
-        className: PropTypes.string,
64
-
65
-        /**
66
-         * The ReactElement to display within the dialog.
67
-         */
68
-        content: PropTypes.object,
69
-
70
-        /**
71
-         * Whether displaying of the popover should be prevented.
72
-         */
73
-        disablePopover: PropTypes.bool,
74
-
75
-        /**
76
-         * An id attribute to apply to the root of the {@code Popover}
77
-         * component.
78
-         */
79
-        id: PropTypes.string,
80
-
81
-        /**
82
-         * Callback to invoke when the popover has opened.
83
-         */
84
-        onPopoverOpen: PropTypes.func,
85
-
86
-        /**
87
-         * From which side of the dialog trigger the dialog should display. The
88
-         * value will be passed to {@code InlineDialog}.
89
-         */
90
-        position: PropTypes.string
91
-    };
92
-
93 104
     /**
94 105
      * Initializes a new {@code Popover} instance.
95 106
      *
96 107
      * @param {Object} props - The read-only properties with which the new
97 108
      * instance is to be initialized.
98 109
      */
99
-    constructor(props) {
110
+    constructor(props: Props) {
100 111
         super(props);
101 112
 
102 113
         this.state = {
103
-            /**
104
-             * Whether or not the {@code InlineDialog} should be displayed.
105
-             *
106
-             * @type {boolean}
107
-             */
108 114
             showDialog: false
109 115
         };
110 116
 
@@ -136,6 +142,8 @@ class Popover extends Component {
136 142
         );
137 143
     }
138 144
 
145
+    _onHideDialog: () => void;
146
+
139 147
     /**
140 148
      * Stops displaying the {@code InlineDialog}.
141 149
      *
@@ -146,6 +154,8 @@ class Popover extends Component {
146 154
         this.setState({ showDialog: false });
147 155
     }
148 156
 
157
+    _onShowDialog: () => void;
158
+
149 159
     /**
150 160
      * Displays the {@code InlineDialog} and calls any registered onPopoverOpen
151 161
      * callbacks.

+ 0
- 1
react/features/base/react/components/AbstractContainer.js Ver fichero

@@ -58,7 +58,6 @@ export type Props = {
58 58
     visible?: ?boolean
59 59
 };
60 60
 
61
-
62 61
 /**
63 62
  * Abstract (base) class for container of React {@link Component} children with
64 63
  * a style.

+ 28
- 26
react/features/base/react/components/native/Link.js Ver fichero

@@ -1,47 +1,47 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { Linking } from 'react-native';
4 5
 
5 6
 import Text from './Text';
6 7
 
7 8
 /**
8
- * Implements a (hyper)link to a URL in the fashion of the HTML anchor element
9
- * and its href attribute.
9
+ * The type of the React {@code Component} props of {@link Link}.
10 10
  */
11
-export default class Link extends Component {
11
+type Props = {
12
+
12 13
     /**
13
-     * {@code Link} component's property types.
14
-     *
15
-     * @static
14
+     * The children to be displayed within this Link.
16 15
      */
17
-    static propTypes = {
18
-        /**
19
-         * The children to be displayed within this Link.
20
-         */
21
-        children: PropTypes.node,
16
+    children: React$Node,
22 17
 
23
-        /**
24
-         * Notifies that this Link failed to open the URL associated with it.
25
-         */
26
-        onLinkingOpenURLRejected: PropTypes.func,
18
+    /**
19
+     * Notifies that this Link failed to open the URL associated with it.
20
+     */
21
+    onLinkingOpenURLRejected: Function,
27 22
 
28
-        /**
29
-         * The CSS style to be applied to this Link for the purposes of display.
30
-         */
31
-        style: PropTypes.object,
23
+    /**
24
+     * The CSS style to be applied to this Link for the purposes of display.
25
+     */
26
+    style: Object,
32 27
 
33
-        /**
34
-         * The URL to be opened when this Link is clicked/pressed.
35
-         */
36
-        url: PropTypes.string
37
-    };
28
+    /**
29
+     * The URL to be opened when this Link is clicked/pressed.
30
+     */
31
+    url: string
32
+};
38 33
 
34
+/**
35
+ * Implements a (hyper)link to a URL in the fashion of the HTML anchor element
36
+ * and its href attribute.
37
+ */
38
+export default class Link extends Component<Props> {
39 39
     /**
40 40
      * Initializes a new Link instance.
41 41
      *
42 42
      * @param {Object} props - Component properties.
43 43
      */
44
-    constructor(props) {
44
+    constructor(props: Props) {
45 45
         super(props);
46 46
 
47 47
         // Bind event handlers so they are only bound once for every instance.
@@ -77,6 +77,8 @@ export default class Link extends Component {
77 77
         onRejected && onRejected(reason);
78 78
     }
79 79
 
80
+    _onPress: () => void;
81
+
80 82
     /**
81 83
      * Handles press on this Link. Opens the URL associated with this Link.
82 84
      *

+ 0
- 7
react/features/base/react/components/web/Container.js Ver fichero

@@ -9,13 +9,6 @@ import type { Props } from '../AbstractContainer';
9 9
  * @extends AbstractContainer
10 10
  */
11 11
 export default class Container<P: Props> extends AbstractContainer<P> {
12
-    /**
13
-     * {@code Container} component's property types.
14
-     *
15
-     * @static
16
-     */
17
-    static propTypes = AbstractContainer.propTypes;
18
-
19 12
     /**
20 13
      * Implements React's {@link Component#render()}.
21 14
      *

+ 14
- 16
react/features/base/react/components/web/InlineDialogFailure.js Ver fichero

@@ -1,7 +1,6 @@
1 1
 /* @flow */
2 2
 
3 3
 import Button from '@atlaskit/button';
4
-import PropTypes from 'prop-types';
5 4
 import React, { Component } from 'react';
6 5
 
7 6
 import { translate } from '../../../i18n';
@@ -9,26 +8,25 @@ import { translate } from '../../../i18n';
9 8
 declare var interfaceConfig: Object;
10 9
 
11 10
 /**
12
- * Inline dialog that represents a failure and allows a retry.
11
+ * The type of the React {@code Component} props of {@link InlineDialogFailure}.
13 12
  */
14
-class InlineDialogFailure extends Component<*> {
13
+type Props = {
14
+
15 15
     /**
16
-     * {@code InlineDialogFailure}'s property types.
17
-     *
18
-     * @static
16
+     * Allows to retry the call that previously didn't succeed.
19 17
      */
20
-    static propTypes = {
21
-        /**
22
-         * Allows to retry the call that previously didn't succeed.
23
-         */
24
-        onRetry: PropTypes.func,
18
+    onRetry: Function,
25 19
 
26
-        /**
27
-         * Invoked to obtain translated strings.
28
-         */
29
-        t: PropTypes.func
30
-    };
20
+    /**
21
+     * Invoked to obtain translated strings.
22
+     */
23
+    t: Function
24
+};
31 25
 
26
+/**
27
+ * Inline dialog that represents a failure and allows a retry.
28
+ */
29
+class InlineDialogFailure extends Component<Props> {
32 30
     /**
33 31
      * Renders the content of this component.
34 32
      *

+ 111
- 93
react/features/base/react/components/web/MultiSelectAutocomplete.js Ver fichero

@@ -1,7 +1,8 @@
1
+// @flow
2
+
1 3
 import { MultiSelectStateless } from '@atlaskit/multi-select';
2 4
 import AKInlineDialog from '@atlaskit/inline-dialog';
3 5
 import _debounce from 'lodash/debounce';
4
-import PropTypes from 'prop-types';
5 6
 import React, { Component } from 'react';
6 7
 
7 8
 import InlineDialogFailure from './InlineDialogFailure';
@@ -9,118 +10,127 @@ import InlineDialogFailure from './InlineDialogFailure';
9 10
 const logger = require('jitsi-meet-logger').getLogger(__filename);
10 11
 
11 12
 /**
12
- * A MultiSelect that is also auto-completing.
13
+ * The type of the React {@code Component} props of
14
+ * {@link MultiSelectAutocomplete}.
13 15
  */
14
-class MultiSelectAutocomplete extends Component {
16
+type Props = {
15 17
 
16 18
     /**
17
-     * {@code MultiSelectAutocomplete} component's property types.
18
-     *
19
-     * @static
19
+     * The default value of the selected item.
20
+     */
21
+    defaultValue: Array<Object>,
22
+
23
+    /**
24
+     * Optional footer to show as a last element in the results.
25
+     * Should be of type {content: <some content>}
26
+     */
27
+    footer: Object,
28
+
29
+    /**
30
+     * Indicates if the component is disabled.
31
+     */
32
+    isDisabled: boolean,
33
+
34
+    /**
35
+     * Text to display while a query is executing.
36
+     */
37
+    loadingMessage: string,
38
+
39
+    /**
40
+     * The text to show when no matches are found.
41
+     */
42
+    noMatchesFound: string,
43
+
44
+    /**
45
+     * The function called immediately before a selection has been actually
46
+     * selected. Provides an opportunity to do any formatting.
20 47
      */
21
-    static propTypes = {
22
-        /**
23
-         * The default value of the selected item.
24
-         */
25
-        defaultValue: PropTypes.array,
26
-
27
-        /**
28
-         * Optional footer to show as a last element in the results.
29
-         * Should be of type {content: <some content>}
30
-         */
31
-        footer: PropTypes.object,
32
-
33
-        /**
34
-         * Indicates if the component is disabled.
35
-         */
36
-        isDisabled: PropTypes.bool,
37
-
38
-        /**
39
-         * Text to display while a query is executing.
40
-         */
41
-        loadingMessage: PropTypes.string,
42
-
43
-        /**
44
-         * The text to show when no matches are found.
45
-         */
46
-        noMatchesFound: PropTypes.string,
47
-
48
-        /**
49
-         * The function called immediately before a selection has been actually
50
-         * selected. Provides an opportunity to do any formatting.
51
-         */
52
-        onItemSelected: PropTypes.func,
53
-
54
-        /**
55
-         * The function called when the selection changes.
56
-         */
57
-        onSelectionChange: PropTypes.func,
58
-
59
-        /**
60
-         * The placeholder text of the input component.
61
-         */
62
-        placeholder: PropTypes.string,
63
-
64
-        /**
65
-         * The service providing the search.
66
-         */
67
-        resourceClient: PropTypes.shape({
68
-            makeQuery: PropTypes.func,
69
-            parseResults: PropTypes.func
70
-        }).isRequired,
71
-
72
-        /**
73
-         * Indicates if the component should fit the container.
74
-         */
75
-        shouldFitContainer: PropTypes.bool,
76
-
77
-        /**
78
-         * Indicates if we should focus.
79
-         */
80
-        shouldFocus: PropTypes.bool
81
-    };
48
+    onItemSelected: Function,
82 49
 
50
+    /**
51
+     * The function called when the selection changes.
52
+     */
53
+    onSelectionChange: Function,
54
+
55
+    /**
56
+     * The placeholder text of the input component.
57
+     */
58
+    placeholder: string,
59
+
60
+    /**
61
+     * The service providing the search.
62
+     */
63
+    resourceClient: { makeQuery: Function, parseResults: Function },
64
+
65
+    /**
66
+     * Indicates if the component should fit the container.
67
+     */
68
+    shouldFitContainer: boolean,
69
+
70
+    /**
71
+     * Indicates if we should focus.
72
+     */
73
+    shouldFocus: boolean
74
+};
75
+
76
+/**
77
+ * The type of the React {@code Component} state of
78
+ * {@link MultiSelectAutocomplete}.
79
+ */
80
+type State = {
81
+
82
+    /**
83
+     * Indicates if the dropdown is open.
84
+     */
85
+    isOpen: boolean,
86
+
87
+    /**
88
+     * The text that filters the query result of the search.
89
+     */
90
+    filterValue: string,
91
+
92
+    /**
93
+     * Indicates if the component is currently loading results.
94
+     */
95
+    loading: boolean,
96
+
97
+    /**
98
+     * Indicates if there was an error.
99
+     */
100
+    error: boolean,
101
+
102
+    /**
103
+     * The list of result items.
104
+     */
105
+    items: Array<Object>,
106
+
107
+    /**
108
+     * The list of selected items.
109
+     */
110
+    selectedItems: Array<Object>
111
+};
112
+
113
+/**
114
+ * A MultiSelect that is also auto-completing.
115
+ */
116
+class MultiSelectAutocomplete extends Component<Props, State> {
83 117
     /**
84 118
      * Initializes a new {@code MultiSelectAutocomplete} instance.
85 119
      *
86 120
      * @param {Object} props - The read-only properties with which the new
87 121
      * instance is to be initialized.
88 122
      */
89
-    constructor(props) {
123
+    constructor(props: Props) {
90 124
         super(props);
91 125
 
92 126
         const defaultValue = this.props.defaultValue || [];
93 127
 
94 128
         this.state = {
95
-            /**
96
-             * Indicates if the dropdown is open.
97
-             */
98 129
             isOpen: false,
99
-
100
-            /**
101
-             * The text that filters the query result of the search.
102
-             */
103 130
             filterValue: '',
104
-
105
-            /**
106
-             * Indicates if the component is currently loading results.
107
-             */
108 131
             loading: false,
109
-
110
-
111
-            /**
112
-             * Indicates if there was an error.
113
-             */
114 132
             error: false,
115
-
116
-            /**
117
-             * The list of result items.
118
-             */
119 133
             items: [],
120
-
121
-            /**
122
-             * The list of selected items.
123
-             */
124 134
             selectedItems: [ ...defaultValue ]
125 135
         };
126 136
 
@@ -137,7 +147,7 @@ class MultiSelectAutocomplete extends Component {
137 147
      * having been selected.
138 148
      * @returns {void}
139 149
      */
140
-    setSelectedItems(selectedItems = []) {
150
+    setSelectedItems(selectedItems: Array<Object> = []) {
141 151
         this.setState({ selectedItems });
142 152
     }
143 153
 
@@ -177,6 +187,8 @@ class MultiSelectAutocomplete extends Component {
177 187
         );
178 188
     }
179 189
 
190
+    _onFilterChange: (string) => void;
191
+
180 192
     /**
181 193
      * Sets the state and sends a query on filter change.
182 194
      *
@@ -198,6 +210,8 @@ class MultiSelectAutocomplete extends Component {
198 210
         }
199 211
     }
200 212
 
213
+    _onRetry: () => void;
214
+
201 215
     /**
202 216
      * Retries the query on retry.
203 217
      *
@@ -208,6 +222,8 @@ class MultiSelectAutocomplete extends Component {
208 222
         this._sendQuery(this.state.filterValue);
209 223
     }
210 224
 
225
+    _onSelectionChange: (Object) => void;
226
+
211 227
     /**
212 228
      * Updates the selected items when a selection event occurs.
213 229
      *
@@ -258,6 +274,8 @@ class MultiSelectAutocomplete extends Component {
258 274
         );
259 275
     }
260 276
 
277
+    _sendQuery: (string) => void;
278
+
261 279
     /**
262 280
      * Sends a query to the resourceClient.
263 281
      *

+ 55
- 17
react/features/base/react/components/web/Watermarks.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 /* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -18,31 +17,70 @@ const _RIGHT_WATERMARK_STYLE = {
18 17
 };
19 18
 
20 19
 /**
21
- * A Web Component which renders watermarks such as Jits, brand, powered by,
22
- * etc.
20
+ * The type of the React {@code Component} props of {@link Watermarks}.
23 21
  */
24
-class Watermarks extends Component<*, *> {
25
-    static propTypes = {
26
-        _isGuest: PropTypes.bool,
27
-        t: PropTypes.func
28
-    };
22
+type Props = {
29 23
 
30
-    state = {
31
-        brandWatermarkLink: String,
32
-        jitsiWatermarkLink: String,
33
-        showBrandWatermark: Boolean,
34
-        showJitsiWatermark: Boolean,
35
-        showJitsiWatermarkForGuests: Boolean,
36
-        showPoweredBy: Boolean
37
-    };
24
+    /**
25
+     * Whether or not the current user is logged in through a JWT.
26
+     */
27
+    _isGuest: boolean,
28
+
29
+    /**
30
+     * Invoked to obtain translated strings.
31
+     */
32
+    t: Function
33
+};
34
+
35
+/**
36
+ * The type of the React {@code Component} state of {@link Watermarks}.
37
+ */
38
+type State = {
39
+
40
+    /**
41
+     * The url to open when clicking the brand watermark.
42
+     */
43
+    brandWatermarkLink: string,
44
+
45
+    /**
46
+     * The url to open when clicking the Jitsi watermark.
47
+     */
48
+    jitsiWatermarkLink: string,
49
+
50
+    /**
51
+     * Whether or not the brand watermark should be displayed.
52
+     */
53
+    showBrandWatermark: boolean,
54
+
55
+    /**
56
+     * Whether or not the Jitsi watermark should be displayed.
57
+     */
58
+    showJitsiWatermark: boolean,
59
+
60
+    /**
61
+     * Whether or not the Jitsi watermark should be displayed for users not
62
+     * logged in through a JWT.
63
+     */
64
+    showJitsiWatermarkForGuests: boolean,
65
+
66
+    /**
67
+     * Whether or not the show the "powered by Jitsi.org" link.
68
+     */
69
+    showPoweredBy: boolean
70
+};
38 71
 
72
+/**
73
+ * A Web Component which renders watermarks such as Jits, brand, powered by,
74
+ * etc.
75
+ */
76
+class Watermarks extends Component<Props, State> {
39 77
     /**
40 78
      * Initializes a new Watermarks instance.
41 79
      *
42 80
      * @param {Object} props - The read-only properties with which the new
43 81
      * instance is to be initialized.
44 82
      */
45
-    constructor(props: Object) {
83
+    constructor(props: Props) {
46 84
         super(props);
47 85
 
48 86
         let showBrandWatermark;

+ 8
- 15
react/features/base/responsive-ui/components/AspectRatioAware.js Ver fichero

@@ -1,11 +1,17 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
7 6
 import { ASPECT_RATIO_NARROW, ASPECT_RATIO_WIDE } from '../constants';
8 7
 
8
+/**
9
+ * The type of the React {@code Component} props of {@link AspectRatioAware}.
10
+ */
11
+type Props = {
12
+    aspectRatio: ASPECT_RATIO_NARROW | ASPECT_RATIO_WIDE
13
+};
14
+
9 15
 /**
10 16
  * Determines whether a specific React {@code Component} decorated into an
11 17
  * {@link AspectRatioAware} has {@link ASPECT_RATIO_NARROW} as the value of its
@@ -34,20 +40,7 @@ export function makeAspectRatioAware(
34 40
     /**
35 41
      * Renders {@code WrappedComponent} with the React prop {@code aspectRatio}.
36 42
      */
37
-    class AspectRatioAware extends Component<*> {
38
-        /**
39
-         * Properties of the aspect ratio aware wrapper.
40
-         */
41
-        static propTypes = {
42
-            /**
43
-             * Either {@link ASPECT_RATIO_NARROW} or {@link ASPECT_RATIO_WIDE}.
44
-             */
45
-            aspectRatio: PropTypes.oneOf([
46
-                ASPECT_RATIO_NARROW,
47
-                ASPECT_RATIO_WIDE
48
-            ])
49
-        }
50
-
43
+    class AspectRatioAware extends Component<Props> {
51 44
         /**
52 45
          * Implement's React render method to wrap the nested component.
53 46
          *

+ 116
- 92
react/features/connection-indicator/components/ConnectionIndicator.js Ver fichero

@@ -1,6 +1,5 @@
1
-/* global interfaceConfig */
1
+/* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n';
@@ -10,6 +9,8 @@ import { ConnectionStatsTable } from '../../connection-stats';
10 9
 
11 10
 import statsEmitter from '../statsEmitter';
12 11
 
12
+declare var interfaceConfig: Object;
13
+
13 14
 /**
14 15
  * The connection quality percentage that must be reached to be considered of
15 16
  * good quality and can result in the connection indicator being hidden.
@@ -25,7 +26,7 @@ const INDICATOR_DISPLAY_THRESHOLD = 30;
25 26
  *
26 27
  * @type {Object[]}
27 28
  */
28
-const QUALITY_TO_WIDTH = [
29
+const QUALITY_TO_WIDTH: Array<Object> = [
29 30
 
30 31
     // Full (3 bars)
31 32
     {
@@ -54,108 +55,107 @@ const QUALITY_TO_WIDTH = [
54 55
     // Note: we never show 0 bars as long as there is a connection.
55 56
 ];
56 57
 
58
+/**
59
+ * The type of the React {@code Component} props of {@link ConnectionIndicator}.
60
+ */
61
+type Props = {
62
+
63
+    /**
64
+     * Whether or not the component should ignore setting a visibility class for
65
+     * hiding the component when the connection quality is not strong.
66
+     */
67
+    alwaysVisible: boolean,
68
+
69
+    /**
70
+     * The current condition of the user's connection, matching one of the
71
+     * enumerated values in the library.
72
+     */
73
+    connectionStatus: string,
74
+
75
+    /**
76
+     * Whether or not clicking the indicator should display a popover for more
77
+     * details.
78
+     */
79
+    enableStatsDisplay: boolean,
80
+
81
+    /**
82
+     * The font-size for the icon.
83
+     */
84
+    iconSize: number,
85
+
86
+    /**
87
+     * Whether or not the displays stats are for local video.
88
+     */
89
+    isLocalVideo: boolean,
90
+
91
+    /**
92
+     * Relative to the icon from where the popover for more connection details
93
+     * should display.
94
+     */
95
+    statsPopoverPosition: string,
96
+
97
+    /**
98
+     * Invoked to obtain translated strings.
99
+     */
100
+    t: Function,
101
+
102
+    /**
103
+     * The user ID associated with the displayed connection indication and
104
+     * stats.
105
+     */
106
+    userID: string
107
+};
108
+
109
+/**
110
+ * The type of the React {@code Component} state of {@link ConnectionIndicator}.
111
+ */
112
+type State = {
113
+
114
+    /**
115
+     * The timeout for automatically hiding the indicator.
116
+     */
117
+    autoHideTimeout: TimeoutID | null,
118
+
119
+    /**
120
+     * Whether or not a CSS class should be applied to the root for hiding the
121
+     * connection indicator. By default the indicator should start out hidden
122
+     * because the current connection status is not known at mount.
123
+     */
124
+    showIndicator: boolean,
125
+
126
+    /**
127
+     * Whether or not the popover content should display additional statistics.
128
+     */
129
+    showMoreStats: boolean,
130
+
131
+    /**
132
+     * Cache of the stats received from subscribing to stats emitting. The keys
133
+     * should be the name of the stat. With each stat update, updates stats are
134
+     * mixed in with cached stats and a new stats object is set in state.
135
+     */
136
+    stats: Object
137
+};
138
+
57 139
 /**
58 140
  * Implements a React {@link Component} which displays the current connection
59 141
  * quality percentage and has a popover to show more detailed connection stats.
60 142
  *
61 143
  * @extends {Component}
62 144
  */
63
-class ConnectionIndicator extends Component {
64
-    /**
65
-     * {@code ConnectionIndicator} component's property types.
66
-     *
67
-     * @static
68
-     */
69
-    static propTypes = {
70
-        /**
71
-         * Whether or not the component should ignore setting a visibility class
72
-         * for hiding the component when the connection quality is not strong.
73
-         */
74
-        alwaysVisible: PropTypes.bool,
75
-
76
-        /**
77
-         * The current condition of the user's connection, matching one of the
78
-         * enumerated values in the library.
79
-         *
80
-         * @type {JitsiParticipantConnectionStatus}
81
-         */
82
-        connectionStatus: PropTypes.string,
83
-
84
-        /**
85
-         * Whether or not clicking the indicator should display a popover for
86
-         * more details.
87
-         */
88
-        enableStatsDisplay: PropTypes.bool,
89
-
90
-        /**
91
-         * The font-size for the icon.
92
-         */
93
-        iconSize: PropTypes.number,
94
-
95
-        /**
96
-         * Whether or not the displays stats are for local video.
97
-         */
98
-        isLocalVideo: PropTypes.bool,
99
-
100
-        /**
101
-         * Relative to the icon from where the popover for more connection
102
-         * details should display.
103
-         */
104
-        statsPopoverPosition: PropTypes.string,
105
-
106
-        /**
107
-         * Invoked to obtain translated strings.
108
-         */
109
-        t: PropTypes.func,
110
-
111
-        /**
112
-         * The user ID associated with the displayed connection indication and
113
-         * stats.
114
-         */
115
-        userID: PropTypes.string
116
-    };
117
-
145
+class ConnectionIndicator extends Component<Props, State> {
118 146
     /**
119 147
      * Initializes a new {@code ConnectionIndicator} instance.
120 148
      *
121 149
      * @param {Object} props - The read-only properties with which the new
122 150
      * instance is to be initialized.
123 151
      */
124
-    constructor(props) {
152
+    constructor(props: Props) {
125 153
         super(props);
126 154
 
127 155
         this.state = {
128
-            /**
129
-             * The timeout for automatically hiding the indicator.
130
-             *
131
-             * @type {timeoutID}
132
-             */
133 156
             autoHideTimeout: null,
134
-
135
-            /**
136
-             * Whether or not a CSS class should be applied to the root for
137
-             * hiding the connection indicator. By default the indicator should
138
-             * start out hidden because the current connection status is not
139
-             * known at mount.
140
-             *
141
-             * @type {boolean}
142
-             */
143 157
             showIndicator: false,
144
-
145
-            /**
146
-             * Whether or not the popover content should display additional
147
-             * statistics.
148
-             *
149
-             * @type {boolean}
150
-             */
151 158
             showMoreStats: false,
152
-
153
-            /**
154
-             * Cache of the stats received from subscribing to stats emitting.
155
-             * The keys should be the name of the stat. With each stat update,
156
-             * updates stats are mixed in with cached stats and a new stats
157
-             * object is set in state.
158
-             */
159 159
             stats: {}
160 160
         };
161 161
 
@@ -201,7 +201,9 @@ class ConnectionIndicator extends Component {
201 201
         statsEmitter.unsubscribeToClientStats(
202 202
             this.props.userID, this._onStatsUpdated);
203 203
 
204
-        clearTimeout(this.state.autoHideTimeout);
204
+        if (this.state.autoHideTimeout) {
205
+            clearTimeout(this.state.autoHideTimeout);
206
+        }
205 207
     }
206 208
 
207 209
     /**
@@ -257,7 +259,7 @@ class ConnectionIndicator extends Component {
257 259
             return 'status-high';
258 260
         }
259 261
 
260
-        return QUALITY_TO_WIDTH.find(x => percent >= x.percent).colorClass;
262
+        return this._getDisplayConfiguration(percent).colorClass;
261 263
     }
262 264
 
263 265
     /**
@@ -287,7 +289,7 @@ class ConnectionIndicator extends Component {
287 289
                 // established so far. Assume a strong connection to start.
288 290
                 tipKey = 'connectionindicator.quality.good';
289 291
             } else {
290
-                const config = QUALITY_TO_WIDTH.find(x => percent >= x.percent);
292
+                const config = this._getDisplayConfiguration(percent);
291 293
 
292 294
                 tipKey = config.tip;
293 295
             }
@@ -297,6 +299,21 @@ class ConnectionIndicator extends Component {
297 299
         return this.props.t(tipKey);
298 300
     }
299 301
 
302
+    /**
303
+     * Get the icon configuration from QUALITY_TO_WIDTH which has a percentage
304
+     * that matches or exceeds the passed in percentage. The implementation
305
+     * assumes QUALITY_TO_WIDTH is already sorted by highest to lowest
306
+     * percentage.
307
+     *
308
+     * @param {number} percent - The connection percentage, out of 100, to find
309
+     * the closest matching configuration for.
310
+     * @private
311
+     * @returns {Object}
312
+     */
313
+    _getDisplayConfiguration(percent: number): Object {
314
+        return QUALITY_TO_WIDTH.find(x => percent >= x.percent) || {};
315
+    }
316
+
300 317
     /**
301 318
      * Returns additional class names to add to the root of the component. The
302 319
      * class names are intended to be used for hiding or showing the indicator.
@@ -314,6 +331,8 @@ class ConnectionIndicator extends Component {
314 331
             ? 'show-connection-indicator' : 'hide-connection-indicator';
315 332
     }
316 333
 
334
+    _onStatsUpdated: (Object) => void;
335
+
317 336
     /**
318 337
      * Callback invoked when new connection stats associated with the passed in
319 338
      * user ID are available. Will update the component's display of current
@@ -341,6 +360,8 @@ class ConnectionIndicator extends Component {
341 360
         this._updateIndicatorAutoHide(newStats.percent);
342 361
     }
343 362
 
363
+    _onToggleShowMore: () => void;
364
+
344 365
     /**
345 366
      * Callback to invoke when the show more link in the popover content is
346 367
      * clicked. Sets the state which will determine if the popover should show
@@ -383,7 +404,7 @@ class ConnectionIndicator extends Component {
383 404
         } else {
384 405
             const { percent } = this.state.stats;
385 406
 
386
-            iconWidth = QUALITY_TO_WIDTH.find(x => percent >= x.percent).width;
407
+            iconWidth = this._getDisplayConfiguration(percent).width;
387 408
         }
388 409
 
389 410
         return [
@@ -449,7 +470,10 @@ class ConnectionIndicator extends Component {
449 470
      */
450 471
     _updateIndicatorAutoHide(percent) {
451 472
         if (percent < INDICATOR_DISPLAY_THRESHOLD) {
452
-            clearTimeout(this.state.autoHideTimeout);
473
+            if (this.state.autoHideTimeout) {
474
+                clearTimeout(this.state.autoHideTimeout);
475
+            }
476
+
453 477
             this.setState({
454 478
                 autoHideTimeout: null,
455 479
                 showIndicator: true

+ 109
- 108
react/features/connection-stats/components/ConnectionStatsTable.js Ver fichero

@@ -1,119 +1,120 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../base/i18n';
5 6
 
6 7
 /**
7
- * React {@code Component} for displaying connection statistics.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of
9
+ * {@link ConnectionStatsTable}.
10 10
  */
11
-class ConnectionStatsTable extends Component {
11
+type Props = {
12
+
12 13
     /**
13
-     * {@code ConnectionStatsTable} component's property types.
14
-     *
15
-     * @static
14
+     * Statistics related to bandwidth.
15
+     * {{
16
+     *     download: Number,
17
+     *     upload: Number
18
+     * }}
19
+     */
20
+    bandwidth: Object,
21
+
22
+    /**
23
+     * Statistics related to bitrate.
24
+     * {{
25
+     *     download: Number,
26
+     *     upload: Number
27
+     * }}
28
+     */
29
+    bitrate: Object,
30
+
31
+    /**
32
+     * The number of bridges (aka media servers) currently used in the
33
+     * conference.
34
+     */
35
+    bridgeCount: number,
36
+
37
+    /**
38
+     * A message describing the connection quality.
39
+     */
40
+    connectionSummary: string,
41
+
42
+    /**
43
+     * The end-to-end round-trip-time.
44
+     */
45
+    e2eRtt: number,
46
+
47
+    /**
48
+     * Statistics related to frame rates for each ssrc.
49
+     * {{
50
+     *     [ ssrc ]: Number
51
+     * }}
52
+     */
53
+    framerate: Object,
54
+
55
+    /**
56
+     * Whether or not the statistics are for local video.
57
+     */
58
+    isLocalVideo: boolean,
59
+
60
+    /**
61
+     * Callback to invoke when the show additional stats link is clicked.
16 62
      */
17
-    static propTypes = {
18
-        /**
19
-         * Statistics related to bandwidth.
20
-         * {{
21
-         *     download: Number,
22
-         *     upload: Number
23
-         * }}
24
-         */
25
-        bandwidth: PropTypes.object,
26
-
27
-        /**
28
-         * Statistics related to bitrate.
29
-         * {{
30
-         *     download: Number,
31
-         *     upload: Number
32
-         * }}
33
-         */
34
-        bitrate: PropTypes.object,
35
-
36
-        /**
37
-         * The number of bridges (aka media servers) currently used in the
38
-         * conference.
39
-         */
40
-        bridgeCount: PropTypes.number,
41
-
42
-        /**
43
-         * A message describing the connection quality.
44
-         */
45
-        connectionSummary: PropTypes.string,
46
-
47
-        /**
48
-         * The end-to-end round-trip-time.
49
-         */
50
-        e2eRtt: PropTypes.number,
51
-
52
-        /**
53
-         * Statistics related to frame rates for each ssrc.
54
-         * {{
55
-         *     [ ssrc ]: Number
56
-         * }}
57
-         */
58
-        framerate: PropTypes.object,
59
-
60
-        /**
61
-         * Whether or not the statistics are for local video.
62
-         */
63
-        isLocalVideo: PropTypes.bool,
64
-
65
-        /**
66
-         * Callback to invoke when the show additional stats link is clicked.
67
-         */
68
-        onShowMore: PropTypes.func,
69
-
70
-        /**
71
-         * Statistics related to packet loss.
72
-         * {{
73
-         *     download: Number,
74
-         *     upload: Number
75
-         * }}
76
-         */
77
-        packetLoss: PropTypes.object,
78
-
79
-        /**
80
-         * The region that we think the client is in.
81
-         */
82
-        region: PropTypes.string,
83
-
84
-        /**
85
-         * Statistics related to display resolutions for each ssrc.
86
-         * {{
87
-         *     [ ssrc ]: {
88
-         *         height: Number,
89
-         *         width: Number
90
-         *     }
91
-         * }}
92
-         */
93
-        resolution: PropTypes.object,
94
-
95
-        /**
96
-         * The region of the media server that we are connected to.
97
-         */
98
-        serverRegion: PropTypes.string,
99
-
100
-        /**
101
-         * Whether or not additional stats about bandwidth and transport should
102
-         * be displayed. Will not display even if true for remote participants.
103
-         */
104
-        shouldShowMore: PropTypes.bool,
105
-
106
-        /**
107
-         * Invoked to obtain translated strings.
108
-         */
109
-        t: PropTypes.func,
110
-
111
-        /**
112
-         * Statistics related to transports.
113
-         */
114
-        transport: PropTypes.array
115
-    };
63
+    onShowMore: Function,
116 64
 
65
+    /**
66
+     * Statistics related to packet loss.
67
+     * {{
68
+     *     download: Number,
69
+     *     upload: Number
70
+     * }}
71
+     */
72
+    packetLoss: Object,
73
+
74
+    /**
75
+     * The region that we think the client is in.
76
+     */
77
+    region: string,
78
+
79
+    /**
80
+     * Statistics related to display resolutions for each ssrc.
81
+     * {{
82
+     *     [ ssrc ]: {
83
+     *         height: Number,
84
+     *         width: Number
85
+     *     }
86
+     * }}
87
+     */
88
+    resolution: Object,
89
+
90
+    /**
91
+     * The region of the media server that we are connected to.
92
+     */
93
+    serverRegion: string,
94
+
95
+    /**
96
+     * Whether or not additional stats about bandwidth and transport should be
97
+     * displayed. Will not display even if true for remote participants.
98
+     */
99
+    shouldShowMore: boolean,
100
+
101
+    /**
102
+     * Invoked to obtain translated strings.
103
+     */
104
+    t: Function,
105
+
106
+    /**
107
+     * Statistics related to transports.
108
+     */
109
+    transport: Array<Object>
110
+};
111
+
112
+/**
113
+ * React {@code Component} for displaying connection statistics.
114
+ *
115
+ * @extends Component
116
+ */
117
+class ConnectionStatsTable extends Component<Props> {
117 118
     /**
118 119
      * Implements React's {@link Component#render()}.
119 120
      *
@@ -574,7 +575,7 @@ class ConnectionStatsTable extends Component {
574 575
      * @private
575 576
      * @returns {ReactElement}
576 577
      */
577
-    _renderTransportTableRow(config) {
578
+    _renderTransportTableRow(config: Object) {
578 579
         const { additionalData, data, key, label } = config;
579 580
 
580 581
         return (

+ 33
- 23
react/features/deep-linking/components/DeepLinkingMobilePage.web.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -35,31 +34,42 @@ const _URLS = {
35 34
 };
36 35
 
37 36
 /**
38
- * React component representing mobile browser page.
39
- *
40
- * @class DeepLinkingMobilePage
37
+ * The type of the React {@code Component} props of
38
+ * {@link DeepLinkingMobilePage}.
41 39
  */
42
-class DeepLinkingMobilePage extends Component<*, *> {
43
-    state: Object;
40
+type Props = {
44 41
 
45 42
     /**
46
-     * DeepLinkingMobilePage component's property types.
47
-     *
48
-     * @static
43
+     * The name of the conference attempting to being joined.
49 44
      */
50
-    static propTypes = {
51
-        /**
52
-         * The name of the conference attempting to being joined.
53
-         */
54
-        _room: PropTypes.string,
55
-
56
-        /**
57
-         * The function to translate human-readable text.
58
-         *
59
-         * @public
60
-         * @type {Function}
61
-         */
62
-        t: PropTypes.func
45
+    _room: string,
46
+
47
+    /**
48
+     * The function to translate human-readable text.
49
+     */
50
+    t: Function
51
+};
52
+
53
+/**
54
+ * The type of the React {@code Component} state of
55
+ * {@link DeepLinkingMobilePage}.
56
+ */
57
+type State = {
58
+
59
+    /**
60
+     * The URL to link to on the button for opening the mobile app.
61
+     */
62
+    joinURL: string
63
+};
64
+
65
+/**
66
+ * React component representing mobile browser page.
67
+ *
68
+ * @class DeepLinkingMobilePage
69
+ */
70
+class DeepLinkingMobilePage extends Component<Props, State> {
71
+    state = {
72
+        joinURL: ''
63 73
     };
64 74
 
65 75
     /**
@@ -68,7 +78,7 @@ class DeepLinkingMobilePage extends Component<*, *> {
68 78
      * @param {Object} props - The read-only React {@code Component} props with
69 79
      * which the new instance is to be initialized.
70 80
      */
71
-    constructor(props) {
81
+    constructor(props: Props) {
72 82
         super(props);
73 83
 
74 84
         // Bind event handlers so they are only bound once per instance.

+ 52
- 29
react/features/desktop-picker/components/DesktopPicker.js Ver fichero

@@ -1,7 +1,6 @@
1 1
 // @flow
2 2
 
3 3
 import Tabs from '@atlaskit/tabs';
4
-import PropTypes from 'prop-types';
5 4
 import React, { Component } from 'react';
6 5
 import { connect } from 'react-redux';
7 6
 
@@ -43,40 +42,64 @@ const TAB_LABELS = {
43 42
 const VALID_TYPES = Object.keys(TAB_LABELS);
44 43
 
45 44
 /**
46
- * React component for DesktopPicker.
47
- *
48
- * @extends Component
45
+ * The type of the React {@code Component} props of {@link DesktopPicker}.
49 46
  */
50
-class DesktopPicker extends Component<*, *> {
47
+type Props = {
48
+
51 49
     /**
52
-     * DesktopPicker component's property types.
53
-     *
54
-     * @static
50
+     * An array with desktop sharing sources to be displayed.
55 51
      */
56
-    static propTypes = {
52
+    desktopSharingSources: Array<string>,
57 53
 
58
-        /**
59
-         * An array with desktop sharing sources to be displayed.
60
-         */
61
-        desktopSharingSources: PropTypes.arrayOf(PropTypes.string),
54
+    /**
55
+     * Used to request DesktopCapturerSources.
56
+     */
57
+    dispatch: Dispatch<*>,
62 58
 
63
-        /**
64
-         * Used to request DesktopCapturerSources.
65
-         */
66
-        dispatch: PropTypes.func,
59
+    /**
60
+     * The callback to be invoked when the component is closed or when a
61
+     * DesktopCapturerSource has been chosen.
62
+     */
63
+    onSourceChoose: Function,
67 64
 
68
-        /**
69
-         * The callback to be invoked when the component is closed or when
70
-         * a DesktopCapturerSource has been chosen.
71
-         */
72
-        onSourceChoose: PropTypes.func,
65
+    /**
66
+     * Used to obtain translations.
67
+     */
68
+    t: Function
69
+};
73 70
 
74
-        /**
75
-         * Used to obtain translations.
76
-         */
77
-        t: PropTypes.func
78
-    };
71
+/**
72
+ * The type of the React {@code Component} state of {@link DesktopPicker}.
73
+ */
74
+type State = {
75
+
76
+    /**
77
+     * The currently higlighted DesktopCapturerSource.
78
+     */
79
+    selectedSource: Object,
80
+
81
+    /**
82
+     * The desktop source type currently being displayed.
83
+     */
84
+    selectedTab: number,
85
+
86
+    /**
87
+     * An object containing all the DesktopCapturerSources.
88
+     */
89
+    sources: Object,
90
+
91
+    /**
92
+     * The desktop source types to fetch previews for.
93
+     */
94
+    types: Array<string>
95
+};
79 96
 
97
+/**
98
+ * React component for DesktopPicker.
99
+ *
100
+ * @extends Component
101
+ */
102
+class DesktopPicker extends Component<Props, State> {
80 103
     _poller = null;
81 104
 
82 105
     state = {
@@ -99,7 +122,7 @@ class DesktopPicker extends Component<*, *> {
99 122
      * @param {Object} props - The read-only properties with which the new
100 123
      * instance is to be initialized.
101 124
      */
102
-    constructor(props) {
125
+    constructor(props: Props) {
103 126
         super(props);
104 127
 
105 128
         // Bind event handlers so they are only bound once per instance.
@@ -132,7 +155,7 @@ class DesktopPicker extends Component<*, *> {
132 155
      * instance will receive.
133 156
      * @returns {void}
134 157
      */
135
-    componentWillReceiveProps(nextProps) {
158
+    componentWillReceiveProps(nextProps: Props) {
136 159
         const { desktopSharingSources } = nextProps;
137 160
 
138 161
         /**

+ 30
- 31
react/features/desktop-picker/components/DesktopPickerPane.js Ver fichero

@@ -1,48 +1,47 @@
1
+/* @flow */
2
+
1 3
 import Spinner from '@atlaskit/spinner';
2
-import PropTypes from 'prop-types';
3 4
 import React, { Component } from 'react';
4 5
 
5 6
 import DesktopSourcePreview from './DesktopSourcePreview';
6 7
 
7 8
 /**
8
- * React component for showing a grid of DesktopSourcePreviews.
9
- *
10
- * @extends Component
9
+ * The type of the React {@code Component} props of {@link DesktopPickerPane}.
11 10
  */
12
-class DesktopPickerPane extends Component {
11
+type Props = {
12
+
13 13
     /**
14
-     * DesktopPickerPane component's property types.
15
-     *
16
-     * @static
14
+     * The handler to be invoked when a DesktopSourcePreview is clicked.
17 15
      */
18
-    static propTypes = {
19
-        /**
20
-         * The handler to be invoked when a DesktopSourcePreview is clicked.
21
-         */
22
-        onClick: PropTypes.func,
16
+    onClick: Function,
23 17
 
24
-        /**
25
-         * The handler to be invoked when a DesktopSourcePreview is double
26
-         * clicked.
27
-         */
28
-        onDoubleClick: PropTypes.func,
18
+    /**
19
+     * The handler to be invoked when a DesktopSourcePreview is double clicked.
20
+     */
21
+    onDoubleClick: Function,
29 22
 
30
-        /**
31
-         * The id of the DesktopCapturerSource that is currently selected.
32
-         */
33
-        selectedSourceId: PropTypes.string,
23
+    /**
24
+     * The id of the DesktopCapturerSource that is currently selected.
25
+     */
26
+    selectedSourceId: string,
34 27
 
35
-        /**
36
-         * An array of DesktopCapturerSources.
37
-         */
38
-        sources: PropTypes.array,
28
+    /**
29
+     * An array of DesktopCapturerSources.
30
+     */
31
+    sources: Array<Object>,
39 32
 
40
-        /**
41
-         * The source type of the DesktopCapturerSources to display.
42
-         */
43
-        type: PropTypes.string
44
-    };
33
+    /**
34
+     * The source type of the DesktopCapturerSources to display.
35
+     */
36
+    type: string
37
+};
45 38
 
39
+/**
40
+ * React component for showing a grid of DesktopSourcePreviews.
41
+ *
42
+ * @extends Component
43
+ */
44
+class DesktopPickerPane extends Component<Props> {
46 45
     /**
47 46
      * Implements React's {@link Component#render()}.
48 47
      *

+ 44
- 39
react/features/desktop-picker/components/DesktopSourcePreview.js Ver fichero

@@ -1,55 +1,56 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 /**
5
- * React component for displaying a preview of a DesktopCapturerSource.
6
- *
7
- * @extends Component
6
+ * The type of the React {@code Component} props of
7
+ * {@link DesktopSourcePreview}.
8 8
  */
9
-class DesktopSourcePreview extends Component {
9
+type Props = {
10
+
10 11
     /**
11
-     * DesktopSourcePreview component's property types.
12
-     *
13
-     * @static
12
+     * The callback to invoke when the component is clicked. The id of the
13
+     * clicked on DesktopCapturerSource will be passed in.
14 14
      */
15
-    static propTypes = {
16
-        /**
17
-         * The callback to invoke when the component is clicked. The id of
18
-         * the DesktopCapturerSource will be passed in.
19
-         */
20
-        onClick: PropTypes.func,
21
-
22
-        /**
23
-         * The callback to invoke when the component is double clicked. The id
24
-         * of the DesktopCapturerSource will be passed in.
25
-         */
26
-        onDoubleClick: PropTypes.func,
27
-
28
-        /**
29
-         * The indicator which determines whether this DesktopSourcePreview is
30
-         * selected. If true, the 'is-selected' CSS class will be added to the
31
-         * Component.
32
-         */
33
-        selected: PropTypes.bool,
34
-
35
-        /**
36
-         * The DesktopCapturerSource to display.
37
-         */
38
-        source: PropTypes.object,
39
-
40
-        /**
41
-         * The source type of the DesktopCapturerSources to display.
42
-         */
43
-        type: PropTypes.string
44
-    };
15
+    onClick: Function,
45 16
 
17
+    /**
18
+     * The callback to invoke when the component is double clicked. The id of
19
+     * the DesktopCapturerSource will be passed in.
20
+     */
21
+    onDoubleClick: Function,
22
+
23
+    /**
24
+     * The indicator which determines whether this DesktopSourcePreview is
25
+     * selected. If true, the 'is-selected' CSS class will be added to the root
26
+     * of Component.
27
+     */
28
+    selected: boolean,
29
+
30
+    /**
31
+     * The DesktopCapturerSource to display.
32
+     */
33
+    source: Object,
34
+
35
+    /**
36
+     * The source type of the DesktopCapturerSources to display.
37
+     */
38
+    type: string
39
+};
40
+
41
+/**
42
+ * React component for displaying a preview of a DesktopCapturerSource.
43
+ *
44
+ * @extends Component
45
+ */
46
+class DesktopSourcePreview extends Component<Props> {
46 47
     /**
47 48
      * Initializes a new DesktopSourcePreview instance.
48 49
      *
49 50
      * @param {Object} props - The read-only properties with which the new
50 51
      * instance is to be initialized.
51 52
      */
52
-    constructor(props) {
53
+    constructor(props: Props) {
53 54
         super(props);
54 55
 
55 56
         this._onClick = this._onClick.bind(this);
@@ -83,6 +84,8 @@ class DesktopSourcePreview extends Component {
83 84
         );
84 85
     }
85 86
 
87
+    _onClick: () => void;
88
+
86 89
     /**
87 90
      * Invokes the passed in onClick callback.
88 91
      *
@@ -94,6 +97,8 @@ class DesktopSourcePreview extends Component {
94 97
         this.props.onClick(source.id, type);
95 98
     }
96 99
 
100
+    _onDoubleClick: () => void;
101
+
97 102
     /**
98 103
      * Invokes the passed in onDoubleClick callback.
99 104
      *

+ 27
- 14
react/features/device-selection/components/AudioInputPreview.js Ver fichero

@@ -1,31 +1,42 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { JitsiTrackEvents } from '../../base/lib-jitsi-meet';
5 6
 
6 7
 /**
7
- * React component for displaying a audio level meter for a JitsiLocalTrack.
8
+ * The type of the React {@code Component} props of {@link AudioInputPreview}.
8 9
  */
9
-class AudioInputPreview extends Component {
10
+type Props = {
11
+
10 12
     /**
11
-     * AudioInputPreview component's property types.
12
-     *
13
-     * @static
13
+     * The JitsiLocalTrack to show an audio level meter for.
14
+     */
15
+    track: Object
16
+};
17
+
18
+/**
19
+ * The type of the React {@code Component} props of {@link AudioInputPreview}.
20
+ */
21
+type State = {
22
+
23
+    /**
24
+     * The current audio input level being received, from 0 to 1.
14 25
      */
15
-    static propTypes = {
16
-        /*
17
-         * The JitsiLocalTrack to show an audio level meter for.
18
-         */
19
-        track: PropTypes.object
20
-    };
26
+    audioLevel: number
27
+};
21 28
 
29
+/**
30
+ * React component for displaying a audio level meter for a JitsiLocalTrack.
31
+ */
32
+class AudioInputPreview extends Component<Props, State> {
22 33
     /**
23 34
      * Initializes a new AudioInputPreview instance.
24 35
      *
25 36
      * @param {Object} props - The read-only React Component props with which
26 37
      * the new instance is to be initialized.
27 38
      */
28
-    constructor(props) {
39
+    constructor(props: Props) {
29 40
         super(props);
30 41
 
31 42
         this.state = {
@@ -52,7 +63,7 @@ class AudioInputPreview extends Component {
52 63
      * @inheritdoc
53 64
      * @returns {void}
54 65
      */
55
-    componentWillReceiveProps(nextProps) {
66
+    componentWillReceiveProps(nextProps: Props) {
56 67
         if (nextProps.track !== this.props.track) {
57 68
             this._listenForAudioUpdates(nextProps.track);
58 69
             this._updateAudioLevel(0);
@@ -117,6 +128,8 @@ class AudioInputPreview extends Component {
117 128
             this._updateAudioLevel);
118 129
     }
119 130
 
131
+    _updateAudioLevel: (number) => void;
132
+
120 133
     /**
121 134
      * Updates the internal state of the last know audio level. The level should
122 135
      * be between 0 and 1, as the level will be used as a percentage out of 1.

+ 26
- 20
react/features/device-selection/components/AudioOutputPreview.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../base/i18n';
@@ -6,28 +7,29 @@ import { Audio } from '../../base/media';
6 7
 
7 8
 const TEST_SOUND_PATH = 'sounds/ring.wav';
8 9
 
10
+/**
11
+ * The type of the React {@code Component} props of {@link AudioOutputPreview}.
12
+ */
13
+type Props = {
14
+
15
+    /**
16
+     * The device id of the audio output device to use.
17
+     */
18
+    deviceId: string,
19
+
20
+    /**
21
+     * Invoked to obtain translated strings.
22
+     */
23
+    t: Function
24
+};
25
+
9 26
 /**
10 27
  * React component for playing a test sound through a specified audio device.
11 28
  *
12 29
  * @extends Component
13 30
  */
14
-class AudioOutputPreview extends Component {
15
-    /**
16
-     * AudioOutputPreview component's property types.
17
-     *
18
-     * @static
19
-     */
20
-    static propTypes = {
21
-        /**
22
-         * The device id of the audio output device to use.
23
-         */
24
-        deviceId: PropTypes.string,
25
-
26
-        /**
27
-         * Invoked to obtain translated strings.
28
-         */
29
-        t: PropTypes.func
30
-    };
31
+class AudioOutputPreview extends Component<Props> {
32
+    _audioElement: ?Object;
31 33
 
32 34
     /**
33 35
      * Initializes a new AudioOutputPreview instance.
@@ -35,7 +37,7 @@ class AudioOutputPreview extends Component {
35 37
      * @param {Object} props - The read-only React Component props with which
36 38
      * the new instance is to be initialized.
37 39
      */
38
-    constructor(props) {
40
+    constructor(props: Props) {
39 41
         super(props);
40 42
 
41 43
         this._audioElement = null;
@@ -85,6 +87,8 @@ class AudioOutputPreview extends Component {
85 87
         );
86 88
     }
87 89
 
90
+    _onClick: () => void;
91
+
88 92
     /**
89 93
      * Plays a test sound.
90 94
      *
@@ -96,6 +100,8 @@ class AudioOutputPreview extends Component {
96 100
         && this._audioElement.play();
97 101
     }
98 102
 
103
+    _setAudioElement: (Object) => void;
104
+
99 105
     /**
100 106
      * Sets the instance variable for the component's audio element so it can be
101 107
      * accessed directly.
@@ -104,7 +110,7 @@ class AudioOutputPreview extends Component {
104 110
      * @private
105 111
      * @returns {void}
106 112
      */
107
-    _setAudioElement(element) {
113
+    _setAudioElement(element: Object) {
108 114
         this._audioElement = element;
109 115
     }
110 116
 

+ 51
- 49
react/features/device-selection/components/DeviceSelector.web.js Ver fichero

@@ -1,64 +1,64 @@
1
+/* @flow */
2
+
1 3
 import AKDropdownMenu from '@atlaskit/dropdown-menu';
2 4
 import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
3
-import PropTypes from 'prop-types';
4 5
 import React, { Component } from 'react';
5 6
 
6 7
 import { translate } from '../../base/i18n';
7 8
 
9
+/**
10
+ * The type of the React {@code Component} props of {@link DeviceSelector}.
11
+ */
12
+type Props = {
13
+
14
+    /**
15
+     * MediaDeviceInfos used for display in the select element.
16
+     */
17
+    devices: Array<Object>,
18
+
19
+    /**
20
+     * If false, will return a selector with no selection options.
21
+     */
22
+    hasPermission: boolean,
23
+
24
+    /**
25
+     * CSS class for the icon to the left of the dropdown trigger.
26
+     */
27
+    icon: string,
28
+
29
+    /**
30
+     * If true, will render the selector disabled with a default selection.
31
+     */
32
+    isDisabled: boolean,
33
+
34
+    /**
35
+     * The translation key to display as a menu label.
36
+     */
37
+    label: string,
38
+
39
+    /**
40
+     * The callback to invoke when a selection is made.
41
+     */
42
+    onSelect: Function,
43
+
44
+    /**
45
+     * The default device to display as selected.
46
+     */
47
+    selectedDeviceId: string,
48
+
49
+    /**
50
+     * Invoked to obtain translated strings.
51
+     */
52
+    t: Function
53
+};
54
+
8 55
 /**
9 56
  * React component for selecting a device from a select element. Wraps
10 57
  * AKDropdownMenu with device selection specific logic.
11 58
  *
12 59
  * @extends Component
13 60
  */
14
-class DeviceSelector extends Component {
15
-    /**
16
-     * DeviceSelector component's property types.
17
-     *
18
-     * @static
19
-     */
20
-    static propTypes = {
21
-        /**
22
-         * MediaDeviceInfos used for display in the select element.
23
-         */
24
-        devices: PropTypes.array,
25
-
26
-        /**
27
-         * If false, will return a selector with no selection options.
28
-         */
29
-        hasPermission: PropTypes.bool,
30
-
31
-        /**
32
-         * CSS class for the icon to the left of the dropdown trigger.
33
-         */
34
-        icon: PropTypes.string,
35
-
36
-        /**
37
-         * If true, will render the selector disabled with a default selection.
38
-         */
39
-        isDisabled: PropTypes.bool,
40
-
41
-        /**
42
-         * The translation key to display as a menu label.
43
-         */
44
-        label: PropTypes.string,
45
-
46
-        /**
47
-         * The callback to invoke when a selection is made.
48
-         */
49
-        onSelect: PropTypes.func,
50
-
51
-        /**
52
-         * The default device to display as selected.
53
-         */
54
-        selectedDeviceId: PropTypes.string,
55
-
56
-        /**
57
-         * Invoked to obtain translated strings.
58
-         */
59
-        t: PropTypes.func
60
-    };
61
-
61
+class DeviceSelector extends Component<Props> {
62 62
     /**
63 63
      * Initializes a new DeviceSelector instance.
64 64
      *
@@ -178,6 +178,8 @@ class DeviceSelector extends Component {
178 178
         );
179 179
     }
180 180
 
181
+    _onSelect: (Object) => void;
182
+
181 183
     /**
182 184
      * Invokes the passed in callback to notify of selection changes.
183 185
      *

+ 20
- 20
react/features/device-selection/components/VideoInputPreview.js Ver fichero

@@ -1,35 +1,35 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { Video } from '../../base/media';
5 6
 
6 7
 const VIDEO_ERROR_CLASS = 'video-preview-has-error';
7 8
 
9
+/**
10
+ * The type of the React {@code Component} props of {@link VideoInputPreview}.
11
+ */
12
+type Props = {
13
+
14
+    /**
15
+     * An error message to display instead of a preview. Displaying an error
16
+     * will take priority over displaying a video preview.
17
+     */
18
+    error: string,
19
+
20
+    /**
21
+     * The JitsiLocalTrack to display.
22
+     */
23
+    track: Object
24
+};
25
+
8 26
 /**
9 27
  * React component for displaying video. This component defers to lib-jitsi-meet
10 28
  * logic for rendering the video.
11 29
  *
12 30
  * @extends Component
13 31
  */
14
-class VideoInputPreview extends Component {
15
-    /**
16
-     * VideoInputPreview component's property types.
17
-     *
18
-     * @static
19
-     */
20
-    static propTypes = {
21
-        /**
22
-         * An error message to display instead of a preview. Displaying an error
23
-         * will take priority over displaying a video preview.
24
-         */
25
-        error: PropTypes.string,
26
-
27
-        /**
28
-         * The JitsiLocalTrack to display.
29
-         */
30
-        track: PropTypes.object
31
-    };
32
-
32
+class VideoInputPreview extends Component<Props> {
33 33
     /**
34 34
      * Implements React's {@link Component#render()}.
35 35
      *

+ 71
- 53
react/features/display-name/components/DisplayName.web.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
@@ -8,53 +9,70 @@ import { translate } from '../../base/i18n';
8 9
 import { participantDisplayNameChanged } from '../../base/participants';
9 10
 
10 11
 /**
11
- * React {@code Component} for displaying and editing a participant's name.
12
- *
13
- * @extends Component
12
+ * The type of the React {@code Component} props of {@link DisplayName}.
14 13
  */
15
-class DisplayName extends Component {
14
+type Props = {
15
+
16 16
     /**
17
-     * {@code DisplayName}'s property types.
18
-     *
19
-     * @static
17
+     * Whether or not the display name should be editable on click.
20 18
      */
21
-    static propTypes = {
22
-        /**
23
-         * Whether or not the display name should be editable on click.
24
-         */
25
-        allowEditing: PropTypes.bool,
19
+    allowEditing: boolean,
26 20
 
27
-        /**
28
-         * Invoked to update the participant's display name.
29
-         */
30
-        dispatch: PropTypes.func,
21
+    /**
22
+     * Invoked to update the participant's display name.
23
+     */
24
+    dispatch: Dispatch<*>,
31 25
 
32
-        /**
33
-         * The participant's current display name.
34
-         */
35
-        displayName: PropTypes.string,
26
+    /**
27
+     * The participant's current display name.
28
+     */
29
+    displayName: string,
36 30
 
37
-        /**
38
-         * A string to append to the displayName, if provided.
39
-         */
40
-        displayNameSuffix: PropTypes.string,
31
+    /**
32
+     * A string to append to the displayName, if provided.
33
+     */
34
+    displayNameSuffix: string,
41 35
 
42
-        /**
43
-         * The ID attribute to add to the component. Useful for global querying
44
-         * for the component by legacy components and torture tests.
45
-         */
46
-        elementID: PropTypes.string,
36
+    /**
37
+     * The ID attribute to add to the component. Useful for global querying for
38
+     * the component by legacy components and torture tests.
39
+     */
40
+    elementID: string,
47 41
 
48
-        /**
49
-         * The ID of the participant whose name is being displayed.
50
-         */
51
-        participantID: PropTypes.string,
42
+    /**
43
+     * The ID of the participant whose name is being displayed.
44
+     */
45
+    participantID: string,
52 46
 
53
-        /**
54
-         * Invoked to obtain translated strings.
55
-         */
56
-        t: PropTypes.func
57
-    };
47
+    /**
48
+     * Invoked to obtain translated strings.
49
+     */
50
+    t: Function
51
+};
52
+
53
+/**
54
+ * The type of the React {@code Component} state of {@link DisplayName}.
55
+ */
56
+type State = {
57
+
58
+    /**
59
+     * The current value of the display name in the edit field.
60
+     */
61
+    editDisplayNameValue: string,
62
+
63
+    /**
64
+     * Whether or not the component should be displaying an editable input.
65
+     */
66
+    isEditing: boolean
67
+};
68
+
69
+/**
70
+ * React {@code Component} for displaying and editing a participant's name.
71
+ *
72
+ * @extends Component
73
+ */
74
+class DisplayName extends Component<Props, State> {
75
+    _nameInput: ?HTMLInputElement;
58 76
 
59 77
     /**
60 78
      * Initializes a new {@code DisplayName} instance.
@@ -62,23 +80,11 @@ class DisplayName extends Component {
62 80
      * @param {Object} props - The read-only properties with which the new
63 81
      * instance is to be initialized.
64 82
      */
65
-    constructor(props) {
83
+    constructor(props: Props) {
66 84
         super(props);
67 85
 
68 86
         this.state = {
69
-            /**
70
-             * The current value of the display name in the edit field.
71
-             *
72
-             * @type {string}
73
-             */
74 87
             editDisplayNameValue: '',
75
-
76
-            /**
77
-             * Whether or not the component should be displaying an editable
78
-             * input.
79
-             *
80
-             * @type {boolean}
81
-             */
82 88
             isEditing: false
83 89
         };
84 90
 
@@ -109,7 +115,9 @@ class DisplayName extends Component {
109 115
      * @returns {void}
110 116
      */
111 117
     componentDidUpdate(previousProps, previousState) {
112
-        if (!previousState.isEditing && this.state.isEditing) {
118
+        if (!previousState.isEditing
119
+            && this.state.isEditing
120
+            && this._nameInput) {
113 121
             this._nameInput.select();
114 122
         }
115 123
     }
@@ -156,6 +164,8 @@ class DisplayName extends Component {
156 164
         );
157 165
     }
158 166
 
167
+    _onChange: () => void;
168
+
159 169
     /**
160 170
      * Updates the internal state of the display name entered into the edit
161 171
      * field.
@@ -170,6 +180,8 @@ class DisplayName extends Component {
170 180
         });
171 181
     }
172 182
 
183
+    _onKeyDown: () => void;
184
+
173 185
     /**
174 186
      * Submits the editted display name update if the enter key is pressed.
175 187
      *
@@ -183,6 +195,8 @@ class DisplayName extends Component {
183 195
         }
184 196
     }
185 197
 
198
+    _onStartEditing: () => void;
199
+
186 200
     /**
187 201
      * Updates the component to display an editable input field and sets the
188 202
      * initial value to the current display name.
@@ -199,6 +213,8 @@ class DisplayName extends Component {
199 213
         }
200 214
     }
201 215
 
216
+    _onSubmit: () => void;
217
+
202 218
     /**
203 219
      * Dispatches an action to update the display name if any change has
204 220
      * occurred after editing. Clears any temporary state used to keep track
@@ -223,6 +239,8 @@ class DisplayName extends Component {
223 239
         this._nameInput = null;
224 240
     }
225 241
 
242
+    _setNameInputRef: (HTMLInputElement | null) => void;
243
+
226 244
     /**
227 245
      * Sets the internal reference to the HTML element backing the React
228 246
      * {@code Component} input with id {@code editDisplayName}.

+ 41
- 31
react/features/display-name/components/DisplayNamePrompt.web.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 import { FieldTextStateless as TextField } from '@atlaskit/field-text';
@@ -11,50 +12,55 @@ import {
11 12
 } from '../../base/participants';
12 13
 
13 14
 /**
14
- * Implements a React {@code Component} for displaying a dialog with an field
15
- * for setting the local participant's display name.
16
- *
17
- * @extends Component
15
+ * The type of the React {@code Component} props of {@link DisplayNamePrompt}.
18 16
  */
19
-class DisplayNamePrompt extends Component {
17
+type Props = {
18
+
20 19
     /**
21
-     * {@code DisplayNamePrompt} component's property types.
22
-     *
23
-     * @static
20
+     * The current ID for the local participant. Used for setting the display
21
+     * name on the associated participant.
24 22
      */
25
-    static propTypes = {
26
-        /**
27
-         * The current ID for the local participant. Used for setting the
28
-         * display name on the associated participant.
29
-         */
30
-        _localParticipantID: PropTypes.string,
23
+    _localParticipantID: string,
31 24
 
32
-        /**
33
-         * Invoked to update the local participant's display name.
34
-         */
35
-        dispatch: PropTypes.func,
25
+    /**
26
+     * Invoked to update the local participant's display name.
27
+     */
28
+    dispatch: Dispatch<*>,
36 29
 
37
-        /**
38
-         * Invoked to obtain translated strings.
39
-         */
40
-        t: PropTypes.func
41
-    };
30
+    /**
31
+     * Invoked to obtain translated strings.
32
+     */
33
+    t: Function
34
+};
35
+
36
+/**
37
+ * The type of the React {@code Component} props of {@link DisplayNamePrompt}.
38
+ */
39
+type State = {
42 40
 
41
+    /**
42
+     * The name to show in the display name text field.
43
+     */
44
+    displayName: string
45
+};
46
+
47
+/**
48
+ * Implements a React {@code Component} for displaying a dialog with an field
49
+ * for setting the local participant's display name.
50
+ *
51
+ * @extends Component
52
+ */
53
+class DisplayNamePrompt extends Component<Props, State> {
43 54
     /**
44 55
      * Initializes a new {@code DisplayNamePrompt} instance.
45 56
      *
46 57
      * @param {Object} props - The read-only properties with which the new
47 58
      * instance is to be initialized.
48 59
      */
49
-    constructor(props) {
60
+    constructor(props: Props) {
50 61
         super(props);
51 62
 
52 63
         this.state = {
53
-            /**
54
-             * The name to show in the display name text field.
55
-             *
56
-             * @type {string}
57
-             */
58 64
             displayName: ''
59 65
         };
60 66
 
@@ -88,6 +94,8 @@ class DisplayNamePrompt extends Component {
88 94
             </Dialog>);
89 95
     }
90 96
 
97
+    _onDisplayNameChange: (Object) => void;
98
+
91 99
     /**
92 100
      * Updates the entered display name.
93 101
      *
@@ -102,12 +110,14 @@ class DisplayNamePrompt extends Component {
102 110
         });
103 111
     }
104 112
 
113
+    _onSubmit: () => boolean;
114
+
105 115
     /**
106 116
      * Dispatches an action to update the local participant's display name. A
107 117
      * name must be entered for the action to dispatch.
108 118
      *
109 119
      * @private
110
-     * @returns {void}
120
+     * @returns {boolean}
111 121
      */
112 122
     _onSubmit() {
113 123
         const { displayName } = this.state;

+ 81
- 51
react/features/feedback/components/FeedbackDialog.web.js Ver fichero

@@ -1,9 +1,8 @@
1
-/* global interfaceConfig */
1
+/* @flow */
2 2
 
3 3
 import { FieldTextAreaStateless } from '@atlaskit/field-text-area';
4 4
 import StarIcon from '@atlaskit/icon/glyph/star';
5 5
 import StarFilledIcon from '@atlaskit/icon/glyph/star-filled';
6
-import PropTypes from 'prop-types';
7 6
 import React, { Component } from 'react';
8 7
 import { connect } from 'react-redux';
9 8
 
@@ -16,6 +15,8 @@ import { translate } from '../../base/i18n';
16 15
 
17 16
 import { cancelFeedback, submitFeedback } from '../actions';
18 17
 
18
+declare var interfaceConfig: Object;
19
+
19 20
 const scoreAnimationClass
20 21
     = interfaceConfig.ENABLE_FEEDBACK_ANIMATION ? 'shake-rotate' : '';
21 22
 
@@ -34,55 +35,83 @@ const SCORES = [
34 35
 ];
35 36
 
36 37
 /**
37
- * A React {@code Component} for displaying a dialog to rate the current
38
- * conference quality, write a message describing the experience, and submit
39
- * the feedback.
40
- *
41
- * @extends Component
38
+ * The type of the React {@code Component} props of {@link FeedbackDialog}.
42 39
  */
43
-class FeedbackDialog extends Component {
40
+type Props = {
41
+
44 42
     /**
45
-     * {@code FeedbackDialog} component's property types.
46
-     *
47
-     * @static
43
+     * The cached feedback message, if any, that was set when closing a previous
44
+     * instance of {@code FeedbackDialog}.
48 45
      */
49
-    static propTypes = {
50
-        /**
51
-         * The cached feedback message, if any, that was set when closing a
52
-         * previous instance of {@code FeedbackDialog}.
53
-         */
54
-        _message: PropTypes.string,
46
+    _message: string,
55 47
 
56
-        /**
57
-         * The cached feedback score, if any, that was set when closing a
58
-         * previous instance of {@code FeedbackDialog}.
59
-         */
60
-        _score: PropTypes.number,
48
+    /**
49
+     * The cached feedback score, if any, that was set when closing a previous
50
+     * instance of {@code FeedbackDialog}.
51
+     */
52
+    _score: number,
61 53
 
62
-        /**
63
-         * The JitsiConference that is being rated. The conference is passed in
64
-         * because feedback can occur after a conference has been left, so
65
-         * references to it may no longer exist in redux.
66
-         *
67
-         * @type {JitsiConference}
68
-         */
69
-        conference: PropTypes.object,
54
+    /**
55
+     * The JitsiConference that is being rated. The conference is passed in
56
+     * because feedback can occur after a conference has been left, so
57
+     * references to it may no longer exist in redux.
58
+     */
59
+    conference: Object,
70 60
 
71
-        /**
72
-         * Invoked to signal feedback submission or canceling.
73
-         */
74
-        dispatch: PropTypes.func,
61
+    /**
62
+     * Invoked to signal feedback submission or canceling.
63
+     */
64
+    dispatch: Dispatch<*>,
75 65
 
76
-        /**
77
-         * Callback invoked when {@code FeedbackDialog} is unmounted.
78
-         */
79
-        onClose: PropTypes.func,
66
+    /**
67
+     * Callback invoked when {@code FeedbackDialog} is unmounted.
68
+     */
69
+    onClose: Function,
80 70
 
81
-        /**
82
-         * Invoked to obtain translated strings.
83
-         */
84
-        t: PropTypes.func
85
-    };
71
+    /**
72
+     * Invoked to obtain translated strings.
73
+     */
74
+    t: Function
75
+};
76
+
77
+/**
78
+ * The type of the React {@code Component} state of {@link FeedbackDialog}.
79
+ */
80
+type State = {
81
+
82
+    /**
83
+     * The currently entered feedback message.
84
+     */
85
+    message: string,
86
+
87
+    /**
88
+     * The score selection index which is currently being hovered. The value -1
89
+     * is used as a sentinel value to match store behavior of using -1 for no
90
+     * score having been selected.
91
+     */
92
+    mousedOverScore: number,
93
+
94
+    /**
95
+     * The currently selected score selection index. The score will not be 0
96
+     * indexed so subtract one to map with SCORES.
97
+     */
98
+    score: number
99
+};
100
+
101
+/**
102
+ * A React {@code Component} for displaying a dialog to rate the current
103
+ * conference quality, write a message describing the experience, and submit
104
+ * the feedback.
105
+ *
106
+ * @extends Component
107
+ */
108
+class FeedbackDialog extends Component<Props, State> {
109
+    /**
110
+     * An array of objects with click handlers for each of the scores listed in
111
+     * the constant SCORES. This pattern is used for binding event handlers only
112
+     * once for each score selection icon.
113
+     */
114
+    _scoreClickConfigurations: Array<Object>;
86 115
 
87 116
     /**
88 117
      * Initializes a new {@code FeedbackDialog} instance.
@@ -90,7 +119,7 @@ class FeedbackDialog extends Component {
90 119
      * @param {Object} props - The read-only React {@code Component} props with
91 120
      * which the new instance is to be initialized.
92 121
      */
93
-    constructor(props) {
122
+    constructor(props: Props) {
94 123
         super(props);
95 124
 
96 125
         const { _message, _score } = this.props;
@@ -121,13 +150,6 @@ class FeedbackDialog extends Component {
121 150
             score: _score > -1 ? _score - 1 : _score
122 151
         };
123 152
 
124
-        /**
125
-         * An array of objects with click handlers for each of the scores listed
126
-         * in SCORES. This pattern is used for binding event handlers only once
127
-         * for each score selection icon.
128
-         *
129
-         * @type {Object[]}
130
-         */
131 153
         this._scoreClickConfigurations = SCORES.map((textKey, index) => {
132 154
             return {
133 155
                 _onClick: () => this._onScoreSelect(index),
@@ -234,6 +256,8 @@ class FeedbackDialog extends Component {
234 256
         );
235 257
     }
236 258
 
259
+    _onCancel: () => boolean;
260
+
237 261
     /**
238 262
      * Dispatches an action notifying feedback was not submitted. The submitted
239 263
      * score will have one added as the rest of the app does not expect 0
@@ -251,6 +275,8 @@ class FeedbackDialog extends Component {
251 275
         return true;
252 276
     }
253 277
 
278
+    _onMessageChange: (Object) => void;
279
+
254 280
     /**
255 281
      * Updates the known entered feedback message.
256 282
      *
@@ -274,6 +300,8 @@ class FeedbackDialog extends Component {
274 300
         this.setState({ score });
275 301
     }
276 302
 
303
+    _onScoreContainerMouseLeave: () => void;
304
+
277 305
     /**
278 306
      * Sets the currently hovered score to null to indicate no hover is
279 307
      * occurring.
@@ -297,6 +325,8 @@ class FeedbackDialog extends Component {
297 325
         this.setState({ mousedOverScore });
298 326
     }
299 327
 
328
+    _onSubmit: () => void;
329
+
300 330
     /**
301 331
      * Dispatches the entered feedback for submission. The submitted score will
302 332
      * have one added as the rest of the app does not expect 0 indexing.

+ 14
- 14
react/features/filmstrip/components/web/AudioMutedIndicator.js Ver fichero

@@ -1,26 +1,26 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import BaseIndicator from './BaseIndicator';
5 6
 
6 7
 /**
7
- * React {@code Component} for showing an audio muted icon with a tooltip.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link AudioMutedIndicator}.
10 9
  */
11
-class AudioMutedIndicator extends Component {
10
+type Props = {
11
+
12 12
     /**
13
-     * {@code AudioMutedIndicator} component's property types.
14
-     *
15
-     * @static
13
+     * From which side of the indicator the tooltip should appear from.
16 14
      */
17
-    static propTypes = {
18
-        /**
19
-         * From which side of the indicator the tooltip should appear from.
20
-         */
21
-        tooltipPosition: PropTypes.string
22
-    };
15
+    tooltipPosition: string
16
+};
23 17
 
18
+/**
19
+ * React {@code Component} for showing an audio muted icon with a tooltip.
20
+ *
21
+ * @extends Component
22
+ */
23
+class AudioMutedIndicator extends Component<Props> {
24 24
     /**
25 25
      * Implements React's {@link Component#render()}.
26 26
      *

+ 46
- 46
react/features/filmstrip/components/web/BaseIndicator.js Ver fichero

@@ -1,15 +1,59 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import Tooltip from '@atlaskit/tooltip';
4 5
 
5 6
 import { translate } from '../../../base/i18n';
6 7
 
8
+/**
9
+ * The type of the React {@code Component} props of {@link BaseIndicator}.
10
+ */
11
+type Props = {
12
+
13
+    /**
14
+     * Additional CSS class names to set on the icon container.
15
+     */
16
+    className: string,
17
+
18
+    /**
19
+     * The CSS classnames to set on the icon element of the component.
20
+     */
21
+    iconClassName: string,
22
+
23
+    /**
24
+     * The font size for the icon.
25
+     */
26
+    iconSize: string,
27
+
28
+    /**
29
+     * The ID attribue to set on the root element of the component.
30
+     */
31
+    id: string,
32
+
33
+    /**
34
+     * Invoked to obtain translated strings.
35
+     */
36
+    t: Function,
37
+
38
+    /**
39
+     * The translation key to use for displaying a tooltip when hovering over
40
+     * the component.
41
+     */
42
+    tooltipKey: string,
43
+
44
+    /**
45
+     * From which side of the indicator the tooltip should appear from,
46
+     * defaulting to "top".
47
+     */
48
+    tooltipPosition: string
49
+};
50
+
7 51
 /**
8 52
  * React {@code Component} for showing an icon with a tooltip.
9 53
  *
10 54
  * @extends Component
11 55
  */
12
-class BaseIndicator extends Component {
56
+class BaseIndicator extends Component<Props> {
13 57
     /**
14 58
      * Default values for {@code BaseIndicator} component's properties.
15 59
      *
@@ -23,50 +67,6 @@ class BaseIndicator extends Component {
23 67
         tooltipPosition: 'top'
24 68
     };
25 69
 
26
-    /**
27
-     * {@code BaseIndicator} component's property types.
28
-     *
29
-     * @static
30
-     */
31
-    static propTypes = {
32
-        /**
33
-         * Additional CSS class names to set on the icon container.
34
-         */
35
-        className: PropTypes.string,
36
-
37
-        /**
38
-         * The CSS classnames to set on the icon element of the component.
39
-         */
40
-        iconClassName: PropTypes.string,
41
-
42
-        /**
43
-         * The font size for the icon.
44
-         */
45
-        iconSize: PropTypes.string,
46
-
47
-        /**
48
-         * The ID attribue to set on the root element of the component.
49
-         */
50
-        id: PropTypes.string,
51
-
52
-        /**
53
-         * Invoked to obtain translated strings.
54
-         */
55
-        t: PropTypes.func,
56
-
57
-        /**
58
-         * The translation key to use for displaying a tooltip when hovering
59
-         * over the component.
60
-         */
61
-        tooltipKey: PropTypes.string,
62
-
63
-        /**
64
-         * From which side of the indicator the tooltip should appear from.
65
-         * Defaults to "top".
66
-         */
67
-        tooltipPosition: PropTypes.string
68
-    };
69
-
70 70
     /**
71 71
      * Implements React's {@link Component#render()}.
72 72
      *

+ 20
- 21
react/features/filmstrip/components/web/DominantSpeakerIndicator.js Ver fichero

@@ -1,34 +1,33 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import BaseIndicator from './BaseIndicator';
5 6
 
6 7
 /**
7
- * Thumbnail badge showing that the participant is the dominant speaker in
8
- * the conference.
9
- *
10
- * @extends Component
8
+ * The type of the React {@code Component} props of
9
+ * {@link DominantSpeakerIndicator}.
11 10
  */
12
-class DominantSpeakerIndicator extends Component {
11
+type Props = {
12
+
13 13
     /**
14
-     * {@code DominantSpeakerIndicator} component's property types.
15
-     *
16
-     * @static
14
+     * The font-size for the icon.
17 15
      */
18
-    static propTypes = {
19
-        /**
20
-         * The font-size for the icon.
21
-         *
22
-         * @type {number}
23
-         */
24
-        iconSize: PropTypes.number,
16
+    iconSize: number,
25 17
 
26
-        /**
27
-         * From which side of the indicator the tooltip should appear from.
28
-         */
29
-        tooltipPosition: PropTypes.string
30
-    };
18
+    /**
19
+     * From which side of the indicator the tooltip should appear from.
20
+     */
21
+    tooltipPosition: string
22
+};
31 23
 
24
+/**
25
+ * Thumbnail badge showing that the participant is the dominant speaker in
26
+ * the conference.
27
+ *
28
+ * @extends Component
29
+ */
30
+class DominantSpeakerIndicator extends Component<Props> {
32 31
     /**
33 32
      * Implements React's {@link Component#render()}.
34 33
      *

+ 14
- 14
react/features/filmstrip/components/web/ModeratorIndicator.js Ver fichero

@@ -1,26 +1,26 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import BaseIndicator from './BaseIndicator';
5 6
 
6 7
 /**
7
- * React {@code Component} for showing a moderator icon with a tooltip.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link ModeratorIndicator}.
10 9
  */
11
-class ModeratorIndicator extends Component {
10
+type Props = {
11
+
12 12
     /**
13
-     * {@code ModeratorIndicator} component's property types.
14
-     *
15
-     * @static
13
+     * From which side of the indicator the tooltip should appear from.
16 14
      */
17
-    static propTypes = {
18
-        /**
19
-         * From which side of the indicator the tooltip should appear from.
20
-         */
21
-        tooltipPosition: PropTypes.string
22
-    };
15
+    tooltipPosition: string
16
+};
23 17
 
18
+/**
19
+ * React {@code Component} for showing a moderator icon with a tooltip.
20
+ *
21
+ * @extends Component
22
+ */
23
+class ModeratorIndicator extends Component<Props> {
24 24
     /**
25 25
      * Implements React's {@link Component#render()}.
26 26
      *

+ 18
- 20
react/features/filmstrip/components/web/RaisedHandIndicator.js Ver fichero

@@ -1,33 +1,31 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import BaseIndicator from './BaseIndicator';
5 6
 
6 7
 /**
7
- * Thumbnail badge showing that the participant would like to speak.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link RaisedHandIndicator}.
10 9
  */
11
-class RaisedHandIndicator extends Component {
10
+type Props = {
11
+
12 12
     /**
13
-     * {@code RaisedHandIndicator} component's property types.
14
-     *
15
-     * @static
13
+     * The font-size for the icon.
16 14
      */
17
-    static propTypes = {
18
-        /**
19
-         * The font-size for the icon.
20
-         *
21
-         * @type {number}
22
-         */
23
-        iconSize: PropTypes.number,
15
+    iconSize: number,
24 16
 
25
-        /**
26
-         * From which side of the indicator the tooltip should appear from.
27
-         */
28
-        tooltipPosition: PropTypes.string
29
-    };
17
+    /**
18
+     * From which side of the indicator the tooltip should appear from.
19
+     */
20
+    tooltipPosition: string
21
+};
30 22
 
23
+/**
24
+ * Thumbnail badge showing that the participant would like to speak.
25
+ *
26
+ * @extends Component
27
+ */
28
+class RaisedHandIndicator extends Component<Props> {
31 29
     /**
32 30
      * Implements React's {@link Component#render()}.
33 31
      *

+ 14
- 14
react/features/filmstrip/components/web/VideoMutedIndicator.js Ver fichero

@@ -1,26 +1,26 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import BaseIndicator from './BaseIndicator';
5 6
 
6 7
 /**
7
- * React {@code Component} for showing a video muted icon with a tooltip.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link VideoMutedIndicator}.
10 9
  */
11
-class VideoMutedIndicator extends Component {
10
+type Props = {
11
+
12 12
     /**
13
-     * {@code VideoMutedIndicator} component's property types.
14
-     *
15
-     * @static
13
+     * From which side of the indicator the tooltip should appear from.
16 14
      */
17
-    static propTypes = {
18
-        /**
19
-         * From which side of the indicator the tooltip should appear from.
20
-         */
21
-        tooltipPosition: PropTypes.string
22
-    };
15
+    tooltipPosition: string
16
+};
23 17
 
18
+/**
19
+ * React {@code Component} for showing a video muted icon with a tooltip.
20
+ *
21
+ * @extends Component
22
+ */
23
+class VideoMutedIndicator extends Component<Props> {
24 24
     /**
25 25
      * Implements React's {@link Component#render()}.
26 26
      *

+ 72
- 64
react/features/invite/components/AddPeopleDialog.web.js Ver fichero

@@ -2,7 +2,6 @@
2 2
 
3 3
 import Avatar from '@atlaskit/avatar';
4 4
 import InlineMessage from '@atlaskit/inline-message';
5
-import PropTypes from 'prop-types';
6 5
 import React, { Component } from 'react';
7 6
 import { connect } from 'react-redux';
8 7
 
@@ -20,87 +19,95 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
20 19
 declare var interfaceConfig: Object;
21 20
 
22 21
 /**
23
- * The dialog that allows to invite people to the call.
22
+ * The type of the React {@code Component} props of {@link AddPeopleDialog}.
24 23
  */
25
-class AddPeopleDialog extends Component<*, *> {
24
+type Props = {
25
+
26 26
     /**
27
-     * {@code AddPeopleDialog}'s property types.
28
-     *
29
-     * @static
27
+     * The {@link JitsiMeetConference} which will be used to invite "room"
28
+     * participants through the SIP Jibri (Video SIP gateway).
30 29
      */
31
-    static propTypes = {
32
-        /**
33
-         * The {@link JitsiMeetConference} which will be used to invite "room"
34
-         * participants through the SIP Jibri (Video SIP gateway).
35
-         */
36
-        _conference: PropTypes.object,
30
+    _conference: Object,
37 31
 
38
-        /**
39
-         * The URL for validating if a phone number can be called.
40
-         */
41
-        _dialOutAuthUrl: PropTypes.string,
32
+    /**
33
+     * The URL for validating if a phone number can be called.
34
+     */
35
+    _dialOutAuthUrl: string,
42 36
 
43
-        /**
44
-         * Whether to show a footer text after the search results
45
-         * as a last element.
46
-         */
47
-        _footerTextEnabled: PropTypes.bool,
37
+    /**
38
+     * Whether to show a footer text after the search results as a last element.
39
+     */
40
+    _footerTextEnabled: boolean,
48 41
 
49
-        /**
50
-         * The JWT token.
51
-         */
52
-        _jwt: PropTypes.string,
42
+    /**
43
+     * The JWT token.
44
+     */
45
+    _jwt: string,
53 46
 
54
-        /**
55
-         * The query types used when searching people.
56
-         */
57
-        _peopleSearchQueryTypes: PropTypes.arrayOf(PropTypes.string),
47
+    /**
48
+     * The query types used when searching people.
49
+     */
50
+    _peopleSearchQueryTypes: Array<string>,
58 51
 
59
-        /**
60
-         * The URL pointing to the service allowing for people search.
61
-         */
62
-        _peopleSearchUrl: PropTypes.string,
52
+    /**
53
+     * The URL pointing to the service allowing for people search.
54
+     */
55
+    _peopleSearchUrl: string,
63 56
 
64
-        /**
65
-         * Whether or not to show Add People functionality.
66
-         */
67
-        addPeopleEnabled: PropTypes.bool,
57
+    /**
58
+     * Whether or not to show Add People functionality.
59
+     */
60
+    addPeopleEnabled: boolean,
68 61
 
69
-        /**
70
-         * Whether or not to show Dial Out functionality.
71
-         */
72
-        dialOutEnabled: PropTypes.bool,
62
+    /**
63
+     * Whether or not to show Dial Out functionality.
64
+     */
65
+    dialOutEnabled: boolean,
73 66
 
74
-        /**
75
-         * The redux {@code dispatch} function.
76
-         */
77
-        dispatch: PropTypes.func,
67
+    /**
68
+     * The redux {@code dispatch} function.
69
+     */
70
+    dispatch: Dispatch<*>,
78 71
 
79
-        /**
80
-         * Invoked to obtain translated strings.
81
-         */
82
-        t: PropTypes.func
83
-    };
72
+    /**
73
+     * Invoked to obtain translated strings.
74
+     */
75
+    t: Function,
76
+};
77
+
78
+/**
79
+ * The type of the React {@code Component} state of {@link AddPeopleDialog}.
80
+ */
81
+type State = {
82
+
83
+    /**
84
+     * Indicating that an error occurred when adding people to the call.
85
+     */
86
+    addToCallError: boolean,
87
+
88
+    /**
89
+     * Indicating that we're currently adding the new people to the
90
+     * call.
91
+     */
92
+    addToCallInProgress: boolean,
93
+
94
+    /**
95
+     * The list of invite items.
96
+     */
97
+    inviteItems: Array<Object>
98
+};
84 99
 
100
+/**
101
+ * The dialog that allows to invite people to the call.
102
+ */
103
+class AddPeopleDialog extends Component<Props, State> {
85 104
     _multiselect = null;
86 105
 
87 106
     _resourceClient: Object;
88 107
 
89 108
     state = {
90
-        /**
91
-         * Indicating that an error occurred when adding people to the call.
92
-         */
93 109
         addToCallError: false,
94
-
95
-        /**
96
-         * Indicating that we're currently adding the new people to the
97
-         * call.
98
-         */
99 110
         addToCallInProgress: false,
100
-
101
-        /**
102
-         * The list of invite items.
103
-         */
104 111
         inviteItems: []
105 112
     };
106 113
 
@@ -110,7 +117,7 @@ class AddPeopleDialog extends Component<*, *> {
110 117
      * @param {Object} props - The read-only properties with which the new
111 118
      * instance is to be initialized.
112 119
      */
113
-    constructor(props) {
120
+    constructor(props: Props) {
114 121
         super(props);
115 122
 
116 123
         // Bind event handlers so they are only bound once per instance.
@@ -142,10 +149,11 @@ class AddPeopleDialog extends Component<*, *> {
142 149
     /**
143 150
      * React Component method that executes once component is updated.
144 151
      *
152
+     * @param {Object} prevProps - The state object before the update.
145 153
      * @param {Object} prevState - The state object before the update.
146 154
      * @returns {void}
147 155
      */
148
-    componentDidUpdate(prevState) {
156
+    componentDidUpdate(prevProps, prevState) {
149 157
         /**
150 158
          * Clears selected items from the multi select component on successful
151 159
          * invite.

+ 19
- 19
react/features/invite/components/dial-in-info-page/NoRoomError.web.js Ver fichero

@@ -1,32 +1,32 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../../base/i18n';
5 6
 
7
+/**
8
+ * The type of the React {@code Component} props of {@link NoRoomError}.
9
+ */
10
+type Props = {
11
+
12
+    /**
13
+     * Additional CSS classnames to append to the root of the component.
14
+     */
15
+    className: string,
16
+
17
+    /**
18
+     * Invoked to obtain translated strings.
19
+     */
20
+    t: Function
21
+};
22
+
6 23
 /**
7 24
  * Displays an error message stating no room name was specified to fetch dial-in
8 25
  * numbers for.
9 26
  *
10 27
  * @extends Component
11 28
  */
12
-class NoRoomError extends Component {
13
-    /**
14
-     * {@code NoRoomError} component's property types.
15
-     *
16
-     * @static
17
-     */
18
-    static propTypes = {
19
-        /**
20
-         * Additional CSS classnames to append to the root of the component.
21
-         */
22
-        className: PropTypes.string,
23
-
24
-        /**
25
-         * Invoked to obtain translated strings.
26
-         */
27
-        t: PropTypes.func
28
-    };
29
-
29
+class NoRoomError extends Component<Props> {
30 30
     /**
31 31
      * Implements React's {@link Component#render()}.
32 32
      *

+ 19
- 19
react/features/invite/components/dial-in-summary/ConferenceID.web.js Ver fichero

@@ -1,31 +1,31 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../../base/i18n';
5 6
 
6 7
 /**
7
- * Displays a conference ID used as a pin for dialing into a conferene.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link ConferenceID}.
10 9
  */
11
-class ConferenceID extends Component {
10
+type Props = {
11
+
12 12
     /**
13
-     * {@code ConferenceID} component's property types.
14
-     *
15
-     * @static
13
+     * The conference ID for dialing in.
14
+     */
15
+    conferenceID: number,
16
+
17
+    /**
18
+     * Invoked to obtain translated strings.
16 19
      */
17
-    static propTypes = {
18
-        /**
19
-         * The conference ID for dialing in.
20
-         */
21
-        conferenceID: PropTypes.number,
22
-
23
-        /**
24
-         * Invoked to obtain translated strings.
25
-         */
26
-        t: PropTypes.func
27
-    };
20
+    t: Function
21
+};
28 22
 
23
+/**
24
+ * Displays a conference ID used as a pin for dialing into a conference.
25
+ *
26
+ * @extends Component
27
+ */
28
+class ConferenceID extends Component<Props> {
29 29
     /**
30 30
      * Implements React's {@link Component#render()}.
31 31
      *

+ 68
- 44
react/features/invite/components/dial-in-summary/DialInSummary.web.js Ver fichero

@@ -1,6 +1,5 @@
1
-/* global config */
1
+/* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../../base/i18n';
@@ -8,53 +7,72 @@ import { translate } from '../../../base/i18n';
8 7
 import ConferenceID from './ConferenceID';
9 8
 import NumbersList from './NumbersList';
10 9
 
10
+declare var config: Object;
11
+
11 12
 /**
12
- * Displays a page listing numbers for dialing into a conference and pin to
13
- * the a specific conference.
14
- *
15
- * @extends Component
13
+ * The type of the React {@code Component} props of {@link DialInSummary}.
16 14
  */
17
-class DialInSummary extends Component {
15
+type Props = {
16
+
18 17
     /**
19
-     * {@code DialInSummary} component's property types.
20
-     *
21
-     * @static
22
-     */
23
-    static propTypes = {
24
-        /**
25
-         * Additional CSS classnames to append to the root of the component.
26
-         */
27
-        className: PropTypes.string,
28
-
29
-        /**
30
-         * Whether or not numbers should include links with the telephone
31
-         * protocol.
32
-         */
33
-        clickableNumbers: PropTypes.bool,
34
-
35
-        /**
36
-         * The name of the conference to show a conferenceID for.
37
-         */
38
-        room: PropTypes.string,
39
-
40
-        /**
41
-         * Invoked to obtain translated strings.
42
-         */
43
-        t: PropTypes.func
44
-    };
18
+     * Additional CSS classnames to append to the root of the component.
19
+     */
20
+    className: string,
45 21
 
46 22
     /**
47
-     * {@code DialInSummary} component's local state.
48
-     *
49
-     * @type {Object}
50
-     * @property {number} conferenceID - The numeric ID of the conference, used
51
-     * as a pin when dialing in.
52
-     * @property {string} error - An error message to display.
53
-     * @property {boolean} loading - Whether or not the app is fetching data.
54
-     * @property {Array|Object} numbers - The dial-in numbers.
55
-     * entered by the local participant.
56
-     * @property {boolean} numbersEnabled - Whether or not dial-in is allowed.
23
+     * Whether or not numbers should include links with the telephone protocol.
57 24
      */
25
+    clickableNumbers: boolean,
26
+
27
+    /**
28
+     * The name of the conference to show a conferenceID for.
29
+     */
30
+    room: string,
31
+
32
+    /**
33
+     * Invoked to obtain translated strings.
34
+     */
35
+    t: Function
36
+};
37
+
38
+/**
39
+ * The type of the React {@code Component} state of {@link DialInSummary}.
40
+ */
41
+type State = {
42
+
43
+    /**
44
+     * The numeric ID of the conference, used as a pin when dialing in.
45
+     */
46
+    conferenceID: ?string,
47
+
48
+    /**
49
+     * An error message to display.
50
+     */
51
+    error: string,
52
+
53
+    /**
54
+     * Whether or not the app is fetching data.
55
+     */
56
+    loading: boolean,
57
+
58
+    /**
59
+     * The dial-in numbers. entered by the local participant.
60
+     */
61
+    numbers: ?Array<Object>,
62
+
63
+    /**
64
+     * Whether or not dial-in is allowed.
65
+     */
66
+    numbersEnabled: ?boolean
67
+}
68
+
69
+/**
70
+ * Displays a page listing numbers for dialing into a conference and pin to
71
+ * the a specific conference.
72
+ *
73
+ * @extends Component
74
+ */
75
+class DialInSummary extends Component<Props, State> {
58 76
     state = {
59 77
         conferenceID: null,
60 78
         error: '',
@@ -69,7 +87,7 @@ class DialInSummary extends Component {
69 87
      * @param {Object} props - The read-only properties with which the new
70 88
      * instance is to be initialized.
71 89
      */
72
-    constructor(props) {
90
+    constructor(props: Props) {
73 91
         super(props);
74 92
 
75 93
         // Bind event handlers so they are only bound once for every instance.
@@ -183,6 +201,8 @@ class DialInSummary extends Component {
183 201
             .catch(() => Promise.reject(this.props.t('info.genericError')));
184 202
     }
185 203
 
204
+    _onGetConferenceIDSuccess: (Object) => void;
205
+
186 206
     /**
187 207
      * Callback invoked when fetching the conference ID succeeds.
188 208
      *
@@ -200,6 +220,8 @@ class DialInSummary extends Component {
200 220
         this.setState({ conferenceID: id });
201 221
     }
202 222
 
223
+    _onGetNumbersSuccess: (Object) => void;
224
+
203 225
     /**
204 226
      * Callback invoked when fetching dial-in numbers succeeds. Sets the
205 227
      * internal to show the numbers.
@@ -218,6 +240,8 @@ class DialInSummary extends Component {
218 240
         });
219 241
     }
220 242
 
243
+    _setErrorMessage: (string) => void;
244
+
221 245
     /**
222 246
      * Sets an error message to display on the page instead of content.
223 247
      *

+ 44
- 43
react/features/invite/components/dial-in-summary/NumbersList.web.js Ver fichero

@@ -1,47 +1,39 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../../base/i18n';
5 6
 
7
+type Props = {
8
+
9
+    /**
10
+     * Whether or not numbers should include links with the telephone protocol.
11
+     */
12
+    clickableNumbers: boolean,
13
+
14
+    /**
15
+     * The conference ID for dialing in.
16
+     */
17
+    conferenceID: number,
18
+
19
+    /**
20
+     * The phone numbers to display. Can be an array of numbers or an object
21
+     * with countries as keys and an array of numbers as values.
22
+     */
23
+    numbers: { [string]: Array<string> } | Array<string>,
24
+
25
+    /**
26
+     * Invoked to obtain translated strings.
27
+     */
28
+    t: Function
29
+}
30
+
6 31
 /**
7 32
  * Displays a table with phone numbers to dial in to a conference.
8 33
  *
9 34
  * @extends Component
10 35
  */
11
-class NumbersList extends Component {
12
-    /**
13
-     * {@code NumbersList} component's property types.
14
-     *
15
-     * @static
16
-     */
17
-    static propTypes = {
18
-        /**
19
-         * Whether or not numbers should include links with the telephone
20
-         * protocol.
21
-         */
22
-        clickableNumbers: PropTypes.bool,
23
-
24
-        /**
25
-         * The conference ID for dialing in.
26
-         */
27
-        conferenceID: PropTypes.number,
28
-
29
-        /**
30
-         * The phone numbers to display. Can be an array of numbers
31
-         * or an object with countries as keys and an array of numbers
32
-         * as values.
33
-         */
34
-        numbers: PropTypes.oneOfType([
35
-            PropTypes.array,
36
-            PropTypes.object
37
-        ]),
38
-
39
-        /**
40
-         * Invoked to obtain translated strings.
41
-         */
42
-        t: PropTypes.func
43
-    };
44
-
36
+class NumbersList extends Component<Props> {
45 37
     /**
46 38
      * Implements React's {@link Component#render()}.
47 39
      *
@@ -50,22 +42,21 @@ class NumbersList extends Component {
50 42
      */
51 43
     render() {
52 44
         const { numbers, t } = this.props;
53
-        const showWithoutCountries = Array.isArray(numbers);
54 45
 
55 46
         return (
56 47
             <table className = 'dial-in-numbers-list'>
57 48
                 <thead>
58 49
                     <tr>
59
-                        { showWithoutCountries
50
+                        { Array.isArray(numbers)
60 51
                             ? null
61 52
                             : <th>{ t('info.country') }</th> }
62 53
                         <th>{ t('info.numbers') }</th>
63 54
                     </tr>
64 55
                 </thead>
65 56
                 <tbody className = 'dial-in-numbers-body'>
66
-                    { showWithoutCountries
57
+                    { Array.isArray(numbers)
67 58
                         ? numbers.map(this._renderNumberRow)
68
-                        : this._renderWithCountries() }
59
+                        : this._renderWithCountries(numbers) }
69 60
                 </tbody>
70 61
             </table>);
71 62
     }
@@ -73,15 +64,25 @@ class NumbersList extends Component {
73 64
     /**
74 65
      * Renders rows of countries and associated phone numbers.
75 66
      *
67
+     * @param {Object} numbersMapping - Things yeah.
76 68
      * @private
77 69
      * @returns {ReactElement[]}
78 70
      */
79
-    _renderWithCountries() {
71
+    _renderWithCountries(numbersMapping: Object) {
80 72
         const rows = [];
81 73
 
82
-        for (const [ country, numbers ] of Object.entries(this.props.numbers)) {
83
-            const formattedNumbers = numbers.map(
84
-                number => this._renderNumberDiv(number));
74
+        for (const [ country, numbers ] of Object.entries(numbersMapping)) {
75
+            if (!Array.isArray(numbers)) {
76
+                return;
77
+            }
78
+
79
+            const formattedNumbers = numbers.map(number => {
80
+                if (typeof number === 'string') {
81
+                    return this._renderNumberDiv(number);
82
+                }
83
+
84
+                return null;
85
+            });
85 86
 
86 87
             rows.push(
87 88
                 <tr key = { country }>

+ 25
- 25
react/features/invite/components/info-dialog/DialInNumber.web.js Ver fichero

@@ -1,39 +1,39 @@
1
+/* @flow */
2
+
1 3
 import React, { Component } from 'react';
2
-import PropTypes from 'prop-types';
3 4
 
4 5
 import { translate } from '../../../base/i18n';
5 6
 
6 7
 /**
7
- * React {@code Component} responsible for displaying a telephone number and
8
- * conference ID for dialing into a conference.
9
- *
10
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link DialInNumber}.
11 9
  */
12
-class DialInNumber extends Component {
10
+type Props = {
11
+
13 12
     /**
14
-     * {@code DialInNumber} component's property types.
15
-     *
16
-     * @static
13
+     * The numberic identifier for the current conference, used after dialing a
14
+     * the number to join the conference.
17 15
      */
18
-    static propTypes = {
19
-        /**
20
-         * The numberic identifier for the current conference, used after
21
-         * dialing a the number to join the conference.
22
-         */
23
-        conferenceID: PropTypes.number,
16
+    conferenceID: number,
24 17
 
25
-        /**
26
-         * The phone number to dial to begin the process of dialing into a
27
-         * conference.
28
-         */
29
-        phoneNumber: PropTypes.string,
18
+    /**
19
+     * The phone number to dial to begin the process of dialing into a
20
+     * conference.
21
+     */
22
+    phoneNumber: string,
30 23
 
31
-        /**
32
-         * Invoked to obtain translated strings.
33
-         */
34
-        t: PropTypes.func
35
-    };
24
+    /**
25
+     * Invoked to obtain translated strings.
26
+     */
27
+    t: Function
28
+};
36 29
 
30
+/**
31
+ * React {@code Component} responsible for displaying a telephone number and
32
+ * conference ID for dialing into a conference.
33
+ *
34
+ * @extends Component
35
+ */
36
+class DialInNumber extends Component<Props> {
37 37
     /**
38 38
      * Implements React's {@link Component#render()}.
39 39
      *

+ 106
- 73
react/features/invite/components/info-dialog/InfoDialog.web.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
@@ -14,87 +15,102 @@ import PasswordForm from './PasswordForm';
14 15
 const logger = require('jitsi-meet-logger').getLogger(__filename);
15 16
 
16 17
 /**
17
- * A React Component with the contents for a dialog that shows information about
18
- * the current conference.
19
- *
20
- * @extends Component
18
+ * The type of the React {@code Component} props of {@link InfoDialog}.
21 19
  */
22
-class InfoDialog extends Component {
20
+type Props = {
21
+
23 22
     /**
24
-     * {@code InfoDialog} component's property types.
25
-     *
26
-     * @static
23
+     * Whether or not the current user can modify the current password.
27 24
      */
28
-    static propTypes = {
29
-        /**
30
-         * Whether or not the current user can modify the current password.
31
-         */
32
-        _canEditPassword: PropTypes.bool,
25
+    _canEditPassword: boolean,
33 26
 
34
-        /**
35
-         * The JitsiConference for which to display a lock state and change the
36
-         * password.
37
-         *
38
-         * @type {JitsiConference}
39
-         */
40
-        _conference: PropTypes.object,
27
+    /**
28
+     * The JitsiConference for which to display a lock state and change the
29
+     * password.
30
+     */
31
+    _conference: Object,
41 32
 
42
-        /**
43
-         * The name of the current conference. Used as part of inviting users.
44
-         */
45
-        _conferenceName: PropTypes.string,
33
+    /**
34
+     * The name of the current conference. Used as part of inviting users.
35
+     */
36
+    _conferenceName: string,
46 37
 
47
-        /**
48
-         * The current url of the conference to be copied onto the clipboard.
49
-         */
50
-        _inviteURL: PropTypes.string,
38
+    /**
39
+     * The current url of the conference to be copied onto the clipboard.
40
+     */
41
+    _inviteURL: string,
51 42
 
52
-        /**
53
-         * The current location url of the conference.
54
-         */
55
-        _locationURL: PropTypes.object,
43
+    /**
44
+     * The current location url of the conference.
45
+     */
46
+    _locationURL: Object,
56 47
 
57
-        /**
58
-         * The value for how the conference is locked (or undefined if not
59
-         * locked) as defined by room-lock constants.
60
-         */
61
-        _locked: PropTypes.string,
48
+    /**
49
+     * The value for how the conference is locked (or undefined if not locked)
50
+     * as defined by room-lock constants.
51
+     */
52
+    _locked: string,
62 53
 
63
-        /**
64
-         * The current known password for the JitsiConference.
65
-         */
66
-        _password: PropTypes.string,
54
+    /**
55
+     * The current known password for the JitsiConference.
56
+     */
57
+    _password: string,
67 58
 
68
-        /**
69
-         * The object representing the dialIn feature.
70
-         */
71
-        dialIn: PropTypes.object,
59
+    /**
60
+     * The object representing the dialIn feature.
61
+     */
62
+    dialIn: Object,
72 63
 
73
-        /**
74
-         * Invoked to open a dialog for adding participants to the conference.
75
-         */
76
-        dispatch: PropTypes.func,
64
+    /**
65
+     * Invoked to open a dialog for adding participants to the conference.
66
+     */
67
+    dispatch: Dispatch<*>,
77 68
 
78
-        /**
79
-         * The current known URL for a live stream in progress.
80
-         */
81
-        liveStreamViewURL: PropTypes.string,
69
+    /**
70
+     * The current known URL for a live stream in progress.
71
+     */
72
+    liveStreamViewURL: string,
82 73
 
83
-        /**
84
-         * Callback invoked when the dialog should be closed.
85
-         */
86
-        onClose: PropTypes.func,
74
+    /**
75
+     * Callback invoked when the dialog should be closed.
76
+     */
77
+    onClose: Function,
87 78
 
88
-        /**
89
-         * Callback invoked when a mouse-related event has been detected.
90
-         */
91
-        onMouseOver: PropTypes.func,
79
+    /**
80
+     * Callback invoked when a mouse-related event has been detected.
81
+     */
82
+    onMouseOver: Function,
92 83
 
93
-        /**
94
-         * Invoked to obtain translated strings.
95
-         */
96
-        t: PropTypes.func
97
-    };
84
+    /**
85
+     * Invoked to obtain translated strings.
86
+     */
87
+    t: Function
88
+};
89
+
90
+/**
91
+ * The type of the React {@code Component} state of {@link InfoDialog}.
92
+ */
93
+type State = {
94
+
95
+    /**
96
+     * Whether or not to show the password in editing mode.
97
+     */
98
+    passwordEditEnabled: boolean,
99
+
100
+    /**
101
+     * The conference dial-in number to display.
102
+     */
103
+    phoneNumber: ?string
104
+};
105
+
106
+/**
107
+ * A React Component with the contents for a dialog that shows information about
108
+ * the current conference.
109
+ *
110
+ * @extends Component
111
+ */
112
+class InfoDialog extends Component<Props, State> {
113
+    _copyElement: ?Object;
98 114
 
99 115
     /**
100 116
      * {@code InfoDialog} component's local state.
@@ -107,7 +123,7 @@ class InfoDialog extends Component {
107 123
      */
108 124
     state = {
109 125
         passwordEditEnabled: false,
110
-        phoneNumber: ''
126
+        phoneNumber: undefined
111 127
     };
112 128
 
113 129
     /**
@@ -116,7 +132,7 @@ class InfoDialog extends Component {
116 132
      * @param {Object} props - The read-only properties with which the new
117 133
      * instance is to be initialized.
118 134
      */
119
-    constructor(props) {
135
+    constructor(props: Props) {
120 136
         super(props);
121 137
 
122 138
         const { defaultCountry, numbers } = props.dialIn;
@@ -162,7 +178,8 @@ class InfoDialog extends Component {
162 178
             const { defaultCountry, numbers } = nextProps.dialIn;
163 179
 
164 180
             this.setState({
165
-                phoneNumber: _getDefaultPhoneNumber(numbers, defaultCountry)
181
+                phoneNumber:
182
+                    _getDefaultPhoneNumber(numbers, defaultCountry)
166 183
             });
167 184
         }
168 185
     }
@@ -293,6 +310,8 @@ class InfoDialog extends Component {
293 310
         return this.props._inviteURL.replace(/^https?:\/\//i, '');
294 311
     }
295 312
 
313
+    _onClickURLText: (Object) => void;
314
+
296 315
     /**
297 316
      * Callback invoked when a displayed URL link is clicked to prevent actual
298 317
      * navigation from happening. The URL links have an href to display the
@@ -307,6 +326,8 @@ class InfoDialog extends Component {
307 326
         event.preventDefault();
308 327
     }
309 328
 
329
+    _onCopyInviteURL: () => void;
330
+
310 331
     /**
311 332
      * Callback invoked to copy the contents of {@code this._copyElement} to the
312 333
      * clipboard.
@@ -316,14 +337,20 @@ class InfoDialog extends Component {
316 337
      */
317 338
     _onCopyInviteURL() {
318 339
         try {
319
-            this._copyElement.select();
340
+            if (!this._copyElement) {
341
+                throw new Error('No element to copy from.');
342
+            }
343
+
344
+            this._copyElement && this._copyElement.select();
320 345
             document.execCommand('copy');
321
-            this._copyElement.blur();
346
+            this._copyElement && this._copyElement.blur();
322 347
         } catch (err) {
323 348
             logger.error('error when copying the text', err);
324 349
         }
325 350
     }
326 351
 
352
+    _onPasswordRemove: () => void;
353
+
327 354
     /**
328 355
      * Callback invoked to unlock the current JitsiConference.
329 356
      *
@@ -334,6 +361,8 @@ class InfoDialog extends Component {
334 361
         this._onPasswordSubmit('');
335 362
     }
336 363
 
364
+    _onPasswordSubmit: (string) => void;
365
+
337 366
     /**
338 367
      * Callback invoked to set a password on the current JitsiConference.
339 368
      *
@@ -352,6 +381,8 @@ class InfoDialog extends Component {
352 381
         ));
353 382
     }
354 383
 
384
+    _onTogglePasswordEditState: () => void;
385
+
355 386
     /**
356 387
      * Toggles whether or not the password should currently be shown as being
357 388
      * edited locally.
@@ -476,6 +507,8 @@ class InfoDialog extends Component {
476 507
             && phoneNumber);
477 508
     }
478 509
 
510
+    _setCopyElement: () => void;
511
+
479 512
     /**
480 513
      * Sets the internal reference to the DOM/HTML element backing the React
481 514
      * {@code Component} input.
@@ -485,7 +518,7 @@ class InfoDialog extends Component {
485 518
      * @private
486 519
      * @returns {void}
487 520
      */
488
-    _setCopyElement(element) {
521
+    _setCopyElement(element: Object) {
489 522
         this._copyElement = element;
490 523
     }
491 524
 }

+ 51
- 43
react/features/invite/components/info-dialog/PasswordForm.web.js Ver fichero

@@ -1,56 +1,60 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../../base/i18n';
5 6
 import { LOCKED_LOCALLY } from '../../../room-lock';
6 7
 
7 8
 /**
8
- * React {@code Component} for displaying and editing the conference password.
9
- *
10
- * @extends Component
9
+ * The type of the React {@code Component} props of {@link PasswordForm}.
11 10
  */
12
-class PasswordForm extends Component {
11
+type Props = {
12
+
13 13
     /**
14
-     * {@code PasswordForm} component's property types.
15
-     *
16
-     * @static
14
+     * Whether or not to show the password editing field.
17 15
      */
18
-    static propTypes = {
19
-        /**
20
-         * Whether or not to show the password editing field.
21
-         */
22
-        editEnabled: PropTypes.bool,
23
-
24
-        /**
25
-         * The value for how the conference is locked (or undefined if not
26
-         * locked) as defined by room-lock constants.
27
-         */
28
-        locked: PropTypes.string,
29
-
30
-        /**
31
-         * Callback to invoke when the local participant is submitting a
32
-         * password set request.
33
-         */
34
-        onSubmit: PropTypes.func,
35
-
36
-        /**
37
-         * The current known password for the JitsiConference.
38
-         */
39
-        password: PropTypes.string,
40
-
41
-        /**
42
-         * Invoked to obtain translated strings.
43
-         */
44
-        t: PropTypes.func
45
-    };
16
+    editEnabled: boolean,
46 17
 
47 18
     /**
48
-     * {@code PasswordForm} component's local state.
49
-     *
50
-     * @type {Object}
51
-     * @property {string} enteredPassword - The value of the password being
52
-     * entered by the local participant.
19
+     * The value for how the conference is locked (or undefined if not locked)
20
+     * as defined by room-lock constants.
53 21
      */
22
+    locked: string,
23
+
24
+    /**
25
+     * Callback to invoke when the local participant is submitting a password
26
+     * set request.
27
+     */
28
+    onSubmit: Function,
29
+
30
+    /**
31
+     * The current known password for the JitsiConference.
32
+     */
33
+    password: string,
34
+
35
+    /**
36
+     * Invoked to obtain translated strings.
37
+     */
38
+    t: Function
39
+};
40
+
41
+/**
42
+ * The type of the React {@code Component} state of {@link PasswordForm}.
43
+ */
44
+type State = {
45
+
46
+    /**
47
+     * The value of the password being entered by the local participant.
48
+     */
49
+    enteredPassword: string
50
+};
51
+
52
+/**
53
+ * React {@code Component} for displaying and editing the conference password.
54
+ *
55
+ * @extends Component
56
+ */
57
+class PasswordForm extends Component<Props, State> {
54 58
     state = {
55 59
         enteredPassword: ''
56 60
     };
@@ -61,7 +65,7 @@ class PasswordForm extends Component {
61 65
      * @param {Props} props - The React {@code Component} props to initialize
62 66
      * the new {@code PasswordForm} instance with.
63 67
      */
64
-    constructor(props) {
68
+    constructor(props: Props) {
65 69
         super(props);
66 70
 
67 71
         // Bind event handlers so they are only bound once per instance.
@@ -77,7 +81,7 @@ class PasswordForm extends Component {
77 81
      * @inheritdoc
78 82
      * @param {Props} nextProps - New props component will receive.
79 83
      */
80
-    componentWillReceiveProps(nextProps) {
84
+    componentWillReceiveProps(nextProps: Props) {
81 85
         if (this.props.editEnabled && !nextProps.editEnabled) {
82 86
             this.setState({ enteredPassword: '' });
83 87
         }
@@ -148,6 +152,8 @@ class PasswordForm extends Component {
148 152
         );
149 153
     }
150 154
 
155
+    _onEnteredPasswordChange: (Object) => void;
156
+
151 157
     /**
152 158
      * Updates the internal state of entered password.
153 159
      *
@@ -159,6 +165,8 @@ class PasswordForm extends Component {
159 165
         this.setState({ enteredPassword: event.target.value });
160 166
     }
161 167
 
168
+    _onPasswordSubmit: (Object) => void;
169
+
162 170
     /**
163 171
      * Invokes the passed in onSubmit callback to notify the parent that a
164 172
      * password submission has been attempted.

+ 1
- 1
react/features/invite/functions.js Ver fichero

@@ -532,7 +532,7 @@ export function getDialInfoPageURL(
532 532
  */
533 533
 export function _getDefaultPhoneNumber(
534 534
         dialInNumbers: Object,
535
-        defaultCountry: string = 'US') {
535
+        defaultCountry: string = 'US'): ?string {
536 536
     if (Array.isArray(dialInNumbers)) {
537 537
         // Dumbly return the first number if an array.
538 538
         return dialInNumbers[0];

+ 20
- 19
react/features/keyboard-shortcuts/components/KeyboardShortcutsDialog.web.js Ver fichero

@@ -1,34 +1,35 @@
1
+/* @flow */
2
+
1 3
 import Lozenge from '@atlaskit/lozenge';
2
-import PropTypes from 'prop-types';
3 4
 import React, { Component } from 'react';
4 5
 
5 6
 import { Dialog } from '../../base/dialog';
6 7
 import { translate } from '../../base/i18n';
7 8
 
8 9
 /**
9
- * Implements a React {@link Component} which displays a dialog describing
10
- * registered keyboard shortcuts.
11
- *
12
- * @extends Component
10
+ * The type of the React {@code Component} props of
11
+ * {@link KeyboardShortcutsDialog}.
13 12
  */
14
-class KeyboardShortcutsDialog extends Component {
13
+type Props = {
14
+
15 15
     /**
16
-     * {@code KeyboardShortcutsDialog} component's property types.
17
-     *
18
-     * @static
16
+     * A Map with keyboard keys as keys and translation keys as values.
19 17
      */
20
-    static propTypes = {
21
-        /**
22
-         * A Map with keyboard keys as keys and translation keys as values.
23
-         */
24
-        shortcutDescriptions: PropTypes.object,
18
+    shortcutDescriptions: Object,
25 19
 
26
-        /**
27
-         * Invoked to obtain translated strings.
28
-         */
29
-        t: PropTypes.func
30
-    };
20
+    /**
21
+     * Invoked to obtain translated strings.
22
+     */
23
+    t: Function
24
+};
31 25
 
26
+/**
27
+ * Implements a React {@link Component} which displays a dialog describing
28
+ * registered keyboard shortcuts.
29
+ *
30
+ * @extends Component
31
+ */
32
+class KeyboardShortcutsDialog extends Component<Props> {
32 33
     /**
33 34
      * Implements React's {@link Component#render()}.
34 35
      *

+ 13
- 16
react/features/mobile/network-activity/components/NetworkActivityIndicator.js Ver fichero

@@ -1,31 +1,28 @@
1 1
 /* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
7 6
 import { LoadingIndicator } from '../../../base/react';
8 7
 
9 8
 /**
10
- * The React {@code Component} which renders a progress indicator when there
11
- * are ongoing network requests.
9
+ * The type of the React {@code Component} props of
10
+ * {@link NetworkActivityIndicator}.
12 11
  */
13
-class NetworkActivityIndicator extends Component<*> {
12
+type Props = {
13
+
14 14
     /**
15
-     * {@code NetworkActivityIndicator} React {@code Component}'s prop types.
16
-     *
17
-     * @static
15
+     * Indicates whether there is network activity i.e. ongoing network
16
+     * requests.
18 17
      */
19
-    static propTypes = {
20
-        /**
21
-         * Indicates whether there is network activity i.e. ongoing network
22
-         * requests.
23
-         *
24
-         * @private
25
-         */
26
-        _networkActivity: PropTypes.bool
27
-    };
18
+    _networkActivity: boolean
19
+};
28 20
 
21
+/**
22
+ * The React {@code Component} which renders a progress indicator when there
23
+ * are ongoing network requests.
24
+ */
25
+class NetworkActivityIndicator extends Component<Props> {
29 26
     /**
30 27
      * Implements React's {@link Component#render()}.
31 28
      *

+ 56
- 72
react/features/overlay/components/AbstractPageReloadOverlay.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import {
@@ -21,53 +20,70 @@ declare var APP: Object;
21 20
 const logger = require('jitsi-meet-logger').getLogger(__filename);
22 21
 
23 22
 /**
24
- * Implements an abstract React {@link Component} for the page reload overlays.
23
+ * The type of the React {@code Component} props of
24
+ * {@link AbstractPageReloadOverlay}.
25 25
  */
26
-export default class AbstractPageReloadOverlay extends Component<*, *> {
26
+type Props = {
27
+
27 28
     /**
28
-     * {@code AbstractPageReloadOverlay} component's property types.
29
-     *
30
-     * @static
29
+     * The details is an object containing more information about the connection
30
+     * failed (shard changes, was the computer suspended, etc.)
31 31
      */
32
-    static propTypes = {
33
-        /**
34
-         * The details is an object containing more information about the
35
-         * connection failed (shard changes, was the computer suspended, etc.)
36
-         *
37
-         * @public
38
-         * @type {object}
39
-         */
40
-        details: PropTypes.object,
32
+    details: Object,
41 33
 
42
-        dispatch: PropTypes.func,
34
+    dispatch: Dispatch<*>,
43 35
 
44
-        /**
45
-         * The indicator which determines whether the reload was caused by
46
-         * network failure.
47
-         *
48
-         * @public
49
-         * @type {boolean}
50
-         */
51
-        isNetworkFailure: PropTypes.bool,
36
+    /**
37
+     * The indicator which determines whether the reload was caused by network
38
+     * failure.
39
+     */
40
+    isNetworkFailure: boolean,
52 41
 
53
-        /**
54
-         * The reason for the error that will cause the reload.
55
-         * NOTE: Used by PageReloadOverlay only.
56
-         *
57
-         * @public
58
-         * @type {string}
59
-         */
60
-        reason: PropTypes.string,
42
+    /**
43
+     * The reason for the error that will cause the reload.
44
+     * NOTE: Used by PageReloadOverlay only.
45
+     */
46
+    reason: string,
61 47
 
62
-        /**
63
-         * The function to translate human-readable text.
64
-         *
65
-         * @public
66
-         * @type {Function}
67
-         */
68
-        t: PropTypes.func
69
-    };
48
+    /**
49
+     * The function to translate human-readable text.
50
+     */
51
+    t: Function
52
+};
53
+
54
+/**
55
+ * The type of the React {@code Component} state of
56
+ * {@link AbstractPageReloadOverlay}.
57
+ */
58
+type State = {
59
+
60
+    /**
61
+     * The translation key for the title of the overlay.
62
+     */
63
+    message: string,
64
+
65
+    /**
66
+     * Current value(time) of the timer.
67
+     */
68
+    timeLeft: number,
69
+
70
+    /**
71
+     * How long the overlay dialog will be displayed before the conference will
72
+     * be reloaded.
73
+     */
74
+    timeoutSeconds: number,
70 75
 
76
+    /**
77
+     * The translation key for the title of the overlay.
78
+     */
79
+    title: string
80
+};
81
+
82
+/**
83
+ * Implements an abstract React {@link Component} for the page reload overlays.
84
+ */
85
+export default class AbstractPageReloadOverlay
86
+    extends Component<Props, State> {
71 87
     /**
72 88
      * Determines whether this overlay needs to be rendered (according to a
73 89
      * specific redux state). Called by {@link OverlayContainer}.
@@ -109,38 +125,6 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
109 125
 
110 126
     _interval: ?IntervalID;
111 127
 
112
-    state: {
113
-
114
-        /**
115
-         * The translation key for the title of the overlay.
116
-         *
117
-         * @type {string}
118
-         */
119
-        message: string,
120
-
121
-        /**
122
-         * Current value(time) of the timer.
123
-         *
124
-         * @type {number}
125
-         */
126
-        timeLeft: number,
127
-
128
-        /**
129
-         * How long the overlay dialog will be displayed before the
130
-         * conference will be reloaded.
131
-         *
132
-         * @type {number}
133
-         */
134
-        timeoutSeconds: number,
135
-
136
-        /**
137
-         * The translation key for the title of the overlay.
138
-         *
139
-         * @type {string}
140
-         */
141
-        title: string
142
-    };
143
-
144 128
     /**
145 129
      * Initializes a new AbstractPageReloadOverlay instance.
146 130
      *

+ 15
- 17
react/features/overlay/components/AbstractSuspendedOverlay.js Ver fichero

@@ -1,26 +1,24 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import { Component } from 'react';
3 4
 
4 5
 /**
5
- * Implements a React {@link Component} for suspended overlay. Shown when a
6
- * suspend is detected.
6
+ * The type of the React {@code Component} props of
7
+ * {@link AbstractSuspendedOverlay}.
7 8
  */
8
-export default class AbstractSuspendedOverlay extends Component {
9
+type Props = {
10
+
9 11
     /**
10
-     * {@code AbstractSuspendedOverlay} component's property types.
11
-     *
12
-     * @static
12
+     * The function to translate human-readable text.
13 13
      */
14
-    static propTypes = {
15
-        /**
16
-         * The function to translate human-readable text.
17
-         *
18
-         * @public
19
-         * @type {Function}
20
-         */
21
-        t: PropTypes.func
22
-    };
14
+    t: Function
15
+};
23 16
 
17
+/**
18
+ * Implements a React {@link Component} for suspended overlay. Shown when a
19
+ * suspend is detected.
20
+ */
21
+export default class AbstractSuspendedOverlay extends Component<Props> {
24 22
     /**
25 23
      * Determines whether this overlay needs to be rendered (according to a
26 24
      * specific redux state). Called by {@link OverlayContainer}.
@@ -29,7 +27,7 @@ export default class AbstractSuspendedOverlay extends Component {
29 27
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
30 28
      * {@code false}, otherwise.
31 29
      */
32
-    static needsRender(state) {
30
+    static needsRender(state: Object) {
33 31
         return state['features/overlay'].suspendDetected;
34 32
     }
35 33
 }

+ 22
- 26
react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js Ver fichero

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

+ 28
- 37
react/features/overlay/components/FilmstripOnlyOverlayFrame.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
@@ -11,49 +12,39 @@ import {
11 12
 import OverlayFrame from './OverlayFrame';
12 13
 
13 14
 /**
14
- * Implements a React Component for the frame of the overlays in filmstrip only
15
- * mode.
15
+ * The type of the React {@code Component} props of
16
+ * {@link FilmstripOnlyOverlayFrame}.
16 17
  */
17
-class FilmstripOnlyOverlayFrame extends Component {
18
+type Props = {
19
+
18 20
     /**
19
-     * FilmstripOnlyOverlayFrame component's property types.
20
-     *
21
-     * @static
21
+     * The source (e.g. URI, URL) of the avatar image of the local participant.
22 22
      */
23
-    static propTypes = {
24
-        /**
25
-         * The source (e.g. URI, URL) of the avatar image of the local
26
-         * participant.
27
-         *
28
-         * @private
29
-         */
30
-        _avatar: PropTypes.string,
23
+    _avatar: string,
31 24
 
32
-        /**
33
-         * The children components to be displayed into the overlay frame for
34
-         * filmstrip only mode.
35
-         *
36
-         * @type {ReactElement}
37
-         */
38
-        children: PropTypes.node.isRequired,
25
+    /**
26
+     * The children components to be displayed into the overlay frame for
27
+     * filmstrip only mode.
28
+     */
29
+    children: React$Node,
39 30
 
40
-        /**
41
-         * The css class name for the icon that will be displayed over the
42
-         * avatar.
43
-         *
44
-         * @type {string}
45
-         */
46
-        icon: PropTypes.string,
31
+    /**
32
+     * The css class name for the icon that will be displayed over the avatar.
33
+     */
34
+    icon: string,
47 35
 
48
-        /**
49
-         * Indicates the css style of the overlay. If true, then lighter;
50
-         * darker, otherwise.
51
-         *
52
-         * @type {boolean}
53
-         */
54
-        isLightOverlay: PropTypes.bool
55
-    };
36
+    /**
37
+     * Indicates the css style of the overlay. If true, then lighter; darker,
38
+     * otherwise.
39
+     */
40
+    isLightOverlay: boolean
41
+};
56 42
 
43
+/**
44
+ * Implements a React Component for the frame of the overlays in filmstrip only
45
+ * mode.
46
+ */
47
+class FilmstripOnlyOverlayFrame extends Component<Props> {
57 48
     /**
58 49
      * Renders content related to the icon.
59 50
      *

+ 31
- 21
react/features/overlay/components/OverlayFrame.web.js Ver fichero

@@ -1,32 +1,42 @@
1
-/* global interfaceConfig */
1
+/* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 
5
+declare var interfaceConfig: Object;
6
+
6 7
 /**
7
- * Implements a React {@link Component} for the frame of the overlays.
8
+ * The type of the React {@code Component} props of {@link OverlayFrame}.
8 9
  */
9
-export default class OverlayFrame extends Component {
10
+type Props = {
11
+
10 12
     /**
11
-     * OverlayFrame component's property types.
12
-     *
13
-     * @static
13
+     * The children components to be displayed into the overlay frame.
14 14
      */
15
-    static propTypes = {
16
-        /**
17
-         * The children components to be displayed into the overlay frame.
18
-         */
19
-        children: PropTypes.node.isRequired,
15
+    children: React$Node,
20 16
 
21
-        /**
22
-         * Indicates the css style of the overlay. If true, then lighter;
23
-         * darker, otherwise.
24
-         *
25
-         * @type {boolean}
26
-         */
27
-        isLightOverlay: PropTypes.bool
28
-    };
17
+    /**
18
+     * Indicates the css style of the overlay. If true, then lighter; darker,
19
+     * otherwise.
20
+     */
21
+    isLightOverlay: boolean
22
+};
29 23
 
24
+/**
25
+ * The type of the React {@code Component} state of {@link OverlayFrame}.
26
+ */
27
+type State = {
28
+
29
+    /**
30
+     * Whether or not the application is currently displaying in filmstrip only
31
+     * mode.
32
+     */
33
+    filmstripOnly: boolean
34
+};
35
+
36
+/**
37
+ * Implements a React {@link Component} for the frame of the overlays.
38
+ */
39
+export default class OverlayFrame extends Component<Props, State> {
30 40
     /**
31 41
      * Initializes a new AbstractOverlay instance.
32 42
      *
@@ -34,7 +44,7 @@ export default class OverlayFrame extends Component {
34 44
      * instance is to be initialized.
35 45
      * @public
36 46
      */
37
-    constructor(props) {
47
+    constructor(props: Props) {
38 48
         super(props);
39 49
 
40 50
         this.state = {

+ 19
- 28
react/features/overlay/components/ReloadButton.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 /* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -8,39 +7,31 @@ import { reloadNow } from '../../app';
8 7
 import { translate } from '../../base/i18n';
9 8
 
10 9
 /**
11
- * Implements a React Component for button for the overlays that will reload
12
- * the page.
10
+ * The type of the React {@code Component} props of {@link ReloadButton}.
13 11
  */
14
-class ReloadButton extends Component<*> {
12
+type Props = {
13
+
15 14
     /**
16
-     * PageReloadOverlay component's property types.
17
-     *
18
-     * @static
15
+     * Reloads the page.
19 16
      */
20
-    static propTypes = {
21
-        /**
22
-         * Reloads the page.
23
-         *
24
-         * @type {Function}
25
-         */
26
-        _reloadNow: PropTypes.func,
17
+    _reloadNow: Function,
27 18
 
28
-        /**
29
-         * The function to translate human-readable text.
30
-         *
31
-         * @public
32
-         * @type {Function}
33
-         */
34
-        t: PropTypes.func,
19
+    /**
20
+     * The function to translate human-readable text.
21
+     */
22
+    t: Function,
35 23
 
36
-        /**
37
-         * The translation key for the text in the button.
38
-         *
39
-         * @type {string}
40
-         */
41
-        textKey: PropTypes.string.isRequired
42
-    };
24
+    /**
25
+     * The translation key for the text in the button.
26
+     */
27
+    textKey: string
28
+};
43 29
 
30
+/**
31
+ * Implements a React Component for button for the overlays that will reload
32
+ * the page.
33
+ */
34
+class ReloadButton extends Component<Props> {
44 35
     /**
45 36
      * Renders the button for relaod the page if necessary.
46 37
      *

+ 41
- 41
react/features/presence-status/components/PresenceLabel.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
@@ -8,13 +9,51 @@ import { Text } from '../../base/react';
8 9
 
9 10
 import { STATUS_TO_I18N_KEY } from '../constants';
10 11
 
12
+/**
13
+ * The type of the React {@code Component} props of {@link PresenceLabel}.
14
+ */
15
+type Props = {
16
+
17
+    /**
18
+     * The current present status associated with the passed in participantID
19
+     * prop.
20
+     */
21
+    _presence: string,
22
+
23
+    /**
24
+     * Class name for the presence label.
25
+     */
26
+    className: string,
27
+
28
+    /**
29
+     * Default presence status that will be displayed if user's presence status
30
+     * is not available.
31
+     */
32
+    defaultPresence: string,
33
+
34
+    /**
35
+     * The ID of the participant whose presence status should display.
36
+     */
37
+    participantID: string,
38
+
39
+    /**
40
+     * Styles for the presence label.
41
+     */
42
+    style: Object,
43
+
44
+    /**
45
+     * Invoked to obtain translated strings.
46
+     */
47
+    t: Function
48
+};
49
+
11 50
 /**
12 51
  * React {@code Component} for displaying the current presence status of a
13 52
  * participant.
14 53
  *
15 54
  * @extends Component
16 55
  */
17
-class PresenceLabel extends Component {
56
+class PresenceLabel extends Component<Props> {
18 57
     /**
19 58
      * The default values for {@code PresenceLabel} component's property types.
20 59
      *
@@ -24,45 +63,6 @@ class PresenceLabel extends Component {
24 63
         _presence: ''
25 64
     };
26 65
 
27
-    /**
28
-     * {@code PresenceLabel} component's property types.
29
-     *
30
-     * @static
31
-     */
32
-    static propTypes = {
33
-        /**
34
-         * The current present status associated with the passed in
35
-         * participantID prop.
36
-         */
37
-        _presence: PropTypes.string,
38
-
39
-        /**
40
-         * Class name for the presence label.
41
-         */
42
-        className: PropTypes.string,
43
-
44
-        /**
45
-         * Default presence status that will be displayed if user's presence
46
-         * status is not available.
47
-         */
48
-        defaultPresence: PropTypes.string,
49
-
50
-        /**
51
-         * The ID of the participant whose presence status shoul display.
52
-         */
53
-        participantID: PropTypes.string,
54
-
55
-        /**
56
-         * Styles for the presence label.
57
-         */
58
-        style: PropTypes.object,
59
-
60
-        /**
61
-         * Invoked to obtain translated strings.
62
-         */
63
-        t: PropTypes.func
64
-    };
65
-
66 66
     /**
67 67
      * Implements React's {@link Component#render()}.
68 68
      *

+ 49
- 36
react/features/recording/components/LiveStream/StreamKeyPicker.web.js Ver fichero

@@ -1,19 +1,61 @@
1
+/* @flow */
2
+
1 3
 import {
2 4
     DropdownItem,
3 5
     DropdownItemGroup,
4 6
     DropdownMenuStateless
5 7
 } from '@atlaskit/dropdown-menu';
6 8
 import React, { PureComponent } from 'react';
7
-import PropTypes from 'prop-types';
8 9
 
9 10
 import { translate } from '../../../base/i18n';
10 11
 
12
+/**
13
+ * The type of the React {@code Component} props of {@link StreamKeyPicker}.
14
+ */
15
+type Props = {
16
+
17
+    /**
18
+     * Broadcasts available for selection. Each broadcast item should be an
19
+     * object with a title for display in the dropdown and a boundStreamID to
20
+     * return in the {@link onBroadcastSelected} callback.
21
+     */
22
+    broadcasts: Array<Object>,
23
+
24
+    /**
25
+     * Callback invoked when an item in the dropdown is selected. The selected
26
+     * broadcast's boundStreamID will be passed back.
27
+     */
28
+    onBroadcastSelected: Function,
29
+
30
+    /**
31
+     * The boundStreamID of the broadcast that should display as selected in the
32
+     * dropdown.
33
+     */
34
+    selectedBoundStreamID: string,
35
+
36
+    /**
37
+     * Invoked to obtain translated strings.
38
+     */
39
+    t: Function
40
+};
41
+
42
+/**
43
+ * The type of the React {@code Component} state of {@link StreamKeyPicker}.
44
+ */
45
+type State = {
46
+
47
+    /**
48
+     * Whether or not to display the dropdown menu to pick a YouTube broadcast.
49
+     */
50
+    isDropdownOpen: boolean
51
+};
52
+
11 53
 /**
12 54
  * A dropdown to select a YouTube broadcast.
13 55
  *
14 56
  * @extends Component
15 57
  */
16
-class StreamKeyPicker extends PureComponent {
58
+class StreamKeyPicker extends PureComponent<Props, State> {
17 59
     /**
18 60
      * Default values for {@code StreamKeyForm} component's properties.
19 61
      *
@@ -23,41 +65,8 @@ class StreamKeyPicker extends PureComponent {
23 65
         broadcasts: []
24 66
     };
25 67
 
26
-    /**
27
-     * {@code StreamKeyPicker} component's property types.
28
-     */
29
-    static propTypes = {
30
-        /**
31
-         * Broadcasts available for selection. Each broadcast item should be an
32
-         * object with a title for display in the dropdown and a boundStreamID
33
-         * to return in the {@link onBroadcastSelected} callback.
34
-         */
35
-        broadcasts: PropTypes.array,
36
-
37
-        /**
38
-         * Callback invoked when an item in the dropdown is selected. The
39
-         * selected broadcast's boundStreamID will be passed back.
40
-         */
41
-        onBroadcastSelected: PropTypes.func,
42
-
43
-        /**
44
-         * The boundStreamID of the broadcast that should display as selected in
45
-         * the dropdown.
46
-         */
47
-        selectedBoundStreamID: PropTypes.string,
48
-
49
-        /**
50
-         * Invoked to obtain translated strings.
51
-         */
52
-        t: PropTypes.func
53
-    };
54
-
55 68
     /**
56 69
      * The initial state of a {@code StreamKeyForm} instance.
57
-     *
58
-     * @type {{
59
-     *     isDropdownOpen: boolean
60
-     * }}
61 70
      */
62 71
     state = {
63 72
         isDropdownOpen: false
@@ -69,7 +78,7 @@ class StreamKeyPicker extends PureComponent {
69 78
      * @param {Props} props - The React {@code Component} props to initialize
70 79
      * the new {@code StreamKeyPicker} instance with.
71 80
      */
72
-    constructor(props) {
81
+    constructor(props: Props) {
73 82
         super(props);
74 83
 
75 84
         // Bind event handlers so they are only bound once per instance.
@@ -139,6 +148,8 @@ class StreamKeyPicker extends PureComponent {
139 148
         });
140 149
     }
141 150
 
151
+    _onDropdownOpenChange: (Object) => void;
152
+
142 153
     /**
143 154
      * Sets the dropdown to be displayed or not based on the passed in event.
144 155
      *
@@ -154,6 +165,8 @@ class StreamKeyPicker extends PureComponent {
154 165
         });
155 166
     }
156 167
 
168
+    _onSelect: (string) => void;
169
+
157 170
     /**
158 171
      * Callback invoked when an item has been clicked in the dropdown menu.
159 172
      *

+ 29
- 34
react/features/remote-control/components/RemoteControlAuthorizationDialog.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -11,49 +10,45 @@ import { getParticipantById } from '../../base/participants';
11 10
 declare var APP: Object;
12 11
 
13 12
 /**
14
- * Implements a dialog for remote control authorization.
13
+ * The type of the React {@code Component} props of
14
+ * {@link RemoteControlAuthorizationDialog}.
15 15
  */
16
-class RemoteControlAuthorizationDialog extends Component<*> {
16
+type Props = {
17
+
17 18
     /**
18
-     * RemoteControlAuthorizationDialog component's property types.
19
-     *
20
-     * @static
19
+     * The display name of the participant who is requesting authorization for
20
+     * remote desktop control session.
21 21
      */
22
-    static propTypes = {
23
-        /**
24
-         * The display name of the participant who is requesting authorization
25
-         * for remote desktop control session.
26
-         *
27
-         * @private
28
-         */
29
-        _displayName: PropTypes.string,
30
-
31
-        /**
32
-         * Used to show/hide the dialog on cancel.
33
-         */
34
-        dispatch: PropTypes.func,
35
-
36
-        /**
37
-         * The ID of the participant who is requesting authorization for remote
38
-         * desktop control session.
39
-         *
40
-         * @public
41
-         */
42
-        participantId: PropTypes.string,
43
-
44
-        /**
45
-         * Invoked to obtain translated strings.
46
-         */
47
-        t: PropTypes.func
48
-    };
22
+    _displayName: string,
23
+
24
+    /**
25
+     * Used to show/hide the dialog on cancel.
26
+     */
27
+    dispatch: Function,
28
+
29
+    /**
30
+     * The ID of the participant who is requesting authorization for remote
31
+     * desktop control session.
32
+     */
33
+    participantId: string,
34
+
35
+    /**
36
+     * Invoked to obtain translated strings.
37
+     */
38
+    t: Function
39
+};
49 40
 
41
+/**
42
+ * Implements a dialog for remote control authorization.
43
+ */
44
+class RemoteControlAuthorizationDialog extends Component<Props> {
50 45
     /**
51 46
      * Initializes a new RemoteControlAuthorizationDialog instance.
52 47
      *
53 48
      * @param {Object} props - The read-only properties with which the new
54 49
      * instance is to be initialized.
55 50
      */
56
-    constructor(props) {
51
+    constructor(props: Props) {
57 52
         super(props);
58 53
 
59 54
         this._onCancel = this._onCancel.bind(this);

+ 32
- 30
react/features/remote-video-menu/components/KickButton.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
@@ -11,41 +12,40 @@ import { kickParticipant } from '../../base/participants';
11 12
 
12 13
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
13 14
 
15
+/**
16
+ * The type of the React {@code Component} state of {@link KickButton}.
17
+ */
18
+type Props = {
19
+
20
+    /**
21
+     * Invoked to signal the participant with the passed in participantID
22
+     * should be removed from the conference.
23
+     */
24
+    dispatch: Dispatch<*>,
25
+
26
+    /**
27
+     * Callback to invoke when {@code KickButton} is clicked.
28
+     */
29
+    onClick: Function,
30
+
31
+    /**
32
+     * The ID of the participant linked to the onClick callback.
33
+     */
34
+    participantID: string,
35
+
36
+    /**
37
+     * Invoked to obtain translated strings.
38
+     */
39
+    t: Function,
40
+};
41
+
14 42
 /**
15 43
  * Implements a React {@link Component} which displays a button for kicking out
16 44
  * a participant from the conference.
17 45
  *
18 46
  * @extends Component
19 47
  */
20
-class KickButton extends Component {
21
-    /**
22
-     * {@code KickButton} component's property types.
23
-     *
24
-     * @static
25
-     */
26
-    static propTypes = {
27
-        /**
28
-         * Invoked to signal the participant with the passed in participantID
29
-         * should be removed from the conference.
30
-         */
31
-        dispatch: PropTypes.func,
32
-
33
-        /**
34
-         * Callback to invoke when {@code KickButton} is clicked.
35
-         */
36
-        onClick: PropTypes.func,
37
-
38
-        /**
39
-         * The ID of the participant linked to the onClick callback.
40
-         */
41
-        participantID: PropTypes.string,
42
-
43
-        /**
44
-         * Invoked to obtain translated strings.
45
-         */
46
-        t: PropTypes.func
47
-    };
48
-
48
+class KickButton extends Component<Props> {
49 49
     /**
50 50
      * Initializes a new {@code KickButton} instance.
51 51
      *
@@ -77,6 +77,8 @@ class KickButton extends Component {
77 77
         );
78 78
     }
79 79
 
80
+    _onClick: () => void;
81
+
80 82
     /**
81 83
      * Remove the participant with associated participantID from the conference.
82 84
      *

+ 38
- 36
react/features/remote-video-menu/components/MuteButton.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
@@ -12,53 +13,52 @@ import { openDialog } from '../../base/dialog';
12 13
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
13 14
 import MuteRemoteParticipantDialog from './MuteRemoteParticipantDialog';
14 15
 
16
+/**
17
+ * The type of the React {@code Component} props of {@link MuteButton}.
18
+ */
19
+type Props = {
20
+
21
+    /**
22
+     * Invoked to send a request for muting the participant with the passed
23
+     * in participantID.
24
+     */
25
+    dispatch: Dispatch<*>,
26
+
27
+    /**
28
+     * Whether or not the participant is currently audio muted.
29
+     */
30
+    isAudioMuted: Function,
31
+
32
+    /**
33
+     * Callback to invoke when {@code MuteButton} is clicked.
34
+     */
35
+    onClick: Function,
36
+
37
+    /**
38
+     * The ID of the participant linked to the onClick callback.
39
+     */
40
+    participantID: string,
41
+
42
+    /**
43
+     * Invoked to obtain translated strings.
44
+     */
45
+    t: Function
46
+};
47
+
15 48
 /**
16 49
  * Implements a React {@link Component} which displays a button for audio muting
17 50
  * a participant in the conference.
18 51
  *
19 52
  * @extends Component
20 53
  */
21
-class MuteButton extends Component {
22
-    /**
23
-     * {@code MuteButton} component's property types.
24
-     *
25
-     * @static
26
-     */
27
-    static propTypes = {
28
-        /**
29
-         * Invoked to send a request for muting the participant with the passed
30
-         * in participantID.
31
-         */
32
-        dispatch: PropTypes.func,
33
-
34
-        /**
35
-         * Whether or not the participant is currently audio muted.
36
-         */
37
-        isAudioMuted: PropTypes.bool,
38
-
39
-        /**
40
-         * Callback to invoke when {@code MuteButton} is clicked.
41
-         */
42
-        onClick: PropTypes.func,
43
-
44
-        /**
45
-         * The ID of the participant linked to the onClick callback.
46
-         */
47
-        participantID: PropTypes.string,
48
-
49
-        /**
50
-         * Invoked to obtain translated strings.
51
-         */
52
-        t: PropTypes.func
53
-    };
54
-
54
+class MuteButton extends Component<Props> {
55 55
     /**
56 56
      * Initializes a new {@code MuteButton} instance.
57 57
      *
58 58
      * @param {Object} props - The read-only React Component props with which
59 59
      * the new instance is to be initialized.
60 60
      */
61
-    constructor(props) {
61
+    constructor(props: Props) {
62 62
         super(props);
63 63
 
64 64
         // Bind event handlers so they are only bound once for every instance.
@@ -91,6 +91,8 @@ class MuteButton extends Component {
91 91
         );
92 92
     }
93 93
 
94
+    _onClick: () => void;
95
+
94 96
     /**
95 97
      * Dispatches a request to mute the participant with the passed in
96 98
      * participantID.

+ 31
- 26
react/features/remote-video-menu/components/MuteRemoteParticipantDialog.web.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
@@ -11,43 +12,43 @@ import {
11 12
 } from '../../analytics';
12 13
 import { muteRemoteParticipant } from '../../base/participants';
13 14
 
15
+/**
16
+ * The type of the React {@code Component} props of
17
+ * {@link MuteRemoteParticipantDialog}.
18
+ */
19
+type Props = {
20
+
21
+    /**
22
+     * Invoked to send a request for muting the participant with the passed
23
+     * in participantID.
24
+     */
25
+    dispatch: Dispatch<*>,
26
+
27
+    /**
28
+     * The ID of the participant linked to the onClick callback.
29
+     */
30
+    participantID: string,
31
+
32
+    /**
33
+     * Invoked to obtain translated strings.
34
+     */
35
+    t: Function
36
+};
37
+
14 38
 /**
15 39
  * A React Component with the contents for a dialog that asks for confirmation
16 40
  * from the user before muting a remote participant.
17 41
  *
18 42
  * @extends Component
19 43
  */
20
-class MuteRemoteParticipantDialog extends Component {
21
-    /**
22
-     * {@code MuteRemoteParticipantDialog} component's property types.
23
-     *
24
-     * @static
25
-     */
26
-    static propTypes = {
27
-        /**
28
-         * Invoked to send a request for muting the participant with the passed
29
-         * in participantID.
30
-         */
31
-        dispatch: PropTypes.func,
32
-
33
-        /**
34
-         * The ID of the participant linked to the onClick callback.
35
-         */
36
-        participantID: PropTypes.string,
37
-
38
-        /**
39
-         * Invoked to obtain translated strings.
40
-         */
41
-        t: PropTypes.func
42
-    };
43
-
44
+class MuteRemoteParticipantDialog extends Component<Props> {
44 45
     /**
45 46
      * Initializes a new {@code MuteRemoteParticipantDialog} instance.
46 47
      *
47 48
      * @param {Object} props - The read-only properties with which the new
48 49
      * instance is to be initialized.
49 50
      */
50
-    constructor(props) {
51
+    constructor(props: Props) {
51 52
         super(props);
52 53
 
53 54
         // Bind event handlers so they are only bound once per instance.
@@ -73,6 +74,8 @@ class MuteRemoteParticipantDialog extends Component {
73 74
         );
74 75
     }
75 76
 
77
+    _onSubmit: () => void;
78
+
76 79
     /**
77 80
      * Handles the submit button action.
78 81
      *
@@ -89,6 +92,8 @@ class MuteRemoteParticipantDialog extends Component {
89 92
         return true;
90 93
     }
91 94
 
95
+    _renderContent: () => React$Element<*>;
96
+
92 97
     /**
93 98
      * Renders the content of the dialog.
94 99
      *

+ 33
- 31
react/features/remote-video-menu/components/RemoteControlButton.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import {
@@ -18,6 +19,33 @@ export const REMOTE_CONTROL_MENU_STATES = {
18 19
     STARTED: 3
19 20
 };
20 21
 
22
+/**
23
+ * The type of the React {@code Component} props of {@link RemoteControlButton}.
24
+ */
25
+type Props = {
26
+
27
+    /**
28
+     * The callback to invoke when the component is clicked.
29
+     */
30
+    onClick: Function,
31
+
32
+    /**
33
+     * The ID of the participant linked to the onClick callback.
34
+     */
35
+    participantID: string,
36
+
37
+    /**
38
+     * The current status of remote control. Should be a number listed in the
39
+     * enum REMOTE_CONTROL_MENU_STATES.
40
+     */
41
+    remoteControlState: number,
42
+
43
+    /**
44
+     * Invoked to obtain translated strings.
45
+     */
46
+    t: Function
47
+};
48
+
21 49
 /**
22 50
  * Implements a React {@link Component} which displays a button showing the
23 51
  * current state of remote control for a participant and can start or stop a
@@ -25,42 +53,14 @@ export const REMOTE_CONTROL_MENU_STATES = {
25 53
  *
26 54
  * @extends Component
27 55
  */
28
-class RemoteControlButton extends Component {
29
-    /**
30
-     * {@code RemoteControlButton} component's property types.
31
-     *
32
-     * @static
33
-     */
34
-    static propTypes = {
35
-        /**
36
-         * The callback to invoke when the component is clicked.
37
-         */
38
-        onClick: PropTypes.func,
39
-
40
-        /**
41
-         * The ID of the participant linked to the onClick callback.
42
-         */
43
-        participantID: PropTypes.string,
44
-
45
-        /**
46
-         * The current status of remote control. Should be a number listed in
47
-         * the enum REMOTE_CONTROL_MENU_STATES.
48
-         */
49
-        remoteControlState: PropTypes.number,
50
-
51
-        /**
52
-         * Invoked to obtain translated strings.
53
-         */
54
-        t: PropTypes.func
55
-    };
56
-
56
+class RemoteControlButton extends Component<Props> {
57 57
     /**
58 58
      * Initializes a new {@code RemoteControlButton} instance.
59 59
      *
60 60
      * @param {Object} props - The read-only React Component props with which
61 61
      * the new instance is to be initialized.
62 62
      */
63
-    constructor(props) {
63
+    constructor(props: Props) {
64 64
         super(props);
65 65
 
66 66
         // Bind event handlers so they are only bound once for every instance.
@@ -112,6 +112,8 @@ class RemoteControlButton extends Component {
112 112
         );
113 113
     }
114 114
 
115
+    _onClick: () => void;
116
+
115 117
     /**
116 118
      * Sends analytics event for pressing the button and executes the passed
117 119
      * onClick handler.

+ 20
- 20
react/features/remote-video-menu/components/RemoteVideoMenu.js Ver fichero

@@ -1,31 +1,31 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 /**
5
- * React {@code Component} responsible for displaying other components as a menu
6
- * for manipulating remote participant state.
7
- *
8
- * @extends {Component}
6
+ * The type of the React {@code Component} props of {@link RemoteVideoMenu}.
9 7
  */
10
-export default class RemoteVideoMenu extends Component {
8
+type Props = {
9
+
11 10
     /**
12
-     * {@code RemoteVideoMenu}'s property types.
13
-     *
14
-     * @static
11
+     * The components to place as the body of the {@code RemoteVideoMenu}.
15 12
      */
16
-    static propTypes = {
17
-        /**
18
-         * The components to place as the body of the {@code RemoteVideoMenu}.
19
-         */
20
-        children: PropTypes.node,
13
+    children: React$Node,
21 14
 
22
-        /**
23
-         * The id attribute to be added to the component's DOM for retrieval
24
-         * when querying the DOM. Not used directly by the component.
25
-         */
26
-        id: PropTypes.string
27
-    };
15
+    /**
16
+     * The id attribute to be added to the component's DOM for retrieval when
17
+     * querying the DOM. Not used directly by the component.
18
+     */
19
+    id: string
20
+};
28 21
 
22
+/**
23
+ * React {@code Component} responsible for displaying other components as a menu
24
+ * for manipulating remote participant state.
25
+ *
26
+ * @extends {Component}
27
+ */
28
+export default class RemoteVideoMenu extends Component<Props> {
29 29
     /**
30 30
      * Implements React's {@link Component#render()}.
31 31
      *

+ 32
- 32
react/features/remote-video-menu/components/RemoteVideoMenuButton.js Ver fichero

@@ -1,46 +1,46 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 /**
5
- * React {@code Component} for displaying an action in {@code RemoteVideoMenu}.
6
- *
7
- * @extends {Component}
6
+ * The type of the React {@code Component} props of
7
+ * {@link RemoteVideoMenuButton}.
8 8
  */
9
-export default class RemoteVideoMenuButton extends Component {
9
+type Props = {
10
+
10 11
     /**
11
-     * {@code RemoteVideoMenuButton}'s property types.
12
-     *
13
-     * @static
12
+     * Text to display within the component that describes the onClick action.
14 13
      */
15
-    static propTypes = {
16
-        /**
17
-         * Text to display within the component that describes the onClick
18
-         * action.
19
-         */
20
-        buttonText: PropTypes.string,
14
+    buttonText: string,
21 15
 
22
-        /**
23
-         * Additional CSS classes to add to the component.
24
-         */
25
-        displayClass: PropTypes.string,
16
+    /**
17
+     * Additional CSS classes to add to the component.
18
+     */
19
+    displayClass?: string,
26 20
 
27
-        /**
28
-         * The CSS classes for the icon that will display within the component.
29
-         */
30
-        iconClass: PropTypes.string,
21
+    /**
22
+     * The CSS classes for the icon that will display within the component.
23
+     */
24
+    iconClass: string,
31 25
 
32
-        /**
33
-         * The id attribute to be added to the component's DOM for retrieval
34
-         * when querying the DOM. Not used directly by the component.
35
-         */
36
-        id: PropTypes.string,
26
+    /**
27
+     * The id attribute to be added to the component's DOM for retrieval when
28
+     * querying the DOM. Not used directly by the component.
29
+     */
30
+    id: string,
37 31
 
38
-        /**
39
-         * Callback to invoke when the component is clicked.
40
-         */
41
-        onClick: PropTypes.func
42
-    };
32
+    /**
33
+     * Callback to invoke when the component is clicked.
34
+     */
35
+    onClick: Function,
36
+};
43 37
 
38
+/**
39
+ * React {@code Component} for displaying an action in {@code RemoteVideoMenu}.
40
+ *
41
+ * @extends {Component}
42
+ */
43
+export default class RemoteVideoMenuButton extends Component<Props> {
44 44
     /**
45 45
      * Implements React's {@link Component#render()}.
46 46
      *

+ 36
- 28
react/features/remote-video-menu/components/VolumeSlider.js Ver fichero

@@ -1,4 +1,5 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 /**
@@ -9,47 +10,52 @@ import React, { Component } from 'react';
9 10
 const VOLUME_SLIDER_SCALE = 100;
10 11
 
11 12
 /**
12
- * Implements a React {@link Component} which displays an input slider for
13
- * adjusting the local volume of a remote participant.
14
- *
15
- * @extends Component
13
+ * The type of the React {@code Component} props of {@link VolumeSlider}.
16 14
  */
17
-class VolumeSlider extends Component {
15
+type Props = {
16
+
18 17
     /**
19
-     * {@code VolumeSlider} component's property types.
20
-     *
21
-     * @static
18
+     * The value of the audio slider should display at when the component first
19
+     * mounts. Changes will be stored in state. The value should be a number
20
+     * between 0 and 1.
22 21
      */
23
-    static propTypes = {
24
-        /**
25
-         * The value of the audio slider should display at when the component
26
-         * first mounts. Changes will be stored in state. The value should be a
27
-         * number between 0 and 1.
28
-         */
29
-        initialValue: PropTypes.number,
22
+    initialValue: number,
23
+
24
+    /**
25
+     * The callback to invoke when the audio slider value changes.
26
+     */
27
+    onChange: Function
28
+};
29
+
30
+/**
31
+ * The type of the React {@code Component} state of {@link VolumeSlider}.
32
+ */
33
+type State = {
30 34
 
31
-        /**
32
-         * The callback to invoke when the audio slider value changes.
33
-         */
34
-        onChange: PropTypes.func
35
-    };
35
+    /**
36
+     * The volume of the participant's audio element. The value will
37
+     * be represented by a slider.
38
+     */
39
+    volumeLevel: number
40
+};
36 41
 
42
+/**
43
+ * Implements a React {@link Component} which displays an input slider for
44
+ * adjusting the local volume of a remote participant.
45
+ *
46
+ * @extends Component
47
+ */
48
+class VolumeSlider extends Component<Props, State> {
37 49
     /**
38 50
      * Initializes a new {@code VolumeSlider} instance.
39 51
      *
40 52
      * @param {Object} props - The read-only properties with which the new
41 53
      * instance is to be initialized.
42 54
      */
43
-    constructor(props) {
55
+    constructor(props: Props) {
44 56
         super(props);
45 57
 
46 58
         this.state = {
47
-            /**
48
-             * The volume of the participant's audio element. The value will
49
-             * be represented by a slider.
50
-             *
51
-             * @type {Number}
52
-             */
53 59
             volumeLevel: (props.initialValue || 0) * VOLUME_SLIDER_SCALE
54 60
         };
55 61
 
@@ -84,6 +90,8 @@ class VolumeSlider extends Component {
84 90
         );
85 91
     }
86 92
 
93
+    _onVolumeChange: (Object) => void;
94
+
87 95
     /**
88 96
      * Sets the internal state of the volume level for the volume slider.
89 97
      * Invokes the prop onVolumeChange to notify of volume changes.

+ 13
- 20
react/features/room-lock/components/PasswordRequiredPrompt.native.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -9,6 +8,15 @@ import { Dialog } from '../../base/dialog';
9 8
 
10 9
 import { _cancelPasswordRequiredPrompt } from '../actions';
11 10
 
11
+/**
12
+ * The style of the {@link TextInput} rendered by
13
+ * {@code PasswordRequiredPrompt}. As it requests the entry of a password, the
14
+ * entry should better be secure.
15
+ */
16
+const _TEXT_INPUT_PROPS = {
17
+    secureTextEntry: true
18
+};
19
+
12 20
 /**
13 21
  * {@code PasswordRequiredPrompt}'s React {@code Component} prop types.
14 22
  */
@@ -20,16 +28,11 @@ type Props = {
20 28
      * @type {JitsiConference}
21 29
      */
22 30
     conference: { join: Function },
23
-    dispatch: Dispatch<*>
24
-};
25 31
 
26
-/**
27
- * The style of the {@link TextInput} rendered by
28
- * {@code PasswordRequiredPrompt}. As it requests the entry of a password, the
29
- * entry should better be secure.
30
- */
31
-const _TEXT_INPUT_PROPS = {
32
-    secureTextEntry: true
32
+    /**
33
+     * The redux dispatch function.
34
+     */
35
+    dispatch: Dispatch<*>
33 36
 };
34 37
 
35 38
 /**
@@ -37,16 +40,6 @@ const _TEXT_INPUT_PROPS = {
37 40
  * is required to join a conference.
38 41
  */
39 42
 class PasswordRequiredPrompt extends Component<Props> {
40
-    /**
41
-     * {@code PasswordRequiredPrompt}'s React {@code Component} prop types.
42
-     *
43
-     * @static
44
-     */
45
-    static propTypes = {
46
-        conference: PropTypes.object,
47
-        dispatch: PropTypes.func
48
-    };
49
-
50 43
     /**
51 44
      * Initializes a new {@code PasswordRequiredPrompt} instance.
52 45
      *

+ 36
- 18
react/features/room-lock/components/PasswordRequiredPrompt.web.js Ver fichero

@@ -1,5 +1,5 @@
1 1
 // @flow
2
-import PropTypes from 'prop-types';
2
+
3 3
 import React, { Component } from 'react';
4 4
 import { connect } from 'react-redux';
5 5
 import { FieldTextStateless as TextField } from '@atlaskit/field-text';
@@ -9,26 +9,44 @@ import { Dialog } from '../../base/dialog';
9 9
 import { translate } from '../../base/i18n';
10 10
 
11 11
 /**
12
- * Implements a React Component which prompts the user when a password is
13
- * required to join a conference.
12
+ * The type of the React {@code Component} props of
13
+ * {@link PasswordRequiredPrompt}.
14 14
  */
15
-class PasswordRequiredPrompt extends Component<*, *> {
15
+type Props = {
16
+
16 17
     /**
17
-     * PasswordRequiredPrompt component's property types.
18
-     *
19
-     * @static
18
+     * The JitsiConference which requires a password.
20 19
      */
21
-    static propTypes = {
22
-        /**
23
-         * The JitsiConference which requires a password.
24
-         *
25
-         * @type {JitsiConference}
26
-         */
27
-        conference: PropTypes.object,
28
-        dispatch: PropTypes.func,
29
-        t: PropTypes.func
30
-    };
20
+    conference: Object,
21
+
22
+    /**
23
+     * The redux store's {@code dispatch} function.
24
+     */
25
+    dispatch: Dispatch<*>,
26
+
27
+    /**
28
+     * The translate function.
29
+     */
30
+    t: Function
31
+};
31 32
 
33
+/**
34
+ * The type of the React {@code Component} state of
35
+ * {@link PasswordRequiredPrompt}.
36
+ */
37
+type State = {
38
+
39
+    /**
40
+     * The password entered by the local participant.
41
+     */
42
+    password: string
43
+}
44
+
45
+/**
46
+ * Implements a React Component which prompts the user when a password is
47
+ * required to join a conference.
48
+ */
49
+class PasswordRequiredPrompt extends Component<Props, State> {
32 50
     state = {
33 51
         password: ''
34 52
     };
@@ -39,7 +57,7 @@ class PasswordRequiredPrompt extends Component<*, *> {
39 57
      * @param {Object} props - The read-only properties with which the new
40 58
      * instance is to be initialized.
41 59
      */
42
-    constructor(props) {
60
+    constructor(props: Props) {
43 61
         super(props);
44 62
 
45 63
         // Bind event handlers so they are only bound once per instance.

+ 16
- 16
react/features/room-lock/components/RoomLockPrompt.native.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -19,25 +18,26 @@ const _TEXT_INPUT_PROPS = {
19 18
 };
20 19
 
21 20
 /**
22
- * Implements a React Component which prompts the user for a password to lock  a
23
- * conference/room.
21
+ * The type of the React {@code Component} props of {@link RoomLockPrompt}.
24 22
  */
25
-class RoomLockPrompt extends Component<*> {
23
+type Props = {
24
+
26 25
     /**
27
-     * RoomLockPrompt component's property types.
28
-     *
29
-     * @static
26
+     * The JitsiConference which requires a password.
27
+     */
28
+    conference: Object,
29
+
30
+    /**
31
+     * Redux store dispatch function.
30 32
      */
31
-    static propTypes = {
32
-        /**
33
-         * The JitsiConference which requires a password.
34
-         *
35
-         * @type {JitsiConference}
36
-         */
37
-        conference: PropTypes.object,
38
-        dispatch: PropTypes.func
39
-    };
33
+    dispatch: Dispatch<*>,
34
+};
40 35
 
36
+/**
37
+ * Implements a React Component which prompts the user for a password to lock  a
38
+ * conference/room.
39
+ */
40
+class RoomLockPrompt extends Component<Props> {
41 41
     /**
42 42
      * Initializes a new RoomLockPrompt instance.
43 43
      *

+ 31
- 23
react/features/speaker-stats/components/SpeakerStats.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -13,34 +12,43 @@ import SpeakerStatsLabels from './SpeakerStatsLabels';
13 12
 declare var interfaceConfig: Object;
14 13
 
15 14
 /**
16
- * React component for displaying a list of speaker stats.
17
- *
18
- * @extends Component
15
+ * The type of the React {@code Component} props of {@link SpeakerStats}
19 16
  */
20
-class SpeakerStats extends Component<*, *> {
17
+type Props = {
18
+
21 19
     /**
22
-     * SpeakerStats component's property types.
23
-     *
24
-     * @static
20
+     * The display name for the local participant obtained from the redux store.
25 21
      */
26
-    static propTypes = {
27
-        /**
28
-         * The display name for the local participant obtained from the redux
29
-         * store.
30
-         */
31
-        _localDisplayName: PropTypes.string,
22
+    _localDisplayName: string,
32 23
 
33
-        /**
34
-         * The JitsiConference from which stats will be pulled.
35
-         */
36
-        conference: PropTypes.object,
24
+    /**
25
+     * The JitsiConference from which stats will be pulled.
26
+     */
27
+    conference: Object,
37 28
 
38
-        /**
39
-         * The function to translate human-readable text.
40
-         */
41
-        t: PropTypes.func
42
-    };
29
+    /**
30
+     * The function to translate human-readable text.
31
+     */
32
+    t: Function
33
+};
43 34
 
35
+/**
36
+ * The type of the React {@code Component} state of {@link SpeakerStats}
37
+ */
38
+type State = {
39
+
40
+    /**
41
+     * The stats summary provided by the JitsiConference.
42
+     */
43
+    stats: Object
44
+};
45
+
46
+/**
47
+ * React component for displaying a list of speaker stats.
48
+ *
49
+ * @extends Component
50
+ */
51
+class SpeakerStats extends Component<Props, State> {
44 52
     state = {
45 53
         stats: {}
46 54
     };

+ 26
- 26
react/features/speaker-stats/components/SpeakerStatsItem.js Ver fichero

@@ -1,41 +1,41 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import TimeElapsed from './TimeElapsed';
5 6
 
6 7
 /**
7
- * React component for display an individual user's speaker stats.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link SpeakerStatsItem}.
10 9
  */
11
-class SpeakerStatsItem extends Component {
10
+type Props = {
11
+
12 12
     /**
13
-     * SpeakerStatsItem component's property types.
14
-     *
15
-     * @static
13
+     * The name of the participant.
16 14
      */
17
-    static propTypes = {
18
-        /**
19
-         * The name of the participant.
20
-         */
21
-        displayName: PropTypes.string,
15
+    displayName: string,
22 16
 
23
-        /**
24
-         * The total milliseconds the participant has been dominant speaker.
25
-         */
26
-        dominantSpeakerTime: PropTypes.number,
17
+    /**
18
+     * The total milliseconds the participant has been dominant speaker.
19
+     */
20
+    dominantSpeakerTime: number,
27 21
 
28
-        /**
29
-         * True if the participant is no longer in the meeting.
30
-         */
31
-        hasLeft: PropTypes.bool,
22
+    /**
23
+     * True if the participant is no longer in the meeting.
24
+     */
25
+    hasLeft: boolean,
32 26
 
33
-        /**
34
-         * True if the participant is currently the dominant speaker.
35
-         */
36
-        isDominantSpeaker: PropTypes.bool
37
-    };
27
+    /**
28
+     * True if the participant is currently the dominant speaker.
29
+     */
30
+    isDominantSpeaker: boolean
31
+};
38 32
 
33
+/**
34
+ * React component for display an individual user's speaker stats.
35
+ *
36
+ * @extends Component
37
+ */
38
+class SpeakerStatsItem extends Component<Props> {
39 39
     /**
40 40
      * Implements React's {@link Component#render()}.
41 41
      *

+ 14
- 14
react/features/speaker-stats/components/SpeakerStatsLabels.js Ver fichero

@@ -1,26 +1,26 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../base/i18n';
5 6
 
6 7
 /**
7
- * React component for labeling speaker stats column items.
8
- *
9
- * @extends Component
8
+ * The type of the React {@code Component} props of {@link SpeakerStatsLabels}.
10 9
  */
11
-class SpeakerStatsLabels extends Component {
10
+type Props = {
11
+
12 12
     /**
13
-     * SpeakerStatsLabels component's property types.
14
-     *
15
-     * @static
13
+     * The function to translate human-readable text.
16 14
      */
17
-    static propTypes = {
18
-        /**
19
-         * The function to translate human-readable text.
20
-         */
21
-        t: PropTypes.func
22
-    };
15
+    t: Function
16
+};
23 17
 
18
+/**
19
+ * React component for labeling speaker stats column items.
20
+ *
21
+ * @extends Component
22
+ */
23
+class SpeakerStatsLabels extends Component<Props> {
24 24
     /**
25 25
      * Implements React's {@link Component#render()}.
26 26
      *

+ 19
- 19
react/features/speaker-stats/components/TimeElapsed.js Ver fichero

@@ -1,8 +1,25 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 import { translate } from '../../base/i18n';
5 6
 
7
+/**
8
+ * The type of the React {@code Component} props of {@link TimeElapsed}.
9
+ */
10
+type Props = {
11
+
12
+    /**
13
+     * The function to translate human-readable text.
14
+     */
15
+    t: Function,
16
+
17
+    /**
18
+     * The milliseconds to be converted into a human-readable format.
19
+     */
20
+    time: number
21
+};
22
+
6 23
 /**
7 24
  * React component for displaying total time elapsed. Converts a total count of
8 25
  * milliseconds into a more humanized form: "# hours, # minutes, # seconds".
@@ -10,24 +27,7 @@ import { translate } from '../../base/i18n';
10 27
  *
11 28
  * @extends Component
12 29
  */
13
-class TimeElapsed extends Component {
14
-    /**
15
-     * TimeElapsed component's property types.
16
-     *
17
-     * @static
18
-     */
19
-    static propTypes = {
20
-        /**
21
-         * The function to translate human-readable text.
22
-         */
23
-        t: PropTypes.func,
24
-
25
-        /**
26
-         * The milliseconds to be converted into a human-readable format.
27
-         */
28
-        time: PropTypes.number
29
-    };
30
-
30
+class TimeElapsed extends Component<Props> {
31 31
     /**
32 32
      * Implements React's {@link Component#render()}.
33 33
      *

+ 52
- 46
react/features/toolbox/components/AbstractToolbarButton.js Ver fichero

@@ -1,67 +1,66 @@
1
-import PropTypes from 'prop-types';
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
4 5
 /**
5
- * Abstract (base) class for a button in {@link Toolbar}.
6
- *
7
- * @abstract
6
+ * The type of the React {@code Component} props of
7
+ * {@link AbstractToolbarButton}.
8 8
  */
9
-export default class AbstractToolbarButton extends Component {
9
+export type Props = {
10
+
10 11
     /**
11
-     * AbstractToolbarButton component's property types.
12
-     *
13
-     * @static
12
+     * A succinct description of what the button does. Used by accessibility
13
+     * tools and torture tests.
14
+     */
15
+    accessibilityLabel: string,
16
+
17
+    /**
18
+     * The name of the Icon of this {@code AbstractToolbarButton}.
19
+     */
20
+    iconName: string,
21
+
22
+    /**
23
+     * The style of the Icon of this {@code AbstractToolbarButton}.
24
+     */
25
+    iconStyle?: Object,
26
+
27
+    /**
28
+     * On click handler.
14 29
      */
15
-    static propTypes = {
16
-        /**
17
-         * A succinct description of what the button does. Used by accessibility
18
-         * tools and torture tests.
19
-         */
20
-        accessibilityLabel: PropTypes.string,
21
-
22
-        /**
23
-         * The name of the Icon of this {@code AbstractToolbarButton}.
24
-         */
25
-        iconName: PropTypes.string,
26
-
27
-        /**
28
-         * The style of the Icon of this {@code AbstractToolbarButton}.
29
-         */
30
-        iconStyle: PropTypes.object,
31
-
32
-        /**
33
-         * On click handler.
34
-         */
35
-        onClick: PropTypes.func,
36
-
37
-        /**
38
-         * {@code AbstractToolbarButton} styles.
39
-         */
40
-        style:
41
-            PropTypes.oneOfType([
42
-                PropTypes.array,
43
-                PropTypes.object
44
-            ]),
45
-
46
-        /**
47
-         * The color underlaying the button.
48
-         */
49
-        underlayColor: PropTypes.any
50
-    };
30
+    onClick: Function,
51 31
 
32
+    /**
33
+     * {@code AbstractToolbarButton} styles.
34
+     */
35
+    style?: Array<string> | Object,
36
+
37
+    /**
38
+     * The color underlaying the button.
39
+     */
40
+    underlayColor?: any
41
+};
42
+
43
+/**
44
+ * Abstract (base) class for a button in {@link Toolbar}.
45
+ *
46
+ * @abstract
47
+ */
48
+export default class AbstractToolbarButton<P: Props> extends Component<P> {
52 49
     /**
53 50
      * Initializes a new {@code AbstractToolbarButton} instance.
54 51
      *
55 52
      * @param {Object} props - The React {@code Component} props to initialize
56 53
      * the new {@code AbstractToolbarButton} instance with.
57 54
      */
58
-    constructor(props) {
55
+    constructor(props: P) {
59 56
         super(props);
60 57
 
61 58
         // Bind event handlers so they are only bound once per instance.
62 59
         this._onClick = this._onClick.bind(this);
63 60
     }
64 61
 
62
+    _onClick: (any) => any;
63
+
65 64
     /**
66 65
      * Handles clicking/pressing this {@code AbstractToolbarButton} by
67 66
      * forwarding the event to the {@code onClick} prop of this instance if any.
@@ -86,15 +85,22 @@ export default class AbstractToolbarButton extends Component {
86 85
         return this._renderButton(this._renderIcon());
87 86
     }
88 87
 
88
+    _renderButton: (React$Element<*> | null) => React$Element<*>;
89
+
89 90
     /**
90 91
      * Renders the icon of this {@code AbstractToolbarButton}.
91 92
      *
92 93
      * @param {string|ReactClass} type - The React Component type of the icon to
93 94
      * be rendered.
94 95
      * @protected
95
-     * @returns {ReactElement} The icon of this {@code AbstractToolbarButton}.
96
+     * @returns {ReactElement|null} The icon of this
97
+     * {@code AbstractToolbarButton}.
96 98
      */
97 99
     _renderIcon(type) {
100
+        if (!type) {
101
+            return null;
102
+        }
103
+
98 104
         const props = {};
99 105
 
100 106
         'iconName' in this.props && (props.name = this.props.iconName);

+ 34
- 30
react/features/toolbox/components/web/OverflowMenuButton.js Ver fichero

@@ -1,5 +1,6 @@
1
+/* @flow */
2
+
1 3
 import InlineDialog from '@atlaskit/inline-dialog';
2
-import PropTypes from 'prop-types';
3 4
 import React, { Component } from 'react';
4 5
 
5 6
 import { createToolbarEvent, sendAnalytics } from '../../../analytics';
@@ -8,45 +9,44 @@ import { translate } from '../../../base/i18n';
8 9
 import ToolbarButton from './ToolbarButton';
9 10
 
10 11
 /**
11
- * A React {@code Component} for opening or closing the {@code OverflowMenu}.
12
- *
13
- * @extends Component
12
+ * The type of the React {@code Component} props of {@link OverflowMenuButton}.
14 13
  */
15
-class OverflowMenuButton extends Component {
14
+type Props = {
15
+
16 16
     /**
17
-     * {@code OverflowMenuButton} component's property types.
18
-     *
19
-     * @static
17
+     * A child React Element to display within {@code InlineDialog}.
18
+     */
19
+    children: React$Node,
20
+
21
+    /**
22
+     * Whether or not the OverflowMenu popover should display.
23
+     */
24
+    isOpen: boolean,
25
+
26
+    /**
27
+     * Calback to change the visibility of the overflow menu.
20 28
      */
21
-    static propTypes = {
22
-        /**
23
-         * A child React Element to display within {@code InlineDialog}.
24
-         */
25
-        children: PropTypes.object,
26
-
27
-        /**
28
-         * Whether or not the OverflowMenu popover should display.
29
-         */
30
-        isOpen: PropTypes.bool,
31
-
32
-        /**
33
-         * Calback to change the visiblility of the overflow menu.
34
-         */
35
-        onVisibilityChange: PropTypes.func,
36
-
37
-        /**
38
-         * Invoked to obtain translated strings.
39
-         */
40
-        t: PropTypes.func
41
-    };
29
+    onVisibilityChange: Function,
42 30
 
31
+    /**
32
+     * Invoked to obtain translated strings.
33
+     */
34
+    t: Function
35
+};
36
+
37
+/**
38
+ * A React {@code Component} for opening or closing the {@code OverflowMenu}.
39
+ *
40
+ * @extends Component
41
+ */
42
+class OverflowMenuButton extends Component<Props> {
43 43
     /**
44 44
      * Initializes a new {@code OverflowMenuButton} instance.
45 45
      *
46 46
      * @param {Object} props - The read-only properties with which the new
47 47
      * instance is to be initialized.
48 48
      */
49
-    constructor(props) {
49
+    constructor(props: Props) {
50 50
         super(props);
51 51
 
52 52
         // Bind event handlers so they are only bound once per instance.
@@ -83,6 +83,8 @@ class OverflowMenuButton extends Component {
83 83
         );
84 84
     }
85 85
 
86
+    _onCloseDialog: () => void;
87
+
86 88
     /**
87 89
      * Callback invoked when {@code InlineDialog} signals that it should be
88 90
      * close.
@@ -94,6 +96,8 @@ class OverflowMenuButton extends Component {
94 96
         this.props.onVisibilityChange(false);
95 97
     }
96 98
 
99
+    _onToggleDialogVisibility: () => void;
100
+
97 101
     /**
98 102
      * Callback invoked to signal that an event has occurred that should change
99 103
      * the visibility of the {@code InlineDialog} component.

+ 30
- 27
react/features/toolbox/components/web/OverflowMenuProfileItem.js Ver fichero

@@ -1,6 +1,5 @@
1
-/* globals interfaceConfig */
1
+/* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { connect } from 'react-redux';
6 5
 
@@ -10,43 +9,45 @@ import {
10 9
     getLocalParticipant
11 10
 } from '../../../base/participants';
12 11
 
12
+declare var interfaceConfig: Object;
13
+
14
+/**
15
+ * The type of the React {@code Component} props of
16
+ * {@link OverflowMenuProfileItem}.
17
+ */
18
+type Props = {
19
+
20
+    /**
21
+     * The redux representation of the local participant.
22
+     */
23
+    _localParticipant: Object,
24
+
25
+    /**
26
+     * Whether the button support clicking or not.
27
+     */
28
+    _unclickable: boolean,
29
+
30
+    /**
31
+     * The callback to invoke when {@code OverflowMenuProfileItem} is
32
+     * clicked.
33
+     */
34
+    onClick: Function
35
+};
36
+
13 37
 /**
14 38
  * A React {@code Component} for displaying a link with a profile avatar as an
15 39
  * icon.
16 40
  *
17 41
  * @extends Component
18 42
  */
19
-class OverflowMenuProfileItem extends Component {
20
-    /**
21
-     * {@code OverflowMenuProfileItem}'s property types.
22
-     *
23
-     * @static
24
-     */
25
-    static propTypes = {
26
-        /**
27
-         * The redux representation of the local participant.
28
-         */
29
-        _localParticipant: PropTypes.object,
30
-
31
-        /**
32
-         * Whether the button support clicking or not.
33
-         */
34
-        _unclickable: PropTypes.bool,
35
-
36
-        /**
37
-         * The callback to invoke when {@code OverflowMenuProfileItem} is
38
-         * clicked.
39
-         */
40
-        onClick: PropTypes.func
41
-    };
42
-
43
+class OverflowMenuProfileItem extends Component<Props> {
43 44
     /**
44 45
      * Initializes a new {@code OverflowMenuProfileItem} instance.
45 46
      *
46 47
      * @param {Object} props - The read-only properties with which the new
47 48
      * instance is to be initialized.
48 49
      */
49
-    constructor(props) {
50
+    constructor(props: Props) {
50 51
         super(props);
51 52
 
52 53
         // Bind event handler so it is only bound once for every instance.
@@ -87,6 +88,8 @@ class OverflowMenuProfileItem extends Component {
87 88
         );
88 89
     }
89 90
 
91
+    _onClick: () => void;
92
+
90 93
     /**
91 94
      * Invokes an on click callback if clicking is allowed.
92 95
      *

+ 22
- 22
react/features/toolbox/components/web/ToolbarButton.js Ver fichero

@@ -1,15 +1,35 @@
1
+/* @flow */
2
+
1 3
 import Tooltip from '@atlaskit/tooltip';
2
-import PropTypes from 'prop-types';
3 4
 import React from 'react';
4 5
 
5 6
 import AbstractToolbarButton from '../AbstractToolbarButton';
7
+import type { Props as AbstractToolbarButtonProps }
8
+    from '../AbstractToolbarButton';
9
+
10
+/**
11
+ * The type of the React {@code Component} props of {@link ToolbarButton}.
12
+ */
13
+type Props = AbstractToolbarButtonProps & {
14
+
15
+    /**
16
+     * The text to display in the tooltip.
17
+     */
18
+    tooltip: string,
19
+
20
+    /**
21
+     * From which direction the tooltip should appear, relative to the
22
+     * button.
23
+     */
24
+    tooltipPosition: string
25
+};
6 26
 
7 27
 /**
8 28
  * Represents a button in the toolbar.
9 29
  *
10 30
  * @extends AbstractToolbarButton
11 31
  */
12
-class ToolbarButton extends AbstractToolbarButton {
32
+class ToolbarButton extends AbstractToolbarButton<Props> {
13 33
     /**
14 34
      * Default values for {@code ToolbarButton} component's properties.
15 35
      *
@@ -19,26 +39,6 @@ class ToolbarButton extends AbstractToolbarButton {
19 39
         tooltipPosition: 'top'
20 40
     };
21 41
 
22
-    /**
23
-     * {@code ToolbarButton} component's property types.
24
-     *
25
-     * @static
26
-     */
27
-    static propTypes = {
28
-        ...AbstractToolbarButton.propTypes,
29
-
30
-        /**
31
-         * The text to display in the tooltip.
32
-         */
33
-        tooltip: PropTypes.string,
34
-
35
-        /**
36
-         * From which direction the tooltip should appear, relative to the
37
-         * button.
38
-         */
39
-        tooltipPosition: PropTypes.string
40
-    }
41
-
42 42
     /**
43 43
      * Renders the button of this {@code ToolbarButton}.
44 44
      *

+ 13
- 17
react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 /* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n';
@@ -17,26 +16,23 @@ import { CHROME, EDGE, FIREFOX, SAFARI } from './browserLinks';
17 16
 const _SNS = 'unsupported-desktop-browser';
18 17
 
19 18
 /**
20
- * React component representing unsupported browser page.
21
- *
22
- * @class UnsupportedDesktopBrowser
19
+ * The type of the React {@code Component} props of
20
+ * {@link UnsupportedDesktopBrowser}.
23 21
  */
24
-class UnsupportedDesktopBrowser extends Component<*> {
22
+type Props = {
23
+
25 24
     /**
26
-     * UnsupportedDesktopBrowser component's property types.
27
-     *
28
-     * @static
25
+     * The function to translate human-readable text.
29 26
      */
30
-    static propTypes = {
31
-        /**
32
-         * The function to translate human-readable text.
33
-         *
34
-         * @public
35
-         * @type {Function}
36
-         */
37
-        t: PropTypes.func
38
-    };
27
+    t: Function
28
+};
39 29
 
30
+/**
31
+ * React component representing unsupported browser page.
32
+ *
33
+ * @class UnsupportedDesktopBrowser
34
+ */
35
+class UnsupportedDesktopBrowser extends Component<Props> {
40 36
     /**
41 37
      * Renders the component.
42 38
      *

+ 49
- 37
react/features/video-quality/components/VideoQualitySlider.web.js Ver fichero

@@ -1,5 +1,6 @@
1
+/* @flow */
2
+
1 3
 import InlineMessage from '@atlaskit/inline-message';
2
-import PropTypes from 'prop-types';
3 4
 import React, { Component } from 'react';
4 5
 import { connect } from 'react-redux';
5 6
 
@@ -40,50 +41,51 @@ const createEvent = function(quality) {
40 41
 };
41 42
 
42 43
 /**
43
- * Implements a React {@link Component} which displays a slider for selecting a
44
- * new receive video quality.
45
- *
46
- * @extends Component
44
+ * The type of the React {@code Component} props of {@link VideoQualitySlider}.
47 45
  */
48
-class VideoQualitySlider extends Component {
46
+type Props = {
47
+
49 48
     /**
50
-     * {@code VideoQualitySlider}'s property types.
51
-     *
52
-     * @static
49
+     * Whether or not the conference is in audio only mode.
53 50
      */
54
-    static propTypes = {
55
-        /**
56
-         * Whether or not the conference is in audio only mode.
57
-         */
58
-        _audioOnly: PropTypes.bool,
51
+    _audioOnly: Boolean,
59 52
 
60
-        /**
61
-         * Whether or not the conference is in peer to peer mode.
62
-         */
63
-        _p2p: PropTypes.bool,
53
+    /**
54
+     * Whether or not the conference is in peer to peer mode.
55
+     */
56
+    _p2p: Boolean,
64 57
 
65
-        /**
66
-         * The currently configured maximum quality resolution to be received
67
-         * from remote participants.
68
-         */
69
-        _receiverVideoQuality: PropTypes.number,
58
+    /**
59
+     * The currently configured maximum quality resolution to be received
60
+     * from remote participants.
61
+     */
62
+    _receiverVideoQuality: Number,
70 63
 
71
-        /**
72
-         * Whether or not displaying video is supported in the current
73
-         * environment. If false, the slider will be disabled.
74
-         */
75
-        _videoSupported: PropTypes.bool,
64
+    /**
65
+     * Whether or not displaying video is supported in the current
66
+     * environment. If false, the slider will be disabled.
67
+     */
68
+    _videoSupported: Boolean,
76 69
 
77
-        /**
78
-         * Invoked to request toggling of audio only mode.
79
-         */
80
-        dispatch: PropTypes.func,
70
+    /**
71
+     * Invoked to request toggling of audio only mode.
72
+     */
73
+    dispatch: Dispatch<*>,
81 74
 
82
-        /**
83
-         * Invoked to obtain translated strings.
84
-         */
85
-        t: PropTypes.func
86
-    };
75
+    /**
76
+     * Invoked to obtain translated strings.
77
+     */
78
+    t: Function
79
+};
80
+
81
+/**
82
+ * Implements a React {@link Component} which displays a slider for selecting a
83
+ * new receive video quality.
84
+ *
85
+ * @extends Component
86
+ */
87
+class VideoQualitySlider extends Component<Props> {
88
+    _sliderOptions: Array<Object>;
87 89
 
88 90
     /**
89 91
      * Initializes a new {@code VideoQualitySlider} instance.
@@ -261,6 +263,8 @@ class VideoQualitySlider extends Component {
261 263
         });
262 264
     }
263 265
 
266
+    _enableAudioOnly: () => void;
267
+
264 268
     /**
265 269
      * Dispatches an action to enable audio only mode.
266 270
      *
@@ -273,6 +277,8 @@ class VideoQualitySlider extends Component {
273 277
         this.props.dispatch(setAudioOnly(true));
274 278
     }
275 279
 
280
+    _enableHighDefinition: () => void;
281
+
276 282
     /**
277 283
      * Handles the action of the high definition video being selected.
278 284
      * Dispatches an action to receive high quality video from remote
@@ -287,6 +293,8 @@ class VideoQualitySlider extends Component {
287 293
         this._setPreferredVideoQuality(HIGH);
288 294
     }
289 295
 
296
+    _enableLowDefinition: () => void;
297
+
290 298
     /**
291 299
      * Dispatches an action to receive low quality video from remote
292 300
      * participants.
@@ -300,6 +308,8 @@ class VideoQualitySlider extends Component {
300 308
         this._setPreferredVideoQuality(LOW);
301 309
     }
302 310
 
311
+    _enableStandardDefinition: () => void;
312
+
303 313
     /**
304 314
      * Dispatches an action to receive standard quality video from remote
305 315
      * participants.
@@ -337,6 +347,8 @@ class VideoQualitySlider extends Component {
337 347
         return _sliderOptions.indexOf(matchingOption);
338 348
     }
339 349
 
350
+    _onSliderChange: () => void;
351
+
340 352
     /**
341 353
      * Invokes a callback when the selected video quality changes.
342 354
      *

+ 35
- 20
react/features/welcome/components/LocalVideoTrackUnderlay.native.js Ver fichero

@@ -1,6 +1,5 @@
1 1
 /* @flow */
2 2
 
3
-import PropTypes from 'prop-types';
4 3
 import React, { Component } from 'react';
5 4
 import { View } from 'react-native';
6 5
 import { connect } from 'react-redux';
@@ -12,30 +11,46 @@ import { getLocalVideoTrack } from '../../base/tracks';
12 11
 import styles from './styles';
13 12
 
14 13
 /**
15
- * Implements a React {@code Component} which underlays the local video track,
16
- * if any, underneath its children.
14
+ * The type of the React {@code Component} props of
15
+ * {@link LocalVideoTrackUnderlay}.
17 16
  */
18
-class LocalVideoTrackUnderlay extends Component<*, *> {
19
-    state: {
20
-
21
-        /**
22
-         * The style of {@code LocalVideoTrackUnderlay} which is a combination
23
-         * of its default style and the consumer-specified style.
24
-         */
25
-        style: Object
26
-    };
17
+type Props = {
27 18
 
28 19
     /**
29
-     * {@code LocalVideoTrackUnderlay}'s React {@code Component} prop types.
30
-     *
31
-     * @static
20
+     * The redux representation of the local participant's video track.
32 21
      */
33
-    static propTypes = {
34
-        _localVideoTrack: PropTypes.object,
35
-        children: PropTypes.node,
36
-        style: PropTypes.object
37
-    };
22
+    _localVideoTrack: Object,
23
+
24
+    /**
25
+     * React Elements to display within the component.
26
+     */
27
+    children: React$Node,
28
+
29
+    /**
30
+     * The style, if any, to apply to {@link LocalVideoTrackUnderlay} in
31
+     * addition to its default style.
32
+     */
33
+    style: Object
34
+};
38 35
 
36
+/**
37
+ * The type of the React {@code Component} state of
38
+ * {@link LocalVideoTrackUnderlay}.
39
+ */
40
+type State = {
41
+
42
+    /**
43
+     * The style of {@code LocalVideoTrackUnderlay} which is a combination
44
+     * of its default style and the consumer-specified style.
45
+     */
46
+    style: Object
47
+};
48
+
49
+/**
50
+ * Implements a React {@code Component} which underlays the local video track,
51
+ * if any, underneath its children.
52
+ */
53
+class LocalVideoTrackUnderlay extends Component<Props, State> {
39 54
     /**
40 55
      * Initializes a new {@code LocalVideoTrackUnderlay} instance.
41 56
      *

Loading…
Cancelar
Guardar