Stricter flow typing on CardStackStyleInterpolator

This commit is contained in:
Adam Miskiewicz 2017-07-03 21:43:06 -07:00
parent 681e1c6e31
commit bbd82dff53
No known key found for this signature in database
GPG Key ID: EC62EB11EB5E47ED

View File

@ -1,6 +1,6 @@
/* @flow */
import { I18nManager } from 'react-native';
import { I18nManager, type AnimatedViewStylePropTypes } from 'react-native';
import type { NavigationSceneRendererProps } from '../TypeDefinition';
@ -22,7 +22,9 @@ import type { NavigationSceneRendererProps } from '../TypeDefinition';
/**
* Render the initial style when the initial layout isn't measured yet.
*/
function forInitial(props: NavigationSceneRendererProps): Object {
function forInitial(
props: NavigationSceneRendererProps
): AnimatedViewStylePropTypes {
const { navigation, scene } = props;
const focused = navigation.state.index === scene.index;
@ -38,7 +40,9 @@ function forInitial(props: NavigationSceneRendererProps): Object {
/**
* Standard iOS-style slide in from the right.
*/
function forHorizontal(props: NavigationSceneRendererProps): Object {
function forHorizontal(
props: NavigationSceneRendererProps
): AnimatedViewStylePropTypes {
const { layout, position, scene } = props;
if (!layout.isMeasured) {
@ -81,7 +85,9 @@ function forHorizontal(props: NavigationSceneRendererProps): Object {
/**
* Standard iOS-style slide in from the bottom (used for modals).
*/
function forVertical(props: NavigationSceneRendererProps): Object {
function forVertical(
props: NavigationSceneRendererProps
): AnimatedViewStylePropTypes {
const { layout, position, scene } = props;
if (!layout.isMeasured) {
@ -117,7 +123,9 @@ function forVertical(props: NavigationSceneRendererProps): Object {
/**
* Standard Android-style fade in from the bottom.
*/
function forFadeFromBottomAndroid(props: NavigationSceneRendererProps): Object {
function forFadeFromBottomAndroid(
props: NavigationSceneRendererProps
): AnimatedViewStylePropTypes {
const { layout, position, scene } = props;
if (!layout.isMeasured) {