update flowification of react-native

Reviewed By: frantic, gabelevi

Differential Revision: D3436342

fbshipit-source-id: 7630eac4601d0768f57dc9fc945595039067eceb
This commit is contained in:
Basil Hosmer 2016-06-16 15:34:51 -07:00 коммит произвёл Facebook Github Bot 9
Родитель 92d6632d7a
Коммит b4a4c71a68
3 изменённых файлов: 27 добавлений и 68 удалений

Просмотреть файл

@ -1,71 +1,13 @@
[ignore]
# We fork some components by platform.
.*/*.web.js
.*/*.android.js
# Some modules have their own node_modules with overlap
.*/node_modules/node-haste/.*
# Ugh
.*/node_modules/babel.*
.*/node_modules/babylon.*
.*/node_modules/invariant.*
# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/ErrorUtils.js
# Flow has a built-in definition for the 'react' module which we prefer to use
# over the currently-untyped source
.*/node_modules/react/react.js
.*/node_modules/react/lib/React.js
.*/node_modules/react/lib/ReactDOM.js
.*/__mocks__/.*
.*/__tests__/.*
.*/commoner/test/source/widget/share.js
# Ignore commoner tests
.*/node_modules/commoner/test/.*
# See https://github.com/facebook/flow/issues/442
.*/react-tools/node_modules/commoner/lib/reader.js
# Ignore jest
.*/node_modules/jest-cli/.*
# Ignore Website
.*/website/.*
# Ignore generators
# Ignore templates with `@flow` in header
.*/local-cli/generator.*
# Ignore BUCK generated folders
.*\.buckd/
# Ignore RNPM
.*/local-cli/rnpm/.*
.*/node_modules/is-my-json-valid/test/.*\.json
.*/node_modules/iconv-lite/encodings/tables/.*\.json
# Ignore malformed json
.*/node_modules/y18n/test/.*\.json
.*/node_modules/spdx-license-ids/spdx-license-ids.json
.*/node_modules/spdx-exceptions/index.json
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
.*/node_modules/resolve/lib/core.json
.*/node_modules/jsonparse/samplejson/.*\.json
.*/node_modules/json5/test/.*\.json
.*/node_modules/ua-parser-js/test/.*\.json
.*/node_modules/builtin-modules/builtin-modules.json
.*/node_modules/binary-extensions/binary-extensions.json
.*/node_modules/url-regex/tlds.json
.*/node_modules/joi/.*\.json
.*/node_modules/isemail/.*\.json
.*/node_modules/tr46/.*\.json
[include]

Просмотреть файл

@ -59,7 +59,7 @@ import type {
type Props = {
direction: NavigationGestureDirection,
navigationState: NavigationState,
onNavigateBack: ?Function,
onNavigateBack?: Function,
renderOverlay: ?NavigationSceneRenderer,
renderScene: NavigationSceneRenderer,
style: any,

Просмотреть файл

@ -16,14 +16,31 @@
*/
'use strict';
// Export ReactNative, plus some native additions.
// Export some ReactNative properties, plus native additions.
//
// The use of Object.create/assign is to work around a Flow bug (#6560135).
// Once that is fixed, change this back to
// Our ReactNative.js has had its types stripped, so here we
// need to enumerate and type the properties we need access to.
//
// var ReactNative = {...require('React'), /* additions */}
//
var ReactNative = Object.assign(Object.create(require('ReactNative')), {
var ReactNativeInternal = (require('ReactNative'): {
// render
render: (
element: ReactElement<any>,
mountInto: number,
callback?: ?(() => void)
) => ?ReactComponent<any, any, any>,
// findNodeHandle
findNodeHandle: (componentOrHandle: any) => ?number,
// NativeMethodsMixin
NativeMethodsMixin: Object
});
// export
var ReactNative = {
// from ReactNative internal
findNodeHandle: ReactNativeInternal.findNodeHandle,
render: ReactNativeInternal.render,
NativeMethodsMixin: ReactNativeInternal.NativeMethodsMixin,
// Components
ActivityIndicator: require('ActivityIndicator'),
ActivityIndicatorIOS: require('ActivityIndicatorIOS'),
@ -118,6 +135,6 @@ var ReactNative = Object.assign(Object.create(require('ReactNative')), {
ColorPropType: require('ColorPropType'),
EdgeInsetsPropType: require('EdgeInsetsPropType'),
PointPropType: require('PointPropType'),
});
};
module.exports = ReactNative;