Move Flow environment into scripts/flow (#11249)
* Move flow environment into scripts/flow * Run Prettier
Dan Abramov committed
Oct 17, 2017 at 14:20 UTC
1ef250d881d270b1bdc869de460af8fce7d8ddc8
4 files changed
+114
-129
.flowconfig
+1
-1
@@ -14,7 +14,7 @@
14
15
[libs]
16
./node_modules/fbjs/flow/lib/dev.js
17
-./flow
17
+./scripts/flow
18
19
[options]
20
module.system=haste
flow/react-native-host-hooks.js
deleted
-127
@@ -1,127 +0,0 @@
1
-/**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @flow
8
- */
9
-
10
-/* eslint-disable */
11
-
12
-declare module 'deepDiffer' {
13
- declare function exports(one: any, two: any): bool;
14
-}
15
-declare module 'deepFreezeAndThrowOnMutationInDev' {
16
- declare function exports<T>(obj : T) : T;
17
-}
18
-declare module 'flattenStyle' { }
19
-declare module 'InitializeCore' { }
20
-declare module 'RCTEventEmitter' {
21
- declare function register(mixed) : void;
22
-}
23
-declare module 'TextInputState' {
24
- declare function blurTextInput(object : any) : void;
25
- declare function focusTextInput(object : any) : void;
26
-}
27
-declare module 'ExceptionsManager' {
28
- declare function handleException(
29
- error: Error,
30
- isFatal: boolean,
31
- ) : void;
32
-}
33
-declare module 'Platform' {
34
- declare var OS : string;
35
-}
36
-declare module 'UIManager' {
37
- declare var customBubblingEventTypes : Object;
38
- declare var customDirectEventTypes : Object;
39
- declare function createView(
40
- reactTag : number,
41
- viewName : string,
42
- rootTag : number,
43
- props : ?Object,
44
- ) : void;
45
- declare function manageChildren(
46
- containerTag : number,
47
- moveFromIndices : Array<number>,
48
- moveToIndices : Array<number>,
49
- addChildReactTags : Array<number>,
50
- addAtIndices : Array<number>,
51
- removeAtIndices : Array<number>
52
- ) : void;
53
- declare function measure(hostComponent: mixed, callback: Function) : void;
54
- declare function measureInWindow(
55
- nativeTag : ?number,
56
- callback : Function
57
- ) : void;
58
- declare function measureLayout(
59
- nativeTag : mixed,
60
- nativeNode : number,
61
- onFail : Function,
62
- onSuccess : Function
63
- ) : void;
64
- declare function removeRootView(containerTag : number) : void;
65
- declare function removeSubviewsFromContainerWithID(containerId : number) : void;
66
- declare function replaceExistingNonRootView() : void;
67
- declare function setChildren(
68
- containerTag : number,
69
- reactTags : Array<number>,
70
- ) : void;
71
- declare function updateView(
72
- reactTag : number,
73
- viewName : string,
74
- props : ?Object,
75
- ) : void;
76
- declare function __takeSnapshot(
77
- view ?: 'window' | Element<any> | number,
78
- options ?: {
79
- width ?: number,
80
- height ?: number,
81
- format ?: 'png' | 'jpeg',
82
- quality ?: number,
83
- },
84
- ) : Promise<any>;
85
-}
86
-declare module 'View' {
87
- declare var exports : typeof React$Component;
88
-}
89
-
90
-declare module 'RTManager' {
91
- declare function createNode(
92
- tag : number,
93
- classType : string,
94
- props : ?Object,
95
- ) : void;
96
-
97
- declare function beginUpdates() : void;
98
-
99
- declare function appendChildToContext(
100
- contextTag : number,
101
- childTag : number,
102
- ) : void;
103
- declare function appendChild(
104
- parentTag : number,
105
- childTag : number,
106
- ) : void;
107
- declare function prependChild(
108
- childTag : number,
109
- beforeTag : number,
110
- ) : void;
111
- declare function deleteChild(
112
- childTag : number,
113
- ) : void;
114
- declare function updateNode(
115
- tag : number,
116
- props : ?Object,
117
- ) : void;
118
-
119
- declare function completeUpdates() : void;
120
-}
121
-
122
-declare module 'BatchedBridge' {
123
- declare function registerCallableModule(
124
- name : string,
125
- module : Object,
126
- ) : void;
127
-}
scripts/flow/environment.js
renamed
+1
-1
@@ -11,4 +11,4 @@
11
12
declare var __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{
13
inject: ?((stuff: Object) => void)
14
-};*/
\ No newline at end of file
14
+};*/
scripts/flow/react-native-host-hooks.js
new
+112
@@ -0,0 +1,112 @@
1
+/**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+/* eslint-disable */
11
+
12
+declare module 'deepDiffer' {
13
+ declare function exports(one: any, two: any): boolean;
14
+}
15
+declare module 'deepFreezeAndThrowOnMutationInDev' {
16
+ declare function exports<T>(obj: T): T;
17
+}
18
+declare module 'flattenStyle' {
19
+}
20
+declare module 'InitializeCore' {
21
+}
22
+declare module 'RCTEventEmitter' {
23
+ declare function register(mixed): void;
24
+}
25
+declare module 'TextInputState' {
26
+ declare function blurTextInput(object: any): void;
27
+ declare function focusTextInput(object: any): void;
28
+}
29
+declare module 'ExceptionsManager' {
30
+ declare function handleException(error: Error, isFatal: boolean): void;
31
+}
32
+declare module 'Platform' {
33
+ declare var OS: string;
34
+}
35
+declare module 'UIManager' {
36
+ declare var customBubblingEventTypes: Object;
37
+ declare var customDirectEventTypes: Object;
38
+ declare function createView(
39
+ reactTag: number,
40
+ viewName: string,
41
+ rootTag: number,
42
+ props: ?Object
43
+ ): void;
44
+ declare function manageChildren(
45
+ containerTag: number,
46
+ moveFromIndices: Array<number>,
47
+ moveToIndices: Array<number>,
48
+ addChildReactTags: Array<number>,
49
+ addAtIndices: Array<number>,
50
+ removeAtIndices: Array<number>
51
+ ): void;
52
+ declare function measure(hostComponent: mixed, callback: Function): void;
53
+ declare function measureInWindow(
54
+ nativeTag: ?number,
55
+ callback: Function
56
+ ): void;
57
+ declare function measureLayout(
58
+ nativeTag: mixed,
59
+ nativeNode: number,
60
+ onFail: Function,
61
+ onSuccess: Function
62
+ ): void;
63
+ declare function removeRootView(containerTag: number): void;
64
+ declare function removeSubviewsFromContainerWithID(containerId: number): void;
65
+ declare function replaceExistingNonRootView(): void;
66
+ declare function setChildren(
67
+ containerTag: number,
68
+ reactTags: Array<number>
69
+ ): void;
70
+ declare function updateView(
71
+ reactTag: number,
72
+ viewName: string,
73
+ props: ?Object
74
+ ): void;
75
+ declare function __takeSnapshot(
76
+ view?: 'window' | Element<any> | number,
77
+ options?: {
78
+ width?: number,
79
+ height?: number,
80
+ format?: 'png' | 'jpeg',
81
+ quality?: number,
82
+ }
83
+ ): Promise<any>;
84
+}
85
+declare module 'View' {
86
+ declare var exports: typeof React$Component;
87
+}
88
+
89
+declare module 'RTManager' {
90
+ declare function createNode(
91
+ tag: number,
92
+ classType: string,
93
+ props: ?Object
94
+ ): void;
95
+
96
+ declare function beginUpdates(): void;
97
+
98
+ declare function appendChildToContext(
99
+ contextTag: number,
100
+ childTag: number
101
+ ): void;
102
+ declare function appendChild(parentTag: number, childTag: number): void;
103
+ declare function prependChild(childTag: number, beforeTag: number): void;
104
+ declare function deleteChild(childTag: number): void;
105
+ declare function updateNode(tag: number, props: ?Object): void;
106
+
107
+ declare function completeUpdates(): void;
108
+}
109
+
110
+declare module 'BatchedBridge' {
111
+ declare function registerCallableModule(name: string, module: Object): void;
112
+}