diff --git a/Libraries/Animated/AnimatedImplementation.js b/Libraries/Animated/AnimatedImplementation.js index e93c0dda4ccfc5..79fbc8a45c0acb 100644 --- a/Libraries/Animated/AnimatedImplementation.js +++ b/Libraries/Animated/AnimatedImplementation.js @@ -91,7 +91,7 @@ const diffClamp = function ( const _combineCallbacks = function ( callback: ?EndCallback, - config: {...AnimationConfig, ...}, + config: $ReadOnly<{...AnimationConfig, ...}>, ) { if (callback && config.onComplete) { return (...args) => { diff --git a/Libraries/Animated/NativeAnimatedHelper.js b/Libraries/Animated/NativeAnimatedHelper.js index 363a4e05b30f5d..204f35900ef1a7 100644 --- a/Libraries/Animated/NativeAnimatedHelper.js +++ b/Libraries/Animated/NativeAnimatedHelper.js @@ -368,7 +368,7 @@ function assertNativeAnimatedModule(): void { let _warnedMissingNativeAnimated = false; function shouldUseNativeDriver( - config: {...AnimationConfig, ...} | EventConfig, + config: $ReadOnly<{...AnimationConfig, ...}> | EventConfig, ): boolean { if (config.useNativeDriver == null) { console.warn( diff --git a/Libraries/Animated/animations/TimingAnimation.js b/Libraries/Animated/animations/TimingAnimation.js index 748bb47cc6f313..859a5755f254ff 100644 --- a/Libraries/Animated/animations/TimingAnimation.js +++ b/Libraries/Animated/animations/TimingAnimation.js @@ -23,7 +23,7 @@ import type {RgbaValue} from '../nodes/AnimatedColor'; import AnimatedColor from '../nodes/AnimatedColor'; -export type TimingAnimationConfig = { +export type TimingAnimationConfig = $ReadOnly<{ ...AnimationConfig, toValue: | number @@ -40,15 +40,15 @@ export type TimingAnimationConfig = { easing?: (value: number) => number, duration?: number, delay?: number, -}; +}>; -export type TimingAnimationConfigSingle = { +export type TimingAnimationConfigSingle = $ReadOnly<{ ...AnimationConfig, toValue: number | AnimatedValue | AnimatedInterpolation, easing?: (value: number) => number, duration?: number, delay?: number, -}; +}>; let _easeInOut; function easeInOut() {