Skip to content

Commit

Permalink
Fix flow typing of TimingAnimationConfig
Browse files Browse the repository at this point in the history
Summary: @​public
Make the flow type of TimingAnimationConfig and TimingAnimation the same as SpringAnimationConfig and SpringAnimation.
This is a more accurate flow type as both are multiplexed through maybeVectorAnim().

Reviewed By: @sahrens

Differential Revision: D2410166
  • Loading branch information
Bill Fisher authored and facebook-github-bot-2 committed Sep 10, 2015
1 parent ac9471f commit 493cb35
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Libraries/Animated/Animated.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ function _flush(rootNode: AnimatedValue): void {
}

type TimingAnimationConfig = {
toValue: number;
toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY;
easing?: (value: number) => number;
duration?: number;
delay?: number;
};

type TimingAnimationConfigSingle = {
toValue: number | AnimatedValue;
easing?: (value: number) => number;
duration?: number;
delay?: number;
Expand All @@ -142,7 +149,7 @@ var easeInOut = Easing.inOut(Easing.ease);
class TimingAnimation extends Animation {
_startTime: number;
_fromValue: number;
_toValue: number;
_toValue: any;
_duration: number;
_delay: number;
_easing: (value: number) => number;
Expand All @@ -151,7 +158,7 @@ class TimingAnimation extends Animation {
_timeout: any;

constructor(
config: TimingAnimationConfig,
config: TimingAnimationConfigSingle,
) {
super();
this._toValue = config.toValue;
Expand Down

0 comments on commit 493cb35

Please sign in to comment.