diff --git a/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js b/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js index 0c2abd7faa0a..46f54894e716 100644 --- a/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js +++ b/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js @@ -21,7 +21,7 @@ type ValueOfUnion = T extends any : empty : empty; type MergeUnion = { - [K in KeysOfUnion]?: ValueOfUnion, + [K in KeysOfUnion]: ValueOfUnion, }; type MaximumOneOf = Values<{ [K in keyof T]: $Exact<{ diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index c0f8309f0ac5..a1f7f5077a76 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<77e50f521f922ce7a408c1683c2d1d61>> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -3005,7 +3005,7 @@ declare type MeasureOnSuccessCallback = ( pageX: number, pageY: number, ) => void -declare type MergeUnion = { [K in KeysOfUnion]?: ValueOfUnion } +declare type MergeUnion = { [K in KeysOfUnion]: ValueOfUnion } declare type Message = { readonly content: string readonly substitutions: ReadonlyArray<{ @@ -5782,18 +5782,18 @@ export { AccessibilityValue, // cf8bcb74 ActionSheetIOS, // b558559e ActionSheetIOSOptions, // 1756eb5a - ActivityIndicator, // d5bcb272 + ActivityIndicator, // 56f16803 ActivityIndicatorInstance, // 1b5e0dd5 - ActivityIndicatorProps, // 508a24c6 + ActivityIndicatorProps, // c7df2301 Alert, // a398a509 AlertButton, // bf1a3b60 AlertButtonStyle, // ec9fb242 AlertOptions, // 8a116d2a AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // 33fe7464 + Animated, // d54fd636 AppConfig, // 35c0ca70 - AppRegistry, // edec2a30 + AppRegistry, // a13def83 AppState, // 12012be5 AppStateEvent, // 80f034c3 AppStateStatus, // 447e5ef2 @@ -5805,8 +5805,8 @@ export { BackPressEventName, // 4620fb76 BlurEvent, // d5e68e96 BoxShadowValue, // b679703f - Button, // f253fc94 - ButtonInstance, // bcf2ef72 + Button, // 26918149 + ButtonInstance, // 0d171eef ButtonProps, // 9886bcc6 Clipboard, // 41addb89 CodegenTypes, // 9067fd06 @@ -5825,9 +5825,9 @@ export { DimensionsPayload, // 653bc26c DisplayMetrics, // 1dc35cef DisplayMetricsAndroid, // 872e62eb - DrawerLayoutAndroid, // beec8621 + DrawerLayoutAndroid, // 0a8c4d68 DrawerLayoutAndroidInstance, // aa243cbf - DrawerLayoutAndroidProps, // 53289373 + DrawerLayoutAndroidProps, // 42edefd0 DrawerSlideEvent, // 38213685 DropShadowValue, // e9df2606 DynamicColorIOS, // d96c228c @@ -5843,9 +5843,9 @@ export { EventSubscription, // b8d084aa ExtendedExceptionData, // 5a6ccf5a FilterFunction, // bf24c0e3 - FlatList, // 5ba109bd - FlatListInstance, // 1095fe06 - FlatListProps, // dd43b1d1 + FlatList, // cb29e423 + FlatListInstance, // dfd9c8c0 + FlatListProps, // 02164dc7 FocusEvent, // f2e4363d FontVariant, // 7c7558bb GestureResponderEvent, // 5cd2a663 @@ -5856,17 +5856,17 @@ export { IEventEmitter, // fbef6131 IOSKeyboardEvent, // e67bfe3a IgnorePattern, // ec6f6ece - Image, // a24a5777 - ImageBackground, // 1fbbacef - ImageBackgroundInstance, // 9c900a60 - ImageBackgroundProps, // b078f0ac + Image, // 424b2d5e + ImageBackground, // abf90733 + ImageBackgroundInstance, // 0b8666b4 + ImageBackgroundProps, // 18e5df8f ImageErrorEvent, // b6227714 ImageInstance, // df709524 ImageLoadEvent, // 31709c38 ImageProgressEventIOS, // 9243d460 - ImageProps, // e6a7a863 + ImageProps, // ef8791f9 ImagePropsAndroid, // ee00e1d5 - ImagePropsBase, // f41b5a7c + ImagePropsBase, // bc9043ea ImagePropsIOS, // 1998f91a ImageRequireSource, // 681d683b ImageResizeMode, // d51106e2 @@ -5874,19 +5874,19 @@ export { ImageSize, // 1c47cf88 ImageSource, // ea31cf4a ImageSourcePropType, // f522e093 - ImageStyle, // 85dc694a + ImageStyle, // c8962086 ImageURISource, // 443d047c - InputAccessoryView, // ab6e2a66 - InputAccessoryViewProps, // 73685b83 + InputAccessoryView, // 3d5e4baa + InputAccessoryViewProps, // 0910370c InputModeOptions, // 4e8581b9 Insets, // e7fe432a KeyDownEvent, // a12d46ea KeyEvent, // 20fa4267 KeyUpEvent, // 0b5d0144 Keyboard, // 49414c97 - KeyboardAvoidingView, // 1fee106e - KeyboardAvoidingViewInstance, // 26062fd4 - KeyboardAvoidingViewProps, // 635ae7fc + KeyboardAvoidingView, // c68798f0 + KeyboardAvoidingViewInstance, // 5fd804aa + KeyboardAvoidingViewProps, // 2d0efe8a KeyboardEvent, // c3f895d4 KeyboardEventEasing, // af4091c8 KeyboardEventName, // 59299ad6 @@ -5911,10 +5911,10 @@ export { MeasureInWindowOnSuccessCallback, // a285f598 MeasureLayoutOnSuccessCallback, // 3592502a MeasureOnSuccessCallback, // 82824e59 - Modal, // f4b88be5 + Modal, // 984f9e1d ModalBaseProps, // a6e4334f ModalInstance, // 0f04c1bf - ModalProps, // c07a247a + ModalProps, // 9d94b716 ModalPropsAndroid, // 515fb173 ModalPropsIOS, // a65a8f5c ModeChangeEvent, // ccf30dc4 @@ -5950,15 +5950,15 @@ export { PointerEvent, // a506d9d7 PressabilityConfig, // 0fd655fe PressabilityEventHandlers, // be359ba3 - Pressable, // 56235a5f + Pressable, // d3fae816 PressableAndroidRippleConfig, // ee32eaca PressableInstance, // ed26f040 - PressableProps, // 7a18f8cd + PressableProps, // 81c3566f PressableStateCallbackType, // f83728cd ProcessedColorValue, // 33f74304 - ProgressBarAndroid, // 30b4a1eb + ProgressBarAndroid, // 6dde5fdd ProgressBarAndroidInstance, // f17242be - ProgressBarAndroidProps, // 98fa6a86 + ProgressBarAndroidProps, // 07fb8402 PublicRootInstance, // 8040afd7 PublicTextInstance, // f9adf69a PushNotificationEventName, // 84e7e150 @@ -5966,9 +5966,9 @@ export { PushNotificationPermissions, // c2e7ae4f Rationale, // 5df1b1c1 ReactNativeVersion, // abd76827 - RefreshControl, // e74ab0c4 - RefreshControlInstance, // 7e1aa88d - RefreshControlProps, // e728e273 + RefreshControl, // 12febd6d + RefreshControlInstance, // c19492a3 + RefreshControlProps, // 029796ed RefreshControlPropsAndroid, // 8ac931ca RefreshControlPropsIOS, // 72a36381 Registry, // 6c39216d @@ -5977,28 +5977,28 @@ export { Role, // af7b889d RootTag, // 3cd10504 RootTagContext, // 38bfc8f6 - RootViewStyleProvider, // d5909148 + RootViewStyleProvider, // a7863f22 Runnable, // 594dd93a Runnables, // 4367c557 SafeAreaInsetsChangeEvent, // cedb5309 - SafeAreaView, // dda99293 + SafeAreaView, // a05fa09c SafeAreaViewInstance, // 2b5d4391 ScaledSize, // 07e417c7 ScrollEvent, // 956fdb27 - ScrollResponderType, // 52c38666 + ScrollResponderType, // 5856f1a8 ScrollToLocationParamsType, // d7ecdad1 - ScrollView, // 08fe7620 - ScrollViewImperativeMethods, // 682315af - ScrollViewInstance, // bcc836b9 - ScrollViewProps, // d845721f + ScrollView, // 5fa69035 + ScrollViewImperativeMethods, // 309770e1 + ScrollViewInstance, // 2b3ba05b + ScrollViewProps, // 2d7e4044 ScrollViewPropsAndroid, // 02f3df2e ScrollViewPropsIOS, // c378379b ScrollViewScrollToOptions, // 3313411e SectionBase, // 9f13db00 - SectionList, // b48c3713 + SectionList, // 6304984c SectionListData, // 1a4de01a - SectionListInstance, // e2814c16 - SectionListProps, // bf7d4c45 + SectionListInstance, // ad194398 + SectionListProps, // 5850df71 SectionListRenderItem, // 715b2086 SectionListRenderItemInfo, // 4a48a922 Separators, // 6a45f7e3 @@ -6015,19 +6015,19 @@ export { StatusBarProps, // c2a44d88 StatusBarStyle, // 78f53eea StyleProp, // fa0e9b4a - StyleSheet, // 8bb13f55 + StyleSheet, // 0975d80d SubmitBehavior, // c4ddf490 - Switch, // 7ea8a527 + Switch, // a27fcb6c SwitchChangeEvent, // 3b472666 SwitchInstance, // 73dce99f - SwitchProps, // aa00dcf4 + SwitchProps, // e5021272 Systrace, // 626d178c TVViewPropsIOS, // 1c612e4e TargetedEvent, // 16e98910 TaskProvider, // 266dedf2 - Text, // 935ec305 + Text, // bd01566f TextContentType, // 239b3ecc - TextInput, // cf6467dc + TextInput, // 2723e729 TextInputAndroidProps, // 9ebbc103 TextInputBlurEvent, // b4c7a58c TextInputChangeEvent, // 92363e10 @@ -6037,46 +6037,46 @@ export { TextInputIOSProps, // fb3c9327 TextInputInstance, // 53fe7b73 TextInputKeyPressEvent, // cbbc322a - TextInputProps, // bb087c92 + TextInputProps, // 8e7e0c91 TextInputSelectionChangeEvent, // 4a8f10c2 TextInputSubmitEditingEvent, // e811fdbd TextInstance, // 7c7e2069 TextLayoutEvent, // 1a21e24a - TextProps, // b3707dfc - TextStyle, // 898adfd1 + TextProps, // 34f8664b + TextStyle, // 9b278311 ToastAndroid, // 88a8969a - TouchableHighlight, // a015710f + TouchableHighlight, // 9677e7eb TouchableHighlightInstance, // 811af7ca - TouchableHighlightProps, // faaeb188 - TouchableNativeFeedback, // 744ee0ee - TouchableNativeFeedbackInstance, // b90e3bae - TouchableNativeFeedbackProps, // 39abde16 - TouchableOpacity, // 6aec357f + TouchableHighlightProps, // 8a98e36b + TouchableNativeFeedback, // f834251c + TouchableNativeFeedbackInstance, // c490b7be + TouchableNativeFeedbackProps, // 76319629 + TouchableOpacity, // 30a729c0 TouchableOpacityInstance, // 0cd8a347 - TouchableOpacityProps, // 0d78e636 - TouchableWithoutFeedback, // 92cfc35d - TouchableWithoutFeedbackProps, // 7e8a325c - TransformsStyle, // 65e70f18 + TouchableOpacityProps, // 9b7ad3bf + TouchableWithoutFeedback, // 94d185b6 + TouchableWithoutFeedbackProps, // a47fef87 + TransformsStyle, // bd31025f TurboModule, // dfe29706 TurboModuleRegistry, // 4ace6db2 UIManager, // 6a18fc05 UTFSequence, // ad625158 Vibration, // 31e4bbf8 - View, // 85575778 + View, // 44e1259e ViewInstance, // 0283d2fc - ViewProps, // 43cbabe5 + ViewProps, // 9e818ec8 ViewPropsAndroid, // 66d760c6 ViewPropsIOS, // 58ee19bf - ViewStyle, // 4e2746d6 + ViewStyle, // 7ca06cb8 ViewabilityConfig, // eb3f7ed8 ViewabilityConfigCallbackPair, // bdd0788c VirtualViewMode, // 6be59722 VirtualizedList, // 68c7345e VirtualizedListInstance, // 423ee7c0 - VirtualizedListProps, // 09a41c15 + VirtualizedListProps, // 72cf4e0c VirtualizedSectionList, // 9fd9cd61 VirtualizedSectionListInstance, // 12b706d5 - VirtualizedSectionListProps, // c63aa8a2 + VirtualizedSectionListProps, // ab9b58ca WrapperComponentProvider, // 9b4247f6 codegenNativeCommands, // 322f3f4e codegenNativeComponent, // 3da62daa diff --git a/packages/react-native/__typetests__/stylesheet-create.tsx b/packages/react-native/__typetests__/stylesheet-create.tsx index 696124613443..7373ff097509 100644 --- a/packages/react-native/__typetests__/stylesheet-create.tsx +++ b/packages/react-native/__typetests__/stylesheet-create.tsx @@ -10,6 +10,7 @@ import * as React from 'react'; // @ts-ignore import {View, StyleSheet, type ShadowStyleIOS} from 'react-native'; +import type {ViewStyle} from 'react-native'; export function App() { return ; @@ -53,3 +54,13 @@ const styles3 = StyleSheet.create({ shadowOffset: shadowOffsetConst, }, }); + +const transforms: ViewStyle['transform'] = []; +transforms.forEach(transform => { + Object.keys(transform); +}); + +const invalidTransforms: ViewStyle['transform'] = [ + // @ts-expect-error Transform objects must not combine multiple properties. + {scale: 1, translateX: 1}, +];