瀏覽代碼

flow: tame the beast

master
Saúl Ibarra Corretgé 7 年之前
父節點
當前提交
0817482b9c

+ 1
- 0
react/features/base/dialog/components/Dialog.native.js 查看文件

@@ -173,6 +173,7 @@ class Dialog extends AbstractDialog<Props, State> {
173 173
                 if (style
174 174
                         && (style = StyleSheet.flatten(style))
175 175
                         && _TAG_KEY in style) {
176
+                    // $FlowFixMe
176 177
                     switch (style[_TAG_KEY]) {
177 178
                     case _SUBMIT_TEXT_TAG_VALUE:
178 179
                         if (this.state.submitting) {

+ 2
- 2
react/features/base/jwt/components/CalleeInfo.js 查看文件

@@ -75,9 +75,9 @@ class CalleeInfo extends Component<Props, State> {
75 75
 
76 76
     _onLargeVideoAvatarVisible: Function;
77 77
 
78
-    _playAudioInterval: ?number;
78
+    _playAudioInterval: *;
79 79
 
80
-    _ringingTimeout: ?number
80
+    _ringingTimeout: *;
81 81
 
82 82
     _setAudio: Function;
83 83
 

+ 3
- 2
react/features/base/media/components/native/VideoTransform.js 查看文件

@@ -3,6 +3,7 @@
3 3
 import React, { Component } from 'react';
4 4
 import { PanResponder, PixelRatio, View } from 'react-native';
5 5
 import { connect } from 'react-redux';
6
+import { type Dispatch } from 'redux';
6 7
 
7 8
 import { storeVideoTransform } from '../../actions';
8 9
 import styles from './styles';
@@ -684,7 +685,7 @@ class VideoTransform extends Component<Props, State> {
684 685
  *     _onUnmount: Function
685 686
  * }}
686 687
  */
687
-function _mapDispatchToProps(dispatch) {
688
+function _mapDispatchToProps(dispatch: Dispatch<*>) {
688 689
     return {
689 690
         /**
690 691
          * Dispatches actions to store the last applied transform to a video.
@@ -712,7 +713,7 @@ function _mapDispatchToProps(dispatch) {
712 713
 function _mapStateToProps(state) {
713 714
     return {
714 715
         /**
715
-         * The stored transforms retreived from Redux to be initially applied to
716
+         * The stored transforms retrieved from Redux to be initially applied to
716 717
          * different streams.
717 718
          *
718 719
          * @private

+ 6
- 6
react/features/base/react/components/native/Header.js 查看文件

@@ -1,6 +1,6 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
3
+import React, { Component, type Node } from 'react';
4 4
 import { Platform, SafeAreaView, StatusBar, View } from 'react-native';
5 5
 
6 6
 import styles, { HEADER_PADDING, STATUSBAR_COLOR } from './styles';
@@ -11,14 +11,14 @@ import styles, { HEADER_PADDING, STATUSBAR_COLOR } from './styles';
11 11
 const IOS10_PADDING = 20;
12 12
 
13 13
 /**
14
- * The type of the React {@code Component} props of {@link ScreenHeader}
14
+ * The type of the React {@code Component} props of {@link Header}
15 15
  */
16 16
 type Props = {
17 17
 
18 18
     /**
19 19
      * Children component(s).
20 20
      */
21
-    children: React$Node,
21
+    children: Node,
22 22
 
23 23
     /**
24 24
      * The component's external style
@@ -37,7 +37,7 @@ export default class Header extends Component<Props> {
37 37
      *
38 38
      * @returns {Object}
39 39
      */
40
-    static get buttonStyle() {
40
+    static get buttonStyle(): Object {
41 41
         return styles.headerButton;
42 42
     }
43 43
 
@@ -47,7 +47,7 @@ export default class Header extends Component<Props> {
47 47
      *
48 48
      * @returns {Object}
49 49
      */
50
-    static get pageStyle() {
50
+    static get pageStyle(): Object {
51 51
         return styles.page;
52 52
     }
53 53
 
@@ -56,7 +56,7 @@ export default class Header extends Component<Props> {
56 56
      *
57 57
      * @returns {Object}
58 58
      */
59
-    static get textStyle() {
59
+    static get textStyle(): Object {
60 60
         return styles.headerText;
61 61
     }
62 62
 

+ 2
- 2
react/features/base/responsive-ui/actions.js 查看文件

@@ -29,7 +29,7 @@ const REDUCED_UI_THRESHOLD = 300;
29 29
  *     aspectRatio: Symbol
30 30
  * }}
31 31
  */
32
-export function setAspectRatio(width: number, height: number): Object {
32
+export function setAspectRatio(width: number, height: number): Function {
33 33
     return (dispatch: Dispatch<*>, getState: Function) => {
34 34
         // Don't change the aspect ratio if width and height are the same, that
35 35
         // is, if we transition to a 1:1 aspect ratio.
@@ -59,7 +59,7 @@ export function setAspectRatio(width: number, height: number): Object {
59 59
  *     reducedUI: boolean
60 60
  * }}
61 61
  */
62
-export function setReducedUI(width: number, height: number) {
62
+export function setReducedUI(width: number, height: number): Function {
63 63
     return (dispatch: Dispatch<*>, getState: Function) => {
64 64
         const reducedUI = Math.min(width, height) < REDUCED_UI_THRESHOLD;
65 65
 

+ 1
- 0
react/features/base/responsive-ui/components/AspectRatioAware.js 查看文件

@@ -58,6 +58,7 @@ export function makeAspectRatioAware(
58 58
         }
59 59
     }
60 60
 
61
+    // $FlowFixMe
61 62
     return connect(_mapStateToProps)(AspectRatioAware);
62 63
 }
63 64
 

+ 4
- 3
react/features/base/responsive-ui/components/AspectRatioDetector.js 查看文件

@@ -1,7 +1,8 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
3
+import React, { Component, type Node } from 'react';
4 4
 import { connect } from 'react-redux';
5
+import { type Dispatch } from 'redux';
5 6
 
6 7
 import { setAspectRatio } from '../actions';
7 8
 import DimensionsDetector from './DimensionsDetector';
@@ -19,7 +20,7 @@ type Props = {
19 20
     /**
20 21
      * Any nested components.
21 22
      */
22
-    children: React$Node
23
+    children: Node
23 24
 };
24 25
 
25 26
 /**
@@ -51,7 +52,7 @@ class AspectRatioDetector extends Component<Props> {
51 52
  *     _onDimensionsChanged: Function
52 53
  * }}
53 54
  */
54
-function _mapDispatchToProps(dispatch) {
55
+function _mapDispatchToProps(dispatch: Dispatch<*>) {
55 56
     return {
56 57
         /**
57 58
          * Handles the "on dimensions changed" event and dispatches aspect ratio

+ 4
- 3
react/features/base/responsive-ui/components/ReducedUIDetector.js 查看文件

@@ -1,7 +1,8 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
3
+import React, { Component, type Node } from 'react';
4 4
 import { connect } from 'react-redux';
5
+import { type Dispatch } from 'redux';
5 6
 
6 7
 import { setReducedUI } from '../actions';
7 8
 import DimensionsDetector from './DimensionsDetector';
@@ -20,7 +21,7 @@ type Props = {
20 21
     /**
21 22
      * Any nested components.
22 23
      */
23
-    children: React$Node
24
+    children: Node
24 25
 };
25 26
 
26 27
 /**
@@ -52,7 +53,7 @@ class ReducedUIDetector extends Component<Props> {
52 53
  *     _onDimensionsChanged: Function
53 54
  * }}
54 55
  */
55
-function _mapDispatchToProps(dispatch) {
56
+function _mapDispatchToProps(dispatch: Dispatch<*>) {
56 57
     return {
57 58
         /**
58 59
          * Handles the "on dimensions changed" event and dispatches the

+ 1
- 2
react/features/base/testing/components/TestConnectionInfo.js 查看文件

@@ -81,8 +81,7 @@ type State = {
81 81
  * a good thing).
82 82
  */
83 83
 class TestConnectionInfo extends Component<Props, State> {
84
-
85
-    _onStatsUpdated: Object => void
84
+    _onStatsUpdated: Object => void;
86 85
 
87 86
     /**
88 87
      * Initializes new <tt>TestConnectionInfo</tt> instance.

+ 4
- 5
react/features/calendar-sync/components/ConferenceNotification.native.js 查看文件

@@ -56,14 +56,14 @@ type State = {
56 56
  * screen when another meeting is about to start.
57 57
  */
58 58
 class ConferenceNotification extends Component<Props, State> {
59
-    updateIntervalId: number;
59
+    updateIntervalId: *;
60 60
 
61 61
     /**
62 62
      * Constructor of the ConferenceNotification component.
63 63
      *
64 64
      * @inheritdoc
65 65
      */
66
-    constructor(props) {
66
+    constructor(props: Props) {
67 67
         super(props);
68 68
 
69 69
         this.state = {
@@ -97,7 +97,7 @@ class ConferenceNotification extends Component<Props, State> {
97 97
      * @inheritdoc
98 98
      */
99 99
     componentWillUnmount() {
100
-        clearTimeout(this.updateIntervalId);
100
+        clearInterval(this.updateIntervalId);
101 101
     }
102 102
 
103 103
     /**
@@ -160,7 +160,7 @@ class ConferenceNotification extends Component<Props, State> {
160 160
         return null;
161 161
     }
162 162
 
163
-    _getNotificationContentStyle: () => Array<Object>
163
+    _getNotificationContentStyle: () => Array<Object>;
164 164
 
165 165
     /**
166 166
      * Decides the color of the notification and some additional
@@ -251,7 +251,6 @@ class ConferenceNotification extends Component<Props, State> {
251 251
     /**
252 252
      * Opens the meeting URL that the notification shows.
253 253
      *
254
-     * @param {string} url - The URL to open.
255 254
      * @private
256 255
      * @returns {void}
257 256
      */

+ 2
- 1
react/features/invite/components/InviteButton.native.js 查看文件

@@ -1,6 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import { connect } from 'react-redux';
4
+import type { Dispatch } from 'redux';
4 5
 
5 6
 import { AbstractButton } from '../../base/toolbox';
6 7
 import type { AbstractButtonProps } from '../../base/toolbox';
@@ -105,7 +106,7 @@ class InviteButton extends AbstractButton<Props, *> {
105 106
  * }}
106 107
  * @private
107 108
  */
108
-function _mapDispatchToProps(dispatch) {
109
+function _mapDispatchToProps(dispatch: Dispatch<*>) {
109 110
     return {
110 111
         /**
111 112
          * Launches native invite dialog.

+ 1
- 1
react/features/large-video/components/LargeVideoBackgroundCanvas.web.js 查看文件

@@ -60,7 +60,7 @@ type Props = {
60 60
 export class LargeVideoBackgroundCanvas extends Component<Props> {
61 61
     _canvasEl: Object;
62 62
 
63
-    _updateCanvasInterval: number;
63
+    _updateCanvasInterval: *;
64 64
 
65 65
     /**
66 66
      * Initializes new {@code LargeVideoBackgroundCanvas} instance.

+ 4
- 4
react/features/overlay/components/AbstractPageReloadOverlay.js 查看文件

@@ -76,7 +76,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
76 76
      * @returns {boolean} - If this overlay needs to be rendered, {@code true};
77 77
      * {@code false}, otherwise.
78 78
      */
79
-    static needsRender(state) {
79
+    static needsRender(state: Object) {
80 80
         const conferenceError = state['features/base/conference'].error;
81 81
         const configError = state['features/base/config'].error;
82 82
         const connectionError = state['features/base/connection'].error;
@@ -88,7 +88,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
88 88
                 || configError);
89 89
     }
90 90
 
91
-    _interval: ?number
91
+    _interval: *;
92 92
 
93 93
     state: {
94 94
 
@@ -120,7 +120,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
120 120
          * @type {string}
121 121
          */
122 122
         title: string
123
-    }
123
+    };
124 124
 
125 125
     /**
126 126
      * Initializes a new AbstractPageReloadOverlay instance.
@@ -222,7 +222,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
222 222
     }
223 223
 
224 224
     /**
225
-     * Renders the button for relaod the page if necessary.
225
+     * Renders the button for reloading the page if necessary.
226 226
      *
227 227
      * @protected
228 228
      * @returns {ReactElement|null}

+ 1
- 1
react/features/recording/components/RecordingLabel.web.js 查看文件

@@ -98,7 +98,7 @@ type State = {
98 98
  * @extends {Component}
99 99
  */
100 100
 class RecordingLabel extends AbstractRecordingLabel<Props, State> {
101
-    _autohideTimeout: number;
101
+    _autohideTimeout: *;
102 102
 
103 103
     state = {
104 104
         hidden: false

+ 1
- 1
react/features/speaker-stats/components/SpeakerStats.js 查看文件

@@ -45,7 +45,7 @@ class SpeakerStats extends Component<*, *> {
45 45
         stats: {}
46 46
     };
47 47
 
48
-    _updateInterval: number;
48
+    _updateInterval: *;
49 49
 
50 50
     /**
51 51
      * Initializes a new SpeakerStats instance.

Loading…
取消
儲存