Quellcode durchsuchen

[flow] Expand the coverage of flow-monitored files

j8
Lyubomir Marinov vor 8 Jahren
Ursprung
Commit
b50f858556

+ 3
- 1
react/features/base/connection/functions.js Datei anzeigen

@@ -1,3 +1,5 @@
1
+/* @flow */
2
+
1 3
 /**
2 4
  * Returns current domain.
3 5
  *
@@ -5,7 +7,7 @@
5 7
  * state.
6 8
  * @returns {(string|undefined)}
7 9
  */
8
-export function getDomain(stateOrGetState) {
10
+export function getDomain(stateOrGetState: Function | Object) {
9 11
     const state
10 12
         = typeof stateOrGetState === 'function'
11 13
             ? stateOrGetState()

+ 20
- 16
react/features/base/connection/reducer.js Datei anzeigen

@@ -1,3 +1,5 @@
1
+/* @flow */
2
+
1 3
 import { ReducerRegistry, setStateProperty } from '../redux';
2 4
 
3 5
 import {
@@ -9,20 +11,22 @@ import {
9 11
 /**
10 12
  * Reduces the Redux actions of the feature base/connection.
11 13
  */
12
-ReducerRegistry.register('features/base/connection', (state = {}, action) => {
13
-    switch (action.type) {
14
-    case CONNECTION_DISCONNECTED:
15
-        return _connectionDisconnected(state, action);
14
+ReducerRegistry.register(
15
+    'features/base/connection',
16
+    (state: Object = {}, action: Object) => {
17
+        switch (action.type) {
18
+        case CONNECTION_DISCONNECTED:
19
+            return _connectionDisconnected(state, action);
16 20
 
17
-    case CONNECTION_ESTABLISHED:
18
-        return _connectionEstablished(state, action);
21
+        case CONNECTION_ESTABLISHED:
22
+            return _connectionEstablished(state, action);
19 23
 
20
-    case SET_DOMAIN:
21
-        return _setDomain(state, action);
22
-    }
24
+        case SET_DOMAIN:
25
+            return _setDomain(state, action);
26
+        }
23 27
 
24
-    return state;
25
-});
28
+        return state;
29
+    });
26 30
 
27 31
 /**
28 32
  * Reduces a specific Redux action CONNECTION_DISCONNECTED of the feature
@@ -34,7 +38,7 @@ ReducerRegistry.register('features/base/connection', (state = {}, action) => {
34 38
  * @returns {Object} The new state of the feature base/connection after the
35 39
  * reduction of the specified action.
36 40
  */
37
-function _connectionDisconnected(state, action) {
41
+function _connectionDisconnected(state: Object, action: Object) {
38 42
     if (state.connection === action.connection) {
39 43
         return setStateProperty(state, 'connection', undefined);
40 44
     }
@@ -52,7 +56,7 @@ function _connectionDisconnected(state, action) {
52 56
  * @returns {Object} The new state of the feature base/connection after the
53 57
  * reduction of the specified action.
54 58
  */
55
-function _connectionEstablished(state, action) {
59
+function _connectionEstablished(state: Object, action: Object) {
56 60
     return setStateProperty(state, 'connection', action.connection);
57 61
 }
58 62
 
@@ -65,7 +69,7 @@ function _connectionEstablished(state, action) {
65 69
  * @private
66 70
  * @returns {Object}
67 71
  */
68
-function _constructConnectionOptions(domain) {
72
+function _constructConnectionOptions(domain: string) {
69 73
     // FIXME The HTTPS scheme for the BOSH URL works with meet.jit.si on both
70 74
     // mobile & Web. It also works with beta.meet.jit.si on Web. Unfortunately,
71 75
     // it doesn't work with beta.meet.jit.si on mobile. Temporarily, use the
@@ -89,7 +93,7 @@ function _constructConnectionOptions(domain) {
89 93
     boshProtocol || (boshProtocol = 'https:');
90 94
 
91 95
     return {
92
-        bosh: `${boshProtocol}//${domain}/http-bind`,
96
+        bosh: `${String(boshProtocol)}//${domain}/http-bind`,
93 97
         hosts: {
94 98
             domain,
95 99
             focus: `focus.${domain}`,
@@ -107,7 +111,7 @@ function _constructConnectionOptions(domain) {
107 111
  * @returns {Object} The new state of the feature base/connection after the
108 112
  * reduction of the specified action.
109 113
  */
110
-function _setDomain(state, action) {
114
+function _setDomain(state: Object, action: Object) {
111 115
     return {
112 116
         ...state,
113 117
         connectionOptions: {

+ 2
- 0
react/features/base/media/middleware.js Datei anzeigen

@@ -1,3 +1,5 @@
1
+/* @flow */
2
+
1 3
 import { CONFERENCE_LEFT } from '../conference';
2 4
 import { MiddlewareRegistry } from '../redux';
3 5
 import { setTrackMuted, TRACK_ADDED } from '../tracks';

+ 1
- 1
react/features/base/react/RouteRegistry.js Datei anzeigen

@@ -19,7 +19,7 @@ type Route = {
19 19
  * without needing to create additional inter-feature dependencies.
20 20
  */
21 21
 class RouteRegistry {
22
-    _elements: Route[];
22
+    _elements: Array<Route>;
23 23
 
24 24
     /**
25 25
      * Initializes a new RouteRegistry instance.

+ 4
- 2
react/features/base/tracks/middleware.js Datei anzeigen

@@ -1,3 +1,5 @@
1
+/* @flow */
2
+
1 3
 import { LIB_DISPOSED, LIB_INITIALIZED } from '../lib-jitsi-meet';
2 4
 import {
3 5
     MEDIA_TYPE,
@@ -67,7 +69,7 @@ MiddlewareRegistry.register(store => next => action => {
67 69
  * @returns {Track} The local <tt>Track</tt> associated with the specified
68 70
  * <tt>mediaType</tt> in the specified <tt>store</tt>.
69 71
  */
70
-function _getLocalTrack(store, mediaType) {
72
+function _getLocalTrack(store, mediaType: MEDIA_TYPE) {
71 73
     return getLocalTrack(store.getState()['features/base/tracks'], mediaType);
72 74
 }
73 75
 
@@ -82,7 +84,7 @@ function _getLocalTrack(store, mediaType) {
82 84
  * @private
83 85
  * @returns {void}
84 86
  */
85
-function _setMuted(store, action, mediaType) {
87
+function _setMuted(store, action, mediaType: MEDIA_TYPE) {
86 88
     const localTrack = _getLocalTrack(store, mediaType);
87 89
 
88 90
     localTrack && setTrackMuted(localTrack.jitsiTrack, action.muted);

+ 1
- 1
react/features/base/util/roomnameGenerator.js Datei anzeigen

@@ -152,7 +152,7 @@ const _CONJUNCTION_ = [
152 152
  * Maps a string (category name) to the array of words from that category.
153 153
  * @const
154 154
  */
155
-const CATEGORIES = {
155
+const CATEGORIES: { [key: string]: Array<string> } = {
156 156
     _ADJECTIVE_,
157 157
     _ADVERB_,
158 158
     _PLURALNOUN_,

Laden…
Abbrechen
Speichern