Add explicit types for methods from AnimatedImplementation in AnimatedMock (#48610)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48610

Changelog:
[Internal] - Improved typings for AnimatedImplementation methods exported from AnimatedMock

Reviewed By: huntie

Differential Revision: D68019816

fbshipit-source-id: ee73213c0b519be9b72b8dfb2e91a125021de63e
This commit is contained in:
Dawid Małecki
2025-01-14 07:31:54 -08:00
committed by Facebook GitHub Bot
parent 07769d4d7e
commit 9f7bacaa6b
2 changed files with 2 additions and 62 deletions
+1 -1
View File
@@ -192,4 +192,4 @@ export default {
forkEvent: AnimatedImplementation.forkEvent,
unforkEvent: AnimatedImplementation.unforkEvent,
Event: AnimatedEvent,
};
} as typeof AnimatedImplementation;
@@ -269,68 +269,8 @@ exports[`public API should not change unintentionally Libraries/Animated/Animate
_isUsingNativeDriver: () => boolean,
...
};
declare const spring: (
value: AnimatedValue | AnimatedValueXY | AnimatedColor,
config: SpringAnimationConfig
) => CompositeAnimation;
declare const timing: (
value: AnimatedValue | AnimatedValueXY | AnimatedColor,
config: TimingAnimationConfig
) => CompositeAnimation;
declare const decay: (
value: AnimatedValue | AnimatedValueXY | AnimatedColor,
config: DecayAnimationConfig
) => CompositeAnimation;
declare const sequence: (
animations: Array<CompositeAnimation>
) => CompositeAnimation;
type ParallelConfig = { stopTogether?: boolean, ... };
declare const parallel: (
animations: Array<CompositeAnimation>,
config?: ?ParallelConfig
) => CompositeAnimation;
declare const delay: (time: number) => CompositeAnimation;
declare const stagger: (
time: number,
animations: Array<CompositeAnimation>
) => CompositeAnimation;
type LoopAnimationConfig = {
iterations: number,
resetBeforeIteration?: boolean,
...
};
declare const loop: (
animation: CompositeAnimation,
LoopAnimationConfig
) => CompositeAnimation;
export type { AnimatedNumeric as Numeric };
declare export default {
Value: AnimatedValue,
ValueXY: AnimatedValueXY,
Color: AnimatedColor,
Interpolation: AnimatedInterpolation,
Node: AnimatedNode,
decay: decay,
timing: timing,
spring: spring,
add: $FlowFixMe,
subtract: $FlowFixMe,
divide: $FlowFixMe,
multiply: $FlowFixMe,
modulo: $FlowFixMe,
diffClamp: $FlowFixMe,
delay: delay,
sequence: sequence,
parallel: parallel,
stagger: stagger,
loop: loop,
event: $FlowFixMe,
createAnimatedComponent: createAnimatedComponent,
attachNativeEvent: attachNativeEvent,
forkEvent: $FlowFixMe,
unforkEvent: $FlowFixMe,
Event: AnimatedEvent,
};
declare export default typeof AnimatedImplementation;
"
`;