Merge pull request #19314 from ahanriat/react-native/add-animated-loop

[react-native] Add Animated.loop typings
This commit is contained in:
Eloy Durán
2017-08-24 18:19:47 +02:00
committed by GitHub

View File

@@ -8194,6 +8194,10 @@ export namespace Animated {
friction?: number;
}
interface LoopAnimationConfig {
iterations?: number; // default -1 for infinite
}
/**
* Creates a new Animated value composed from two Animated values added
* together.
@@ -8275,6 +8279,18 @@ export namespace Animated {
animations: Array<CompositeAnimation>
): CompositeAnimation
/**
* Loops a given animation continuously, so that each time it reaches the end,
* it resets and begins again from the start. Can specify number of times to
* loop using the key 'iterations' in the config. Will loop without blocking
* the UI thread if the child animation is set to 'useNativeDriver'.
*/
export function loop(
animation: CompositeAnimation,
config?: LoopAnimationConfig,
): CompositeAnimation
/**
* Spring animation based on Rebound and Origami. Tracks velocity state to
* create fluid motions as the `toValue` updates, and can be chained together.