mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make TimingAnimationConfig read-only
Summary: Makes `TimingAnimationConfig` read-only, as it's purely an input type. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D34146703 fbshipit-source-id: 77ac7ee0641a869b62e5f95b6a7f711c71e82c7d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1aec881958
commit
4cd50aee78
@@ -91,7 +91,7 @@ const diffClamp = function (
|
||||
|
||||
const _combineCallbacks = function (
|
||||
callback: ?EndCallback,
|
||||
config: {...AnimationConfig, ...},
|
||||
config: $ReadOnly<{...AnimationConfig, ...}>,
|
||||
) {
|
||||
if (callback && config.onComplete) {
|
||||
return (...args) => {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user