mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge pull request #19314 from ahanriat/react-native/add-animated-loop
[react-native] Add Animated.loop typings
This commit is contained in:
16
types/react-native/index.d.ts
vendored
16
types/react-native/index.d.ts
vendored
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user