diff --git a/packages/react-native/Libraries/Animated/AnimatedExports.js.flow b/packages/react-native/Libraries/Animated/AnimatedExports.js.flow index 51a1b68186f..a487448e247 100644 --- a/packages/react-native/Libraries/Animated/AnimatedExports.js.flow +++ b/packages/react-native/Libraries/Animated/AnimatedExports.js.flow @@ -24,6 +24,8 @@ export {default as Node} from './nodes/AnimatedNode'; export {default as Value} from './nodes/AnimatedValue'; export {default as ValueXY} from './nodes/AnimatedValueXY'; +export type {AnimatedValueConfig as AnimatedConfig} from './nodes/AnimatedValue'; + export const add = AnimatedImplementation.add; export const attachNativeEvent = AnimatedImplementation.attachNativeEvent; export const createAnimatedComponent = diff --git a/packages/react-native/Libraries/Animated/useAnimatedValue.js b/packages/react-native/Libraries/Animated/useAnimatedValue.js index 0a430ed5c3c..4809135697b 100644 --- a/packages/react-native/Libraries/Animated/useAnimatedValue.js +++ b/packages/react-native/Libraries/Animated/useAnimatedValue.js @@ -8,14 +8,12 @@ * @format */ -import type {AnimatedValueConfig} from './nodes/AnimatedValue'; - import Animated from './Animated'; import {useRef} from 'react'; export default function useAnimatedValue( initialValue: number, - config?: ?AnimatedValueConfig, + config?: ?Animated.AnimatedConfig, ): Animated.Value { const ref = useRef(null); if (ref.current == null) { diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index e932154065a..801fcc7d7ad 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -172,6 +172,7 @@ export { default as Interpolation } from \\"./nodes/AnimatedInterpolation\\"; export { default as Node } from \\"./nodes/AnimatedNode\\"; export { default as Value } from \\"./nodes/AnimatedValue\\"; export { default as ValueXY } from \\"./nodes/AnimatedValueXY\\"; +export type { AnimatedValueConfig as AnimatedConfig } from \\"./nodes/AnimatedValue\\"; declare export const add: $FlowFixMe; declare export const attachNativeEvent: $FlowFixMe; declare export const createAnimatedComponent: $FlowFixMe; @@ -1006,7 +1007,7 @@ exports[`public API should not change unintentionally Libraries/Animated/useAnim exports[`public API should not change unintentionally Libraries/Animated/useAnimatedValue.js 1`] = ` "declare export default function useAnimatedValue( initialValue: number, - config?: ?AnimatedValueConfig + config?: ?Animated.AnimatedConfig ): Animated.Value; " `; diff --git a/scripts/build/build-types/buildTypes.js b/scripts/build/build-types/buildTypes.js index a305eac59e0..e9579bae287 100644 --- a/scripts/build/build-types/buildTypes.js +++ b/scripts/build/build-types/buildTypes.js @@ -29,6 +29,7 @@ const ENTRY_POINTS = [ 'packages/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js', 'packages/react-native/Libraries/Alert/Alert.js', 'packages/react-native/Libraries/Animated/Animated.js', + 'packages/react-native/Libraries/Animated/useAnimatedValue.js', 'packages/react-native/Libraries/AppState/AppState.js', 'packages/react-native/Libraries/BatchedBridge/NativeModules.js', 'packages/react-native/Libraries/Blob/Blob.js',