Bring back TypeDefinition.js and re-add Flow to NavigationPlayground (#3363)

* Bring back TypeDefinition.js and re-add Flow to NavigationPlayground

* Type EventListener correctly and ignore metro errors
This commit is contained in:
Ashoat Tevosyan
2018-01-26 17:15:49 -07:00
parent d4dfdf8315
commit 52828e98cb
16 changed files with 94485 additions and 561 deletions

View File

@@ -0,0 +1,83 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; Ignore polyfills
.*/Libraries/polyfills/.*
.*/react-navigation/node_modules/.*
; Additional create-react-native-app ignores
; Ignore duplicate module providers
.*/node_modules/fbemitter/lib/*
; Ignore misbehaving dev-dependencies
.*/node_modules/xdl/build/*
.*/node_modules/reqwest/tests/*
; Ignore missing expo-sdk dependencies (temporarily)
; https://github.com/expo/expo/issues/162
.*/node_modules/expo/src/*
; Ignore react-native-fbads dependency of the expo sdk
.*/node_modules/react-native-fbads/*
.*/react-navigation/lib-rn/.*
.*/react-navigation/lib/.*
.*/react-navigation/examples/ReduxExample/.*
.*/react-navigation/website/.*
; This package is required by Expo and causes Flow errors
.*/node_modules/react-native-gesture-handler/.*
.*/node_modules/metro/.*
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/
[options]
module.system=haste
emoji=true
experimental.strict_type_args=true
munge_underscores=true
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true
[version]
^0.61.0

View File

@@ -11,7 +11,7 @@
"splash": {
"image": "./assets/icons/splash.png"
},
"sdkVersion": "24.0.0",
"sdkVersion": "25.0.0",
"entryPoint": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"packagerOpts": {
"assetExts": [

View File

@@ -1,5 +1,5 @@
// flow-typed signature: 5964a245d3129ecd50da1f74a2f86454
// flow-typed version: <<STUB>>/babel-jest_v^21.0.0/flow_v0.53.0
// flow-typed signature: ee7b4028012cfdcd83cc6541a39b2282
// flow-typed version: <<STUB>>/babel-jest_v^21.0.0/flow_v0.61.0
/**
* This is an autogenerated libdef stub for:

View File

@@ -1,5 +1,5 @@
// flow-typed signature: 4fb1f6897647ab1ad25d819aa06d2d6c
// flow-typed version: <<STUB>>/expo_v^22.0.0/flow_v0.53.0
// flow-typed signature: c1ecfe71fbb86c3602b7da3d7c141df1
// flow-typed version: <<STUB>>/expo_v^24.0.2/flow_v0.61.0
/**
* This is an autogenerated libdef stub for:
@@ -26,6 +26,18 @@ declare module 'expo/AppEntry' {
declare module.exports: any;
}
declare module 'expo/flow/metro-bundler' {
declare module.exports: any;
}
declare module 'expo/flow/react-native-gesture-handler' {
declare module.exports: any;
}
declare module 'expo/src/__mocks__/Constants-development' {
declare module.exports: any;
}
declare module 'expo/src/__tests__/Amplitude-test' {
declare module.exports: any;
}
@@ -50,6 +62,10 @@ declare module 'expo/src/__tests__/Facebook-test' {
declare module.exports: any;
}
declare module 'expo/src/__tests__/Font-test' {
declare module.exports: any;
}
declare module 'expo/src/__tests__/Location-test' {
declare module.exports: any;
}
@@ -70,6 +86,22 @@ declare module 'expo/src/__tests__/WebBrowser-test' {
declare module.exports: any;
}
declare module 'expo/src/admob/RNAdMobBanner' {
declare module.exports: any;
}
declare module 'expo/src/admob/RNAdMobInterstitial' {
declare module.exports: any;
}
declare module 'expo/src/admob/RNAdMobRewarded' {
declare module.exports: any;
}
declare module 'expo/src/admob/RNPublisherBanner' {
declare module.exports: any;
}
declare module 'expo/src/Amplitude' {
declare module.exports: any;
}
@@ -78,43 +110,39 @@ declare module 'expo/src/apisAreAvailable' {
declare module.exports: any;
}
declare module 'expo/src/AppLoading' {
declare module.exports: any;
}
declare module 'expo/src/AppLoadingNativeWrapper.android' {
declare module.exports: any;
}
declare module 'expo/src/AppLoadingNativeWrapper.ios' {
declare module.exports: any;
}
declare module 'expo/src/Asset' {
declare module.exports: any;
}
declare module 'expo/src/Audio' {
declare module.exports: any;
}
declare module 'expo/src/AuthSession' {
declare module.exports: any;
}
declare module 'expo/src/AV' {
declare module 'expo/src/av/Audio' {
declare module.exports: any;
}
declare module 'expo/src/BarCodeScanner' {
declare module 'expo/src/av/Audio/Recording' {
declare module.exports: any;
}
declare module 'expo/src/BlurView.android' {
declare module 'expo/src/av/Audio/Sound' {
declare module.exports: any;
}
declare module 'expo/src/BlurView.ios' {
declare module 'expo/src/av/AV' {
declare module.exports: any;
}
declare module 'expo/src/av/Video' {
declare module.exports: any;
}
declare module 'expo/src/BarCodeScanner.android' {
declare module.exports: any;
}
declare module 'expo/src/BarCodeScanner.ios' {
declare module.exports: any;
}
@@ -126,6 +154,10 @@ declare module 'expo/src/Camera' {
declare module.exports: any;
}
declare module 'expo/src/CameraBasedBarCodeScanner' {
declare module.exports: any;
}
declare module 'expo/src/Constants' {
declare module.exports: any;
}
@@ -142,6 +174,34 @@ declare module 'expo/src/DocumentPicker' {
declare module.exports: any;
}
declare module 'expo/src/effects/BlurView.android' {
declare module.exports: any;
}
declare module 'expo/src/effects/BlurView.ios' {
declare module.exports: any;
}
declare module 'expo/src/effects/LinearGradient.android' {
declare module.exports: any;
}
declare module 'expo/src/effects/LinearGradient.ios' {
declare module.exports: any;
}
declare module 'expo/src/environment/__tests__/validate-test' {
declare module.exports: any;
}
declare module 'expo/src/environment/logging' {
declare module.exports: any;
}
declare module 'expo/src/environment/validate' {
declare module.exports: any;
}
declare module 'expo/src/ErrorRecovery' {
declare module.exports: any;
}
@@ -150,31 +210,35 @@ declare module 'expo/src/Expo' {
declare module.exports: any;
}
declare module 'expo/src/facebook-ads/AdSettings' {
declare module.exports: any;
}
declare module 'expo/src/facebook-ads/BannerViewManager' {
declare module.exports: any;
}
declare module 'expo/src/facebook-ads/index' {
declare module.exports: any;
}
declare module 'expo/src/facebook-ads/InterstitialAdManager' {
declare module.exports: any;
}
declare module 'expo/src/facebook-ads/NativeAdsManager' {
declare module.exports: any;
}
declare module 'expo/src/facebook-ads/withNativeAd' {
declare module.exports: any;
}
declare module 'expo/src/Facebook' {
declare module.exports: any;
}
declare module 'expo/src/FacebookAds/AdSettings' {
declare module.exports: any;
}
declare module 'expo/src/FacebookAds/BannerViewManager' {
declare module.exports: any;
}
declare module 'expo/src/FacebookAds/index' {
declare module.exports: any;
}
declare module 'expo/src/FacebookAds/InterstitialAdManager' {
declare module.exports: any;
}
declare module 'expo/src/FacebookAds/NativeAdsManager' {
declare module.exports: any;
}
declare module 'expo/src/FacebookAds/withNativeAd' {
declare module 'expo/src/FaceDetector' {
declare module.exports: any;
}
@@ -202,6 +266,10 @@ declare module 'expo/src/Icon' {
declare module.exports: any;
}
declare module 'expo/src/ImageManipulator' {
declare module.exports: any;
}
declare module 'expo/src/ImagePicker' {
declare module.exports: any;
}
@@ -214,11 +282,23 @@ declare module 'expo/src/KeepAwake' {
declare module.exports: any;
}
declare module 'expo/src/LegacyAsyncStorage.android' {
declare module 'expo/src/launch/AppLoading' {
declare module.exports: any;
}
declare module 'expo/src/LegacyAsyncStorage.ios' {
declare module 'expo/src/launch/AppLoadingNativeWrapper.android' {
declare module.exports: any;
}
declare module 'expo/src/launch/AppLoadingNativeWrapper.ios' {
declare module.exports: any;
}
declare module 'expo/src/launch/registerRootComponent' {
declare module.exports: any;
}
declare module 'expo/src/launch/RootErrorBoundary' {
declare module.exports: any;
}
@@ -226,35 +306,59 @@ declare module 'expo/src/lib/Queue' {
declare module.exports: any;
}
declare module 'expo/src/LinearGradient.android' {
declare module.exports: any;
}
declare module 'expo/src/LinearGradient.ios' {
declare module.exports: any;
}
declare module 'expo/src/Location' {
declare module.exports: any;
}
declare module 'expo/src/Logs' {
declare module 'expo/src/logs/__tests__/Logs-test' {
declare module.exports: any;
}
declare module 'expo/src/Modal/Modal' {
declare module 'expo/src/logs/__tests__/LogSerialization-test' {
declare module.exports: any;
}
declare module 'expo/src/Modal/ModalHost' {
declare module 'expo/src/logs/__tests__/RemoteConsole-test' {
declare module.exports: any;
}
declare module 'expo/src/Modal/ModalImplementation' {
declare module 'expo/src/logs/__tests__/RemoteLogging-test' {
declare module.exports: any;
}
declare module 'expo/src/Modal/PureContainer' {
declare module 'expo/src/logs/__tests__/RemoteLogs-test' {
declare module.exports: any;
}
declare module 'expo/src/logs/Logs' {
declare module.exports: any;
}
declare module 'expo/src/logs/LogSerialization' {
declare module.exports: any;
}
declare module 'expo/src/logs/RemoteConsole' {
declare module.exports: any;
}
declare module 'expo/src/logs/RemoteLogging' {
declare module.exports: any;
}
declare module 'expo/src/modal/Modal' {
declare module.exports: any;
}
declare module 'expo/src/modal/ModalHost' {
declare module.exports: any;
}
declare module 'expo/src/modal/ModalImplementation' {
declare module.exports: any;
}
declare module 'expo/src/modal/PureContainer' {
declare module.exports: any;
}
@@ -262,6 +366,10 @@ declare module 'expo/src/Notifications' {
declare module.exports: any;
}
declare module 'expo/src/OldBarCodeScanner' {
declare module.exports: any;
}
declare module 'expo/src/Payments' {
declare module.exports: any;
}
@@ -274,30 +382,6 @@ declare module 'expo/src/Permissions' {
declare module.exports: any;
}
declare module 'expo/src/registerRootComponent' {
declare module.exports: any;
}
declare module 'expo/src/RNAdMobBanner' {
declare module.exports: any;
}
declare module 'expo/src/RNAdMobInterstitial' {
declare module.exports: any;
}
declare module 'expo/src/RNAdMobRewarded' {
declare module.exports: any;
}
declare module 'expo/src/RNPublisherBanner' {
declare module.exports: any;
}
declare module 'expo/src/RootErrorBoundary' {
declare module.exports: any;
}
declare module 'expo/src/ScreenOrientation' {
declare module.exports: any;
}
@@ -374,11 +458,11 @@ declare module 'expo/src/takeSnapshotAsync' {
declare module.exports: any;
}
declare module 'expo/src/Util' {
declare module 'expo/src/timer/polyfillNextTick' {
declare module.exports: any;
}
declare module 'expo/src/Video' {
declare module 'expo/src/Util' {
declare module.exports: any;
}
@@ -398,6 +482,15 @@ declare module 'expo/tools/LogReporter' {
declare module 'expo/AppEntry.js' {
declare module.exports: $Exports<'expo/AppEntry'>;
}
declare module 'expo/flow/metro-bundler.js' {
declare module.exports: $Exports<'expo/flow/metro-bundler'>;
}
declare module 'expo/flow/react-native-gesture-handler.js' {
declare module.exports: $Exports<'expo/flow/react-native-gesture-handler'>;
}
declare module 'expo/src/__mocks__/Constants-development.js' {
declare module.exports: $Exports<'expo/src/__mocks__/Constants-development'>;
}
declare module 'expo/src/__tests__/Amplitude-test.js' {
declare module.exports: $Exports<'expo/src/__tests__/Amplitude-test'>;
}
@@ -416,6 +509,9 @@ declare module 'expo/src/__tests__/Expo-test.js' {
declare module 'expo/src/__tests__/Facebook-test.js' {
declare module.exports: $Exports<'expo/src/__tests__/Facebook-test'>;
}
declare module 'expo/src/__tests__/Font-test.js' {
declare module.exports: $Exports<'expo/src/__tests__/Font-test'>;
}
declare module 'expo/src/__tests__/Location-test.js' {
declare module.exports: $Exports<'expo/src/__tests__/Location-test'>;
}
@@ -431,41 +527,50 @@ declare module 'expo/src/__tests__/Segment-test.js' {
declare module 'expo/src/__tests__/WebBrowser-test.js' {
declare module.exports: $Exports<'expo/src/__tests__/WebBrowser-test'>;
}
declare module 'expo/src/admob/RNAdMobBanner.js' {
declare module.exports: $Exports<'expo/src/admob/RNAdMobBanner'>;
}
declare module 'expo/src/admob/RNAdMobInterstitial.js' {
declare module.exports: $Exports<'expo/src/admob/RNAdMobInterstitial'>;
}
declare module 'expo/src/admob/RNAdMobRewarded.js' {
declare module.exports: $Exports<'expo/src/admob/RNAdMobRewarded'>;
}
declare module 'expo/src/admob/RNPublisherBanner.js' {
declare module.exports: $Exports<'expo/src/admob/RNPublisherBanner'>;
}
declare module 'expo/src/Amplitude.js' {
declare module.exports: $Exports<'expo/src/Amplitude'>;
}
declare module 'expo/src/apisAreAvailable.js' {
declare module.exports: $Exports<'expo/src/apisAreAvailable'>;
}
declare module 'expo/src/AppLoading.js' {
declare module.exports: $Exports<'expo/src/AppLoading'>;
}
declare module 'expo/src/AppLoadingNativeWrapper.android.js' {
declare module.exports: $Exports<'expo/src/AppLoadingNativeWrapper.android'>;
}
declare module 'expo/src/AppLoadingNativeWrapper.ios.js' {
declare module.exports: $Exports<'expo/src/AppLoadingNativeWrapper.ios'>;
}
declare module 'expo/src/Asset.js' {
declare module.exports: $Exports<'expo/src/Asset'>;
}
declare module 'expo/src/Audio.js' {
declare module.exports: $Exports<'expo/src/Audio'>;
}
declare module 'expo/src/AuthSession.js' {
declare module.exports: $Exports<'expo/src/AuthSession'>;
}
declare module 'expo/src/AV.js' {
declare module.exports: $Exports<'expo/src/AV'>;
declare module 'expo/src/av/Audio.js' {
declare module.exports: $Exports<'expo/src/av/Audio'>;
}
declare module 'expo/src/BarCodeScanner.js' {
declare module.exports: $Exports<'expo/src/BarCodeScanner'>;
declare module 'expo/src/av/Audio/Recording.js' {
declare module.exports: $Exports<'expo/src/av/Audio/Recording'>;
}
declare module 'expo/src/BlurView.android.js' {
declare module.exports: $Exports<'expo/src/BlurView.android'>;
declare module 'expo/src/av/Audio/Sound.js' {
declare module.exports: $Exports<'expo/src/av/Audio/Sound'>;
}
declare module 'expo/src/BlurView.ios.js' {
declare module.exports: $Exports<'expo/src/BlurView.ios'>;
declare module 'expo/src/av/AV.js' {
declare module.exports: $Exports<'expo/src/av/AV'>;
}
declare module 'expo/src/av/Video.js' {
declare module.exports: $Exports<'expo/src/av/Video'>;
}
declare module 'expo/src/BarCodeScanner.android.js' {
declare module.exports: $Exports<'expo/src/BarCodeScanner.android'>;
}
declare module 'expo/src/BarCodeScanner.ios.js' {
declare module.exports: $Exports<'expo/src/BarCodeScanner.ios'>;
}
declare module 'expo/src/Brightness.js' {
declare module.exports: $Exports<'expo/src/Brightness'>;
@@ -473,6 +578,9 @@ declare module 'expo/src/Brightness.js' {
declare module 'expo/src/Camera.js' {
declare module.exports: $Exports<'expo/src/Camera'>;
}
declare module 'expo/src/CameraBasedBarCodeScanner.js' {
declare module.exports: $Exports<'expo/src/CameraBasedBarCodeScanner'>;
}
declare module 'expo/src/Constants.js' {
declare module.exports: $Exports<'expo/src/Constants'>;
}
@@ -485,32 +593,56 @@ declare module 'expo/src/DangerZone.js' {
declare module 'expo/src/DocumentPicker.js' {
declare module.exports: $Exports<'expo/src/DocumentPicker'>;
}
declare module 'expo/src/effects/BlurView.android.js' {
declare module.exports: $Exports<'expo/src/effects/BlurView.android'>;
}
declare module 'expo/src/effects/BlurView.ios.js' {
declare module.exports: $Exports<'expo/src/effects/BlurView.ios'>;
}
declare module 'expo/src/effects/LinearGradient.android.js' {
declare module.exports: $Exports<'expo/src/effects/LinearGradient.android'>;
}
declare module 'expo/src/effects/LinearGradient.ios.js' {
declare module.exports: $Exports<'expo/src/effects/LinearGradient.ios'>;
}
declare module 'expo/src/environment/__tests__/validate-test.js' {
declare module.exports: $Exports<'expo/src/environment/__tests__/validate-test'>;
}
declare module 'expo/src/environment/logging.js' {
declare module.exports: $Exports<'expo/src/environment/logging'>;
}
declare module 'expo/src/environment/validate.js' {
declare module.exports: $Exports<'expo/src/environment/validate'>;
}
declare module 'expo/src/ErrorRecovery.js' {
declare module.exports: $Exports<'expo/src/ErrorRecovery'>;
}
declare module 'expo/src/Expo.js' {
declare module.exports: $Exports<'expo/src/Expo'>;
}
declare module 'expo/src/facebook-ads/AdSettings.js' {
declare module.exports: $Exports<'expo/src/facebook-ads/AdSettings'>;
}
declare module 'expo/src/facebook-ads/BannerViewManager.js' {
declare module.exports: $Exports<'expo/src/facebook-ads/BannerViewManager'>;
}
declare module 'expo/src/facebook-ads/index.js' {
declare module.exports: $Exports<'expo/src/facebook-ads/index'>;
}
declare module 'expo/src/facebook-ads/InterstitialAdManager.js' {
declare module.exports: $Exports<'expo/src/facebook-ads/InterstitialAdManager'>;
}
declare module 'expo/src/facebook-ads/NativeAdsManager.js' {
declare module.exports: $Exports<'expo/src/facebook-ads/NativeAdsManager'>;
}
declare module 'expo/src/facebook-ads/withNativeAd.js' {
declare module.exports: $Exports<'expo/src/facebook-ads/withNativeAd'>;
}
declare module 'expo/src/Facebook.js' {
declare module.exports: $Exports<'expo/src/Facebook'>;
}
declare module 'expo/src/FacebookAds/AdSettings.js' {
declare module.exports: $Exports<'expo/src/FacebookAds/AdSettings'>;
}
declare module 'expo/src/FacebookAds/BannerViewManager.js' {
declare module.exports: $Exports<'expo/src/FacebookAds/BannerViewManager'>;
}
declare module 'expo/src/FacebookAds/index.js' {
declare module.exports: $Exports<'expo/src/FacebookAds/index'>;
}
declare module 'expo/src/FacebookAds/InterstitialAdManager.js' {
declare module.exports: $Exports<'expo/src/FacebookAds/InterstitialAdManager'>;
}
declare module 'expo/src/FacebookAds/NativeAdsManager.js' {
declare module.exports: $Exports<'expo/src/FacebookAds/NativeAdsManager'>;
}
declare module 'expo/src/FacebookAds/withNativeAd.js' {
declare module.exports: $Exports<'expo/src/FacebookAds/withNativeAd'>;
declare module 'expo/src/FaceDetector.js' {
declare module.exports: $Exports<'expo/src/FaceDetector'>;
}
declare module 'expo/src/FileSystem.js' {
declare module.exports: $Exports<'expo/src/FileSystem'>;
@@ -530,6 +662,9 @@ declare module 'expo/src/Google.js' {
declare module 'expo/src/Icon.js' {
declare module.exports: $Exports<'expo/src/Icon'>;
}
declare module 'expo/src/ImageManipulator.js' {
declare module.exports: $Exports<'expo/src/ImageManipulator'>;
}
declare module 'expo/src/ImagePicker.js' {
declare module.exports: $Exports<'expo/src/ImagePicker'>;
}
@@ -539,42 +674,72 @@ declare module 'expo/src/IntentLauncherAndroid.js' {
declare module 'expo/src/KeepAwake.js' {
declare module.exports: $Exports<'expo/src/KeepAwake'>;
}
declare module 'expo/src/LegacyAsyncStorage.android.js' {
declare module.exports: $Exports<'expo/src/LegacyAsyncStorage.android'>;
declare module 'expo/src/launch/AppLoading.js' {
declare module.exports: $Exports<'expo/src/launch/AppLoading'>;
}
declare module 'expo/src/LegacyAsyncStorage.ios.js' {
declare module.exports: $Exports<'expo/src/LegacyAsyncStorage.ios'>;
declare module 'expo/src/launch/AppLoadingNativeWrapper.android.js' {
declare module.exports: $Exports<'expo/src/launch/AppLoadingNativeWrapper.android'>;
}
declare module 'expo/src/launch/AppLoadingNativeWrapper.ios.js' {
declare module.exports: $Exports<'expo/src/launch/AppLoadingNativeWrapper.ios'>;
}
declare module 'expo/src/launch/registerRootComponent.js' {
declare module.exports: $Exports<'expo/src/launch/registerRootComponent'>;
}
declare module 'expo/src/launch/RootErrorBoundary.js' {
declare module.exports: $Exports<'expo/src/launch/RootErrorBoundary'>;
}
declare module 'expo/src/lib/Queue.js' {
declare module.exports: $Exports<'expo/src/lib/Queue'>;
}
declare module 'expo/src/LinearGradient.android.js' {
declare module.exports: $Exports<'expo/src/LinearGradient.android'>;
}
declare module 'expo/src/LinearGradient.ios.js' {
declare module.exports: $Exports<'expo/src/LinearGradient.ios'>;
}
declare module 'expo/src/Location.js' {
declare module.exports: $Exports<'expo/src/Location'>;
}
declare module 'expo/src/Logs.js' {
declare module.exports: $Exports<'expo/src/Logs'>;
declare module 'expo/src/logs/__tests__/Logs-test.js' {
declare module.exports: $Exports<'expo/src/logs/__tests__/Logs-test'>;
}
declare module 'expo/src/Modal/Modal.js' {
declare module.exports: $Exports<'expo/src/Modal/Modal'>;
declare module 'expo/src/logs/__tests__/LogSerialization-test.js' {
declare module.exports: $Exports<'expo/src/logs/__tests__/LogSerialization-test'>;
}
declare module 'expo/src/Modal/ModalHost.js' {
declare module.exports: $Exports<'expo/src/Modal/ModalHost'>;
declare module 'expo/src/logs/__tests__/RemoteConsole-test.js' {
declare module.exports: $Exports<'expo/src/logs/__tests__/RemoteConsole-test'>;
}
declare module 'expo/src/Modal/ModalImplementation.js' {
declare module.exports: $Exports<'expo/src/Modal/ModalImplementation'>;
declare module 'expo/src/logs/__tests__/RemoteLogging-test.js' {
declare module.exports: $Exports<'expo/src/logs/__tests__/RemoteLogging-test'>;
}
declare module 'expo/src/Modal/PureContainer.js' {
declare module.exports: $Exports<'expo/src/Modal/PureContainer'>;
declare module 'expo/src/logs/__tests__/RemoteLogs-test.js' {
declare module.exports: $Exports<'expo/src/logs/__tests__/RemoteLogs-test'>;
}
declare module 'expo/src/logs/Logs.js' {
declare module.exports: $Exports<'expo/src/logs/Logs'>;
}
declare module 'expo/src/logs/LogSerialization.js' {
declare module.exports: $Exports<'expo/src/logs/LogSerialization'>;
}
declare module 'expo/src/logs/RemoteConsole.js' {
declare module.exports: $Exports<'expo/src/logs/RemoteConsole'>;
}
declare module 'expo/src/logs/RemoteLogging.js' {
declare module.exports: $Exports<'expo/src/logs/RemoteLogging'>;
}
declare module 'expo/src/modal/Modal.js' {
declare module.exports: $Exports<'expo/src/modal/Modal'>;
}
declare module 'expo/src/modal/ModalHost.js' {
declare module.exports: $Exports<'expo/src/modal/ModalHost'>;
}
declare module 'expo/src/modal/ModalImplementation.js' {
declare module.exports: $Exports<'expo/src/modal/ModalImplementation'>;
}
declare module 'expo/src/modal/PureContainer.js' {
declare module.exports: $Exports<'expo/src/modal/PureContainer'>;
}
declare module 'expo/src/Notifications.js' {
declare module.exports: $Exports<'expo/src/Notifications'>;
}
declare module 'expo/src/OldBarCodeScanner.js' {
declare module.exports: $Exports<'expo/src/OldBarCodeScanner'>;
}
declare module 'expo/src/Payments.js' {
declare module.exports: $Exports<'expo/src/Payments'>;
}
@@ -584,24 +749,6 @@ declare module 'expo/src/Pedometer.js' {
declare module 'expo/src/Permissions.js' {
declare module.exports: $Exports<'expo/src/Permissions'>;
}
declare module 'expo/src/registerRootComponent.js' {
declare module.exports: $Exports<'expo/src/registerRootComponent'>;
}
declare module 'expo/src/RNAdMobBanner.js' {
declare module.exports: $Exports<'expo/src/RNAdMobBanner'>;
}
declare module 'expo/src/RNAdMobInterstitial.js' {
declare module.exports: $Exports<'expo/src/RNAdMobInterstitial'>;
}
declare module 'expo/src/RNAdMobRewarded.js' {
declare module.exports: $Exports<'expo/src/RNAdMobRewarded'>;
}
declare module 'expo/src/RNPublisherBanner.js' {
declare module.exports: $Exports<'expo/src/RNPublisherBanner'>;
}
declare module 'expo/src/RootErrorBoundary.js' {
declare module.exports: $Exports<'expo/src/RootErrorBoundary'>;
}
declare module 'expo/src/ScreenOrientation.js' {
declare module.exports: $Exports<'expo/src/ScreenOrientation'>;
}
@@ -659,12 +806,12 @@ declare module 'expo/src/Svg.js' {
declare module 'expo/src/takeSnapshotAsync.js' {
declare module.exports: $Exports<'expo/src/takeSnapshotAsync'>;
}
declare module 'expo/src/timer/polyfillNextTick.js' {
declare module.exports: $Exports<'expo/src/timer/polyfillNextTick'>;
}
declare module 'expo/src/Util.js' {
declare module.exports: $Exports<'expo/src/Util'>;
}
declare module 'expo/src/Video.js' {
declare module.exports: $Exports<'expo/src/Video'>;
}
declare module 'expo/src/WebBrowser.js' {
declare module.exports: $Exports<'expo/src/WebBrowser'>;
}

View File

@@ -1,5 +1,5 @@
// flow-typed signature: 72ab5b9c7dcb88b82de627702a0db27a
// flow-typed version: <<STUB>>/jest-expo_v^22.0.0/flow_v0.53.0
// flow-typed signature: b1e3826a494aecf4ff482336321b54bd
// flow-typed version: <<STUB>>/jest-expo_v^24.0.0/flow_v0.61.0
/**
* This is an autogenerated libdef stub for:

View File

@@ -1,8 +1,8 @@
// flow-typed signature: a0369c11661f437ec4ccdd805579ddcf
// flow-typed version: c4b9fea7c9/jest_v20.x.x/flow_>=v0.33.x
// flow-typed signature: 107cf7068b8835594e97f938e8848244
// flow-typed version: 8b4dd96654/jest_v21.x.x/flow_>=v0.39.x
type JestMockFn = {
(...args: Array<any>): any,
type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
(...args: TArguments): TReturn,
/**
* An object for introspecting mock calls
*/
@@ -12,24 +12,24 @@ type JestMockFn = {
* function. Each call is represented by an array of arguments that were
* passed during the call.
*/
calls: Array<Array<any>>,
calls: Array<TArguments>,
/**
* An array that contains all the object instances that have been
* instantiated from this mock function.
*/
instances: mixed
instances: Array<TReturn>
},
/**
* Resets all information stored in the mockFn.mock.calls and
* mockFn.mock.instances arrays. Often this is useful when you want to clean
* up a mock's usage data between two assertions.
*/
mockClear(): Function,
mockClear(): void,
/**
* Resets all information stored in the mock. This is useful when you want to
* completely restore a mock back to its initial state.
*/
mockReset(): Function,
mockReset(): void,
/**
* Removes the mock and restores the initial implementation. This is useful
* when you want to mock functions in certain test cases and restore the
@@ -37,20 +37,24 @@ type JestMockFn = {
* works when mock was created with jest.spyOn. Thus you have to take care of
* restoration yourself when manually assigning jest.fn().
*/
mockRestore(): Function,
mockRestore(): void,
/**
* Accepts a function that should be used as the implementation of the mock.
* The mock itself will still record all calls that go into and instances
* that come from itself -- the only difference is that the implementation
* will also be executed when the mock is called.
*/
mockImplementation(fn: Function): JestMockFn,
mockImplementation(
fn: (...args: TArguments) => TReturn
): JestMockFn<TArguments, TReturn>,
/**
* Accepts a function that will be used as an implementation of the mock for
* one call to the mocked function. Can be chained so that multiple function
* calls produce different results.
*/
mockImplementationOnce(fn: Function): JestMockFn,
mockImplementationOnce(
fn: (...args: TArguments) => TReturn
): JestMockFn<TArguments, TReturn>,
/**
* Just a simple sugar function for returning `this`
*/
@@ -58,11 +62,11 @@ type JestMockFn = {
/**
* Deprecated: use jest.fn(() => value) instead
*/
mockReturnValue(value: any): JestMockFn,
mockReturnValue(value: TReturn): JestMockFn<TArguments, TReturn>,
/**
* Sugar for only returning a value once inside your mock
*/
mockReturnValueOnce(value: any): JestMockFn
mockReturnValueOnce(value: TReturn): JestMockFn<TArguments, TReturn>
};
type JestAsymmetricEqualityType = {
@@ -129,7 +133,7 @@ type EnzymeMatchersType = {
toIncludeText(text: string): void,
toHaveValue(value: any): void,
toMatchElement(element: React$Element<any>): void,
toMatchSelector(selector: string): void,
toMatchSelector(selector: string): void
};
type JestExpectType = {
@@ -254,7 +258,7 @@ type JestExpectType = {
/**
* Use .toMatchObject to check that a javascript object matches a subset of the properties of an object.
*/
toMatchObject(object: Object): void,
toMatchObject(object: Object | Array<Object>): void,
/**
* This ensures that a React component matches the most recent snapshot.
*/
@@ -267,8 +271,8 @@ type JestExpectType = {
*
* Alias: .toThrowError
*/
toThrow(message?: string | Error | RegExp): void,
toThrowError(message?: string | Error | RegExp): void,
toThrow(message?: string | Error | Class<Error> | RegExp): void,
toThrowError(message?: string | Error | Class<Error> | RegExp): void,
/**
* Use .toThrowErrorMatchingSnapshot to test that a function throws a error
* matching the most recent snapshot when it is called.
@@ -324,7 +328,9 @@ type JestObjectType = {
* Returns a new, unused mock function. Optionally takes a mock
* implementation.
*/
fn(implementation?: Function): JestMockFn,
fn<TArguments: $ReadOnlyArray<*>, TReturn>(
implementation?: (...args: TArguments) => TReturn
): JestMockFn<TArguments, TReturn>,
/**
* Determines if the given function is a mocked function.
*/
@@ -348,6 +354,16 @@ type JestObjectType = {
moduleFactory?: any,
options?: Object
): JestObjectType,
/**
* Returns the actual module instead of a mock, bypassing all checks on
* whether the module should receive a mock implementation or not.
*/
requireActual(moduleName: string): any,
/**
* Returns a mock module instead of the actual module, bypassing all checks
* on whether the module should be required normally or not.
*/
requireMock(moduleName: string): any,
/**
* Resets the module registry - the cache of all required modules. This is
* useful to isolate modules where local state might conflict between tests.
@@ -404,7 +420,12 @@ type JestObjectType = {
* Creates a mock function similar to jest.fn but also tracks calls to
* object[methodName].
*/
spyOn(object: Object, methodName: string): JestMockFn
spyOn(object: Object, methodName: string): JestMockFn<any, any>,
/**
* Set the default timeout interval for tests and before/after hooks in milliseconds.
* Note: The default timeout interval is 5 seconds if this method is not called.
*/
setTimeout(timeout: number): JestObjectType
};
type JestSpyType = {
@@ -412,33 +433,44 @@ type JestSpyType = {
};
/** Runs this function after every test inside this context */
declare function afterEach(fn: Function): void;
declare function afterEach(
fn: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void;
/** Runs this function before every test inside this context */
declare function beforeEach(fn: Function): void;
declare function beforeEach(
fn: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void;
/** Runs this function after all tests have finished inside this context */
declare function afterAll(fn: Function): void;
declare function afterAll(
fn: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void;
/** Runs this function before any tests have started inside this context */
declare function beforeAll(fn: Function): void;
declare function beforeAll(
fn: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void;
/** A context for grouping tests together */
declare var describe: {
/**
* Creates a block that groups together several related tests in one "test suite"
*/
(name: string, fn: Function): void,
(name: string, fn: () => void): void,
/**
* Only run this describe block
*/
only(name: string, fn: Function): void,
only(name: string, fn: () => void): void,
/**
* Skip running this describe block
*/
skip(name: string, fn: Function): void,
skip(name: string, fn: () => void): void
};
/** An individual test unit */
declare var it: {
/**
@@ -446,31 +478,55 @@ declare var it: {
*
* @param {string} Name of Test
* @param {Function} Test
* @param {number} Timeout for the test, in milliseconds.
*/
(name: string, fn?: Function): ?Promise<void>,
(
name: string,
fn?: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void,
/**
* Only run this test
*
* @param {string} Name of Test
* @param {Function} Test
* @param {number} Timeout for the test, in milliseconds.
*/
only(name: string, fn?: Function): ?Promise<void>,
only(
name: string,
fn?: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void,
/**
* Skip running this test
*
* @param {string} Name of Test
* @param {Function} Test
* @param {number} Timeout for the test, in milliseconds.
*/
skip(name: string, fn?: Function): ?Promise<void>,
skip(
name: string,
fn?: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void,
/**
* Run the test concurrently
*
* @param {string} Name of Test
* @param {Function} Test
* @param {number} Timeout for the test, in milliseconds.
*/
concurrent(name: string, fn?: Function): ?Promise<void>
concurrent(
name: string,
fn?: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void
};
declare function fit(name: string, fn: Function): ?Promise<void>;
declare function fit(
name: string,
fn: (done: () => void) => ?Promise<mixed>,
timeout?: number
): void;
/** An individual test unit */
declare var test: typeof it;
/** A disabled group of tests */
@@ -509,7 +565,7 @@ declare function spyOn(value: mixed, method: string): Object;
declare var jest: JestObjectType;
/**
* The global Jamine object, this is generally not exposed as the public API,
* The global Jasmine object, this is generally not exposed as the public API,
* using features inside here could break in later versions of Jest.
*/
declare var jasmine: {

View File

@@ -1,5 +1,5 @@
// flow-typed signature: bd52927dcfdd08c54751906ebaf7cfa1
// flow-typed version: <<STUB>>/react-native-scripts_v^1.3.1/flow_v0.53.0
// flow-typed signature: 42d8cd2e84e894c09d28f891fef9f01d
// flow-typed version: <<STUB>>/react-native-scripts_v^1.5.0/flow_v0.61.0
/**
* This is an autogenerated libdef stub for:

View File

@@ -0,0 +1,62 @@
// flow-typed signature: 2d946f2ec4aba5210b19d053c411a59d
// flow-typed version: 95b3e05165/react-test-renderer_v16.x.x/flow_>=v0.47.x
// Type definitions for react-test-renderer 16.x.x
// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer
type ReactTestRendererJSON = {
type: string,
props: { [propName: string]: any },
children: null | ReactTestRendererJSON[]
};
type ReactTestRendererTree = ReactTestRendererJSON & {
nodeType: "component" | "host",
instance: any,
rendered: null | ReactTestRendererTree
};
type ReactTestInstance = {
instance: any,
type: string,
props: { [propName: string]: any },
parent: null | ReactTestInstance,
children: Array<ReactTestInstance | string>,
find(predicate: (node: ReactTestInstance) => boolean): ReactTestInstance,
findByType(type: React$ElementType): ReactTestInstance,
findByProps(props: { [propName: string]: any }): ReactTestInstance,
findAll(
predicate: (node: ReactTestInstance) => boolean,
options?: { deep: boolean }
): ReactTestInstance[],
findAllByType(
type: React$ElementType,
options?: { deep: boolean }
): ReactTestInstance[],
findAllByProps(
props: { [propName: string]: any },
options?: { deep: boolean }
): ReactTestInstance[]
};
type ReactTestRenderer = {
toJSON(): null | ReactTestRendererJSON,
toTree(): null | ReactTestRendererTree,
unmount(nextElement?: React$Element<any>): void,
update(nextElement: React$Element<any>): void,
getInstance(): null | ReactTestInstance,
root: ReactTestInstance
};
type TestRendererOptions = {
createNodeMock(element: React$Element<any>): any
};
declare module "react-test-renderer" {
declare function create(
nextElement: React$Element<any>,
options?: TestRendererOptions
): ReactTestRenderer;
}

View File

@@ -2,12 +2,19 @@
* @flow
*/
import React from 'react';
import type { NavigationScreenProp, EventListener } from 'react-navigation';
import * as React from 'react';
import { Button, ScrollView, StatusBar } from 'react-native';
import { StackNavigator, SafeAreaView } from 'react-navigation';
import SampleText from './SampleText';
class MyNavScreen extends React.Component {
type MyNavScreenProps = {
navigation: NavigationScreenProp<*>,
banner: React.Node,
};
class MyNavScreen extends React.Component<MyNavScreenProps> {
render() {
const { navigation, banner } = this.props;
return (
@@ -28,10 +35,19 @@ class MyNavScreen extends React.Component {
}
}
class MyHomeScreen extends React.Component {
type MyHomeScreenProps = {
navigation: NavigationScreenProp<*>,
};
class MyHomeScreen extends React.Component<MyHomeScreenProps> {
static navigationOptions = {
title: 'Welcome',
};
_s0: EventListener;
_s1: EventListener;
_s2: EventListener;
_s3: EventListener;
componentDidMount() {
this._s0 = this.props.navigation.addListener('willFocus', this._onWF);
this._s1 = this.props.navigation.addListener('didFocus', this._onDF);
@@ -63,10 +79,18 @@ class MyHomeScreen extends React.Component {
}
}
class MyPhotosScreen extends React.Component {
type MyPhotosScreenProps = {
navigation: NavigationScreenProp<*>,
};
class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
static navigationOptions = {
title: 'Photos',
};
_s0: EventListener;
_s1: EventListener;
_s2: EventListener;
_s3: EventListener;
componentDidMount() {
this._s0 = this.props.navigation.addListener('willFocus', this._onWF);
this._s1 = this.props.navigation.addListener('didFocus', this._onDF);

View File

@@ -2,6 +2,8 @@
* @flow
*/
import type { NavigationScreenProp, EventListener } from 'react-navigation';
import React from 'react';
import { Button, Platform, ScrollView, StatusBar, View } from 'react-native';
import { SafeAreaView, TabNavigator } from 'react-navigation';
@@ -114,8 +116,17 @@ const SimpleTabs = TabNavigator(
}
);
class SimpleTabsContainer extends React.Component {
type SimpleTabsContainerProps = {
navigation: NavigationScreenProp<*>,
};
class SimpleTabsContainer extends React.Component<SimpleTabsContainerProps> {
static router = SimpleTabs.router;
_s0: EventListener;
_s1: EventListener;
_s2: EventListener;
_s3: EventListener;
componentDidMount() {
this._s0 = this.props.navigation.addListener('willFocus', this._onWF);
this._s1 = this.props.navigation.addListener('didFocus', this._onDF);

View File

@@ -12,13 +12,13 @@
},
"dependencies": {
"expo": "^24.0.2",
"react": "16.0.0",
"react-native": "^0.51.0",
"react": "16.2.0",
"react-native": "^0.52.0",
"react-navigation": "link:../.."
},
"devDependencies": {
"babel-jest": "^21.0.0",
"flow-bin": "^0.56.0",
"flow-bin": "^0.61.0",
"jest": "^21.0.1",
"jest-expo": "^24.0.0",
"react-native-scripts": "^1.5.0",

View File

@@ -398,7 +398,7 @@ babel-core@^6.0.0, babel-core@^6.24.1, babel-core@^6.26.0, babel-core@^6.7.2:
slash "^1.0.0"
source-map "^0.5.6"
babel-generator@^6.18.0, babel-generator@^6.24.1, babel-generator@^6.26.0:
babel-generator@^6.18.0, babel-generator@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5"
dependencies:
@@ -1388,10 +1388,14 @@ combined-stream@^1.0.5, combined-stream@~1.0.5:
dependencies:
delayed-stream "~1.0.0"
commander@^2.9.0, commander@~2.12.1:
commander@^2.9.0:
version "2.12.2"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555"
commander@~2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
component-emitter@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
@@ -1474,6 +1478,15 @@ connect@^2.8.3:
utils-merge "1.0.0"
vhost "~3.0.1"
connect@^3.6.5:
version "3.6.5"
resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.5.tgz#fb8dde7ba0763877d0ec9df9dac0b4b40e72c7da"
dependencies:
debug "2.6.9"
finalhandler "1.0.6"
parseurl "~1.3.2"
utils-merge "1.0.1"
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
@@ -1734,6 +1747,10 @@ detect-libc@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
detect-newline@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2"
diff@^3.2.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c"
@@ -1897,6 +1914,10 @@ event-target-shim@^1.0.5:
version "1.1.1"
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-1.1.1.tgz#a86e5ee6bdaa16054475da797ccddf0c55698491"
eventemitter3@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.0.0.tgz#fc29ecf233bd19fbd527bb4089bbf665dc90c1e3"
exec-async@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/exec-async/-/exec-async-2.2.0.tgz#c7c5ad2eef3478d38390c6dd3acfe8af0efc8301"
@@ -2148,6 +2169,18 @@ finalhandler@0.4.0:
on-finished "~2.3.0"
unpipe "~1.0.0"
finalhandler@1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.6.tgz#007aea33d1a4d3e42017f624848ad58d212f814f"
dependencies:
debug "2.6.9"
encodeurl "~1.0.1"
escape-html "~1.0.3"
on-finished "~2.3.0"
parseurl "~1.3.2"
statuses "~1.3.1"
unpipe "~1.0.0"
finalhandler@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5"
@@ -2180,9 +2213,9 @@ find-up@^2.0.0, find-up@^2.1.0:
dependencies:
locate-path "^2.0.0"
flow-bin@^0.56.0:
version "0.56.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.56.0.tgz#ce43092203a344ba9bf63c0cabe95d95145f6cad"
flow-bin@^0.61.0:
version "0.61.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.61.0.tgz#d0473a8c35dbbf4de573823f4932124397d32d35"
follow-redirects@^1.2.3:
version "1.2.6"
@@ -2399,7 +2432,7 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2:
once "^1.3.0"
path-is-absolute "^1.0.0"
global@^4.3.0, global@^4.3.2:
global@^4.3.0:
version "4.3.2"
resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f"
dependencies:
@@ -3045,7 +3078,13 @@ jest-diff@^21.2.1:
jest-get-type "^21.2.0"
pretty-format "^21.2.1"
jest-docblock@^21, jest-docblock@^21.2.0:
jest-docblock@22.1.0, jest-docblock@^22.1.0:
version "22.1.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.1.0.tgz#3fe5986d5444cbcb149746eb4b07c57c5a464dfd"
dependencies:
detect-newline "^2.1.0"
jest-docblock@^21.2.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"
@@ -3077,7 +3116,18 @@ jest-get-type@^21.2.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23"
jest-haste-map@^21, jest-haste-map@^21.2.0:
jest-haste-map@22.1.0:
version "22.1.0"
resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-22.1.0.tgz#1174c6ff393f9818ebf1163710d8868b5370da2a"
dependencies:
fb-watchman "^2.0.0"
graceful-fs "^4.1.11"
jest-docblock "^22.1.0"
jest-worker "^22.1.0"
micromatch "^2.3.11"
sane "^2.0.0"
jest-haste-map@^21.2.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-21.2.0.tgz#1363f0a8bb4338f24f001806571eff7a4b2ff3d8"
dependencies:
@@ -3208,6 +3258,12 @@ jest-validate@^21.2.1:
leven "^2.1.0"
pretty-format "^21.2.1"
jest-worker@22.1.0, jest-worker@^22.1.0:
version "22.1.0"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-22.1.0.tgz#0987832fe58fbdc205357f4c19b992446368cafb"
dependencies:
merge-stream "^1.0.1"
jest@^21.0.1, jest@^21.2.1:
version "21.2.1"
resolved "https://registry.yarnpkg.com/jest/-/jest-21.2.1.tgz#c964e0b47383768a1438e3ccf3c3d470327604e1"
@@ -3561,6 +3617,10 @@ lodash.templatesettings@^3.0.0:
lodash._reinterpolate "^3.0.0"
lodash.escape "^3.0.0"
lodash.throttle@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
lodash.zipobject@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/lodash.zipobject/-/lodash.zipobject-4.1.3.tgz#b399f5aba8ff62a746f6979bf20b214f964dbef8"
@@ -3708,14 +3768,26 @@ methods@^1.1.1, methods@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
metro-bundler@^0.20.0:
version "0.20.3"
resolved "https://registry.yarnpkg.com/metro-bundler/-/metro-bundler-0.20.3.tgz#0ded01b64e8963117017b106f75b83cfc34f3656"
metro-core@0.24.7, metro-core@^0.24.1:
version "0.24.7"
resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.24.7.tgz#89e4fbea5bad574eb971459ebfa74c028f52d278"
dependencies:
lodash.throttle "^4.1.1"
metro-source-map@0.24.7:
version "0.24.7"
resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.24.7.tgz#b13d0ae6417c2a2cd3d521ae6cd898196748ec0b"
dependencies:
source-map "^0.5.6"
metro@^0.24.1:
version "0.24.7"
resolved "https://registry.yarnpkg.com/metro/-/metro-0.24.7.tgz#42cecdb236b702d16243812294f7d3b97c43378d"
dependencies:
absolute-path "^0.0.0"
async "^2.4.0"
babel-core "^6.24.1"
babel-generator "^6.24.1"
babel-generator "^6.26.0"
babel-plugin-external-helpers "^6.18.0"
babel-preset-es2015-node "^6.1.1"
babel-preset-fbjs "^2.1.4"
@@ -3724,30 +3796,39 @@ metro-bundler@^0.20.0:
babylon "^6.18.0"
chalk "^1.1.1"
concat-stream "^1.6.0"
connect "^3.6.5"
core-js "^2.2.2"
debug "^2.2.0"
denodeify "^1.2.1"
eventemitter3 "^3.0.0"
fbjs "^0.8.14"
fs-extra "^1.0.0"
graceful-fs "^4.1.3"
image-size "^0.6.0"
jest-docblock "^21"
jest-haste-map "^21"
jest-docblock "22.1.0"
jest-haste-map "22.1.0"
jest-worker "22.1.0"
json-stable-stringify "^1.0.1"
json5 "^0.4.0"
left-pad "^1.1.3"
lodash "^4.16.6"
lodash.throttle "^4.1.1"
merge-stream "^1.0.1"
metro-core "0.24.7"
metro-source-map "0.24.7"
mime-types "2.1.11"
mkdirp "^0.5.1"
request "^2.79.0"
rimraf "^2.5.4"
serialize-error "^2.1.0"
source-map "^0.5.6"
temp "0.8.3"
throat "^4.1.0"
uglify-es "^3.1.8"
uglify-es "^3.1.9"
wordwrap "^1.0.0"
write-file-atomic "^1.2.0"
ws "^1.1.0"
xpipe "^1.0.5"
yargs "^9.0.0"
micromatch@^2.1.5, micromatch@^2.3.11:
version "2.3.11"
@@ -4547,9 +4628,9 @@ react-deep-force-update@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz#bcd31478027b64b3339f108921ab520b4313dc2c"
react-devtools-core@^2.5.0:
version "2.5.2"
resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-2.5.2.tgz#f97bec5afae5d9318d16778065e0c214c4d5714c"
react-devtools-core@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-3.0.0.tgz#f683e19f0311108f97dbb5b29d948323a1bf7c03"
dependencies:
shell-quote "^1.6.1"
ws "^2.0.3"
@@ -4631,9 +4712,9 @@ react-native-vector-icons@4.4.2:
prop-types "^15.5.10"
yargs "^8.0.2"
react-native@^0.51.0:
version "0.51.0"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.51.0.tgz#fe25934b3030fd323f3ca1a70f034133465955ed"
react-native@^0.52.0:
version "0.52.1"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.52.1.tgz#68ca222f9c6a9bbe4a6f95896a5f9611c1311c31"
dependencies:
absolute-path "^0.0.0"
art "^0.10.0"
@@ -4662,7 +4743,8 @@ react-native@^0.51.0:
graceful-fs "^4.1.3"
inquirer "^3.0.6"
lodash "^4.16.6"
metro-bundler "^0.20.0"
metro "^0.24.1"
metro-core "^0.24.1"
mime "^1.3.4"
minimist "^1.2.0"
mkdirp "^0.5.1"
@@ -4676,7 +4758,7 @@ react-native@^0.51.0:
promise "^7.1.1"
prop-types "^15.5.8"
react-clone-referenced-element "^1.0.1"
react-devtools-core "^2.5.0"
react-devtools-core "3.0.0"
react-timer-mixin "^0.13.2"
regenerator-runtime "^0.11.0"
rimraf "^2.5.4"
@@ -4729,9 +4811,9 @@ react-transform-hmr@^1.0.4:
global "^4.3.0"
react-proxy "^1.1.7"
react@16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d"
react@16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
@@ -5120,6 +5202,10 @@ sentence-case@^1.1.1, sentence-case@^1.1.2:
dependencies:
lower-case "^1.1.1"
serialize-error@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a"
serve-favicon@~2.3.0:
version "2.3.2"
resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.3.2.tgz#dd419e268de012ab72b319d337f2105013f9381f"
@@ -5686,11 +5772,11 @@ ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
uglify-es@^3.1.8:
version "3.2.2"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.2.2.tgz#15c62b7775002c81b7987a1c49ecd3f126cace73"
uglify-es@^3.1.9:
version "3.3.8"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.8.tgz#f2c68e6cff0d0f9dc9577e4da207151c2e753b7e"
dependencies:
commander "~2.12.1"
commander "~2.13.0"
source-map "~0.6.1"
uglify-js@^2.6:

View File

@@ -0,0 +1,574 @@
/* @flow */
import * as React from 'react';
import type { StyleObj } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
import { Animated } from 'react-native';
export type ViewStyleProp = StyleObj;
export type TextStyleProp = StyleObj;
export type AnimatedViewStyleProp = $PropertyType<
$PropertyType<Animated.View, 'props'>,
'style'
>;
export type AnimatedTextStyleProp = $PropertyType<
$PropertyType<Animated.Text, 'props'>,
'style'
>;
/**
* Navigation State + Action
*/
export type NavigationParams = {
[key: string]: mixed,
};
export type NavigationNavigateAction = {|
type: 'Navigation/NAVIGATE',
routeName: string,
params?: NavigationParams,
// The action to run inside the sub-router
action?: NavigationNavigateAction,
|};
export type DeprecatedNavigationNavigateAction = {|
type: 'Navigate',
routeName: string,
params?: NavigationParams,
// The action to run inside the sub-router
action?: NavigationNavigateAction | DeprecatedNavigationNavigateAction,
|};
export type NavigationBackAction = {|
type: 'Navigation/BACK',
key?: ?string,
|};
export type DeprecatedNavigationBackAction = {|
type: 'Back',
key?: ?string,
|};
export type NavigationSetParamsAction = {|
type: 'Navigation/SET_PARAMS',
// The key of the route where the params should be set
key: string,
// The new params to merge into the existing route params
params: NavigationParams,
|};
export type DeprecatedNavigationSetParamsAction = {|
type: 'SetParams',
// The key of the route where the params should be set
key: string,
// The new params to merge into the existing route params
params: NavigationParams,
|};
export type NavigationInitAction = {|
type: 'Navigation/INIT',
params?: NavigationParams,
|};
export type DeprecatedNavigationInitAction = {|
type: 'Init',
params?: NavigationParams,
|};
export type NavigationResetAction = {|
type: 'Navigation/RESET',
index: number,
key?: ?string,
actions: Array<NavigationNavigateAction>,
|};
export type DeprecatedNavigationResetAction = {|
type: 'Reset',
index: number,
key?: ?string,
actions: Array<NavigationNavigateAction | DeprecatedNavigationNavigateAction>,
|};
export type NavigationUriAction = {|
type: 'Navigation/URI',
uri: string,
|};
export type DeprecatedNavigationUriAction = {|
type: 'Uri',
uri: string,
|};
export type NavigationAction =
| NavigationInitAction
| NavigationNavigateAction
| NavigationBackAction
| NavigationSetParamsAction
| NavigationResetAction;
export type DeprecatedNavigationAction =
| DeprecatedNavigationInitAction
| DeprecatedNavigationNavigateAction
| DeprecatedNavigationBackAction
| DeprecatedNavigationSetParamsAction
| DeprecatedNavigationResetAction;
export type PossiblyDeprecatedNavigationAction =
| NavigationAction
| DeprecatedNavigationAction;
/**
* NavigationState is a tree of routes for a single navigator, where each child
* route may either be a NavigationScreenRoute or a NavigationRouterRoute.
* NavigationScreenRoute represents a leaf screen, while the
* NavigationRouterRoute represents the state of a child navigator.
*
* NOTE: NavigationState is a state tree local to a single navigator and
* its child navigators (via the routes field).
* If we're in navigator nested deep inside the app, the state will only be the
* state for that navigator.
* The state for the root navigator of our app represents the whole navigation
* state for the whole app.
*/
export type NavigationState = {
/**
* Index refers to the active child route in the routes array.
*/
index: number,
routes: Array<NavigationRoute>,
};
export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute;
export type NavigationLeafRoute = {
/**
* React's key used by some navigators. No need to specify these manually,
* they will be defined by the router.
*/
key: string,
/**
* For example 'Home'.
* This is used as a key in a route config when creating a navigator.
*/
routeName: string,
/**
* Path is an advanced feature used for deep linking and on the web.
*/
path?: string,
/**
* Params passed to this route when navigating to it,
* e.g. `{ car_id: 123 }` in a route that displays a car.
*/
params?: NavigationParams,
};
export type NavigationStateRoute = NavigationLeafRoute & NavigationState;
/**
* Router
*/
export type NavigationScreenOptionsGetter<Options: {}> = (
navigation: NavigationScreenProp<NavigationRoute>,
screenProps?: {}
) => Options;
export type NavigationRouter<State: NavigationState, Options: {}> = {
/**
* The reducer that outputs the new navigation state for a given action, with
* an optional previous state. When the action is considered handled but the
* state is unchanged, the output state is null.
*/
getStateForAction: (action: NavigationAction, lastState: ?State) => ?State,
/**
* Maps a URI-like string to an action. This can be mapped to a state
* using `getStateForAction`.
*/
getActionForPathAndParams: (
path: string,
params?: NavigationParams
) => ?NavigationAction,
getPathAndParamsForState: (
state: State
) => {
path: string,
params?: NavigationParams,
},
getComponentForRouteName: (routeName: string) => NavigationComponent,
getComponentForState: (state: State) => NavigationComponent,
/**
* Gets the screen navigation options for a given screen.
*
* For example, we could get the config for the 'Foo' screen when the
* `navigation.state` is:
*
* {routeName: 'Foo', key: '123'}
*/
getScreenOptions: NavigationScreenOptionsGetter<Options>,
};
export type NavigationScreenDetails<T> = {
options: T,
state: NavigationRoute,
navigation: NavigationScreenProp<NavigationRoute>,
};
export type NavigationScreenOptions = {
title?: string,
};
export type NavigationScreenConfigProps = {
navigation: NavigationScreenProp<NavigationRoute>,
screenProps: {},
};
export type NavigationScreenConfig<Options> =
| Options
| (({
...$Exact<NavigationScreenConfigProps>,
navigationOptions: Options,
}) => Options);
export type NavigationComponent =
| NavigationScreenComponent<NavigationRoute, *, *>
| NavigationNavigator<NavigationStateRoute, *, *>;
export type NavigationScreenComponent<
Route: NavigationRoute,
Options: {},
Props: {}
> = React.ComponentType<NavigationNavigatorProps<Options, Route> & Props> & {
router?: void,
navigationOptions?: NavigationScreenConfig<Options>,
};
export type NavigationNavigator<
State: NavigationState,
Options: {},
Props: {}
> = React.ComponentType<NavigationNavigatorProps<Options, State> & Props> & {
router: NavigationRouter<State, Options>,
navigationOptions?: ?NavigationScreenConfig<Options>,
};
export type NavigationRouteConfig<T: {}> = {
...$Exact<T>,
navigationOptions?: NavigationScreenConfig<*>,
path?: string,
};
export type NavigationScreenRouteConfig =
| {
screen: NavigationComponent,
}
| {
getScreen: () => NavigationComponent,
};
export type NavigationPathsConfig = {
[routeName: string]: string,
};
export type NavigationRouteConfigMap = {
[routeName: string]: NavigationRouteConfig<*>,
};
/**
* Header
*/
export type HeaderMode = 'float' | 'screen' | 'none';
export type HeaderProps = NavigationSceneRendererProps & {
mode: HeaderMode,
router: NavigationRouter<NavigationState, NavigationStackScreenOptions>,
getScreenDetails: NavigationScene => NavigationScreenDetails<
NavigationStackScreenOptions
>,
leftInterpolator: (props: NavigationSceneRendererProps) => {},
titleInterpolator: (props: NavigationSceneRendererProps) => {},
rightInterpolator: (props: NavigationSceneRendererProps) => {},
};
/**
* Stack Navigator
*/
export type NavigationStackScreenOptions = NavigationScreenOptions & {
header?: ?(React.Node | (HeaderProps => React.Node)),
headerTitle?: string | React.Node | React.ComponentType<any>,
headerTitleStyle?: AnimatedTextStyleProp,
headerTitleAllowFontScaling?: boolean,
headerTintColor?: string,
headerLeft?: React.Node | React.ComponentType<any>,
headerBackTitle?: string,
headerTruncatedBackTitle?: string,
headerBackTitleStyle?: TextStyleProp,
headerPressColorAndroid?: string,
headerRight?: React.Node,
headerStyle?: ViewStyleProp,
gesturesEnabled?: boolean,
gestureResponseDistance?: { vertical?: number, horizontal?: number },
gestureDirection?: 'default' | 'inverted',
};
export type NavigationStackRouterConfig = {
initialRouteName?: string,
initialRouteParams?: NavigationParams,
paths?: NavigationPathsConfig,
navigationOptions?: NavigationScreenConfig<*>,
};
export type NavigationStackViewConfig = {
mode?: 'card' | 'modal',
headerMode?: HeaderMode,
cardStyle?: ViewStyleProp,
transitionConfig?: () => TransitionConfig,
onTransitionStart?: () => void,
onTransitionEnd?: () => void,
};
export type StackNavigatorConfig = {
...$Exact<NavigationStackViewConfig>,
...$Exact<NavigationStackRouterConfig>,
};
/**
* Tab Navigator
*/
export type NavigationTabRouterConfig = {
initialRouteName?: string,
paths?: NavigationPathsConfig,
navigationOptions?: NavigationScreenConfig<*>,
order?: Array<string>, // todo: type these as the real route names rather than 'string'
// Does the back button cause the router to switch to the initial tab
backBehavior?: 'none' | 'initialRoute', // defaults `initialRoute`
};
type TabScene = {
route: NavigationRoute,
focused: boolean,
index: number,
tintColor?: ?string,
};
export type NavigationTabScreenOptions = {|
...$Exact<NavigationScreenOptions>,
tabBarIcon?:
| React.Node
| ((options: { tintColor: ?string, focused: boolean }) => ?React.Node),
tabBarLabel?:
| string
| React.Node
| ((options: { tintColor: ?string, focused: boolean }) => ?React.Node),
tabBarVisible?: boolean,
tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string },
tabBarOnPress?: (
scene: TabScene,
jumpToIndex: (index: number) => void
) => void,
|};
/**
* Drawer
*/
export type NavigationDrawerScreenOptions = {|
...$Exact<NavigationScreenOptions>,
drawerIcon?:
| React.Node
| ((options: { tintColor: ?string, focused: boolean }) => ?React.Node),
drawerLabel?:
| React.Node
| ((options: { tintColor: ?string, focused: boolean }) => ?React.Node),
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open',
|};
/**
* Navigator Prop
*/
export type NavigationDispatch = (
action: PossiblyDeprecatedNavigationAction
) => boolean;
export type NavigationProp<S> = {
+state: S,
dispatch: NavigationDispatch,
};
export type EventListener = {
remove: () => void,
};
export type NavigationScreenProp<+S> = {
+state: S,
dispatch: NavigationDispatch,
goBack: (routeKey?: ?string) => boolean,
navigate: (
routeName: string,
params?: NavigationParams,
action?: NavigationNavigateAction
) => boolean,
setParams: (newParams: NavigationParams) => boolean,
addListener: (eventName: string, callback: Function) => EventListener,
};
export type NavigationNavigatorProps<O: {}, S: {}> = {
navigation: NavigationScreenProp<S>,
screenProps?: {},
navigationOptions?: O,
};
/**
* Navigation container
*/
export type NavigationContainer<
State: NavigationState,
Options: {},
Props: {}
> = React.ComponentType<NavigationContainerProps<State, Options> & Props> & {
router: NavigationRouter<State, Options>,
navigationOptions?: ?NavigationScreenConfig<Options>,
};
export type NavigationContainerProps<S: {}, O: {}> = {
uriPrefix?: string | RegExp,
onNavigationStateChange?: (
NavigationState,
NavigationState,
NavigationAction
) => void,
navigation?: NavigationScreenProp<S>,
screenProps?: *,
navigationOptions?: O,
};
/**
* Gestures, Animations, and Interpolators
*/
export type NavigationGestureDirection = 'horizontal' | 'vertical';
export type NavigationLayout = {
height: Animated.Value,
initHeight: number,
initWidth: number,
isMeasured: boolean,
width: Animated.Value,
};
export type NavigationScene = {
index: number,
isActive: boolean,
isStale: boolean,
key: string,
route: NavigationRoute,
};
export type NavigationTransitionProps = {
// The layout of the screen container
layout: NavigationLayout,
// The destination navigation state of the transition
navigation: NavigationScreenProp<NavigationState>,
// The progressive index of the transitioner's navigation state.
position: Animated.Value,
// The value that represents the progress of the transition when navigation
// state changes from one to another. Its numeric value will range from 0
// to 1.
// progress.__getAnimatedValue() < 1 : transtion is happening.
// progress.__getAnimatedValue() == 1 : transtion completes.
progress: Animated.Value,
// All the scenes of the transitioner.
scenes: Array<NavigationScene>,
// The active scene, corresponding to the route at
// `navigation.state.routes[navigation.state.index]`. When rendering
// NavigationSceneRendererPropsIndex, the scene does not refer to the active
// scene, but instead the scene that is being rendered. The index always
// is the index of the scene
scene: NavigationScene,
index: number,
screenProps?: {},
};
// The scene renderer props are nearly identical to the props used for rendering
// a transition. The exception is that the passed scene is not the active scene
// but is instead the scene that the renderer should render content for.
export type NavigationSceneRendererProps = NavigationTransitionProps;
export type NavigationTransitionSpec = {
duration?: number,
// An easing function from `Easing`.
easing?: (t: number) => number,
// A timing function such as `Animated.timing`.
timing?: (value: Animated.Value, config: any) => any,
};
/**
* Describes a visual transition from one screen to another.
*/
export type TransitionConfig = {
// The basics properties of the animation, such as duration and easing
transitionSpec?: NavigationTransitionSpec,
// How to animate position and opacity of the screen
// based on the value generated by the transitionSpec
screenInterpolator?: (props: NavigationSceneRendererProps) => {},
// How to animate position and opacity of the header componetns
// based on the value generated by the transitionSpec
headerLeftInterpolator?: (props: NavigationSceneRendererProps) => {},
headerTitleInterpolator?: (props: NavigationSceneRendererProps) => {},
headerRightInterpolator?: (props: NavigationSceneRendererProps) => {},
// The style of the container. Useful when a scene doesn't have
// 100% opacity and the underlying container is visible.
containerStyle?: ViewStyleProp,
};
export type NavigationAnimationSetter = (
position: Animated.Value,
newState: NavigationState,
lastState: NavigationState
) => void;
export type NavigationSceneRenderer = () => React.Node;
export type NavigationStyleInterpolator = (
props: NavigationSceneRendererProps
) => AnimatedViewStyleProp;
export type LayoutEvent = {
nativeEvent: {
layout: {
x: number,
y: number,
width: number,
height: number,
},
},
};
export type SceneIndicesForInterpolationInputRange = {
first: number,
last: number,
};

View File

@@ -1,24 +1,10 @@
/**
* @flow
*/
import type {
NavigationEventSubscriber,
NavigationAction,
NavigationState,
NavigationEventPayload,
} from './TypeDefinition';
/*
* This is used to extract one children's worth of events from a stream of navigation action events
*
* Based on the 'action' events that get fired for this navigation state, this utility will fire
* focus and blur events for this child
*/
export default function getChildEventSubscriber(
addListener: NavigationEventSubscriber,
key: string
): NavigationEventSubscriber {
export default function getChildEventSubscriber(addListener, key) {
const actionSubscribers = new Set();
const willFocusSubscribers = new Set();
const didFocusSubscribers = new Set();
@@ -66,7 +52,7 @@ export default function getChildEventSubscriber(
];
const upstreamSubscribers = upstreamEvents.map(eventName =>
addListener(eventName, (payload: NavigationEventPayload) => {
addListener(eventName, payload => {
const { state, lastState, action } = payload;
const lastFocusKey = lastState && lastState.routes[lastState.index].key;
const focusKey = state && state.routes[state.index].key;

File diff suppressed because it is too large Load Diff