浏览代码

flow: tame the beast

🔥🔥🔥
master
Saúl Ibarra Corretgé 6 年前
父节点
当前提交
c025c7e132
共有 100 个文件被更改,包括 356 次插入251 次删除
  1. 6
    6
      react/features/app/actions.js
  2. 6
    4
      react/features/authentication/actions.js
  3. 2
    1
      react/features/authentication/components/LoginDialog.native.js
  4. 2
    1
      react/features/authentication/components/WaitForOwnerDialog.native.js
  5. 3
    1
      react/features/authentication/middleware.js
  6. 3
    1
      react/features/base/app/actions.js
  7. 4
    1
      react/features/base/color-scheme/ColorSchemeRegistry.js
  8. 6
    6
      react/features/base/conference/actions.js
  9. 2
    2
      react/features/base/config/actions.js
  10. 2
    2
      react/features/base/connection/actions.native.js
  11. 1
    1
      react/features/base/connection/actions.web.js
  12. 4
    2
      react/features/base/dialog/actions.js
  13. 3
    3
      react/features/base/dialog/components/AbstractDialog.js
  14. 1
    2
      react/features/base/dialog/components/native/BaseDialog.js
  15. 2
    3
      react/features/base/dialog/components/native/BaseSubmitDialog.js
  16. 1
    0
      react/features/base/dialog/components/native/BottomSheet.js
  17. 1
    2
      react/features/base/dialog/components/native/ConfirmDialog.js
  18. 1
    0
      react/features/base/dialog/components/native/CustomDialog.js
  19. 1
    3
      react/features/base/dialog/components/native/CustomSubmitDialog.js
  20. 1
    2
      react/features/base/dialog/components/native/InputDialog.js
  21. 4
    3
      react/features/base/dialog/components/web/Dialog.js
  22. 7
    7
      react/features/base/dialog/constants.js
  23. 2
    2
      react/features/base/lib-jitsi-meet/actions.js
  24. 1
    1
      react/features/base/media/actions.js
  25. 2
    1
      react/features/base/media/components/AbstractVideoTrack.js
  26. 1
    0
      react/features/base/media/components/native/VideoTrack.js
  27. 6
    3
      react/features/base/media/components/native/VideoTransform.js
  28. 2
    2
      react/features/base/media/components/web/VideoTrack.js
  29. 1
    1
      react/features/base/react/Types.js
  30. 1
    1
      react/features/base/react/components/AbstractContainer.js
  31. 42
    26
      react/features/base/react/components/native/AvatarListItem.js
  32. 1
    0
      react/features/base/react/components/native/BackButton.js
  33. 1
    0
      react/features/base/react/components/native/Header.js
  34. 1
    0
      react/features/base/react/components/native/PagedList.js
  35. 1
    0
      react/features/base/react/components/web/Watermarks.js
  36. 2
    8
      react/features/base/redux/MiddlewareRegistry.js
  37. 1
    0
      react/features/base/redux/ReducerRegistry.js
  38. 10
    4
      react/features/base/redux/StateListenerRegistry.js
  39. 2
    2
      react/features/base/responsive-ui/actions.js
  40. 2
    1
      react/features/base/responsive-ui/components/AspectRatioDetector.js
  41. 2
    1
      react/features/base/responsive-ui/components/ReducedUIDetector.js
  42. 1
    0
      react/features/base/sounds/components/SoundCollection.js
  43. 1
    1
      react/features/base/styles/functions.js
  44. 3
    2
      react/features/base/testing/components/TestConnectionInfo.js
  45. 1
    0
      react/features/base/testing/components/TestHint.ios.js
  46. 1
    0
      react/features/base/toolbox/components/AbstractToolboxItem.js
  47. 3
    1
      react/features/calendar-sync/actions.native.js
  48. 4
    3
      react/features/calendar-sync/actions.web.js
  49. 3
    2
      react/features/calendar-sync/components/AddMeetingUrlButton.web.js
  50. 1
    1
      react/features/calendar-sync/components/CalendarListContent.native.js
  51. 4
    2
      react/features/calendar-sync/components/CalendarListContent.web.js
  52. 5
    4
      react/features/calendar-sync/functions.native.js
  53. 3
    3
      react/features/calendar-sync/functions.web.js
  54. 8
    6
      react/features/calendar-sync/web/googleCalendar.js
  55. 64
    63
      react/features/calendar-sync/web/microsoftCalendar.js
  56. 3
    2
      react/features/chat/components/AbstractChat.js
  57. 1
    0
      react/features/chat/components/native/ChatButton.js
  58. 1
    0
      react/features/chat/components/web/ChatCounter.js
  59. 3
    1
      react/features/chat/components/web/ChatInput.js
  60. 2
    1
      react/features/chat/components/web/DisplayNameForm.js
  61. 1
    0
      react/features/conference/components/native/DisplayNameLabel.js
  62. 1
    0
      react/features/conference/components/native/Labels.js
  63. 1
    0
      react/features/conference/components/native/NavigationBar.js
  64. 1
    0
      react/features/conference/components/web/Conference.js
  65. 2
    1
      react/features/conference/components/web/Labels.js
  66. 2
    0
      react/features/conference/components/web/Subject.js
  67. 4
    2
      react/features/deep-linking/actions.js
  68. 3
    2
      react/features/deep-linking/components/DeepLinkingDesktopPage.web.js
  69. 2
    1
      react/features/desktop-picker/components/DesktopPicker.js
  70. 2
    1
      react/features/display-name/components/AbstractDisplayNamePrompt.js
  71. 2
    1
      react/features/display-name/components/DisplayName.web.js
  72. 1
    0
      react/features/display-name/components/DisplayNamePrompt.native.js
  73. 3
    1
      react/features/feedback/actions.js
  74. 3
    2
      react/features/feedback/components/FeedbackDialog.web.js
  75. 1
    0
      react/features/filmstrip/components/native/Filmstrip.js
  76. 1
    0
      react/features/filmstrip/components/native/LocalThumbnail.js
  77. 3
    1
      react/features/filmstrip/components/native/Thumbnail.js
  78. 3
    1
      react/features/filmstrip/components/native/TileView.js
  79. 3
    1
      react/features/filmstrip/components/web/Filmstrip.js
  80. 1
    0
      react/features/filmstrip/components/web/Toolbar.js
  81. 14
    11
      react/features/google-api/actions.js
  82. 4
    2
      react/features/invite/actions.js
  83. 2
    1
      react/features/invite/components/InfoDialogButton.web.js
  84. 1
    1
      react/features/invite/components/InviteButton.native.js
  85. 1
    1
      react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js
  86. 9
    7
      react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js
  87. 3
    2
      react/features/invite/components/add-people-dialog/web/AddPeopleDialog.js
  88. 1
    0
      react/features/invite/components/callee-info/CalleeInfo.js
  89. 1
    0
      react/features/invite/components/callee-info/CalleeInfoContainer.js
  90. 2
    1
      react/features/invite/components/info-dialog/InfoDialog.web.js
  91. 4
    2
      react/features/large-video/actions.js
  92. 2
    1
      react/features/large-video/components/LargeVideo.native.js
  93. 3
    2
      react/features/local-recording/components/LocalRecordingInfoDialog.js
  94. 3
    3
      react/features/local-recording/recording/flac/flacEncodeWorker.js
  95. 4
    2
      react/features/mobile/background/actions.js
  96. 1
    1
      react/features/mobile/background/middleware.js
  97. 2
    1
      react/features/mobile/network-activity/components/NetworkActivityIndicator.js
  98. 2
    1
      react/features/mobile/picture-in-picture/actions.js
  99. 1
    0
      react/features/notifications/components/NotificationsContainer.web.js
  100. 0
    0
      react/features/overlay/components/AbstractPageReloadOverlay.js

+ 6
- 6
react/features/app/actions.js 查看文件

31
  * @returns {Function}
31
  * @returns {Function}
32
  */
32
  */
33
 export function appNavigate(uri: ?string) {
33
 export function appNavigate(uri: ?string) {
34
-    return (dispatch: Dispatch<*>, getState: Function) =>
34
+    return (dispatch: Dispatch<any>, getState: Function) =>
35
         _appNavigateToOptionalLocation(dispatch, getState, parseURIString(uri));
35
         _appNavigateToOptionalLocation(dispatch, getState, parseURIString(uri));
36
 }
36
 }
37
 
37
 
50
  * @returns {Promise<void>}
50
  * @returns {Promise<void>}
51
  */
51
  */
52
 function _appNavigateToMandatoryLocation(
52
 function _appNavigateToMandatoryLocation(
53
-        dispatch: Dispatch<*>, getState: Function,
53
+        dispatch: Dispatch<any>, getState: Function,
54
         newLocation: Object
54
         newLocation: Object
55
 ): Promise<void> {
55
 ): Promise<void> {
56
     const { room } = newLocation;
56
     const { room } = newLocation;
111
  * @returns {void}
111
  * @returns {void}
112
  */
112
  */
113
 function _appNavigateToOptionalLocation(
113
 function _appNavigateToOptionalLocation(
114
-        dispatch: Dispatch<*>, getState: Function,
114
+        dispatch: Dispatch<any>, getState: Function,
115
         location: Object) {
115
         location: Object) {
116
     // If the specified location (URI) does not identify a host, use the app's
116
     // If the specified location (URI) does not identify a host, use the app's
117
     // default.
117
     // default.
150
  * @returns {Promise<Object>}
150
  * @returns {Promise<Object>}
151
  */
151
  */
152
 function _loadConfig(
152
 function _loadConfig(
153
-        dispatch: Dispatch<*>,
153
+        dispatch: Dispatch<any>,
154
         getState: Function,
154
         getState: Function,
155
         { contextRoot, host, protocol, room }) {
155
         { contextRoot, host, protocol, room }) {
156
     // XXX As the mobile/React Native app does not employ config on the
156
     // XXX As the mobile/React Native app does not employ config on the
211
  * @returns {Function}
211
  * @returns {Function}
212
  */
212
  */
213
 export function redirectWithStoredParams(pathname: string) {
213
 export function redirectWithStoredParams(pathname: string) {
214
-    return (dispatch: Dispatch<*>, getState: Function) => {
214
+    return (dispatch: Dispatch<any>, getState: Function) => {
215
         const { locationURL } = getState()['features/base/connection'];
215
         const { locationURL } = getState()['features/base/connection'];
216
         const newLocationURL = new URL(locationURL.href);
216
         const newLocationURL = new URL(locationURL.href);
217
 
217
 
248
  * @returns {Function}
248
  * @returns {Function}
249
  */
249
  */
250
 export function reloadWithStoredParams() {
250
 export function reloadWithStoredParams() {
251
-    return (dispatch: Dispatch<*>, getState: Function) => {
251
+    return (dispatch: Dispatch<any>, getState: Function) => {
252
         const { locationURL } = getState()['features/base/connection'];
252
         const { locationURL } = getState()['features/base/connection'];
253
         const windowLocation = window.location;
253
         const windowLocation = window.location;
254
         const oldSearchString = windowLocation.search;
254
         const oldSearchString = windowLocation.search;

+ 6
- 4
react/features/authentication/actions.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import type { Dispatch } from 'redux';
4
+
3
 import { appNavigate } from '../app';
5
 import { appNavigate } from '../app';
4
 import { checkIfCanJoin, conferenceLeft } from '../base/conference';
6
 import { checkIfCanJoin, conferenceLeft } from '../base/conference';
5
 import { connectionFailed } from '../base/connection';
7
 import { connectionFailed } from '../base/connection';
33
         id: string,
35
         id: string,
34
         password: string,
36
         password: string,
35
         conference: Object) {
37
         conference: Object) {
36
-    return (dispatch: Dispatch, getState: Function) => {
38
+    return (dispatch: Dispatch<any>, getState: Function) => {
37
         const { password: roomPassword }
39
         const { password: roomPassword }
38
             = getState()['features/base/conference'];
40
             = getState()['features/base/conference'];
39
         const process
41
         const process
73
  * }}
75
  * }}
74
  */
76
  */
75
 export function cancelLogin() {
77
 export function cancelLogin() {
76
-    return (dispatch: Dispatch<*>, getState: Function) => {
78
+    return (dispatch: Dispatch<any>, getState: Function) => {
77
         dispatch({ type: CANCEL_LOGIN });
79
         dispatch({ type: CANCEL_LOGIN });
78
 
80
 
79
         // XXX The error associated with CONNECTION_FAILED was marked as
81
         // XXX The error associated with CONNECTION_FAILED was marked as
100
  * @returns {Function}
102
  * @returns {Function}
101
  */
103
  */
102
 export function cancelWaitForOwner() {
104
 export function cancelWaitForOwner() {
103
-    return (dispatch: Dispatch<*>, getState: Function) => {
105
+    return (dispatch: Dispatch<any>, getState: Function) => {
104
         dispatch(stopWaitForOwner());
106
         dispatch(stopWaitForOwner());
105
 
107
 
106
         // XXX The error associated with CONFERENCE_FAILED was marked as
108
         // XXX The error associated with CONFERENCE_FAILED was marked as
228
  * @returns {Function}
230
  * @returns {Function}
229
  */
231
  */
230
 export function waitForOwner() {
232
 export function waitForOwner() {
231
-    return (dispatch: Dispatch) =>
233
+    return (dispatch: Dispatch<any>) =>
232
         dispatch({
234
         dispatch({
233
             type: WAIT_FOR_OWNER,
235
             type: WAIT_FOR_OWNER,
234
             handler: () => dispatch(checkIfCanJoin()),
236
             handler: () => dispatch(checkIfCanJoin()),

+ 2
- 1
react/features/authentication/components/LoginDialog.native.js 查看文件

3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { Text, TextInput, View } from 'react-native';
4
 import { Text, TextInput, View } from 'react-native';
5
 import { connect as reduxConnect } from 'react-redux';
5
 import { connect as reduxConnect } from 'react-redux';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import { connect, toJid } from '../../base/connection';
8
 import { connect, toJid } from '../../base/connection';
8
 import {
9
 import {
59
     /**
60
     /**
60
      * Redux store dispatch method.
61
      * Redux store dispatch method.
61
      */
62
      */
62
-    dispatch: Dispatch<*>,
63
+    dispatch: Dispatch<any>,
63
 
64
 
64
     /**
65
     /**
65
      * Invoked to obtain translated strings.
66
      * Invoked to obtain translated strings.

+ 2
- 1
react/features/authentication/components/WaitForOwnerDialog.native.js 查看文件

2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
+import type { Dispatch } from 'redux';
5
 
6
 
6
 import { ConfirmDialog } from '../../base/dialog';
7
 import { ConfirmDialog } from '../../base/dialog';
7
 import { translate } from '../../base/i18n';
8
 import { translate } from '../../base/i18n';
21
     /**
22
     /**
22
      * Redux store dispatch function.
23
      * Redux store dispatch function.
23
      */
24
      */
24
-    dispatch: Dispatch<*>,
25
+    dispatch: Dispatch<any>,
25
 
26
 
26
     /**
27
     /**
27
      * Invoked to obtain translated strings.
28
      * Invoked to obtain translated strings.

+ 3
- 1
react/features/authentication/middleware.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import type { Dispatch } from 'redux';
4
+
3
 import { appNavigate } from '../app';
5
 import { appNavigate } from '../app';
4
 import {
6
 import {
5
     CONFERENCE_FAILED,
7
     CONFERENCE_FAILED,
160
  * @param {Object} store - The redux store.
162
  * @param {Object} store - The redux store.
161
  * @returns {void}
163
  * @returns {void}
162
  */
164
  */
163
-function _hideLoginDialog({ dispatch }: { dispatch: Dispatch<*> }) {
165
+function _hideLoginDialog({ dispatch }: { dispatch: Dispatch<any> }) {
164
     dispatch(hideDialog(LoginDialog));
166
     dispatch(hideDialog(LoginDialog));
165
 }
167
 }
166
 
168
 

+ 3
- 1
react/features/base/app/actions.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import type { Dispatch } from 'redux';
4
+
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
5
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
4
 
6
 
5
 declare var APP;
7
 declare var APP;
14
  * }}
16
  * }}
15
  */
17
  */
16
 export function appWillMount(app: Object) {
18
 export function appWillMount(app: Object) {
17
-    return (dispatch: Dispatch<*>) => {
19
+    return (dispatch: Dispatch<any>) => {
18
         dispatch({
20
         dispatch({
19
             type: APP_WILL_MOUNT,
21
             type: APP_WILL_MOUNT,
20
             app
22
             app

+ 4
- 1
react/features/base/color-scheme/ColorSchemeRegistry.js 查看文件

122
                 } else if (typeof styleValue === 'function') {
122
                 } else if (typeof styleValue === 'function') {
123
                     // The value is a function, which indicates that it's a
123
                     // The value is a function, which indicates that it's a
124
                     // dynamic, schemed color we need to resolve.
124
                     // dynamic, schemed color we need to resolve.
125
+                    // $FlowExpectedError
126
+                    const value = styleValue();
127
+
125
                     schemedStyle[styleName]
128
                     schemedStyle[styleName]
126
-                        = this._getColor(stateful, componentName, styleValue());
129
+                        = this._getColor(stateful, componentName, value);
127
                 }
130
                 }
128
 
131
 
129
             }
132
             }

+ 6
- 6
react/features/base/conference/actions.js 查看文件

299
  * @returns {Function}
299
  * @returns {Function}
300
  */
300
  */
301
 function _conferenceWillJoin(conference: Object) {
301
 function _conferenceWillJoin(conference: Object) {
302
-    return (dispatch: Dispatch<*>, getState: Function) => {
302
+    return (dispatch: Dispatch<any>, getState: Function) => {
303
         const localTracks
303
         const localTracks
304
             = getLocalTracks(getState()['features/base/tracks'])
304
             = getLocalTracks(getState()['features/base/tracks'])
305
                 .map(t => t.jitsiTrack);
305
                 .map(t => t.jitsiTrack);
565
  * @returns {Function}
565
  * @returns {Function}
566
  */
566
  */
567
 export function setLastN(lastN: ?number) {
567
 export function setLastN(lastN: ?number) {
568
-    return (dispatch: Dispatch<*>, getState: Function) => {
568
+    return (dispatch: Dispatch<any>, getState: Function) => {
569
         if (typeof lastN === 'undefined') {
569
         if (typeof lastN === 'undefined') {
570
             const config = getState()['features/base/config'];
570
             const config = getState()['features/base/config'];
571
 
571
 
618
         conference: Object,
618
         conference: Object,
619
         method: Function,
619
         method: Function,
620
         password: string) {
620
         password: string) {
621
-    return (dispatch: Dispatch<*>, getState: Function): ?Promise<void> => {
621
+    return (dispatch: Dispatch<any>, getState: Function): ?Promise<void> => {
622
         switch (method) {
622
         switch (method) {
623
         case conference.join: {
623
         case conference.join: {
624
             let state = getState()['features/base/conference'];
624
             let state = getState()['features/base/conference'];
721
  */
721
  */
722
 export function setStartMutedPolicy(
722
 export function setStartMutedPolicy(
723
         startAudioMuted: boolean, startVideoMuted: boolean) {
723
         startAudioMuted: boolean, startVideoMuted: boolean) {
724
-    return (dispatch: Dispatch<*>, getState: Function) => {
724
+    return (dispatch: Dispatch<any>, getState: Function) => {
725
         const conference = getCurrentConference(getState());
725
         const conference = getCurrentConference(getState());
726
 
726
 
727
         conference && conference.setStartMutedPolicy({
727
         conference && conference.setStartMutedPolicy({
740
  * @returns {Function}
740
  * @returns {Function}
741
  */
741
  */
742
 export function toggleAudioOnly() {
742
 export function toggleAudioOnly() {
743
-    return (dispatch: Dispatch<*>, getState: Function) => {
743
+    return (dispatch: Dispatch<any>, getState: Function) => {
744
         const { audioOnly } = getState()['features/base/conference'];
744
         const { audioOnly } = getState()['features/base/conference'];
745
 
745
 
746
         return dispatch(setAudioOnly(!audioOnly, true));
746
         return dispatch(setAudioOnly(!audioOnly, true));
754
  * @returns {void}
754
  * @returns {void}
755
  */
755
  */
756
 export function setSubject(subject: string = '') {
756
 export function setSubject(subject: string = '') {
757
-    return (dispatch: Dispatch<*>, getState: Function) => {
757
+    return (dispatch: Dispatch<any>, getState: Function) => {
758
         const { conference } = getState()['features/base/conference'];
758
         const { conference } = getState()['features/base/conference'];
759
 
759
 
760
         if (conference) {
760
         if (conference) {

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

59
  * @returns {Function}
59
  * @returns {Function}
60
  */
60
  */
61
 export function setConfig(config: Object = {}) {
61
 export function setConfig(config: Object = {}) {
62
-    return (dispatch: Dispatch<*>, getState: Function) => {
62
+    return (dispatch: Dispatch<any>, getState: Function) => {
63
         const { locationURL } = getState()['features/base/connection'];
63
         const { locationURL } = getState()['features/base/connection'];
64
 
64
 
65
         // Now that the loading of the config was successful override the values
65
         // Now that the loading of the config was successful override the values
99
  * @returns {Function}
99
  * @returns {Function}
100
  */
100
  */
101
 export function storeConfig(baseURL: string, config: Object) {
101
 export function storeConfig(baseURL: string, config: Object) {
102
-    return (dispatch: Dispatch<*>) => {
102
+    return (dispatch: Dispatch<any>) => {
103
         // Try to store the configuration in localStorage. If the deployment
103
         // Try to store the configuration in localStorage. If the deployment
104
         // specified 'getroom' as a function, for example, it does not make
104
         // specified 'getroom' as a function, for example, it does not make
105
         // sense to and it will not be stored.
105
         // sense to and it will not be stored.

+ 2
- 2
react/features/base/connection/actions.native.js 查看文件

76
  * @returns {Function}
76
  * @returns {Function}
77
  */
77
  */
78
 export function connect(id: ?string, password: ?string) {
78
 export function connect(id: ?string, password: ?string) {
79
-    return (dispatch: Dispatch<*>, getState: Function) => {
79
+    return (dispatch: Dispatch<any>, getState: Function) => {
80
         const state = getState();
80
         const state = getState();
81
         const options = _constructOptions(state);
81
         const options = _constructOptions(state);
82
         const { issuer, jwt } = state['features/base/jwt'];
82
         const { issuer, jwt } = state['features/base/jwt'];
322
  * @returns {Function}
322
  * @returns {Function}
323
  */
323
  */
324
 export function disconnect() {
324
 export function disconnect() {
325
-    return (dispatch: Dispatch<*>, getState: Function): Promise<void> => {
325
+    return (dispatch: Dispatch<any>, getState: Function): Promise<void> => {
326
         const state = getState();
326
         const state = getState();
327
 
327
 
328
         // The conference we have already joined or are joining.
328
         // The conference we have already joined or are joining.

+ 1
- 1
react/features/base/connection/actions.web.js 查看文件

19
  * @returns {Promise<JitsiConnection>}
19
  * @returns {Promise<JitsiConnection>}
20
  */
20
  */
21
 export function connect() {
21
 export function connect() {
22
-    return (dispatch: Dispatch<*>, getState: Function) => {
22
+    return (dispatch: Dispatch<any>, getState: Function) => {
23
         // XXX Lib-jitsi-meet does not accept uppercase letters.
23
         // XXX Lib-jitsi-meet does not accept uppercase letters.
24
         const room = getState()['features/base/conference'].room.toLowerCase();
24
         const room = getState()['features/base/conference'].room.toLowerCase();
25
 
25
 

+ 4
- 2
react/features/base/dialog/actions.js 查看文件

1
-/* @flow */
1
+// @flow
2
+
3
+import type { Dispatch } from 'redux';
2
 
4
 
3
 import { HIDE_DIALOG, OPEN_DIALOG } from './actionTypes';
5
 import { HIDE_DIALOG, OPEN_DIALOG } from './actionTypes';
4
 import { isDialogOpen } from './functions';
6
 import { isDialogOpen } from './functions';
53
  * @returns {Function}
55
  * @returns {Function}
54
  */
56
  */
55
 export function toggleDialog(component: Object, componentProps: ?Object) {
57
 export function toggleDialog(component: Object, componentProps: ?Object) {
56
-    return (dispatch: Dispatch, getState: Function) => {
58
+    return (dispatch: Dispatch<any>, getState: Function) => {
57
         if (isDialogOpen(getState, component)) {
59
         if (isDialogOpen(getState, component)) {
58
             dispatch(hideDialog(component));
60
             dispatch(hideDialog(component));
59
         } else {
61
         } else {

+ 3
- 3
react/features/base/dialog/components/AbstractDialog.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { Component } from 'react';
3
 import { Component } from 'react';
4
+import type { Dispatch } from 'redux';
4
 
5
 
5
 import { hideDialog } from '../actions';
6
 import { hideDialog } from '../actions';
6
 import type { DialogProps } from '../constants';
7
 import type { DialogProps } from '../constants';
8
 /**
9
 /**
9
  * The type of the React {@code Component} props of {@link AbstractDialog}.
10
  * The type of the React {@code Component} props of {@link AbstractDialog}.
10
  */
11
  */
11
-export type Props = {
12
-    ...DialogProps,
12
+export type Props = DialogProps & {
13
 
13
 
14
     /**
14
     /**
15
      * Used to show/hide the dialog on cancel.
15
      * Used to show/hide the dialog on cancel.
16
      */
16
      */
17
-    dispatch: Dispatch<*>
17
+    dispatch: Dispatch<any>
18
 };
18
 };
19
 
19
 
20
 /**
20
 /**

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

16
 } from '../AbstractDialog';
16
 } from '../AbstractDialog';
17
 import { brandedDialog as styles } from './styles';
17
 import { brandedDialog as styles } from './styles';
18
 
18
 
19
-export type Props = {
20
-    ...AbstractProps,
19
+export type Props = AbstractProps & {
21
 
20
 
22
     /**
21
     /**
23
      * The color-schemed stylesheet of the feature.
22
      * The color-schemed stylesheet of the feature.

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

10
     brandedDialog
10
     brandedDialog
11
 } from './styles';
11
 } from './styles';
12
 
12
 
13
-type Props = {
14
-    ...BaseProps,
13
+type Props = BaseProps & {
15
 
14
 
16
     /**
15
     /**
17
      * The color-schemed stylesheet of the feature.
16
      * The color-schemed stylesheet of the feature.
83
 
82
 
84
     _onCancel: () => void;
83
     _onCancel: () => void;
85
 
84
 
86
-    _onSubmit: ?string => boolean;
85
+    _onSubmit: () => boolean;
87
 
86
 
88
     _renderHTML: string => Object | string
87
     _renderHTML: string => Object | string
89
 
88
 

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

107
     };
107
     };
108
 }
108
 }
109
 
109
 
110
+// $FlowExpectedError
110
 export default connect(_mapStateToProps)(BottomSheet);
111
 export default connect(_mapStateToProps)(BottomSheet);

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

13
 import BaseSubmitDialog from './BaseSubmitDialog';
13
 import BaseSubmitDialog from './BaseSubmitDialog';
14
 import { brandedDialog } from './styles';
14
 import { brandedDialog } from './styles';
15
 
15
 
16
-type Props = {
17
-    ...BaseProps,
16
+type Props = BaseProps & {
18
 
17
 
19
     /**
18
     /**
20
      * The color-schemed stylesheet of the feature.
19
      * The color-schemed stylesheet of the feature.

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

21
     }
21
     }
22
 }
22
 }
23
 
23
 
24
+// $FlowExpectedError
24
 export default connect(_abstractMapStateToProps)(CustomDialog);
25
 export default connect(_abstractMapStateToProps)(CustomDialog);

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

9
 import { type Props as BaseProps } from './BaseDialog';
9
 import { type Props as BaseProps } from './BaseDialog';
10
 import BaseSubmitDialog from './BaseSubmitDialog';
10
 import BaseSubmitDialog from './BaseSubmitDialog';
11
 
11
 
12
-type Props = {
13
-    ...BaseProps,
14
-
12
+type Props = BaseProps & {
15
     t: Function
13
     t: Function
16
 }
14
 }
17
 
15
 

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

18
     inputDialog as styles
18
     inputDialog as styles
19
 } from './styles';
19
 } from './styles';
20
 
20
 
21
-type Props = {
22
-    ...BaseProps,
21
+type Props = BaseProps & {
23
 
22
 
24
     /**
23
     /**
25
      * The color-schemed stylesheet of the feature.
24
      * The color-schemed stylesheet of the feature.

+ 4
- 3
react/features/base/dialog/components/web/Dialog.js 查看文件

10
 /**
10
 /**
11
  * The type of the React {@code Component} props of {@link Dialog}.
11
  * The type of the React {@code Component} props of {@link Dialog}.
12
  */
12
  */
13
-type Props = {
14
-    ...AbstractDialogProps,
13
+type Props = AbstractDialogProps & {
15
 
14
 
16
     /**
15
     /**
17
      * Whether the dialog is modal. This means clicking on the blanket will
16
      * Whether the dialog is modal. This means clicking on the blanket will
44
      * @param {Object} props - The read-only properties with which the new
43
      * @param {Object} props - The read-only properties with which the new
45
      * instance is to be initialized.
44
      * instance is to be initialized.
46
      */
45
      */
47
-    constructor(props) {
46
+    constructor(props: Props) {
48
         super(props);
47
         super(props);
49
 
48
 
50
         // Bind event handlers so they are only bound once per instance.
49
         // Bind event handlers so they are only bound once per instance.
65
             onSubmit: this._onSubmit
64
             onSubmit: this._onSubmit
66
         };
65
         };
67
 
66
 
67
+        // $FlowExpectedError
68
         delete props.dispatch;
68
         delete props.dispatch;
69
 
69
 
70
         return <StatelessDialog { ...props } />;
70
         return <StatelessDialog { ...props } />;
84
     _onSubmit: (?string) => void;
84
     _onSubmit: (?string) => void;
85
 }
85
 }
86
 
86
 
87
+// $FlowExpectedError
87
 export default connect()(Dialog);
88
 export default connect()(Dialog);

+ 7
- 7
react/features/base/dialog/constants.js 查看文件

5
     /**
5
     /**
6
      * Whether cancel button is disabled. Enabled by default.
6
      * Whether cancel button is disabled. Enabled by default.
7
      */
7
      */
8
-    cancelDisabled: boolean,
8
+    cancelDisabled: ?boolean,
9
 
9
 
10
     /**
10
     /**
11
      * Optional i18n key to change the cancel button title.
11
      * Optional i18n key to change the cancel button title.
12
      */
12
      */
13
-    cancelKey: string,
13
+    cancelKey: ?string,
14
 
14
 
15
     /**
15
     /**
16
      * The React {@code Component} children which represents the dialog's body.
16
      * The React {@code Component} children which represents the dialog's body.
17
      */
17
      */
18
-    children: React$Node,
18
+    children: ?React$Node,
19
 
19
 
20
     /**
20
     /**
21
      * Is ok button enabled/disabled. Enabled by default.
21
      * Is ok button enabled/disabled. Enabled by default.
22
      */
22
      */
23
-    okDisabled: boolean,
23
+    okDisabled: ?boolean,
24
 
24
 
25
     /**
25
     /**
26
      * Optional i18n key to change the ok button title.
26
      * Optional i18n key to change the ok button title.
27
      */
27
      */
28
-    okKey: string,
28
+    okKey: ?string,
29
 
29
 
30
     /**
30
     /**
31
      * The handler for onCancel event.
31
      * The handler for onCancel event.
47
     /**
47
     /**
48
      * Key to use for showing a title.
48
      * Key to use for showing a title.
49
      */
49
      */
50
-    titleKey: string,
50
+    titleKey: ?string,
51
 
51
 
52
     /**
52
     /**
53
      * The string to use as a title instead of {@code titleKey}. If a truthy
53
      * The string to use as a title instead of {@code titleKey}. If a truthy
54
      * value is specified, it takes precedence over {@code titleKey} i.e.
54
      * value is specified, it takes precedence over {@code titleKey} i.e.
55
      * the latter is unused.
55
      * the latter is unused.
56
      */
56
      */
57
-    titleString: string
57
+    titleString: ?string
58
 };
58
 };
59
 
59
 
60
 /**
60
 /**

+ 2
- 2
react/features/base/lib-jitsi-meet/actions.js 查看文件

20
  * @returns {Function}
20
  * @returns {Function}
21
  */
21
  */
22
 export function disposeLib() {
22
 export function disposeLib() {
23
-    return (dispatch: Dispatch<*>) => {
23
+    return (dispatch: Dispatch<any>) => {
24
         dispatch({ type: LIB_WILL_DISPOSE });
24
         dispatch({ type: LIB_WILL_DISPOSE });
25
 
25
 
26
         // TODO Currently, lib-jitsi-meet doesn't have the functionality to
26
         // TODO Currently, lib-jitsi-meet doesn't have the functionality to
36
  * @returns {Function}
36
  * @returns {Function}
37
  */
37
  */
38
 export function initLib() {
38
 export function initLib() {
39
-    return (dispatch: Dispatch<*>, getState: Function): void => {
39
+    return (dispatch: Dispatch<any>, getState: Function): void => {
40
         const config = getState()['features/base/config'];
40
         const config = getState()['features/base/config'];
41
 
41
 
42
         if (!config) {
42
         if (!config) {

+ 1
- 1
react/features/base/media/actions.js 查看文件

99
         muted: boolean,
99
         muted: boolean,
100
         authority: number = VIDEO_MUTISM_AUTHORITY.USER,
100
         authority: number = VIDEO_MUTISM_AUTHORITY.USER,
101
         ensureTrack: boolean = false) {
101
         ensureTrack: boolean = false) {
102
-    return (dispatch: Dispatch<*>, getState: Function) => {
102
+    return (dispatch: Dispatch<any>, getState: Function) => {
103
         const oldValue = getState()['features/base/media'].video.muted;
103
         const oldValue = getState()['features/base/media'].video.muted;
104
 
104
 
105
         // eslint-disable-next-line no-bitwise
105
         // eslint-disable-next-line no-bitwise

+ 2
- 1
react/features/base/media/components/AbstractVideoTrack.js 查看文件

1
 /* @flow */
1
 /* @flow */
2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
+import type { Dispatch } from 'redux';
4
 
5
 
5
 import { trackVideoStarted } from '../../tracks';
6
 import { trackVideoStarted } from '../../tracks';
6
 
7
 
15
     /**
16
     /**
16
      * The Redux dispatch function.
17
      * The Redux dispatch function.
17
      */
18
      */
18
-    dispatch: Dispatch<*>,
19
+    dispatch: Dispatch<any>,
19
 
20
 
20
     /**
21
     /**
21
      * Callback to invoke when the {@link Video} of {@code AbstractVideoTrack}
22
      * Callback to invoke when the {@link Video} of {@code AbstractVideoTrack}

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

29
     }
29
     }
30
 }
30
 }
31
 
31
 
32
+// $FlowExpectedError
32
 export default connect()(VideoTrack);
33
 export default connect()(VideoTrack);

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

5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
 import { type Dispatch } from 'redux';
6
 import { type Dispatch } from 'redux';
7
 
7
 
8
+import type { PanResponderInstance } from 'PanResponder';
9
+
8
 import { storeVideoTransform } from '../../actions';
10
 import { storeVideoTransform } from '../../actions';
9
 import styles from './styles';
11
 import styles from './styles';
10
 
12
 
117
     /**
119
     /**
118
      * The gesture handler object.
120
      * The gesture handler object.
119
      */
121
      */
120
-    gestureHandlers: PanResponder;
122
+    gestureHandlers: PanResponderInstance;
121
 
123
 
122
     /**
124
     /**
123
      * The initial distance of the fingers on pinch start.
125
      * The initial distance of the fingers on pinch start.
190
      *
192
      *
191
      * @inheritdoc
193
      * @inheritdoc
192
      */
194
      */
193
-    componentDidUpdate(prevProps, prevState) {
195
+    componentDidUpdate(prevProps: Props, prevState: State) {
194
         if (prevProps.streamId !== this.props.streamId) {
196
         if (prevProps.streamId !== this.props.streamId) {
195
             this._storeTransform(prevProps.streamId, prevState.transform);
197
             this._storeTransform(prevProps.streamId, prevState.transform);
196
             this._restoreTransform(this.props.streamId);
198
             this._restoreTransform(this.props.streamId);
687
  *     _onUnmount: Function
689
  *     _onUnmount: Function
688
  * }}
690
  * }}
689
  */
691
  */
690
-function _mapDispatchToProps(dispatch: Dispatch<*>) {
692
+function _mapDispatchToProps(dispatch: Dispatch<any>) {
691
     return {
693
     return {
692
         /**
694
         /**
693
          * Dispatches actions to store the last applied transform to a video.
695
          * Dispatches actions to store the last applied transform to a video.
725
     };
727
     };
726
 }
728
 }
727
 
729
 
730
+// $FlowExpectedError
728
 export default connect(_mapStateToProps, _mapDispatchToProps)(VideoTransform);
731
 export default connect(_mapStateToProps, _mapDispatchToProps)(VideoTransform);

+ 2
- 2
react/features/base/media/components/web/VideoTrack.js 查看文件

11
 /**
11
 /**
12
  * The type of the React {@code Component} props of {@link VideoTrack}.
12
  * The type of the React {@code Component} props of {@link VideoTrack}.
13
  */
13
  */
14
-type Props = {
15
-    ...AbstractVideoTrackProps,
14
+type Props = AbstractVideoTrackProps & {
16
 
15
 
17
     /**
16
     /**
18
      * CSS classes to add to the video element.
17
      * CSS classes to add to the video element.
64
     _onVideoPlaying: () => void;
63
     _onVideoPlaying: () => void;
65
 }
64
 }
66
 
65
 
66
+// $FlowExpectedError
67
 export default connect()(VideoTrack);
67
 export default connect()(VideoTrack);

+ 1
- 1
react/features/base/react/Types.js 查看文件

20
     /**
20
     /**
21
      * An optional react element to append to the end of the Item.
21
      * An optional react element to append to the end of the Item.
22
      */
22
      */
23
-    elementAfter?: ?ComponentType<any>,
23
+    elementAfter?: ?React$Node,
24
 
24
 
25
     /**
25
     /**
26
      * Unique ID of the item.
26
      * Unique ID of the item.

+ 1
- 1
react/features/base/react/components/AbstractContainer.js 查看文件

20
     /**
20
     /**
21
      * React Elements to display within the component.
21
      * React Elements to display within the component.
22
      */
22
      */
23
-    children: React$Node | Object,
23
+    children: React$Node,
24
 
24
 
25
     /**
25
     /**
26
      * The event handler/listener to be invoked when this
26
      * The event handler/listener to be invoked when this

+ 42
- 26
react/features/base/react/components/native/AvatarListItem.js 查看文件

32
     /**
32
     /**
33
      * Children of the component.
33
      * Children of the component.
34
      */
34
      */
35
-    children?: ?React$Element<*>,
35
+    children?: React$Node,
36
 
36
 
37
     /**
37
     /**
38
      * item containing data to be rendered
38
      * item containing data to be rendered
70
         this._renderItemLine = this._renderItemLine.bind(this);
70
         this._renderItemLine = this._renderItemLine.bind(this);
71
     }
71
     }
72
 
72
 
73
+    /**
74
+     * Helper function to render the content in the avatar container.
75
+     *
76
+     * @returns {React$Element}
77
+     */
78
+    _getAvatarContent() {
79
+        const {
80
+            avatarSize = AVATAR_SIZE,
81
+            avatarTextStyle
82
+        } = this.props;
83
+        const { avatar, title } = this.props.item;
84
+        const isAvatarURL = Boolean(avatar && avatar.match(/^http[s]*:\/\//i));
85
+
86
+        if (isAvatarURL) {
87
+            return (
88
+                <Avatar
89
+                    size = { avatarSize }
90
+                    uri = { avatar } />
91
+            );
92
+        }
93
+
94
+        if (avatar && !isAvatarURL) {
95
+            return (
96
+                <Icon name = { avatar } />
97
+            );
98
+        }
99
+
100
+        return (
101
+            <Text
102
+                style = { [
103
+                    styles.avatarContent,
104
+                    avatarTextStyle
105
+                ] }>
106
+                { title.substr(0, 1).toUpperCase() }
107
+            </Text>
108
+        );
109
+    }
110
+
73
     /**
111
     /**
74
      * Implements {@code Component#render}.
112
      * Implements {@code Component#render}.
75
      *
113
      *
78
     render() {
116
     render() {
79
         const {
117
         const {
80
             avatarSize = AVATAR_SIZE,
118
             avatarSize = AVATAR_SIZE,
81
-            avatarStyle,
82
-            avatarTextStyle
119
+            avatarStyle
83
         } = this.props;
120
         } = this.props;
84
-        const { avatar, colorBase, lines, title } = this.props.item;
121
+        const { colorBase, lines, title } = this.props.item;
85
         const avatarStyles = {
122
         const avatarStyles = {
86
             ...styles.avatar,
123
             ...styles.avatar,
87
             ...this._getAvatarColor(colorBase),
124
             ...this._getAvatarColor(colorBase),
91
             width: avatarSize
128
             width: avatarSize
92
         };
129
         };
93
 
130
 
94
-        const isAvatarURL = Boolean(avatar && avatar.match(/^http[s]*:\/\//i));
95
-
96
         return (
131
         return (
97
             <Container
132
             <Container
98
                 onClick = { this.props.onPress }
133
                 onClick = { this.props.onPress }
100
                 underlayColor = { UNDERLAY_COLOR }>
135
                 underlayColor = { UNDERLAY_COLOR }>
101
                 <Container style = { styles.avatarContainer }>
136
                 <Container style = { styles.avatarContainer }>
102
                     <Container style = { avatarStyles }>
137
                     <Container style = { avatarStyles }>
103
-                        {
104
-                            isAvatarURL && <Avatar
105
-                                size = { avatarSize }
106
-                                uri = { avatar } />
107
-                        }
108
-
109
-                        {
110
-                            Boolean(avatar && !isAvatarURL) && <Icon
111
-                                name = { avatar } />
112
-                        }
113
-
114
-                        {
115
-                            !avatar && <Text
116
-                                style = { [
117
-                                    styles.avatarContent,
118
-                                    avatarTextStyle
119
-                                ] }>
120
-                                { title.substr(0, 1).toUpperCase() }
121
-                            </Text>
122
-                        }
138
+                        { this._getAvatarContent() }
123
                     </Container>
139
                     </Container>
124
                 </Container>
140
                 </Container>
125
                 <Container style = { styles.listItemDetails }>
141
                 <Container style = { styles.listItemDetails }>

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

68
     };
68
     };
69
 }
69
 }
70
 
70
 
71
+// $FlowExpectedError
71
 export default connect(_mapStateToProps)(BackButton);
72
 export default connect(_mapStateToProps)(BackButton);

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

165
     };
165
     };
166
 }
166
 }
167
 
167
 
168
+// $FlowExpectedError
168
 export default connect(_mapStateToProps)(Header);
169
 export default connect(_mapStateToProps)(Header);

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

283
     }
283
     }
284
 }
284
 }
285
 
285
 
286
+// $FlowExpectedError
286
 export default connect()(PagedList);
287
 export default connect()(PagedList);

+ 1
- 0
react/features/base/react/components/web/Watermarks.js 查看文件

242
     };
242
     };
243
 }
243
 }
244
 
244
 
245
+// $FlowExpectedError
245
 export default connect(_mapStateToProps)(translate(Watermarks));
246
 export default connect(_mapStateToProps)(translate(Watermarks));

+ 2
- 8
react/features/base/redux/MiddlewareRegistry.js 查看文件

32
      * @returns {Middleware}
32
      * @returns {Middleware}
33
      */
33
      */
34
     applyMiddleware(...additional: Array<Middleware<*, *>>) {
34
     applyMiddleware(...additional: Array<Middleware<*, *>>) {
35
-        // XXX The explicit definition of the local variable middlewares is to
36
-        // satisfy flow.
37
-        const middlewares = [
38
-            ...this._elements,
39
-            ...additional
40
-        ];
41
-
42
-        return applyMiddleware(...middlewares);
35
+        // $FlowExpectedError
36
+        return applyMiddleware(...this._elements, ...additional);
43
     }
37
     }
44
 
38
 
45
     /**
39
     /**

+ 1
- 0
react/features/base/redux/ReducerRegistry.js 查看文件

38
      * @returns {Function}
38
      * @returns {Function}
39
      */
39
      */
40
     combineReducers(additional: NameReducerMap<*, *> = {}) {
40
     combineReducers(additional: NameReducerMap<*, *> = {}) {
41
+        // $FlowExpectedError
41
         return combineReducers({
42
         return combineReducers({
42
             ...this._elements,
43
             ...this._elements,
43
             ...additional
44
             ...additional

+ 10
- 4
react/features/base/redux/StateListenerRegistry.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import type { Store } from 'redux';
4
+
3
 const logger = require('jitsi-meet-logger').getLogger(__filename);
5
 const logger = require('jitsi-meet-logger').getLogger(__filename);
4
 
6
 
5
 /**
7
 /**
16
  * invoked only if {@code prevSelection} and {@code selection} are different.
18
  * invoked only if {@code prevSelection} and {@code selection} are different.
17
  * Immutable!
19
  * Immutable!
18
  */
20
  */
19
-type Listener = (selection: any, store: Store, prevSelection: any) => void;
21
+type Listener
22
+    = (selection: any, store: Store<*, *>, prevSelection: any) => void;
20
 
23
 
21
 /**
24
 /**
22
  * The type selector supported for registration with
25
  * The type selector supported for registration with
65
      */
68
      */
66
     _selectorListeners: Set<SelectorListener> = new Set();
69
     _selectorListeners: Set<SelectorListener> = new Set();
67
 
70
 
68
-    _listener: (Store) => void;
71
+    _listener: ({
72
+        prevSelections: Map<SelectorListener, any>,
73
+        store: Store<*, *>
74
+    }) => void;
69
 
75
 
70
     /**
76
     /**
71
      * Invoked by a specific redux store any time an action is dispatched, and
77
      * Invoked by a specific redux store any time an action is dispatched, and
78
      */
84
      */
79
     _listener({ prevSelections, store }: {
85
     _listener({ prevSelections, store }: {
80
             prevSelections: Map<SelectorListener, any>,
86
             prevSelections: Map<SelectorListener, any>,
81
-            store: Store
87
+            store: Store<*, *>
82
     }) {
88
     }) {
83
         for (const selectorListener of this._selectorListeners) {
89
         for (const selectorListener of this._selectorListeners) {
84
             const prevSelection = prevSelections.get(selectorListener);
90
             const prevSelection = prevSelections.get(selectorListener);
129
      * {@code StateListenerRegistry} is to {@code subscribe}.
135
      * {@code StateListenerRegistry} is to {@code subscribe}.
130
      * @returns {void}
136
      * @returns {void}
131
      */
137
      */
132
-    subscribe(store: Store) {
138
+    subscribe(store: Store<*, *>) {
133
         // XXX If StateListenerRegistry is not utilized by the app to listen to
139
         // XXX If StateListenerRegistry is not utilized by the app to listen to
134
         // state changes, do not bother subscribing to the store at all.
140
         // state changes, do not bother subscribing to the store at all.
135
         if (this._selectorListeners.size) {
141
         if (this._selectorListeners.size) {

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

30
  * }}
30
  * }}
31
  */
31
  */
32
 export function setAspectRatio(width: number, height: number): Function {
32
 export function setAspectRatio(width: number, height: number): Function {
33
-    return (dispatch: Dispatch<*>, getState: Function) => {
33
+    return (dispatch: Dispatch<any>, getState: Function) => {
34
         // Don't change the aspect ratio if width and height are the same, that
34
         // Don't change the aspect ratio if width and height are the same, that
35
         // is, if we transition to a 1:1 aspect ratio.
35
         // is, if we transition to a 1:1 aspect ratio.
36
         if (width !== height) {
36
         if (width !== height) {
60
  * }}
60
  * }}
61
  */
61
  */
62
 export function setReducedUI(width: number, height: number): Function {
62
 export function setReducedUI(width: number, height: number): Function {
63
-    return (dispatch: Dispatch<*>, getState: Function) => {
63
+    return (dispatch: Dispatch<any>, getState: Function) => {
64
         const reducedUI = Math.min(width, height) < REDUCED_UI_THRESHOLD;
64
         const reducedUI = Math.min(width, height) < REDUCED_UI_THRESHOLD;
65
 
65
 
66
         if (reducedUI !== getState()['features/base/responsive-ui'].reducedUI) {
66
         if (reducedUI !== getState()['features/base/responsive-ui'].reducedUI) {

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

52
  *     _onDimensionsChanged: Function
52
  *     _onDimensionsChanged: Function
53
  * }}
53
  * }}
54
  */
54
  */
55
-function _mapDispatchToProps(dispatch: Dispatch<*>) {
55
+function _mapDispatchToProps(dispatch: Dispatch<any>) {
56
     return {
56
     return {
57
         /**
57
         /**
58
          * Handles the "on dimensions changed" event and dispatches aspect ratio
58
          * Handles the "on dimensions changed" event and dispatches aspect ratio
69
     };
69
     };
70
 }
70
 }
71
 
71
 
72
+// $FlowExpectedError
72
 export default connect(undefined, _mapDispatchToProps)(AspectRatioDetector);
73
 export default connect(undefined, _mapDispatchToProps)(AspectRatioDetector);

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

53
  *     _onDimensionsChanged: Function
53
  *     _onDimensionsChanged: Function
54
  * }}
54
  * }}
55
  */
55
  */
56
-function _mapDispatchToProps(dispatch: Dispatch<*>) {
56
+function _mapDispatchToProps(dispatch: Dispatch<any>) {
57
     return {
57
     return {
58
         /**
58
         /**
59
          * Handles the "on dimensions changed" event and dispatches the
59
          * Handles the "on dimensions changed" event and dispatches the
70
     };
70
     };
71
 }
71
 }
72
 
72
 
73
+// $FlowExpectedError
73
 export default connect(undefined, _mapDispatchToProps)(ReducedUIDetector);
74
 export default connect(undefined, _mapDispatchToProps)(ReducedUIDetector);

+ 1
- 0
react/features/base/sounds/components/SoundCollection.js 查看文件

153
     };
153
     };
154
 }
154
 }
155
 
155
 
156
+// $FlowExpectedError
156
 export default connect(_mapStateToProps, _mapDispatchToProps)(SoundCollection);
157
 export default connect(_mapStateToProps, _mapDispatchToProps)(SoundCollection);

+ 1
- 1
react/features/base/styles/functions.js 查看文件

46
  * @returns {StyleType} - The merged styles.
46
  * @returns {StyleType} - The merged styles.
47
  */
47
  */
48
 export function combineStyles(a: StyleType, b: StyleType): StyleType {
48
 export function combineStyles(a: StyleType, b: StyleType): StyleType {
49
-    const result = [];
49
+    const result: Array<StyleSheet> = [];
50
 
50
 
51
     if (a) {
51
     if (a) {
52
         if (Array.isArray(a)) {
52
         if (Array.isArray(a)) {

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

89
      * @param {Object} props - The read-only properties with which the new
89
      * @param {Object} props - The read-only properties with which the new
90
      * instance is to be initialized.
90
      * instance is to be initialized.
91
      */
91
      */
92
-    constructor(props: Object) {
92
+    constructor(props: Props) {
93
         super(props);
93
         super(props);
94
 
94
 
95
         this._onStatsUpdated = this._onStatsUpdated.bind(this);
95
         this._onStatsUpdated = this._onStatsUpdated.bind(this);
142
      * @inheritdoc
142
      * @inheritdoc
143
      * returns {void}
143
      * returns {void}
144
      */
144
      */
145
-    componentDidUpdate(prevProps) {
145
+    componentDidUpdate(prevProps: Props) {
146
         if (prevProps._localUserId !== this.props._localUserId) {
146
         if (prevProps._localUserId !== this.props._localUserId) {
147
             statsEmitter.unsubscribeToClientStats(
147
             statsEmitter.unsubscribeToClientStats(
148
                 prevProps._localUserId, this._onStatsUpdated);
148
                 prevProps._localUserId, this._onStatsUpdated);
215
     };
215
     };
216
 }
216
 }
217
 
217
 
218
+// $FlowExpectedError
218
 export default connect(_mapStateToProps)(TestConnectionInfo);
219
 export default connect(_mapStateToProps)(TestConnectionInfo);

+ 1
- 0
react/features/base/testing/components/TestHint.ios.js 查看文件

34
     }
34
     }
35
 }
35
 }
36
 
36
 
37
+// $FlowExpectedError
37
 export default connect(_mapStateToProps)(TestHint);
38
 export default connect(_mapStateToProps)(TestHint);

+ 1
- 0
react/features/base/toolbox/components/AbstractToolboxItem.js 查看文件

201
      */
201
      */
202
     _renderItem() {
202
     _renderItem() {
203
         // To be implemented by a subclass.
203
         // To be implemented by a subclass.
204
+        return null;
204
     }
205
     }
205
 
206
 
206
     /**
207
     /**

+ 3
- 1
react/features/calendar-sync/actions.native.js 查看文件

1
 // @flow
1
 // @flow
2
 import { generateRoomWithoutSeparator } from 'js-utils/random';
2
 import { generateRoomWithoutSeparator } from 'js-utils/random';
3
 
3
 
4
+import type { Dispatch } from 'redux';
5
+
4
 import { getDefaultURL } from '../app';
6
 import { getDefaultURL } from '../app';
5
 import { openDialog } from '../base/dialog';
7
 import { openDialog } from '../base/dialog';
6
 
8
 
35
  * @returns {Function}
37
  * @returns {Function}
36
  */
38
  */
37
 export function updateCalendarEvent(eventId: string) {
39
 export function updateCalendarEvent(eventId: string) {
38
-    return (dispatch: Dispatch<*>, getState: Function) => {
40
+    return (dispatch: Dispatch<any>, getState: Function) => {
39
         const defaultUrl = getDefaultURL(getState);
41
         const defaultUrl = getDefaultURL(getState);
40
         const roomName = generateRoomWithoutSeparator();
42
         const roomName = generateRoomWithoutSeparator();
41
 
43
 

+ 4
- 3
react/features/calendar-sync/actions.web.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { generateRoomWithoutSeparator } from 'js-utils/random';
3
 import { generateRoomWithoutSeparator } from 'js-utils/random';
4
+import type { Dispatch } from 'redux';
4
 
5
 
5
 import { loadGoogleAPI } from '../google-api';
6
 import { loadGoogleAPI } from '../google-api';
6
 
7
 
197
  * @returns {Function}
198
  * @returns {Function}
198
  */
199
  */
199
 export function signIn(calendarType: string): Function {
200
 export function signIn(calendarType: string): Function {
200
-    return (dispatch: Dispatch<*>) => {
201
+    return (dispatch: Dispatch<any>) => {
201
         const integration = _getCalendarIntegration(calendarType);
202
         const integration = _getCalendarIntegration(calendarType);
202
 
203
 
203
         if (!integration) {
204
         if (!integration) {
229
  * @returns {Function}
230
  * @returns {Function}
230
  */
231
  */
231
 export function updateCalendarEvent(id: string, calendarId: string): Function {
232
 export function updateCalendarEvent(id: string, calendarId: string): Function {
232
-    return (dispatch: Dispatch<*>, getState: Function) => {
233
+    return (dispatch: Dispatch<any>, getState: Function) => {
233
 
234
 
234
         const { integrationType } = getState()['features/calendar-sync'];
235
         const { integrationType } = getState()['features/calendar-sync'];
235
         const integration = _getCalendarIntegration(integrationType);
236
         const integration = _getCalendarIntegration(integrationType);
276
  * @returns {Function}
277
  * @returns {Function}
277
  */
278
  */
278
 export function updateProfile(calendarType: string): Function {
279
 export function updateProfile(calendarType: string): Function {
279
-    return (dispatch: Dispatch<*>) => {
280
+    return (dispatch: Dispatch<any>) => {
280
         const integration = _getCalendarIntegration(calendarType);
281
         const integration = _getCalendarIntegration(calendarType);
281
 
282
 
282
         if (!integration) {
283
         if (!integration) {

+ 3
- 2
react/features/calendar-sync/components/AddMeetingUrlButton.web.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import Tooltip from '@atlaskit/tooltip';
3
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
5
-import Tooltip from '@atlaskit/tooltip';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import {
8
 import {
8
     createCalendarClickedEvent,
9
     createCalendarClickedEvent,
25
     /**
26
     /**
26
      * Invoked to add a meeting URL to a calendar event.
27
      * Invoked to add a meeting URL to a calendar event.
27
      */
28
      */
28
-    dispatch: Dispatch<*>,
29
+    dispatch: Dispatch<any>,
29
 
30
 
30
     /**
31
     /**
31
      * The ID of the calendar event that will have a meeting URL added on click.
32
      * The ID of the calendar event that will have a meeting URL added on click.

+ 1
- 1
react/features/calendar-sync/components/CalendarListContent.native.js 查看文件

108
         );
108
         );
109
     }
109
     }
110
 
110
 
111
-    _onPress: (string, string) => Function;
111
+    _onPress: (string, ?string) => Function;
112
 
112
 
113
     /**
113
     /**
114
      * Handles the list's navigate action.
114
      * Handles the list's navigate action.

+ 4
- 2
react/features/calendar-sync/components/CalendarListContent.web.js 查看文件

59
      *
59
      *
60
      * @inheritdoc
60
      * @inheritdoc
61
      */
61
      */
62
-    constructor(props) {
62
+    constructor(props: Props) {
63
         super(props);
63
         super(props);
64
 
64
 
65
         // Bind event handlers so they are only bound once per instance.
65
         // Bind event handlers so they are only bound once per instance.
114
         this._onPress(url, 'calendar.meeting.join');
114
         this._onPress(url, 'calendar.meeting.join');
115
     }
115
     }
116
 
116
 
117
-    _onPress: (string, string) => Function;
117
+    _onPress: (string, ?string) => Function;
118
 
118
 
119
     /**
119
     /**
120
      * Handles the list's navigate action.
120
      * Handles the list's navigate action.
173
 }
173
 }
174
 
174
 
175
 export default isCalendarEnabled()
175
 export default isCalendarEnabled()
176
+
177
+    // $FlowExpectedError
176
     ? connect(_mapStateToProps)(CalendarListContent)
178
     ? connect(_mapStateToProps)(CalendarListContent)
177
     : undefined;
179
     : undefined;

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

2
 
2
 
3
 import { NativeModules, Platform } from 'react-native';
3
 import { NativeModules, Platform } from 'react-native';
4
 import RNCalendarEvents from 'react-native-calendar-events';
4
 import RNCalendarEvents from 'react-native-calendar-events';
5
+import type { Store } from 'redux';
5
 
6
 
6
 import { getShareInfoText } from '../invite';
7
 import { getShareInfoText } from '../invite';
7
 
8
 
22
  * @returns {Promise<*>}
23
  * @returns {Promise<*>}
23
  */
24
  */
24
 export function addLinkToCalendarEntry(
25
 export function addLinkToCalendarEntry(
25
-        state: Object, id: string, link: string) {
26
+        state: Object, id: string, link: string): Promise<any> {
26
     return new Promise((resolve, reject) => {
27
     return new Promise((resolve, reject) => {
27
         getShareInfoText(state, link, true).then(shareInfoText => {
28
         getShareInfoText(state, link, true).then(shareInfoText => {
28
             RNCalendarEvents.findEventById(id).then(event => {
29
             RNCalendarEvents.findEventById(id).then(event => {
76
  * @returns {void}
77
  * @returns {void}
77
  */
78
  */
78
 export function _fetchCalendarEntries(
79
 export function _fetchCalendarEntries(
79
-        store,
80
-        maybePromptForPermission,
81
-        forcePermission) {
80
+        store: Store<*, *>,
81
+        maybePromptForPermission: boolean,
82
+        forcePermission: ?boolean) {
82
     const { dispatch, getState } = store;
83
     const { dispatch, getState } = store;
83
     const promptForPermission
84
     const promptForPermission
84
         = (maybePromptForPermission
85
         = (maybePromptForPermission

+ 3
- 3
react/features/calendar-sync/functions.web.js 查看文件

47
  * @returns {void}
47
  * @returns {void}
48
  */
48
  */
49
 export function _fetchCalendarEntries(
49
 export function _fetchCalendarEntries(
50
-        store,
51
-        maybePromptForPermission,
52
-        forcePermission) {
50
+        store: Object,
51
+        maybePromptForPermission: boolean,
52
+        forcePermission: ?boolean) {
53
     /* eslint-enable no-unused-vars */
53
     /* eslint-enable no-unused-vars */
54
     const { dispatch, getState } = store;
54
     const { dispatch, getState } = store;
55
 
55
 

+ 8
- 6
react/features/calendar-sync/web/googleCalendar.js 查看文件

1
-/* @flow */
1
+// @flow
2
+
3
+import type { Dispatch } from 'redux';
2
 
4
 
3
 import {
5
 import {
4
     getCalendarEntries,
6
     getCalendarEntries,
29
     /**
31
     /**
30
      * Returns the email address for the currently logged in user.
32
      * Returns the email address for the currently logged in user.
31
      *
33
      *
32
-     * @returns {function(Dispatch<*>): Promise<string|never>}
34
+     * @returns {function(Dispatch<any>): Promise<string|never>}
33
      */
35
      */
34
     getCurrentEmail() {
36
     getCurrentEmail() {
35
         return updateProfile();
37
         return updateProfile();
38
     /**
40
     /**
39
      * Initializes the google api if needed.
41
      * Initializes the google api if needed.
40
      *
42
      *
41
-     * @returns {function(Dispatch<*>, Function): Promise<void>}
43
+     * @returns {function(Dispatch<any>, Function): Promise<void>}
42
      */
44
      */
43
     load() {
45
     load() {
44
-        return (dispatch: Dispatch<*>, getState: Function) => {
46
+        return (dispatch: Dispatch<any>, getState: Function) => {
45
             const { googleApiApplicationClientID }
47
             const { googleApiApplicationClientID }
46
                 = getState()['features/base/config'];
48
                 = getState()['features/base/config'];
47
 
49
 
52
     /**
54
     /**
53
      * Prompts the participant to sign in to the Google API Client Library.
55
      * Prompts the participant to sign in to the Google API Client Library.
54
      *
56
      *
55
-     * @returns {function(Dispatch<*>): Promise<string|never>}
57
+     * @returns {function(Dispatch<any>): Promise<string|never>}
56
      */
58
      */
57
     signIn,
59
     signIn,
58
 
60
 
72
      * @param {string} id - The event id.
74
      * @param {string} id - The event id.
73
      * @param {string} calendarId - The id of the calendar to use.
75
      * @param {string} calendarId - The id of the calendar to use.
74
      * @param {string} location - The location to save to the event.
76
      * @param {string} location - The location to save to the event.
75
-     * @returns {function(Dispatch<*>): Promise<string|never>}
77
+     * @returns {function(Dispatch<any>): Promise<string|never>}
76
      */
78
      */
77
     updateCalendarEvent
79
     updateCalendarEvent
78
 };
80
 };

+ 64
- 63
react/features/calendar-sync/web/microsoftCalendar.js 查看文件

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import { Client } from '@microsoft/microsoft-graph-client';
3
 import { Client } from '@microsoft/microsoft-graph-client';
4
 import rs from 'jsrsasign';
4
 import rs from 'jsrsasign';
5
+import type { Dispatch } from 'redux';
5
 
6
 
6
 import { createDeferred } from '../../../../modules/util/helpers';
7
 import { createDeferred } from '../../../../modules/util/helpers';
7
 
8
 
77
      * @param {number} fetchStartDays - The number of days to go back
78
      * @param {number} fetchStartDays - The number of days to go back
78
      * when fetching.
79
      * when fetching.
79
      * @param {number} fetchEndDays - The number of days to fetch.
80
      * @param {number} fetchEndDays - The number of days to fetch.
80
-     * @returns {function(Dispatch<*>, Function): Promise<CalendarEntries>}
81
+     * @returns {function(Dispatch<any>, Function): Promise<CalendarEntries>}
81
      */
82
      */
82
     getCalendarEntries(fetchStartDays: ?number, fetchEndDays: ?number) {
83
     getCalendarEntries(fetchStartDays: ?number, fetchEndDays: ?number) {
83
-        return (dispatch: Dispatch<*>, getState: Function): Promise<*> => {
84
+        return (dispatch: Dispatch<any>, getState: Function): Promise<*> => {
84
             const state = getState()['features/calendar-sync'] || {};
85
             const state = getState()['features/calendar-sync'] || {};
85
             const token = state.msAuthState && state.msAuthState.accessToken;
86
             const token = state.msAuthState && state.msAuthState.accessToken;
86
 
87
 
118
      * @returns {function(Dispatch<*, Function>): Promise<string>}
119
      * @returns {function(Dispatch<*, Function>): Promise<string>}
119
      */
120
      */
120
     getCurrentEmail(): Function {
121
     getCurrentEmail(): Function {
121
-        return (dispatch: Dispatch<*>, getState: Function) => {
122
+        return (dispatch: Dispatch<any>, getState: Function) => {
122
             const { msAuthState = {} }
123
             const { msAuthState = {} }
123
                 = getState()['features/calendar-sync'] || {};
124
                 = getState()['features/calendar-sync'] || {};
124
             const email = msAuthState.userSigninName || '';
125
             const email = msAuthState.userSigninName || '';
139
     /**
140
     /**
140
      * Prompts the participant to sign in to the Microsoft API Client Library.
141
      * Prompts the participant to sign in to the Microsoft API Client Library.
141
      *
142
      *
142
-     * @returns {function(Dispatch<*>, Function): Promise<void>}
143
+     * @returns {function(Dispatch<any>, Function): Promise<void>}
143
      */
144
      */
144
     signIn(): Function {
145
     signIn(): Function {
145
-        return (dispatch: Dispatch<*>, getState: Function) => {
146
+        return (dispatch: Dispatch<any>, getState: Function) => {
146
             // Ensure only one popup window at a time.
147
             // Ensure only one popup window at a time.
147
             if (popupAuthWindow) {
148
             if (popupAuthWindow) {
148
                 popupAuthWindow.focus();
149
                 popupAuthWindow.focus();
238
     /**
239
     /**
239
      * Returns whether or not the user is currently signed in.
240
      * Returns whether or not the user is currently signed in.
240
      *
241
      *
241
-     * @returns {function(Dispatch<*>, Function): Promise<boolean>}
242
+     * @returns {function(Dispatch<any>, Function): Promise<boolean>}
242
      */
243
      */
243
     _isSignedIn(): Function {
244
     _isSignedIn(): Function {
244
-        return (dispatch: Dispatch<*>, getState: Function) => {
245
+        return (dispatch: Dispatch<any>, getState: Function) => {
245
             const now = new Date().getTime();
246
             const now = new Date().getTime();
246
             const state
247
             const state
247
                 = getState()['features/calendar-sync'].msAuthState || {};
248
                 = getState()['features/calendar-sync'].msAuthState || {};
250
 
251
 
251
             if (state.accessToken && isExpired) {
252
             if (state.accessToken && isExpired) {
252
                 // token expired, let's refresh it
253
                 // token expired, let's refresh it
253
-                return dispatch(this._refreshAuthToken())
254
+                return dispatch(refreshAuthToken())
254
                     .then(() => true)
255
                     .then(() => true)
255
                     .catch(() => false);
256
                     .catch(() => false);
256
             }
257
             }
259
         };
260
         };
260
     },
261
     },
261
 
262
 
262
-    /**
263
-     * Renews an existing auth token so it can continue to be used.
264
-     *
265
-     * @private
266
-     * @returns {function(Dispatch<*>, Function): Promise<void>}
267
-     */
268
-    _refreshAuthToken(): Function {
269
-        return (dispatch: Dispatch<*>, getState: Function) => {
270
-            const { microsoftApiApplicationClientID }
271
-                = getState()['features/base/config'];
272
-            const { msAuthState = {} }
273
-                = getState()['features/calendar-sync'] || {};
274
-
275
-            const refreshAuthUrl = getAuthRefreshUrl(
276
-                microsoftApiApplicationClientID,
277
-                msAuthState.userDomainType,
278
-                msAuthState.userSigninName);
279
-
280
-            const iframe = document.createElement('iframe');
281
-
282
-            iframe.setAttribute('id', 'auth-iframe');
283
-            iframe.setAttribute('name', 'auth-iframe');
284
-            iframe.setAttribute('style', 'display: none');
285
-            iframe.setAttribute('src', refreshAuthUrl);
286
-
287
-            const signInPromise = new Promise(resolve => {
288
-                iframe.onload = () => {
289
-                    resolve(iframe.contentWindow.location.hash);
290
-                };
291
-            });
292
-
293
-            // The check for body existence is done for flow, which also runs
294
-            // against native where document.body may not be defined.
295
-            if (!document.body) {
296
-                return Promise.reject(
297
-                    'Cannot refresh auth token in this environment');
298
-            }
299
-
300
-            document.body.appendChild(iframe);
301
-
302
-            return signInPromise.then(hash => {
303
-                const params = getParamsFromHash(hash);
304
-
305
-                dispatch(setCalendarAPIAuthState({
306
-                    accessToken: params.access_token,
307
-                    idToken: params.id_token,
308
-                    tokenExpires: params.tokenExpires
309
-                }));
310
-            });
311
-        };
312
-    },
313
-
314
     /**
263
     /**
315
      * Updates calendar event by generating new invite URL and editing the event
264
      * Updates calendar event by generating new invite URL and editing the event
316
      * adding some descriptive text and location.
265
      * adding some descriptive text and location.
318
      * @param {string} id - The event id.
267
      * @param {string} id - The event id.
319
      * @param {string} calendarId - The id of the calendar to use.
268
      * @param {string} calendarId - The id of the calendar to use.
320
      * @param {string} location - The location to save to the event.
269
      * @param {string} location - The location to save to the event.
321
-     * @returns {function(Dispatch<*>): Promise<string|never>}
270
+     * @returns {function(Dispatch<any>): Promise<string|never>}
322
      */
271
      */
323
     updateCalendarEvent(id: string, calendarId: string, location: string) {
272
     updateCalendarEvent(id: string, calendarId: string, location: string) {
324
-        return (dispatch: Dispatch<*>, getState: Function): Promise<*> => {
273
+        return (dispatch: Dispatch<any>, getState: Function): Promise<*> => {
325
             const state = getState()['features/calendar-sync'] || {};
274
             const state = getState()['features/calendar-sync'] || {};
326
             const token = state.msAuthState && state.msAuthState.accessToken;
275
             const token = state.msAuthState && state.msAuthState.accessToken;
327
 
276
 
533
     };
482
     };
534
 }
483
 }
535
 
484
 
485
+/**
486
+ * Renews an existing auth token so it can continue to be used.
487
+ *
488
+ * @private
489
+ * @returns {function(Dispatch<any>, Function): Promise<void>}
490
+ */
491
+function refreshAuthToken(): Function {
492
+    return (dispatch: Dispatch<any>, getState: Function) => {
493
+        const { microsoftApiApplicationClientID }
494
+            = getState()['features/base/config'];
495
+        const { msAuthState = {} }
496
+            = getState()['features/calendar-sync'] || {};
497
+
498
+        const refreshAuthUrl = getAuthRefreshUrl(
499
+            microsoftApiApplicationClientID,
500
+            msAuthState.userDomainType,
501
+            msAuthState.userSigninName);
502
+
503
+        const iframe = document.createElement('iframe');
504
+
505
+        iframe.setAttribute('id', 'auth-iframe');
506
+        iframe.setAttribute('name', 'auth-iframe');
507
+        iframe.setAttribute('style', 'display: none');
508
+        iframe.setAttribute('src', refreshAuthUrl);
509
+
510
+        const signInPromise = new Promise(resolve => {
511
+            iframe.onload = () => {
512
+                resolve(iframe.contentWindow.location.hash);
513
+            };
514
+        });
515
+
516
+        // The check for body existence is done for flow, which also runs
517
+        // against native where document.body may not be defined.
518
+        if (!document.body) {
519
+            return Promise.reject(
520
+                'Cannot refresh auth token in this environment');
521
+        }
522
+
523
+        document.body.appendChild(iframe);
524
+
525
+        return signInPromise.then(hash => {
526
+            const params = getParamsFromHash(hash);
527
+
528
+            dispatch(setCalendarAPIAuthState({
529
+                accessToken: params.access_token,
530
+                idToken: params.id_token,
531
+                tokenExpires: params.tokenExpires
532
+            }));
533
+        });
534
+    };
535
+}
536
+
536
 /**
537
 /**
537
  * Retrieves calendar entries from a specific calendar.
538
  * Retrieves calendar entries from a specific calendar.
538
  *
539
  *

+ 3
- 2
react/features/chat/components/AbstractChat.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { Component } from 'react';
3
 import { Component } from 'react';
4
+import type { Dispatch } from 'redux';
4
 
5
 
5
 import { getLocalParticipant } from '../../base/participants';
6
 import { getLocalParticipant } from '../../base/participants';
6
 
7
 
41
     /**
42
     /**
42
      * The Redux dispatch function.
43
      * The Redux dispatch function.
43
      */
44
      */
44
-    dispatch: Dispatch<*>,
45
+    dispatch: Dispatch<any>,
45
 
46
 
46
     /**
47
     /**
47
      * Function to be used to translate i18n labels.
48
      * Function to be used to translate i18n labels.
64
  * }}
65
  * }}
65
  * @private
66
  * @private
66
  */
67
  */
67
-export function _mapDispatchToProps(dispatch: Dispatch<*>) {
68
+export function _mapDispatchToProps(dispatch: Dispatch<any>) {
68
     return {
69
     return {
69
         /**
70
         /**
70
          * Toggles the chat window.
71
          * Toggles the chat window.

+ 1
- 0
react/features/chat/components/native/ChatButton.js 查看文件

126
     };
126
     };
127
 }
127
 }
128
 
128
 
129
+// $FlowExpectedError
129
 export default connect(_mapStateToProps, _mapDispatchToProps)(ChatButton);
130
 export default connect(_mapStateToProps, _mapDispatchToProps)(ChatButton);

+ 1
- 0
react/features/chat/components/web/ChatCounter.js 查看文件

57
     };
57
     };
58
 }
58
 }
59
 
59
 
60
+// $FlowExpectedError
60
 export default connect(_mapStateToProps)(ChatCounter);
61
 export default connect(_mapStateToProps)(ChatCounter);

+ 3
- 1
react/features/chat/components/web/ChatInput.js 查看文件

3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
 import Emoji from 'react-emoji-render';
5
 import Emoji from 'react-emoji-render';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import { sendMessage } from '../../actions';
8
 import { sendMessage } from '../../actions';
8
 
9
 
16
     /**
17
     /**
17
      * Invoked to send chat messages.
18
      * Invoked to send chat messages.
18
      */
19
      */
19
-    dispatch: Dispatch<*>,
20
+    dispatch: Dispatch<any>,
20
 
21
 
21
     /**
22
     /**
22
      * Optional callback to get a reference to the chat input element.
23
      * Optional callback to get a reference to the chat input element.
231
     }
232
     }
232
 }
233
 }
233
 
234
 
235
+// $FlowExpectedError
234
 export default connect()(ChatInput);
236
 export default connect()(ChatInput);

+ 2
- 1
react/features/chat/components/web/DisplayNameForm.js 查看文件

3
 import { FieldTextStateless } from '@atlaskit/field-text';
3
 import { FieldTextStateless } from '@atlaskit/field-text';
4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import { translate } from '../../../base/i18n';
8
 import { translate } from '../../../base/i18n';
8
 import { updateSettings } from '../../../base/settings';
9
 import { updateSettings } from '../../../base/settings';
15
     /**
16
     /**
16
      * Invoked to set the local participant display name.
17
      * Invoked to set the local participant display name.
17
      */
18
      */
18
-    dispatch: Dispatch<*>,
19
+    dispatch: Dispatch<any>,
19
 
20
 
20
     /**
21
     /**
21
      * Invoked to obtain translated strings.
22
      * Invoked to obtain translated strings.

+ 1
- 0
react/features/conference/components/native/DisplayNameLabel.js 查看文件

76
     };
76
     };
77
 }
77
 }
78
 
78
 
79
+// $FlowExpectedError
79
 export default connect(_mapStateToProps)(DisplayNameLabel);
80
 export default connect(_mapStateToProps)(DisplayNameLabel);

+ 1
- 0
react/features/conference/components/native/Labels.js 查看文件

367
     };
367
     };
368
 }
368
 }
369
 
369
 
370
+// $FlowExpectedError
370
 export default connect(_mapStateToProps)(makeAspectRatioAware(Labels));
371
 export default connect(_mapStateToProps)(makeAspectRatioAware(Labels));

+ 1
- 0
react/features/conference/components/native/NavigationBar.js 查看文件

93
     };
93
     };
94
 }
94
 }
95
 
95
 
96
+// $FlowExpectedError
96
 export default connect(_mapStateToProps)(NavigationBar);
97
 export default connect(_mapStateToProps)(NavigationBar);

+ 1
- 0
react/features/conference/components/web/Conference.js 查看文件

308
     };
308
     };
309
 }
309
 }
310
 
310
 
311
+// $FlowExpectedError
311
 export default reactReduxConnect(_mapStateToProps)(translate(Conference));
312
 export default reactReduxConnect(_mapStateToProps)(translate(Conference));

+ 2
- 1
react/features/conference/components/web/Labels.js 查看文件

38
      *
38
      *
39
      * @inheritdoc
39
      * @inheritdoc
40
      */
40
      */
41
-    static getDerivedStateFromProps(props, prevState) {
41
+    static getDerivedStateFromProps(props: Props, prevState: State) {
42
         return {
42
         return {
43
             filmstripBecomingVisible: !prevState.filmstripBecomingVisible
43
             filmstripBecomingVisible: !prevState.filmstripBecomingVisible
44
                 && props._filmstripVisible
44
                 && props._filmstripVisible
105
     _renderVideoQualityLabel: () => React$Element<*>;
105
     _renderVideoQualityLabel: () => React$Element<*>;
106
 }
106
 }
107
 
107
 
108
+// $FlowExpectedError
108
 export default connect(_mapStateToProps)(Labels);
109
 export default connect(_mapStateToProps)(Labels);

+ 2
- 0
react/features/conference/components/web/Subject.js 查看文件

64
         _visible: isToolboxVisible(state)
64
         _visible: isToolboxVisible(state)
65
     };
65
     };
66
 }
66
 }
67
+
68
+// $FlowExpectedError
67
 export default connect(_mapStateToProps)(Subject);
69
 export default connect(_mapStateToProps)(Subject);

+ 4
- 2
react/features/deep-linking/actions.js 查看文件

1
-/* @flow */
1
+// @flow
2
+
3
+import type { Dispatch } from 'redux';
2
 
4
 
3
 import { appNavigate } from '../app';
5
 import { appNavigate } from '../app';
4
 
6
 
10
  * @returns {Function}
12
  * @returns {Function}
11
  */
13
  */
12
 export function openWebApp() {
14
 export function openWebApp() {
13
-    return (dispatch: Dispatch<*>) => {
15
+    return (dispatch: Dispatch<any>) => {
14
         // In order to go to the web app we need to skip the deep linking
16
         // In order to go to the web app we need to skip the deep linking
15
         // interceptor. OPEN_WEB_APP action should set launchInWeb to true in
17
         // interceptor. OPEN_WEB_APP action should set launchInWeb to true in
16
         // the redux store. After this when appNavigate() is called the
18
         // the redux store. After this when appNavigate() is called the

+ 3
- 2
react/features/deep-linking/components/DeepLinkingDesktopPage.web.js 查看文件

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import Button, { ButtonGroup } from '@atlaskit/button';
3
 import Button, { ButtonGroup } from '@atlaskit/button';
4
 import { AtlasKitThemeProvider } from '@atlaskit/theme';
4
 import { AtlasKitThemeProvider } from '@atlaskit/theme';
5
 import React, { Component } from 'react';
5
 import React, { Component } from 'react';
6
 import { connect } from 'react-redux';
6
 import { connect } from 'react-redux';
7
+import type { Dispatch } from 'redux';
7
 
8
 
8
 import { createDeepLinkingPageEvent, sendAnalytics } from '../../analytics';
9
 import { createDeepLinkingPageEvent, sendAnalytics } from '../../analytics';
9
 import { translate } from '../../base/i18n';
10
 import { translate } from '../../base/i18n';
25
     /**
26
     /**
26
      * Used to dispatch actions from the buttons.
27
      * Used to dispatch actions from the buttons.
27
      */
28
      */
28
-    dispatch: Dispatch<*>,
29
+    dispatch: Dispatch<any>,
29
 
30
 
30
     /**
31
     /**
31
      * Used to obtain translations.
32
      * Used to obtain translations.

+ 2
- 1
react/features/desktop-picker/components/DesktopPicker.js 查看文件

3
 import Tabs from '@atlaskit/tabs';
3
 import Tabs from '@atlaskit/tabs';
4
 import React, { PureComponent } from 'react';
4
 import React, { PureComponent } from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import { Dialog, hideDialog } from '../../base/dialog';
8
 import { Dialog, hideDialog } from '../../base/dialog';
8
 import { translate } from '../../base/i18n';
9
 import { translate } from '../../base/i18n';
54
     /**
55
     /**
55
      * Used to request DesktopCapturerSources.
56
      * Used to request DesktopCapturerSources.
56
      */
57
      */
57
-    dispatch: Dispatch<*>,
58
+    dispatch: Dispatch<any>,
58
 
59
 
59
     /**
60
     /**
60
      * The callback to be invoked when the component is closed or when a
61
      * The callback to be invoked when the component is closed or when a

+ 2
- 1
react/features/display-name/components/AbstractDisplayNamePrompt.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { Component } from 'react';
3
 import { Component } from 'react';
4
+import type { Dispatch } from 'redux';
4
 
5
 
5
 import { updateSettings } from '../../base/settings';
6
 import { updateSettings } from '../../base/settings';
6
 
7
 
13
     /**
14
     /**
14
      * Invoked to update the local participant's display name.
15
      * Invoked to update the local participant's display name.
15
      */
16
      */
16
-    dispatch: Dispatch<*>,
17
+    dispatch: Dispatch<any>,
17
 
18
 
18
     /**
19
     /**
19
      * Function to be invoked after a successful display name change.
20
      * Function to be invoked after a successful display name change.

+ 2
- 1
react/features/display-name/components/DisplayName.web.js 查看文件

2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
+import type { Dispatch } from 'redux';
5
 
6
 
6
 import { appendSuffix } from '../functions';
7
 import { appendSuffix } from '../functions';
7
 
8
 
29
     /**
30
     /**
30
      * Invoked to update the participant's display name.
31
      * Invoked to update the participant's display name.
31
      */
32
      */
32
-    dispatch: Dispatch<*>,
33
+    dispatch: Dispatch<any>,
33
 
34
 
34
     /**
35
     /**
35
      * A string to append to the displayName, if provided.
36
      * A string to append to the displayName, if provided.

+ 1
- 0
react/features/display-name/components/DisplayNamePrompt.native.js 查看文件

27
     _onSetDisplayName: string => boolean;
27
     _onSetDisplayName: string => boolean;
28
 }
28
 }
29
 
29
 
30
+// $FlowExpectedError
30
 export default connect()(DisplayNamePrompt);
31
 export default connect()(DisplayNamePrompt);

+ 3
- 1
react/features/feedback/actions.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import type { Dispatch } from 'redux';
4
+
3
 import { openDialog } from '../base/dialog';
5
 import { openDialog } from '../base/dialog';
4
 import { FEEDBACK_REQUEST_IN_PROGRESS } from '../../../modules/UI/UIErrors';
6
 import { FEEDBACK_REQUEST_IN_PROGRESS } from '../../../modules/UI/UIErrors';
5
 
7
 
46
         showThankYou: boolean
48
         showThankYou: boolean
47
     };
49
     };
48
 
50
 
49
-    return (dispatch: Dispatch<*>, getState: Function): Promise<R> => {
51
+    return (dispatch: Dispatch<any>, getState: Function): Promise<R> => {
50
         const state = getState();
52
         const state = getState();
51
 
53
 
52
         if (interfaceConfig.filmStripOnly || config.iAmRecorder) {
54
         if (interfaceConfig.filmStripOnly || config.iAmRecorder) {

+ 3
- 2
react/features/feedback/components/FeedbackDialog.web.js 查看文件

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import { FieldTextAreaStateless } from '@atlaskit/field-text-area';
3
 import { FieldTextAreaStateless } from '@atlaskit/field-text-area';
4
 import StarIcon from '@atlaskit/icon/glyph/star';
4
 import StarIcon from '@atlaskit/icon/glyph/star';
5
 import StarFilledIcon from '@atlaskit/icon/glyph/star-filled';
5
 import StarFilledIcon from '@atlaskit/icon/glyph/star-filled';
6
 import React, { Component } from 'react';
6
 import React, { Component } from 'react';
7
 import { connect } from 'react-redux';
7
 import { connect } from 'react-redux';
8
+import type { Dispatch } from 'redux';
8
 
9
 
9
 import {
10
 import {
10
     createFeedbackOpenEvent,
11
     createFeedbackOpenEvent,
62
     /**
63
     /**
63
      * Invoked to signal feedback submission or canceling.
64
      * Invoked to signal feedback submission or canceling.
64
      */
65
      */
65
-    dispatch: Dispatch<*>,
66
+    dispatch: Dispatch<any>,
66
 
67
 
67
     /**
68
     /**
68
      * Callback invoked when {@code FeedbackDialog} is unmounted.
69
      * Callback invoked when {@code FeedbackDialog} is unmounted.

+ 1
- 0
react/features/filmstrip/components/native/Filmstrip.js 查看文件

219
     };
219
     };
220
 }
220
 }
221
 
221
 
222
+// $FlowExpectedError
222
 export default connect(_mapStateToProps)(makeAspectRatioAware(Filmstrip));
223
 export default connect(_mapStateToProps)(makeAspectRatioAware(Filmstrip));

+ 1
- 0
react/features/filmstrip/components/native/LocalThumbnail.js 查看文件

60
     };
60
     };
61
 }
61
 }
62
 
62
 
63
+// $FlowExpectedError
63
 export default connect(_mapStateToProps)(LocalThumbnail);
64
 export default connect(_mapStateToProps)(LocalThumbnail);

+ 3
- 1
react/features/filmstrip/components/native/Thumbnail.js 查看文件

2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
+import type { Dispatch } from 'redux';
5
 
6
 
6
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
7
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
7
 import { openDialog } from '../../../base/dialog';
8
 import { openDialog } from '../../../base/dialog';
81
     /**
82
     /**
82
      * Invoked to trigger state changes in Redux.
83
      * Invoked to trigger state changes in Redux.
83
      */
84
      */
84
-    dispatch: Dispatch<*>,
85
+    dispatch: Dispatch<any>,
85
 
86
 
86
     /**
87
     /**
87
      * The Redux representation of the participant to display.
88
      * The Redux representation of the participant to display.
254
     };
255
     };
255
 }
256
 }
256
 
257
 
258
+// $FlowExpectedError
257
 export default connect(_mapStateToProps, _mapDispatchToProps)(Thumbnail);
259
 export default connect(_mapStateToProps, _mapDispatchToProps)(Thumbnail);

+ 3
- 1
react/features/filmstrip/components/native/TileView.js 查看文件

7
     View
7
     View
8
 } from 'react-native';
8
 } from 'react-native';
9
 import { connect } from 'react-redux';
9
 import { connect } from 'react-redux';
10
+import type { Dispatch } from 'redux';
10
 
11
 
11
 import {
12
 import {
12
     getNearestReceiverVideoQualityLevel,
13
     getNearestReceiverVideoQualityLevel,
34
     /**
35
     /**
35
      * Invoked to update the receiver video quality.
36
      * Invoked to update the receiver video quality.
36
      */
37
      */
37
-    dispatch: Dispatch<*>,
38
+    dispatch: Dispatch<any>,
38
 
39
 
39
     /**
40
     /**
40
      * Callback to invoke when tile view is tapped.
41
      * Callback to invoke when tile view is tapped.
334
     };
335
     };
335
 }
336
 }
336
 
337
 
338
+// $FlowExpectedError
337
 export default connect(_mapStateToProps)(makeAspectRatioAware(TileView));
339
 export default connect(_mapStateToProps)(makeAspectRatioAware(TileView));

+ 3
- 1
react/features/filmstrip/components/web/Filmstrip.js 查看文件

3
 import _ from 'lodash';
3
 import _ from 'lodash';
4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import {
8
 import {
8
     createShortcutEvent,
9
     createShortcutEvent,
53
     /**
54
     /**
54
      * The redux {@code dispatch} function.
55
      * The redux {@code dispatch} function.
55
      */
56
      */
56
-    dispatch: Dispatch<*>
57
+    dispatch: Dispatch<any>
57
 };
58
 };
58
 
59
 
59
 /**
60
 /**
318
     };
319
     };
319
 }
320
 }
320
 
321
 
322
+// $FlowExpectedError
321
 export default connect(_mapStateToProps)(Filmstrip);
323
 export default connect(_mapStateToProps)(Filmstrip);

+ 1
- 0
react/features/filmstrip/components/web/Toolbar.js 查看文件

90
     };
90
     };
91
 }
91
 }
92
 
92
 
93
+// $FlowExpectedError
93
 export default connect(_mapStateToProps)(Toolbar);
94
 export default connect(_mapStateToProps)(Toolbar);

+ 14
- 11
react/features/google-api/actions.js 查看文件

1
-/* @flow */
1
+// @flow
2
+
3
+import type { Dispatch } from 'redux';
4
+
2
 import { getShareInfoText } from '../invite';
5
 import { getShareInfoText } from '../invite';
3
 
6
 
4
 import {
7
 import {
13
  *
16
  *
14
  * @param {number} fetchStartDays - The number of days to go back when fetching.
17
  * @param {number} fetchStartDays - The number of days to go back when fetching.
15
  * @param {number} fetchEndDays - The number of days to fetch.
18
  * @param {number} fetchEndDays - The number of days to fetch.
16
- * @returns {function(Dispatch<*>): Promise<CalendarEntries>}
19
+ * @returns {function(Dispatch<any>): Promise<CalendarEntries>}
17
  */
20
  */
18
 export function getCalendarEntries(
21
 export function getCalendarEntries(
19
         fetchStartDays: ?number, fetchEndDays: ?number) {
22
         fetchStartDays: ?number, fetchEndDays: ?number) {
30
  * @returns {Function}
33
  * @returns {Function}
31
  */
34
  */
32
 export function loadGoogleAPI(clientId: string) {
35
 export function loadGoogleAPI(clientId: string) {
33
-    return (dispatch: Dispatch<*>, getState: Function) =>
36
+    return (dispatch: Dispatch<any>, getState: Function) =>
34
         googleApi.get()
37
         googleApi.get()
35
         .then(() => {
38
         .then(() => {
36
             if (getState()['features/google-api'].googleAPIState
39
             if (getState()['features/google-api'].googleAPIState
146
 /**
149
 /**
147
  * Prompts the participant to sign in to the Google API Client Library.
150
  * Prompts the participant to sign in to the Google API Client Library.
148
  *
151
  *
149
- * @returns {function(Dispatch<*>): Promise<string | never>}
152
+ * @returns {function(Dispatch<any>): Promise<string | never>}
150
  */
153
  */
151
 export function signIn() {
154
 export function signIn() {
152
-    return (dispatch: Dispatch<*>) => googleApi.get()
155
+    return (dispatch: Dispatch<any>) => googleApi.get()
153
             .then(() => googleApi.signInIfNotSignedIn())
156
             .then(() => googleApi.signInIfNotSignedIn())
154
             .then(() => dispatch({
157
             .then(() => dispatch({
155
                 type: SET_GOOGLE_API_STATE,
158
                 type: SET_GOOGLE_API_STATE,
160
 /**
163
 /**
161
  * Logs out the user.
164
  * Logs out the user.
162
  *
165
  *
163
- * @returns {function(Dispatch<*>): Promise<string | never>}
166
+ * @returns {function(Dispatch<any>): Promise<string | never>}
164
  */
167
  */
165
 export function signOut() {
168
 export function signOut() {
166
-    return (dispatch: Dispatch<*>) =>
169
+    return (dispatch: Dispatch<any>) =>
167
         googleApi.get()
170
         googleApi.get()
168
             .then(() => googleApi.signOut())
171
             .then(() => googleApi.signOut())
169
             .then(() => {
172
             .then(() => {
181
 /**
184
 /**
182
  * Updates the profile data that is currently used.
185
  * Updates the profile data that is currently used.
183
  *
186
  *
184
- * @returns {function(Dispatch<*>): Promise<string | never>}
187
+ * @returns {function(Dispatch<any>): Promise<string | never>}
185
  */
188
  */
186
 export function updateProfile() {
189
 export function updateProfile() {
187
-    return (dispatch: Dispatch<*>) => googleApi.get()
190
+    return (dispatch: Dispatch<any>) => googleApi.get()
188
         .then(() => googleApi.signInIfNotSignedIn())
191
         .then(() => googleApi.signInIfNotSignedIn())
189
         .then(() => dispatch({
192
         .then(() => dispatch({
190
             type: SET_GOOGLE_API_STATE,
193
             type: SET_GOOGLE_API_STATE,
207
  * @param {string} id - The event id to update.
210
  * @param {string} id - The event id to update.
208
  * @param {string} calendarId - The calendar id to use.
211
  * @param {string} calendarId - The calendar id to use.
209
  * @param {string} location - The location to add to the event.
212
  * @param {string} location - The location to add to the event.
210
- * @returns {function(Dispatch<*>): Promise<string | never>}
213
+ * @returns {function(Dispatch<any>): Promise<string | never>}
211
  */
214
  */
212
 export function updateCalendarEvent(
215
 export function updateCalendarEvent(
213
         id: string, calendarId: string, location: string) {
216
         id: string, calendarId: string, location: string) {
214
-    return (dispatch: Dispatch<*>, getState: Function) =>
217
+    return (dispatch: Dispatch<any>, getState: Function) =>
215
         getShareInfoText(getState(), location)
218
         getShareInfoText(getState(), location)
216
             .then(text =>
219
             .then(text =>
217
                 googleApi._updateCalendarEntry(id, calendarId, location, text));
220
                 googleApi._updateCalendarEntry(id, calendarId, location, text));

+ 4
- 2
react/features/invite/actions.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import type { Dispatch } from 'redux';
4
+
3
 import { getInviteURL } from '../base/connection';
5
 import { getInviteURL } from '../base/connection';
4
 import { inviteVideoRooms } from '../videosipgw';
6
 import { inviteVideoRooms } from '../videosipgw';
5
 import { getParticipants } from '../base/participants';
7
 import { getParticipants } from '../base/participants';
51
         invitees: Array<Object>,
53
         invitees: Array<Object>,
52
         showCalleeInfo: boolean = false) {
54
         showCalleeInfo: boolean = false) {
53
     return (
55
     return (
54
-            dispatch: Dispatch<*>,
56
+            dispatch: Dispatch<any>,
55
             getState: Function): Promise<Array<Object>> => {
57
             getState: Function): Promise<Array<Object>> => {
56
         const state = getState();
58
         const state = getState();
57
         const participants = getParticipants(state);
59
         const participants = getParticipants(state);
161
  * @returns {Function}
163
  * @returns {Function}
162
  */
164
  */
163
 export function updateDialInNumbers() {
165
 export function updateDialInNumbers() {
164
-    return (dispatch: Dispatch<*>, getState: Function) => {
166
+    return (dispatch: Dispatch<any>, getState: Function) => {
165
         const state = getState();
167
         const state = getState();
166
         const { dialInConfCodeUrl, dialInNumbersUrl, hosts }
168
         const { dialInConfCodeUrl, dialInNumbersUrl, hosts }
167
             = state['features/base/config'];
169
             = state['features/base/config'];

+ 2
- 1
react/features/invite/components/InfoDialogButton.web.js 查看文件

3
 import InlineDialog from '@atlaskit/inline-dialog';
3
 import InlineDialog from '@atlaskit/inline-dialog';
4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import { createToolbarEvent, sendAnalytics } from '../../analytics';
8
 import { createToolbarEvent, sendAnalytics } from '../../analytics';
8
 import { openDialog } from '../../base/dialog';
9
 import { openDialog } from '../../base/dialog';
58
     /**
59
     /**
59
      * Invoked to toggle display of the info dialog.
60
      * Invoked to toggle display of the info dialog.
60
      */
61
      */
61
-    dispatch: Dispatch<*>,
62
+    dispatch: Dispatch<any>,
62
 
63
 
63
     /**
64
     /**
64
      * Whether to show the label or not.
65
      * Whether to show the label or not.

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

71
  * }}
71
  * }}
72
  * @private
72
  * @private
73
  */
73
  */
74
-function _mapDispatchToProps(dispatch: Dispatch<*>) {
74
+function _mapDispatchToProps(dispatch: Dispatch<any>) {
75
     return {
75
     return {
76
 
76
 
77
         /**
77
         /**

+ 1
- 1
react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js 查看文件

158
             || this.state.addToCallInProgress;
158
             || this.state.addToCallInProgress;
159
     }
159
     }
160
 
160
 
161
-    _query: (string) => Promise<Array<Object>>;
161
+    _query: (?string) => Promise<Array<Object>>;
162
 
162
 
163
     /**
163
     /**
164
      * Performs a people and phone number search request.
164
      * Performs a people and phone number search request.

+ 9
- 7
react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js 查看文件

268
                 });
268
                 });
269
             } else {
269
             } else {
270
                 // Item is not selected yet, need to add to the list.
270
                 // Item is not selected yet, need to add to the list.
271
+                const items: Array<*> = inviteItems.concat(item);
272
+
271
                 this.setState({
273
                 this.setState({
272
-                    inviteItems: _.orderBy(
273
-                        inviteItems.concat(item), [ 'name' ], [ 'asc' ])
274
+                    // $FlowExpectedError
275
+                    inviteItems: _.orderBy(items, [ 'name' ], [ 'asc' ])
274
                 });
276
                 });
275
             }
277
             }
276
         };
278
         };
320
                 }
322
                 }
321
             });
323
             });
322
 
324
 
323
-            selectableItems
324
-                = _.orderBy(
325
-                    this.state.inviteItems.concat(selectableItems),
326
-                    [ 'name' ], [ 'asc' ]);
325
+            const items = this.state.inviteItems.concat(selectableItems);
326
+
327
+            // $FlowExpectedError
328
+            selectableItems = _.orderBy(items, [ 'name' ], [ 'asc' ]);
327
 
329
 
328
             this.setState({
330
             this.setState({
329
                 selectableItems
331
                 selectableItems
402
         );
404
         );
403
     }
405
     }
404
 
406
 
405
-    _renderSeparator: () => ?React$Element<*>
407
+    _renderSeparator: () => React$Element<*> | null
406
 
408
 
407
     /**
409
     /**
408
      * Renders the item separator.
410
      * Renders the item separator.

+ 3
- 2
react/features/invite/components/add-people-dialog/web/AddPeopleDialog.js 查看文件

4
 import InlineMessage from '@atlaskit/inline-message';
4
 import InlineMessage from '@atlaskit/inline-message';
5
 import React from 'react';
5
 import React from 'react';
6
 import { connect } from 'react-redux';
6
 import { connect } from 'react-redux';
7
+import type { Dispatch } from 'redux';
7
 
8
 
8
 import { createInviteDialogEvent, sendAnalytics } from '../../../../analytics';
9
 import { createInviteDialogEvent, sendAnalytics } from '../../../../analytics';
9
 import { Dialog, hideDialog } from '../../../../base/dialog';
10
 import { Dialog, hideDialog } from '../../../../base/dialog';
38
     /**
39
     /**
39
      * The redux {@code dispatch} function.
40
      * The redux {@code dispatch} function.
40
      */
41
      */
41
-    dispatch: Dispatch<*>,
42
+    dispatch: Dispatch<any>,
42
 
43
 
43
     /**
44
     /**
44
      * Invoked to obtain translated strings.
45
      * Invoked to obtain translated strings.
267
             });
268
             });
268
     }
269
     }
269
 
270
 
270
-    _parseQueryResults: (Array<Object>, string) => Array<Object>;
271
+    _parseQueryResults: (?Array<Object>) => Array<Object>;
271
 
272
 
272
     /**
273
     /**
273
      * Processes results from requesting available numbers and people by munging
274
      * Processes results from requesting available numbers and people by munging

+ 1
- 0
react/features/invite/components/callee-info/CalleeInfo.js 查看文件

158
     };
158
     };
159
 }
159
 }
160
 
160
 
161
+// $FlowExpectedError
161
 export default connect(_mapStateToProps)(CalleeInfo);
162
 export default connect(_mapStateToProps)(CalleeInfo);

+ 1
- 0
react/features/invite/components/callee-info/CalleeInfoContainer.js 查看文件

61
     };
61
     };
62
 }
62
 }
63
 
63
 
64
+// $FlowExpectedError
64
 export default connect(_mapStateToProps)(CalleeInfoContainer);
65
 export default connect(_mapStateToProps)(CalleeInfoContainer);

+ 2
- 1
react/features/invite/components/info-dialog/InfoDialog.web.js 查看文件

2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
+import type { Dispatch } from 'redux';
5
 
6
 
6
 import { setPassword } from '../../../base/conference';
7
 import { setPassword } from '../../../base/conference';
7
 import { getInviteURL } from '../../../base/connection';
8
 import { getInviteURL } from '../../../base/connection';
65
     /**
66
     /**
66
      * Invoked to open a dialog for adding participants to the conference.
67
      * Invoked to open a dialog for adding participants to the conference.
67
      */
68
      */
68
-    dispatch: Dispatch<*>,
69
+    dispatch: Dispatch<any>,
69
 
70
 
70
     /**
71
     /**
71
      * Whether is Atlaskit InlineDialog or a normal dialog.
72
      * Whether is Atlaskit InlineDialog or a normal dialog.

+ 4
- 2
react/features/large-video/actions.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import type { Dispatch } from 'redux';
4
+
3
 import {
5
 import {
4
     createSelectParticipantFailedEvent,
6
     createSelectParticipantFailedEvent,
5
     sendAnalytics
7
     sendAnalytics
23
  * @returns {Function}
25
  * @returns {Function}
24
  */
26
  */
25
 export function selectParticipant() {
27
 export function selectParticipant() {
26
-    return (dispatch: Dispatch<*>, getState: Function) => {
28
+    return (dispatch: Dispatch<any>, getState: Function) => {
27
         const state = getState();
29
         const state = getState();
28
         const { conference } = state['features/base/conference'];
30
         const { conference } = state['features/base/conference'];
29
 
31
 
54
  * @returns {Function}
56
  * @returns {Function}
55
  */
57
  */
56
 export function selectParticipantInLargeVideo() {
58
 export function selectParticipantInLargeVideo() {
57
-    return (dispatch: Dispatch<*>, getState: Function) => {
59
+    return (dispatch: Dispatch<any>, getState: Function) => {
58
         const state = getState();
60
         const state = getState();
59
         const participantId = _electParticipantInLargeVideo(state);
61
         const participantId = _electParticipantInLargeVideo(state);
60
         const largeVideo = state['features/large-video'];
62
         const largeVideo = state['features/large-video'];

+ 2
- 1
react/features/large-video/components/LargeVideo.native.js 查看文件

72
      * @param {Object} props - The read-only properties with which the new
72
      * @param {Object} props - The read-only properties with which the new
73
      * instance is to be initialized.
73
      * instance is to be initialized.
74
      */
74
      */
75
-    constructor(props) {
75
+    constructor(props: Props) {
76
         super(props);
76
         super(props);
77
 
77
 
78
         // Bind event handlers so they are only bound once per instance.
78
         // Bind event handlers so they are only bound once per instance.
159
     };
159
     };
160
 }
160
 }
161
 
161
 
162
+// $FlowExpectedError
162
 export default connect(_mapStateToProps)(LargeVideo);
163
 export default connect(_mapStateToProps)(LargeVideo);

+ 3
- 2
react/features/local-recording/components/LocalRecordingInfoDialog.js 查看文件

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
+import type { Dispatch } from 'redux';
6
 
7
 
7
 import { Dialog } from '../../base/dialog';
8
 import { Dialog } from '../../base/dialog';
8
 import { translate } from '../../base/i18n';
9
 import { translate } from '../../base/i18n';
24
     /**
25
     /**
25
      * Redux store dispatch function.
26
      * Redux store dispatch function.
26
      */
27
      */
27
-    dispatch: Dispatch<*>,
28
+    dispatch: Dispatch<any>,
28
 
29
 
29
     /**
30
     /**
30
      * Current encoding format.
31
      * Current encoding format.

+ 3
- 3
react/features/local-recording/recording/flac/flacEncodeWorker.js 查看文件

69
     /**
69
     /**
70
      * Initial state, when libflac.js is not initialized.
70
      * Initial state, when libflac.js is not initialized.
71
      */
71
      */
72
-    UNINTIALIZED: Symbol('uninitialized'),
72
+    UNINTIALIZED: 'uninitialized',
73
 
73
 
74
     /**
74
     /**
75
      * Actively encoding new audio bits.
75
      * Actively encoding new audio bits.
76
      */
76
      */
77
-    WORKING: Symbol('working'),
77
+    WORKING: 'working',
78
 
78
 
79
     /**
79
     /**
80
      * Encoding has finished and encoded bits are available.
80
      * Encoding has finished and encoded bits are available.
81
      */
81
      */
82
-    FINISHED: Symbol('finished')
82
+    FINISHED: 'finished'
83
 });
83
 });
84
 
84
 
85
 /**
85
 /**

+ 4
- 2
react/features/mobile/background/actions.js 查看文件

1
-/* @flow */
1
+// @flow
2
+
3
+import type { Dispatch } from 'redux';
2
 
4
 
3
 import {
5
 import {
4
     createTrackMutedEvent,
6
     createTrackMutedEvent,
37
  * @returns {Function}
39
  * @returns {Function}
38
  */
40
  */
39
 export function _setBackgroundVideoMuted(muted: boolean) {
41
 export function _setBackgroundVideoMuted(muted: boolean) {
40
-    return (dispatch: Dispatch<*>, getState: Function) => {
42
+    return (dispatch: Dispatch<any>, getState: Function) => {
41
         // Disable remote video when we mute by setting lastN to 0. Skip it if
43
         // Disable remote video when we mute by setting lastN to 0. Skip it if
42
         // the conference is in audio-only mode, as it's already configured to
44
         // the conference is in audio-only mode, as it's already configured to
43
         // have no video. Leave it as undefined when unmuting, the default value
45
         // have no video. Leave it as undefined when unmuting, the default value

+ 1
- 1
react/features/mobile/background/middleware.js 查看文件

91
  * @private
91
  * @private
92
  * @returns {void}
92
  * @returns {void}
93
  */
93
  */
94
-function _onAppStateChange(dispatch: Dispatch<*>, appState: string) {
94
+function _onAppStateChange(dispatch: Dispatch<any>, appState: string) {
95
     dispatch(appStateChanged(appState));
95
     dispatch(appStateChanged(appState));
96
 }
96
 }
97
 
97
 

+ 2
- 1
react/features/mobile/network-activity/components/NetworkActivityIndicator.js 查看文件

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
52
     };
52
     };
53
 }
53
 }
54
 
54
 
55
+// $FlowExpectedError
55
 export default connect(_mapStateToProps)(NetworkActivityIndicator);
56
 export default connect(_mapStateToProps)(NetworkActivityIndicator);

+ 2
- 1
react/features/mobile/picture-in-picture/actions.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { NativeModules } from 'react-native';
3
 import { NativeModules } from 'react-native';
4
+import type { Dispatch } from 'redux';
4
 
5
 
5
 import { getAppProp } from '../../base/app';
6
 import { getAppProp } from '../../base/app';
6
 import { Platform } from '../../base/react';
7
 import { Platform } from '../../base/react';
20
  * @returns {Function}
21
  * @returns {Function}
21
  */
22
  */
22
 export function enterPictureInPicture() {
23
 export function enterPictureInPicture() {
23
-    return (dispatch: Dispatch, getState: Function) => {
24
+    return (dispatch: Dispatch<any>, getState: Function) => {
24
         // XXX At the time of this writing this action can only be dispatched by
25
         // XXX At the time of this writing this action can only be dispatched by
25
         // the button which is on the conference view, which means that it's
26
         // the button which is on the conference view, which means that it's
26
         // fine to enter PiP mode.
27
         // fine to enter PiP mode.

+ 1
- 0
react/features/notifications/components/NotificationsContainer.web.js 查看文件

63
     }
63
     }
64
 }
64
 }
65
 
65
 
66
+// $FlowExpectedError
66
 export default connect(_mapStateToProps)(NotificationsContainer);
67
 export default connect(_mapStateToProps)(NotificationsContainer);

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


部分文件因为文件数量过多而无法显示

正在加载...
取消
保存