From 141d397bdf27e1997be10f6cc9b63508cd20c55a Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Tue, 28 Jan 2020 14:35:31 +0100 Subject: [PATCH] chore: tweak types for stack --- packages/stack/src/types.tsx | 37 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/packages/stack/src/types.tsx b/packages/stack/src/types.tsx index 74530f4c..56e0b037 100644 --- a/packages/stack/src/types.tsx +++ b/packages/stack/src/types.tsx @@ -1,6 +1,5 @@ import { Animated, - EasingFunction, StyleProp, TextStyle, ViewStyle, @@ -430,29 +429,21 @@ export type StackHeaderTitleProps = { style?: StyleProp; }; -export type Screen = React.ComponentType & { - navigationOptions?: StackNavigationOptions & { - [key: string]: any; - }; -}; - -export type SpringConfig = { - damping: number; - mass: number; - stiffness: number; - restSpeedThreshold: number; - restDisplacementThreshold: number; - overshootClamping: boolean; -}; - -export type TimingConfig = { - duration: number; - easing: EasingFunction; -}; - export type TransitionSpec = - | { animation: 'spring'; config: SpringConfig } - | { animation: 'timing'; config: TimingConfig }; + | { + animation: 'spring'; + config: Omit< + Animated.SpringAnimationConfig, + 'toValue' | keyof Animated.AnimationConfig + >; + } + | { + animation: 'timing'; + config: Omit< + Animated.TimingAnimationConfig, + 'toValue' | keyof Animated.AnimationConfig + >; + }; export type StackCardInterpolationProps = { /**