Skip to content

Commit 25a25ea

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Add missing type for AnimatedValue.resetAnimation() and AnimatedValue.animate()
Summary: See https://www.internalfb.com/code/fbsource/[d96fd0b6ac13]/xplat/js/react-native-github/Libraries/Animated/nodes/AnimatedValue.js?lines=207 Changelog: [General][Fixed] - Add missing type for AnimatedValue.resetAnimation() and AnimatedValue.animate() Reviewed By: christophpurrer Differential Revision: D42034719 fbshipit-source-id: 40e25940e04bdf296c8b5e4bf39bee2e4baeae07
1 parent 64475ae commit 25a25ea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Libraries/Animated/Animated.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,28 @@ export namespace Animated {
168168
*/
169169
stopAnimation(callback?: (value: number) => void): void;
170170

171+
/**
172+
* Stops any animation and resets the value to its original.
173+
*
174+
* See https://reactnative.dev/docs/animatedvalue#resetanimation
175+
*/
176+
resetAnimation(callback?: (value: number) => void): void;
177+
171178
/**
172179
* Interpolates the value before updating the property, e.g. mapping 0-1 to
173180
* 0-10.
174181
*/
175182
interpolate<OutputT extends number | string>(
176183
config: InterpolationConfigType,
177184
): AnimatedInterpolation<OutputT>;
185+
186+
/**
187+
* Typically only used internally, but could be used by a custom Animation
188+
* class.
189+
*
190+
* See https://reactnative.dev/docs/animatedvalue#animate
191+
*/
192+
animate(animation: Animation, callback?: EndCallback | null): void;
178193
}
179194

180195
type ValueXYListenerCallback = (value: {x: number; y: number}) => void;
@@ -201,6 +216,8 @@ export namespace Animated {
201216

202217
extractOffset(): void;
203218

219+
resetAnimation(callback?: (value: {x: number; y: number}) => void): void;
220+
204221
stopAnimation(callback?: (value: {x: number; y: number}) => void): void;
205222

206223
addListener(callback: ValueXYListenerCallback): string;

0 commit comments

Comments
 (0)