Skip to content

Commit 3c02738

Browse files
coadofacebook-github-bot
authored andcommitted
Add explicit types for Types and Properties in LayoutAnimation (#48728)
Summary: Pull Request resolved: #48728 Changelog: [General][Changed] - Improved types for exported Types and Properties in LayoutAnimation Reviewed By: rshest Differential Revision: D68270119 fbshipit-source-id: 7e9e6e6f20b6c17990b40d423eb4571807004b49
1 parent 812c3b3 commit 3c02738

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react-native/Libraries/LayoutAnimation/LayoutAnimation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ const LayoutAnimation = {
174174
easeIn: 'easeIn',
175175
easeOut: 'easeOut',
176176
keyboard: 'keyboard',
177-
}),
177+
}) as $ReadOnly<{[K in LayoutAnimationType]: K}>,
178178
Properties: Object.freeze({
179179
opacity: 'opacity',
180180
scaleX: 'scaleX',
181181
scaleY: 'scaleY',
182182
scaleXY: 'scaleXY',
183-
}),
183+
}) as $ReadOnly<{[K in LayoutAnimationProperty]: K}>,
184184
checkConfig(...args: Array<mixed>) {
185185
console.error('LayoutAnimation.checkConfig(...) has been disabled.');
186186
},

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5635,8 +5635,8 @@ declare const Presets: {
56355635
declare const LayoutAnimation: {
56365636
configureNext: configureNext,
56375637
create: create,
5638-
Types: $FlowFixMe,
5639-
Properties: $FlowFixMe,
5638+
Types: $ReadOnly<{ [K in LayoutAnimationType]: K }>,
5639+
Properties: $ReadOnly<{ [K in LayoutAnimationProperty]: K }>,
56405640
checkConfig(...args: Array<mixed>): void,
56415641
Presets: Presets,
56425642
easeInEaseOut: (onAnimationDidEnd?: OnAnimationDidEndCallback) => void,

0 commit comments

Comments
 (0)