diff --git a/Libraries/Animated/Animated.js b/Libraries/Animated/Animated.js index 70beabf56a98a9..88fd9dbb188dbe 100644 --- a/Libraries/Animated/Animated.js +++ b/Libraries/Animated/Animated.js @@ -16,8 +16,8 @@ import typeof AnimatedSectionList from './components/AnimatedSectionList'; import typeof AnimatedText from './components/AnimatedText'; import typeof AnimatedView from './components/AnimatedView'; -const AnimatedMock = require('./AnimatedMock'); -const AnimatedImplementation = require('./AnimatedImplementation'); +import * as AnimatedMock from './AnimatedMock'; +import * as AnimatedImplementation from './AnimatedImplementation'; const Animated = ((Platform.isTesting ? AnimatedMock diff --git a/Libraries/Animated/AnimatedImplementation.js b/Libraries/Animated/AnimatedImplementation.js index 79fbc8a45c0acb..f483d0a63f3647 100644 --- a/Libraries/Animated/AnimatedImplementation.js +++ b/Libraries/Animated/AnimatedImplementation.js @@ -551,6 +551,19 @@ const event = function ( } }; +// All types of animated nodes that represent scalar numbers and can be interpolated (etc) +type AnimatedNumeric = + | AnimatedAddition + | AnimatedDiffClamp + | AnimatedDivision + | AnimatedInterpolation + | AnimatedModulo + | AnimatedMultiplication + | AnimatedSubtraction + | AnimatedValue; + +export type {AnimatedNumeric as Numeric}; + /** * The `Animated` library is designed to make animations fluid, powerful, and * easy to build and maintain. `Animated` focuses on declarative relationships diff --git a/Libraries/Animated/AnimatedMock.js b/Libraries/Animated/AnimatedMock.js index f2ce29359c2a66..af517502197d53 100644 --- a/Libraries/Animated/AnimatedMock.js +++ b/Libraries/Animated/AnimatedMock.js @@ -23,7 +23,7 @@ import type {EndCallback} from './animations/Animation'; import type {TimingAnimationConfig} from './animations/TimingAnimation'; import type {DecayAnimationConfig} from './animations/DecayAnimation'; import type {SpringAnimationConfig} from './animations/SpringAnimation'; - +import type {Numeric as AnimatedNumeric} from './AnimatedImplementation'; import AnimatedColor from './nodes/AnimatedColor'; /** @@ -163,6 +163,8 @@ const loop = function ( return emptyAnimation; }; +export type {AnimatedNumeric as Numeric}; + module.exports = { Value: AnimatedValue, ValueXY: AnimatedValueXY,