diff --git a/package.json b/package.json index 74b02e44c8f5..6c0b4a3cb097 100644 --- a/package.json +++ b/package.json @@ -106,8 +106,8 @@ "micromatch": "^4.0.4", "node-fetch": "^2.2.0", "nullthrows": "^1.1.1", - "prettier": "3.6.2", - "prettier-plugin-hermes-parser": "0.36.0", + "prettier": "3.9.4", + "prettier-plugin-hermes-parser": "0.37.0", "react": "19.2.3", "react-test-renderer": "19.2.3", "rimraf": "^3.0.2", diff --git a/packages/debugger-frontend/index.js b/packages/debugger-frontend/index.js index ecd558a5d286..38903035b351 100644 --- a/packages/debugger-frontend/index.js +++ b/packages/debugger-frontend/index.js @@ -10,7 +10,12 @@ const path = require('path'); -let frontEndPath = path.join(__dirname, 'dist', 'third-party', 'front_end'); +let frontEndPath /*:string */ = path.join( + __dirname, + 'dist', + 'third-party', + 'front_end', +); if (process.env.REACT_NATIVE_DEBUGGER_FRONTEND_PATH != null) { frontEndPath = process.env.REACT_NATIVE_DEBUGGER_FRONTEND_PATH; @@ -33,4 +38,4 @@ if (process.env.REACT_NATIVE_DEBUGGER_FRONTEND_PATH != null) { ); } -module.exports = frontEndPath /*:: as string */; +module.exports = frontEndPath; diff --git a/packages/eslint-config-react-native/package.json b/packages/eslint-config-react-native/package.json index 4f405f5c2d96..937b51e14be1 100644 --- a/packages/eslint-config-react-native/package.json +++ b/packages/eslint-config-react-native/package.json @@ -43,6 +43,6 @@ }, "devDependencies": { "eslint": "^8.57.0", - "prettier": "3.6.2" + "prettier": "3.9.4" } } diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 1c7631f78fca..59c181994b2b 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -48,7 +48,7 @@ "babel-plugin-syntax-hermes-parser": "0.36.1", "hermes-estree": "0.36.1", "micromatch": "^4.0.4", - "prettier": "3.6.2", + "prettier": "3.9.4", "rimraf": "^3.0.2" }, "peerDependencies": { diff --git a/packages/react-native/Libraries/Alert/Alert.d.ts b/packages/react-native/Libraries/Alert/Alert.d.ts index c6a84a820a48..1692b6c4b568 100644 --- a/packages/react-native/Libraries/Alert/Alert.d.ts +++ b/packages/react-native/Libraries/Alert/Alert.d.ts @@ -85,10 +85,7 @@ export interface AlertStatic { } export type AlertType = - | 'default' - | 'plain-text' - | 'secure-text' - | 'login-password'; + 'default' | 'plain-text' | 'secure-text' | 'login-password'; export const Alert: AlertStatic; export type Alert = AlertStatic; diff --git a/packages/react-native/Libraries/Animated/Animated.d.ts b/packages/react-native/Libraries/Animated/Animated.d.ts index 6432625bdee9..86f905ee6966 100644 --- a/packages/react-native/Libraries/Animated/Animated.d.ts +++ b/packages/react-native/Libraries/Animated/Animated.d.ts @@ -78,11 +78,7 @@ export namespace Animated { }; type AnimatedColorInputValue = - | RgbaValue - | RgbaAnimatedValue - | ColorValue - | null - | undefined; + RgbaValue | RgbaAnimatedValue | ColorValue | null | undefined; class AnimatedColor extends AnimatedWithChildren { r: AnimatedValue; @@ -542,8 +538,7 @@ export namespace Animated { ): (...args: any[]) => void; export type ComponentProps = T extends - | React.ComponentType - | React.Component + React.ComponentType | React.Component ? P : never; @@ -586,8 +581,9 @@ export namespace Animated { : WithAnimatedValue; }; - export interface AnimatedComponent> - extends React.FC>> {} + export interface AnimatedComponent< + T extends React.ComponentType, + > extends React.FC>> {} export type AnimatedComponentOptions = { collapsable?: boolean | undefined; diff --git a/packages/react-native/Libraries/AppState/AppState.d.ts b/packages/react-native/Libraries/AppState/AppState.d.ts index ddc5ad0a511a..3bdd45e280f9 100644 --- a/packages/react-native/Libraries/AppState/AppState.d.ts +++ b/packages/react-native/Libraries/AppState/AppState.d.ts @@ -37,11 +37,7 @@ import {NativeEventSubscription} from '../EventEmitter/RCTNativeAppEventEmitter' */ export type AppStateEvent = 'change' | 'memoryWarning' | 'blur' | 'focus'; export type AppStateStatus = - | 'active' - | 'background' - | 'inactive' - | 'unknown' - | 'extension'; + 'active' | 'background' | 'inactive' | 'unknown' | 'extension'; export interface AppStateStatic { currentState: AppStateStatus; diff --git a/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts b/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts index 2c3f50530069..f2405fd59b5e 100644 --- a/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +++ b/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts @@ -46,10 +46,7 @@ type AccessibilityAnnouncementFinishedEventHandler = ( ) => void; type AccessibilityEventTypes = - | 'click' - | 'focus' - | 'viewHoverEnter' - | 'windowStateChange'; + 'click' | 'focus' | 'viewHoverEnter' | 'windowStateChange'; /** * @see https://reactnative.dev/docs/accessibilityinfo diff --git a/packages/react-native/Libraries/Components/Button.d.ts b/packages/react-native/Libraries/Components/Button.d.ts index 706307156b85..a76b883a2d64 100644 --- a/packages/react-native/Libraries/Components/Button.d.ts +++ b/packages/react-native/Libraries/Components/Button.d.ts @@ -12,22 +12,21 @@ import {ColorValue} from '../StyleSheet/StyleSheet'; import {TouchableNativeFeedbackProps} from './Touchable/TouchableNativeFeedback'; import {TouchableOpacityProps} from './Touchable/TouchableOpacity'; -export interface ButtonProps - extends Pick< - TouchableNativeFeedbackProps & TouchableOpacityProps, - | 'accessibilityLabel' - | 'accessibilityState' - | 'hasTVPreferredFocus' - | 'nextFocusDown' - | 'nextFocusForward' - | 'nextFocusLeft' - | 'nextFocusRight' - | 'nextFocusUp' - | 'testID' - | 'disabled' - | 'onPress' - | 'touchSoundDisabled' - > { +export interface ButtonProps extends Pick< + TouchableNativeFeedbackProps & TouchableOpacityProps, + | 'accessibilityLabel' + | 'accessibilityState' + | 'hasTVPreferredFocus' + | 'nextFocusDown' + | 'nextFocusForward' + | 'nextFocusLeft' + | 'nextFocusRight' + | 'nextFocusUp' + | 'testID' + | 'disabled' + | 'onPress' + | 'touchSoundDisabled' +> { /** * Text to display inside the button. On Android the given title will be converted to the uppercased form. */ diff --git a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts index 26fdec88e432..6a5f7a7adb15 100644 --- a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +++ b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts @@ -17,8 +17,7 @@ import { } from '../../Types/CoreEventTypes'; import {ViewProps} from '../View/ViewPropTypes'; -export interface DrawerSlideEvent - extends NativeSyntheticEvent {} +export interface DrawerSlideEvent extends NativeSyntheticEvent {} /** * DrawerLayoutAndroid is deprecated and will be removed in a future release. @@ -101,8 +100,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * it's closing or opening animation */ onDrawerStateChanged?: - | ((event: 'Idle' | 'Dragging' | 'Settling') => void) - | undefined; + ((event: 'Idle' | 'Dragging' | 'Settling') => void) | undefined; /** * The navigation view that will be rendered to the side of the diff --git a/packages/react-native/Libraries/Components/Keyboard/Keyboard.d.ts b/packages/react-native/Libraries/Components/Keyboard/Keyboard.d.ts index 062016e57ecd..211fd6f32b48 100644 --- a/packages/react-native/Libraries/Components/Keyboard/Keyboard.d.ts +++ b/packages/react-native/Libraries/Components/Keyboard/Keyboard.d.ts @@ -19,11 +19,7 @@ export type KeyboardEventName = | 'keyboardDidChangeFrame'; export type KeyboardEventEasing = - | 'easeIn' - | 'easeInEaseOut' - | 'easeOut' - | 'linear' - | 'keyboard'; + 'easeIn' | 'easeInEaseOut' | 'easeOut' | 'linear' | 'keyboard'; type KeyboardMetrics = { screenX: number; diff --git a/packages/react-native/Libraries/Components/Pressable/Pressable.d.ts b/packages/react-native/Libraries/Components/Pressable/Pressable.d.ts index 00d131f4aa11..aad64fe3183e 100644 --- a/packages/react-native/Libraries/Components/Pressable/Pressable.d.ts +++ b/packages/react-native/Libraries/Components/Pressable/Pressable.d.ts @@ -34,7 +34,8 @@ export interface PressableAndroidRippleConfig { } export interface PressableProps - extends AccessibilityProps, + extends + AccessibilityProps, Omit { /** * Called when the hover is activated to provide visual feedback. @@ -76,18 +77,14 @@ export interface PressableProps * @platform macos windows */ onBlur?: - | null - | ((event: NativeSyntheticEvent) => void) - | undefined; + null | ((event: NativeSyntheticEvent) => void) | undefined; /** * Called after the element is focused. * @platform macos windows */ onFocus?: - | null - | ((event: NativeSyntheticEvent) => void) - | undefined; + null | ((event: NativeSyntheticEvent) => void) | undefined; /** * Either children or a render prop that receives a boolean reflecting whether diff --git a/packages/react-native/Libraries/Components/RefreshControl/RefreshControl.d.ts b/packages/react-native/Libraries/Components/RefreshControl/RefreshControl.d.ts index 5fc0711b47c0..99a1357825f7 100644 --- a/packages/react-native/Libraries/Components/RefreshControl/RefreshControl.d.ts +++ b/packages/react-native/Libraries/Components/RefreshControl/RefreshControl.d.ts @@ -53,8 +53,7 @@ export interface RefreshControlPropsAndroid extends ViewProps { } export interface RefreshControlProps - extends RefreshControlPropsIOS, - RefreshControlPropsAndroid { + extends RefreshControlPropsIOS, RefreshControlPropsAndroid { /** * Called when the view starts refreshing. */ diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts b/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts index 9e36eeec115d..6d9a90b3d5a9 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts @@ -28,8 +28,7 @@ export interface PointProp { y: number; } -export interface ScrollResponderEvent - extends NativeSyntheticEvent {} +export interface ScrollResponderEvent extends NativeSyntheticEvent {} interface SubscribableMixin { /** @@ -410,11 +409,7 @@ export interface ScrollViewPropsIOS { * The default value of this property is "never". */ contentInsetAdjustmentBehavior?: - | 'automatic' - | 'scrollableAxes' - | 'never' - | 'always' - | undefined; + 'automatic' | 'scrollableAxes' | 'never' | 'always' | undefined; /** * When true the ScrollView will try to lock to only vertical or horizontal @@ -523,8 +518,7 @@ export interface ScrollViewPropsIOS { * @platform ios */ onScrollToTop?: - | ((event: NativeSyntheticEvent) => void) - | undefined; + ((event: NativeSyntheticEvent) => void) | undefined; /** * The current scale of the scroll view content. The default value is 1.0. @@ -598,10 +592,7 @@ export interface ScrollViewPropsAndroid { } export interface ScrollViewProps - extends ViewProps, - ScrollViewPropsIOS, - ScrollViewPropsAndroid, - Touchable { + extends ViewProps, ScrollViewPropsIOS, ScrollViewPropsAndroid, Touchable { /** * These styles will be applied to the scroll view content container which * wraps all of the child views. Example: @@ -681,43 +672,37 @@ export interface ScrollViewProps * */ onContentSizeChange?: - | ((contentWidth: number, contentHeight: number) => void) - | undefined; + ((contentWidth: number, contentHeight: number) => void) | undefined; /** * Fires at most once per frame during scrolling. */ onScroll?: - | ((event: NativeSyntheticEvent) => void) - | undefined; + ((event: NativeSyntheticEvent) => void) | undefined; /** * Fires if a user initiates a scroll gesture. */ onScrollBeginDrag?: - | ((event: NativeSyntheticEvent) => void) - | undefined; + ((event: NativeSyntheticEvent) => void) | undefined; /** * Fires when a user has finished scrolling. */ onScrollEndDrag?: - | ((event: NativeSyntheticEvent) => void) - | undefined; + ((event: NativeSyntheticEvent) => void) | undefined; /** * Fires when scroll view has finished moving */ onMomentumScrollEnd?: - | ((event: NativeSyntheticEvent) => void) - | undefined; + ((event: NativeSyntheticEvent) => void) | undefined; /** * Fires when scroll view has begun moving */ onMomentumScrollBegin?: - | ((event: NativeSyntheticEvent) => void) - | undefined; + ((event: NativeSyntheticEvent) => void) | undefined; /** * When true the scroll view stops on multiples of the scroll view's size @@ -900,8 +885,7 @@ export interface ScrollViewImperativeMethods { export type ScrollResponderType = ScrollViewImperativeMethods; export interface PublicScrollViewInstance - extends HostInstance, - ScrollViewImperativeMethods {} + extends HostInstance, ScrollViewImperativeMethods {} declare class ScrollViewComponent extends React.Component {} export declare const ScrollViewBase: Constructor & diff --git a/packages/react-native/Libraries/Components/StatusBar/StatusBar.d.ts b/packages/react-native/Libraries/Components/StatusBar/StatusBar.d.ts index d383d62ea562..b53c8a43624d 100644 --- a/packages/react-native/Libraries/Components/StatusBar/StatusBar.d.ts +++ b/packages/react-native/Libraries/Components/StatusBar/StatusBar.d.ts @@ -10,10 +10,7 @@ import type * as React from 'react'; export type StatusBarStyle = - | 'default' - | 'auto' - | 'light-content' - | 'dark-content'; + 'default' | 'auto' | 'light-content' | 'dark-content'; export type StatusBarAnimation = 'none' | 'fade' | 'slide'; diff --git a/packages/react-native/Libraries/Components/Switch/Switch.d.ts b/packages/react-native/Libraries/Components/Switch/Switch.d.ts index 7ffe96e663f6..35f501b70b66 100644 --- a/packages/react-native/Libraries/Components/Switch/Switch.d.ts +++ b/packages/react-native/Libraries/Components/Switch/Switch.d.ts @@ -45,8 +45,7 @@ export interface SwitchChangeEventData extends TargetedEvent { value: boolean; } -export interface SwitchChangeEvent - extends NativeSyntheticEvent {} +export interface SwitchChangeEvent extends NativeSyntheticEvent {} export interface SwitchProps extends SwitchPropsIOS { /** @@ -76,9 +75,7 @@ export interface SwitchProps extends SwitchPropsIOS { * Invoked with the change event as an argument when the value changes. */ onChange?: - | ((event: SwitchChangeEvent) => Promise | void) - | null - | undefined; + ((event: SwitchChangeEvent) => Promise | void) | null | undefined; /** * Invoked with the new value when the value changes. diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts index 6f24c1d360ba..9cb01c24c646 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts @@ -40,43 +40,25 @@ export type KeyboardTypeIOS = | 'web-search'; export type KeyboardTypeAndroid = 'visible-password'; export type KeyboardTypeOptions = - | KeyboardType - | KeyboardTypeAndroid - | KeyboardTypeIOS; + KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS; export type InputModeOptions = - | 'none' - | 'text' - | 'decimal' - | 'numeric' - | 'tel' - | 'search' - | 'email' - | 'url'; + 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'; export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send'; export type ReturnKeyTypeAndroid = 'none' | 'previous'; export type ReturnKeyTypeIOS = - | 'default' - | 'google' - | 'join' - | 'route' - | 'yahoo' - | 'emergency-call'; + 'default' | 'google' | 'join' | 'route' | 'yahoo' | 'emergency-call'; export type ReturnKeyTypeOptions = - | ReturnKeyType - | ReturnKeyTypeAndroid - | ReturnKeyTypeIOS; + ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; export type EnterKeyHintTypeAndroid = 'previous'; export type EnterKeyHintTypeIOS = 'enter'; export type EnterKeyHintType = 'done' | 'go' | 'next' | 'search' | 'send'; export type EnterKeyHintTypeOptions = - | EnterKeyHintType - | EnterKeyHintTypeAndroid - | EnterKeyHintTypeIOS; + EnterKeyHintType | EnterKeyHintTypeAndroid | EnterKeyHintTypeIOS; type DataDetectorTypes = | 'phoneNumber' @@ -145,11 +127,7 @@ export interface TextInputIOSProps { * When the clear button should appear on the right side of the text view */ clearButtonMode?: - | 'never' - | 'while-editing' - | 'unless-editing' - | 'always' - | undefined; + 'never' | 'while-editing' | 'unless-editing' | 'always' | undefined; /** * If true, clears the text field automatically when editing begins @@ -324,24 +302,14 @@ export interface TextInputIOSProps { * Set line break strategy on iOS. */ lineBreakStrategyIOS?: - | 'none' - | 'standard' - | 'hangul-word' - | 'push-out' - | undefined; + 'none' | 'standard' | 'hangul-word' | 'push-out' | undefined; /** * Set line break mode on iOS. * @platform ios */ lineBreakModeIOS?: - | 'wordWrapping' - | 'char' - | 'clip' - | 'head' - | 'middle' - | 'tail' - | undefined; + 'wordWrapping' | 'char' | 'clip' | 'head' | 'middle' | 'tail' | undefined; /** * If `false`, the iOS system will not insert an extra space after a paste operation @@ -573,7 +541,8 @@ export type TextInputSubmitEditingEvent = * @see https://reactnative.dev/docs/textinput#props */ export interface TextInputProps - extends ViewProps, + extends + ViewProps, TextInputIOSProps, TextInputAndroidProps, AccessibilityProps { @@ -865,8 +834,7 @@ export interface TextInputProps * Only called for multiline text inputs. */ onContentSizeChange?: - | ((e: TextInputContentSizeChangeEvent) => void) - | undefined; + ((e: TextInputContentSizeChangeEvent) => void) | undefined; /** * Callback that is called when text input ends. @@ -887,8 +855,7 @@ export interface TextInputProps * Callback that is called when a touch is released. */ onPressOut?: - | ((e: NativeSyntheticEvent) => void) - | undefined; + ((e: NativeSyntheticEvent) => void) | undefined; /** * Callback that is called when the text input is focused diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts b/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts index 9de3953b3150..e4b600844546 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +++ b/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts @@ -32,15 +32,13 @@ interface ThemeAttributeBackgroundPropType extends BaseBackgroundPropType { } type BackgroundPropType = - | RippleBackgroundPropType - | ThemeAttributeBackgroundPropType; + RippleBackgroundPropType | ThemeAttributeBackgroundPropType; /** * @see https://reactnative.dev/docs/touchablenativefeedback#props */ export interface TouchableNativeFeedbackProps - extends TouchableWithoutFeedbackProps, - TVProps { + extends TouchableWithoutFeedbackProps, TVProps { /** * Determines the type of background drawable that's going to be used to display feedback. * It takes an object with type property and extra data depending on the type. diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts index d579a8d66b12..0436416e6ed7 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts +++ b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts @@ -60,8 +60,7 @@ export interface TVProps { * @see https://reactnative.dev/docs/touchableopacity#props */ export interface TouchableOpacityProps - extends TouchableWithoutFeedbackProps, - TVProps { + extends TouchableWithoutFeedbackProps, TVProps { /** * Determines what the opacity of the wrapped view should be when touch is active. * Defaults to 0.2 diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts b/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts index 572a96901d5d..c47baa7c57d8 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +++ b/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts @@ -37,7 +37,8 @@ export interface TouchableWithoutFeedbackPropsAndroid { * @see https://reactnative.dev/docs/touchablewithoutfeedback#props */ export interface TouchableWithoutFeedbackProps - extends TouchableWithoutFeedbackPropsIOS, + extends + TouchableWithoutFeedbackPropsIOS, TouchableWithoutFeedbackPropsAndroid, AccessibilityProps { children?: React.ReactNode | undefined; diff --git a/packages/react-native/Libraries/Components/View/ViewAccessibility.d.ts b/packages/react-native/Libraries/Components/View/ViewAccessibility.d.ts index 7b22fb120e8d..ab4fd7a62b05 100644 --- a/packages/react-native/Libraries/Components/View/ViewAccessibility.d.ts +++ b/packages/react-native/Libraries/Components/View/ViewAccessibility.d.ts @@ -13,8 +13,7 @@ import {NativeSyntheticEvent} from '../../Types/CoreEventTypes'; * @see https://reactnative.dev/docs/accessibility#accessibility-properties */ export interface AccessibilityProps - extends AccessibilityPropsAndroid, - AccessibilityPropsIOS { + extends AccessibilityPropsAndroid, AccessibilityPropsIOS { /** * When true, indicates that the view is an accessibility element. * By default, all the touchable elements are accessible. @@ -76,15 +75,13 @@ export interface AccessibilityProps * When `accessible` is true, the system will try to invoke this function when the user performs an accessibility custom action. */ onAccessibilityAction?: - | ((event: AccessibilityActionEvent) => void) - | undefined; + ((event: AccessibilityActionEvent) => void) | undefined; /** * [Android] Controlling if a view fires accessibility events and if it is reported to accessibility services. */ importantForAccessibility?: - | ('auto' | 'yes' | 'no' | 'no-hide-descendants') - | undefined; + ('auto' | 'yes' | 'no' | 'no-hide-descendants') | undefined; /** * A value indicating whether the accessibility elements contained within @@ -278,11 +275,7 @@ export interface AccessibilityPropsAndroid { * @platform android */ importantForAccessibility?: - | 'auto' - | 'yes' - | 'no' - | 'no-hide-descendants' - | undefined; + 'auto' | 'yes' | 'no' | 'no-hide-descendants' | undefined; /** * Enables the view to be screen reader focusable, not keyboard focusable. diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts index 62803cabce7e..86e72f419fdd 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts @@ -129,7 +129,8 @@ export interface ViewPropsAndroid { * @see https://reactnative.dev/docs/view#props */ export interface ViewProps - extends ViewPropsAndroid, + extends + ViewPropsAndroid, ViewPropsIOS, GestureResponderHandlers, Touchable, diff --git a/packages/react-native/Libraries/Image/Image.d.ts b/packages/react-native/Libraries/Image/Image.d.ts index 03e70b518173..e889dcbb0e3b 100644 --- a/packages/react-native/Libraries/Image/Image.d.ts +++ b/packages/react-native/Libraries/Image/Image.d.ts @@ -99,9 +99,7 @@ interface ImagePropsAndroid { * @see https://reactnative.dev/docs/image#source */ export type ImageSourcePropType = - | ImageURISource - | ImageURISource[] - | ImageRequireSource; + ImageURISource | ImageURISource[] | ImageRequireSource; /** * @deprecated Use `ImageLoadEvent` instead. @@ -145,9 +143,7 @@ export interface ImageResolvedAssetSource { * @see https://reactnative.dev/docs/image */ export interface ImagePropsBase - extends ImagePropsIOS, - ImagePropsAndroid, - AccessibilityProps { + extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps { /** * Used to reference react managed images from native code. */ diff --git a/packages/react-native/Libraries/Image/ImageResizeMode.d.ts b/packages/react-native/Libraries/Image/ImageResizeMode.d.ts index 5df952b678de..024ef61ab103 100644 --- a/packages/react-native/Libraries/Image/ImageResizeMode.d.ts +++ b/packages/react-native/Libraries/Image/ImageResizeMode.d.ts @@ -8,12 +8,7 @@ */ export type ImageResizeMode = - | 'cover' - | 'contain' - | 'stretch' - | 'repeat' - | 'center' - | 'none'; + 'cover' | 'contain' | 'stretch' | 'repeat' | 'center' | 'none'; /** * @see ImageResizeMode.js diff --git a/packages/react-native/Libraries/Image/ImageSource.d.ts b/packages/react-native/Libraries/Image/ImageSource.d.ts index 98b9423175d8..43449f47309a 100644 --- a/packages/react-native/Libraries/Image/ImageSource.d.ts +++ b/packages/react-native/Libraries/Image/ImageSource.d.ts @@ -74,6 +74,4 @@ export interface ImageURISource { export type ImageRequireSource = number; export type ImageSource = - | ImageRequireSource - | ImageURISource - | ReadonlyArray; + ImageRequireSource | ImageURISource | ReadonlyArray; diff --git a/packages/react-native/Libraries/LayoutAnimation/LayoutAnimation.d.ts b/packages/react-native/Libraries/LayoutAnimation/LayoutAnimation.d.ts index 38ba92f73d52..73a353c4395d 100644 --- a/packages/react-native/Libraries/LayoutAnimation/LayoutAnimation.d.ts +++ b/packages/react-native/Libraries/LayoutAnimation/LayoutAnimation.d.ts @@ -8,22 +8,14 @@ */ export type LayoutAnimationType = - | 'spring' - | 'linear' - | 'easeInEaseOut' - | 'easeIn' - | 'easeOut' - | 'keyboard'; + 'spring' | 'linear' | 'easeInEaseOut' | 'easeIn' | 'easeOut' | 'keyboard'; export type LayoutAnimationTypes = { [type in LayoutAnimationType]: type; }; export type LayoutAnimationProperty = - | 'opacity' - | 'scaleX' - | 'scaleY' - | 'scaleXY'; + 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY'; export type LayoutAnimationProperties = { [prop in LayoutAnimationProperty]: prop; diff --git a/packages/react-native/Libraries/Lists/SectionList.d.ts b/packages/react-native/Libraries/Lists/SectionList.d.ts index d21a0589bbe9..25529ed887a6 100644 --- a/packages/react-native/Libraries/Lists/SectionList.d.ts +++ b/packages/react-native/Libraries/Lists/SectionList.d.ts @@ -36,10 +36,7 @@ export interface SectionBase { renderItem?: SectionListRenderItem | undefined; ItemSeparatorComponent?: - | React.ComponentType - | React.ReactElement - | null - | undefined; + React.ComponentType | React.ReactElement | null | undefined; keyExtractor?: ((item: ItemT, index: number) => string) | undefined; } @@ -54,8 +51,10 @@ export type SectionListData = SectionBase< * @see https://reactnative.dev/docs/sectionlist.html#props */ -export interface SectionListRenderItemInfo - extends ListRenderItemInfo { +export interface SectionListRenderItemInfo< + ItemT, + SectionT = DefaultSectionT, +> extends ListRenderItemInfo { section: SectionListData; } @@ -68,16 +67,15 @@ type VirtualizedListWithoutPreConfiguredProps = Omit< 'stickyHeaderIndices' >; -export interface SectionListProps - extends VirtualizedListWithoutPreConfiguredProps { +export interface SectionListProps< + ItemT, + SectionT = DefaultSectionT, +> extends VirtualizedListWithoutPreConfiguredProps { /** * Rendered in between each section. */ SectionSeparatorComponent?: - | React.ComponentType - | React.ReactElement - | null - | undefined; + React.ComponentType | React.ReactElement | null | undefined; /** * A marker property for telling the list to re-render (since it implements PureComponent). @@ -260,8 +258,10 @@ export class SectionList< > extends SectionListComponent> {} /* This definition is deprecated because it extends the wrong base type */ -export interface SectionListStatic - extends React.ComponentClass> { +export interface SectionListStatic< + ItemT, + SectionT = DefaultSectionT, +> extends React.ComponentClass> { /** * Scrolls to the item at the specified sectionIndex and itemIndex (within the section) * positioned in the viewable area such that viewPosition 0 places it at the top diff --git a/packages/react-native/Libraries/Modal/Modal.d.ts b/packages/react-native/Libraries/Modal/Modal.d.ts index db4e023be707..e60f63145fa5 100644 --- a/packages/react-native/Libraries/Modal/Modal.d.ts +++ b/packages/react-native/Libraries/Modal/Modal.d.ts @@ -58,11 +58,7 @@ export interface ModalPropsIOS { * The `presentationStyle` determines the style of modal to show */ presentationStyle?: - | 'fullScreen' - | 'pageSheet' - | 'formSheet' - | 'overFullScreen' - | undefined; + 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen' | undefined; /** * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations. @@ -88,8 +84,7 @@ export interface ModalPropsIOS { * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation. */ onOrientationChange?: - | ((event: NativeSyntheticEvent) => void) - | undefined; + ((event: NativeSyntheticEvent) => void) | undefined; /** * Controls whether the modal can be dismissed by swiping down on iOS. diff --git a/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts b/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts index 924c3d3f131f..96ad77f17ecf 100644 --- a/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +++ b/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts @@ -74,51 +74,53 @@ export interface PermissionsAndroidStatic { * A list of specified "dangerous" permissions that require prompting the user */ PERMISSIONS: { - [key in - | 'READ_CALENDAR' - | 'WRITE_CALENDAR' - | 'CAMERA' - | 'READ_CONTACTS' - | 'WRITE_CONTACTS' - | 'GET_ACCOUNTS' - | 'ACCESS_FINE_LOCATION' - | 'ACCESS_COARSE_LOCATION' - | 'ACCESS_BACKGROUND_LOCATION' - | 'RECORD_AUDIO' - | 'READ_PHONE_STATE' - | 'CALL_PHONE' - | 'READ_CALL_LOG' - | 'WRITE_CALL_LOG' - | 'ADD_VOICEMAIL' - | 'READ_VOICEMAIL' - | 'WRITE_VOICEMAIL' - | 'USE_SIP' - | 'PROCESS_OUTGOING_CALLS' - | 'BODY_SENSORS' - | 'BODY_SENSORS_BACKGROUND' - | 'SEND_SMS' - | 'RECEIVE_SMS' - | 'READ_SMS' - | 'RECEIVE_WAP_PUSH' - | 'RECEIVE_MMS' - | 'READ_EXTERNAL_STORAGE' - | 'READ_MEDIA_IMAGES' - | 'READ_MEDIA_VIDEO' - | 'READ_MEDIA_AUDIO' - | 'READ_MEDIA_VISUAL_USER_SELECTED' - | 'WRITE_EXTERNAL_STORAGE' - | 'BLUETOOTH_CONNECT' - | 'BLUETOOTH_SCAN' - | 'BLUETOOTH_ADVERTISE' - | 'ACCESS_MEDIA_LOCATION' - | 'ACCEPT_HANDOVER' - | 'ACTIVITY_RECOGNITION' - | 'ANSWER_PHONE_CALLS' - | 'READ_PHONE_NUMBERS' - | 'UWB_RANGING' - | 'POST_NOTIFICATIONS' - | 'NEARBY_WIFI_DEVICES' - | 'ACCESS_LOCAL_NETWORK']: Permission; + [ + key in + | 'READ_CALENDAR' + | 'WRITE_CALENDAR' + | 'CAMERA' + | 'READ_CONTACTS' + | 'WRITE_CONTACTS' + | 'GET_ACCOUNTS' + | 'ACCESS_FINE_LOCATION' + | 'ACCESS_COARSE_LOCATION' + | 'ACCESS_BACKGROUND_LOCATION' + | 'RECORD_AUDIO' + | 'READ_PHONE_STATE' + | 'CALL_PHONE' + | 'READ_CALL_LOG' + | 'WRITE_CALL_LOG' + | 'ADD_VOICEMAIL' + | 'READ_VOICEMAIL' + | 'WRITE_VOICEMAIL' + | 'USE_SIP' + | 'PROCESS_OUTGOING_CALLS' + | 'BODY_SENSORS' + | 'BODY_SENSORS_BACKGROUND' + | 'SEND_SMS' + | 'RECEIVE_SMS' + | 'READ_SMS' + | 'RECEIVE_WAP_PUSH' + | 'RECEIVE_MMS' + | 'READ_EXTERNAL_STORAGE' + | 'READ_MEDIA_IMAGES' + | 'READ_MEDIA_VIDEO' + | 'READ_MEDIA_AUDIO' + | 'READ_MEDIA_VISUAL_USER_SELECTED' + | 'WRITE_EXTERNAL_STORAGE' + | 'BLUETOOTH_CONNECT' + | 'BLUETOOTH_SCAN' + | 'BLUETOOTH_ADVERTISE' + | 'ACCESS_MEDIA_LOCATION' + | 'ACCEPT_HANDOVER' + | 'ACTIVITY_RECOGNITION' + | 'ANSWER_PHONE_CALLS' + | 'READ_PHONE_NUMBERS' + | 'UWB_RANGING' + | 'POST_NOTIFICATIONS' + | 'NEARBY_WIFI_DEVICES' + | 'ACCESS_LOCAL_NETWORK' + ]: Permission; }; new (): PermissionsAndroidStatic; /** diff --git a/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts b/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts index 364bd8aa01ed..f68bd1ff85b1 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +++ b/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts @@ -80,22 +80,13 @@ type ScheduleLocalNotificationDetails = { fireDate?: number | string | undefined; isSilent?: boolean | undefined; repeatInterval?: - | 'year' - | 'month' - | 'week' - | 'day' - | 'hour' - | 'minute' - | undefined; + 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | undefined; soundName?: string | undefined; userInfo?: Object | undefined; }; export type PushNotificationEventName = - | 'notification' - | 'localNotification' - | 'register' - | 'registrationError'; + 'notification' | 'localNotification' | 'register' | 'registrationError'; type FetchResult = { NewData: 'UIBackgroundFetchResultNewData'; diff --git a/packages/react-native/Libraries/ReactNative/RendererProxy.d.ts b/packages/react-native/Libraries/ReactNative/RendererProxy.d.ts index f7f451c09934..3e0fa1c1c9c3 100644 --- a/packages/react-native/Libraries/ReactNative/RendererProxy.d.ts +++ b/packages/react-native/Libraries/ReactNative/RendererProxy.d.ts @@ -13,8 +13,5 @@ export type NodeHandle = number; export function findNodeHandle( componentOrHandle: - | null - | number - | React.Component - | React.ComponentClass, + null | number | React.Component | React.ComponentClass, ): null | NodeHandle; diff --git a/packages/react-native/Libraries/ReactNative/UIManager.d.ts b/packages/react-native/Libraries/ReactNative/UIManager.d.ts index 773419bccf9c..f6c59166b5f7 100644 --- a/packages/react-native/Libraries/ReactNative/UIManager.d.ts +++ b/packages/react-native/Libraries/ReactNative/UIManager.d.ts @@ -86,8 +86,7 @@ export interface UIManagerStatic { * UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); */ setLayoutAnimationEnabledExperimental?: - | ((value: boolean) => void) - | undefined; + ((value: boolean) => void) | undefined; getViewManagerConfig: (name: string) => { Commands: {[key: string]: number}; diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheet.d.ts b/packages/react-native/Libraries/StyleSheet/StyleSheet.d.ts index 2b69bd1dc216..04583bc23f59 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheet.d.ts +++ b/packages/react-native/Libraries/StyleSheet/StyleSheet.d.ts @@ -15,8 +15,9 @@ export interface StyleSheetProperties { } type Falsy = undefined | null | false | ''; -interface RecursiveArray - extends Array | RecursiveArray> {} +interface RecursiveArray extends Array< + T | ReadonlyArray | RecursiveArray +> {} export type StyleProp = T | RecursiveArray | Falsy; type OpaqueColorValue = symbol & {__TYPE__: 'Color'}; diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts index a34ff98222e7..80c004612b10 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts @@ -12,18 +12,10 @@ import {ImageResizeMode} from '../Image/ImageResizeMode'; import {ColorValue} from './StyleSheet'; type FlexAlignType = - | 'flex-start' - | 'flex-end' - | 'center' - | 'stretch' - | 'baseline'; + 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'; export type DimensionValue = - | number - | 'auto' - | `${number}%` - | Animated.AnimatedNode - | null; + number | 'auto' | `${number}%` | Animated.AnimatedNode | null; type AnimatableNumericValue = number | Animated.AnimatedNode; type AnimatableStringValue = string | Animated.AnimatedNode; @@ -61,11 +53,7 @@ export interface FlexStyle { flex?: number | undefined; flexBasis?: DimensionValue | undefined; flexDirection?: - | 'row' - | 'column' - | 'row-reverse' - | 'column-reverse' - | undefined; + 'row' | 'column' | 'row-reverse' | 'column-reverse' | undefined; rowGap?: number | string | undefined; gap?: number | string | undefined; columnGap?: number | string | undefined; @@ -381,10 +369,7 @@ export type LinearGradientValue = { export type GradientValue = LinearGradientValue; type RadialExtent = - | 'closest-corner' - | 'closest-side' - | 'farthest-corner' - | 'farthest-side'; + 'closest-corner' | 'closest-side' | 'farthest-corner' | 'farthest-side'; export type RadialGradientPosition = | { top: number | string; @@ -430,10 +415,7 @@ export type BackgroundSizeValue = { }; export type BackgroundRepeatKeyword = - | 'repeat' - | 'space' - | 'round' - | 'no-repeat'; + 'repeat' | 'space' | 'round' | 'no-repeat'; export type BackgroundPositionValue = | { @@ -519,21 +501,13 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { mixBlendMode?: BlendMode | undefined; backgroundImage?: ReadonlyArray | string | undefined; experimental_backgroundImage?: - | ReadonlyArray - | string - | undefined; + ReadonlyArray | string | undefined; experimental_backgroundSize?: - | ReadonlyArray - | string - | undefined; + ReadonlyArray | string | undefined; experimental_backgroundPosition?: - | ReadonlyArray - | string - | undefined; + ReadonlyArray | string | undefined; experimental_backgroundRepeat?: - | ReadonlyArray - | string - | undefined; + ReadonlyArray | string | undefined; } export type FontVariant = @@ -574,12 +548,7 @@ export interface TextStyleIOS extends ViewStyle { fontVariant?: FontVariant[] | undefined; textDecorationColor?: ColorValue | undefined; textDecorationStyle?: - | 'solid' - | 'double' - | 'dotted' - | 'dashed' - | 'wavy' - | undefined; + 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy' | undefined; writingDirection?: 'auto' | 'ltr' | 'rtl' | undefined; } @@ -650,12 +619,7 @@ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { | 'underline line-through' | undefined; textDecorationStyle?: - | 'solid' - | 'double' - | 'dotted' - | 'dashed' - | 'wavy' - | undefined; + 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy' | undefined; textDecorationColor?: ColorValue | undefined; textShadowColor?: ColorValue | undefined; textShadowOffset?: {width: number; height: number} | undefined; diff --git a/packages/react-native/Libraries/Text/Text.d.ts b/packages/react-native/Libraries/Text/Text.d.ts index fe77abfcc43c..cdb26800b76c 100644 --- a/packages/react-native/Libraries/Text/Text.d.ts +++ b/packages/react-native/Libraries/Text/Text.d.ts @@ -52,11 +52,7 @@ export interface TextPropsIOS { * Set line break strategy on iOS. */ lineBreakStrategyIOS?: - | 'none' - | 'standard' - | 'hangul-word' - | 'push-out' - | undefined; + 'none' | 'standard' | 'hangul-word' | 'push-out' | undefined; } export interface TextPropsAndroid { @@ -86,13 +82,7 @@ export interface TextPropsAndroid { * By default no data types are detected. */ dataDetectorType?: - | null - | 'phoneNumber' - | 'link' - | 'email' - | 'none' - | 'all' - | undefined; + null | 'phoneNumber' | 'link' | 'email' | 'none' | 'all' | undefined; /** * Hyphenation strategy @@ -102,9 +92,7 @@ export interface TextPropsAndroid { // https://reactnative.dev/docs/text#props export interface TextProps - extends TextPropsIOS, - TextPropsAndroid, - AccessibilityProps { + extends TextPropsIOS, TextPropsAndroid, AccessibilityProps { /** * Specifies whether fonts should scale to respect Text Size accessibility settings. * The default is `true`. @@ -216,8 +204,7 @@ export interface TextProps * Defines how far your touch may move off of the button, before deactivating the button. */ pressRetentionOffset?: - | {top: number; left: number; bottom: number; right: number} - | undefined; + {top: number; left: number; bottom: number; right: number} | undefined; } /** diff --git a/packages/react-native/Libraries/Types/CoreEventTypes.d.ts b/packages/react-native/Libraries/Types/CoreEventTypes.d.ts index 3bcef4f26b9e..e55fae6b7b8d 100644 --- a/packages/react-native/Libraries/Types/CoreEventTypes.d.ts +++ b/packages/react-native/Libraries/Types/CoreEventTypes.d.ts @@ -45,8 +45,11 @@ export interface TextLayoutEventData extends TargetedEvent { export type TextLayoutEvent = NativeSyntheticEvent; // Similar to React.SyntheticEvent except for nativeEvent -export interface NativeSyntheticEvent - extends React.BaseSyntheticEvent {} +export interface NativeSyntheticEvent extends React.BaseSyntheticEvent< + T, + HostInstance, + HostInstance +> {} export interface NativeTouchEvent { /** @@ -239,8 +242,7 @@ export interface NativePointerEvent extends NativeMouseEvent { export type PointerEvent = NativeSyntheticEvent; -export interface GestureResponderEvent - extends NativeSyntheticEvent {} +export interface GestureResponderEvent extends NativeSyntheticEvent {} export interface MouseEvent extends NativeSyntheticEvent {} diff --git a/packages/react-native/Libraries/Utilities/Platform.d.ts b/packages/react-native/Libraries/Utilities/Platform.d.ts index b7252bd27c63..01da20012a04 100644 --- a/packages/react-native/Libraries/Utilities/Platform.d.ts +++ b/packages/react-native/Libraries/Utilities/Platform.d.ts @@ -11,12 +11,7 @@ * @see https://reactnative.dev/docs/platform-specific-code#content */ export type PlatformOSType = - | 'ios' - | 'android' - | 'macos' - | 'windows' - | 'web' - | 'native'; + 'ios' | 'android' | 'macos' | 'windows' | 'web' | 'native'; type PlatformConstants = { isTesting: boolean; isDisableAnimations?: boolean | undefined; diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index b5cdeaf11758..214d2651245e 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<<637f1d0b012ebca68c9e020a52eb2803>> + * @generated SignedSource<<0ef11b701c83f2414d61f7ec37c78df1>> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -178,9 +178,7 @@ declare const createAnimatedComponent: typeof $$AnimatedImplementation.createAni declare const decay: typeof $$AnimatedImplementation.decay declare const decayImpl: ( value: - | AnimatedColor_default - | AnimatedValue_default - | AnimatedValueXY_default, + AnimatedColor_default | AnimatedValue_default | AnimatedValueXY_default, config: DecayAnimationConfig, ) => CompositeAnimation declare const delay: typeof $$AnimatedImplementation.delay @@ -291,8 +289,7 @@ declare let NativeModules_default: { [moduleName: string]: any } declare const NativeTouchable: - | typeof TouchableNativeFeedback - | typeof TouchableOpacity + typeof TouchableNativeFeedback | typeof TouchableOpacity declare const Networking: typeof RCTNetworking_default declare const PanResponder: typeof PanResponder_default declare const PanResponder_default: { @@ -393,9 +390,7 @@ declare let Settings_default: { declare const spring: typeof $$AnimatedImplementation.spring declare const springImpl: ( value: - | AnimatedColor_default - | AnimatedValue_default - | AnimatedValueXY_default, + AnimatedColor_default | AnimatedValue_default | AnimatedValueXY_default, config: SpringAnimationConfig, ) => CompositeAnimation declare const stagger: typeof $$AnimatedImplementation.stagger @@ -434,9 +429,7 @@ declare const TextInput: TextInputType declare const timing: typeof $$AnimatedImplementation.timing declare const timingImpl: ( value: - | AnimatedColor_default - | AnimatedValue_default - | AnimatedValueXY_default, + AnimatedColor_default | AnimatedValue_default | AnimatedValueXY_default, config: TimingAnimationConfig, ) => CompositeAnimation declare const ToastAndroid: typeof ToastAndroid_default @@ -530,10 +523,8 @@ declare const VirtualizedSectionList: typeof VirtualizedSectionList_default declare const VirtualizedSectionList_default: VirtualizedSectionListType declare const VirtualizedSectionListComponent_default: < ItemT, - SectionT extends SectionBase< - ItemT, - DefaultVirtualizedSectionT - > = DefaultVirtualizedSectionT, + SectionT extends SectionBase = + DefaultVirtualizedSectionT, >( props: VirtualizedSectionListProps & { ref?: React.Ref<{ @@ -688,18 +679,9 @@ declare type ____LayoutStyle_Internal = { | "space-evenly" | "stretch" readonly alignItems?: - | "baseline" - | "center" - | "flex-end" - | "flex-start" - | "stretch" + "baseline" | "center" | "flex-end" | "flex-start" | "stretch" readonly alignSelf?: - | "auto" - | "baseline" - | "center" - | "flex-end" - | "flex-start" - | "stretch" + "auto" | "baseline" | "center" | "flex-end" | "flex-start" | "stretch" readonly aspectRatio?: number | string readonly borderBottomWidth?: number readonly borderEndWidth?: number @@ -810,26 +792,13 @@ declare type ____TextStyle_InternalBase = { readonly letterSpacing?: number readonly lineHeight?: number readonly textAlign?: - | "auto" - | "center" - | "end" - | "justify" - | "left" - | "right" - | "start" + "auto" | "center" | "end" | "justify" | "left" | "right" | "start" readonly textAlignVertical?: "auto" | "bottom" | "center" | "top" readonly textDecorationColor?: ____ColorValue_Internal readonly textDecorationLine?: - | "line-through" - | "none" - | "underline line-through" - | "underline" + "line-through" | "none" | "underline line-through" | "underline" readonly textDecorationStyle?: - | "dashed" - | "dotted" - | "double" - | "solid" - | "wavy" + "dashed" | "dotted" | "double" | "solid" | "wavy" readonly textShadowColor?: ____ColorValue_Internal readonly textShadowOffset?: { readonly height: number @@ -909,8 +878,7 @@ declare type ____TransformStyle_Internal = { > | string readonly transformOrigin?: - | [number | string, number | string, number | string] - | string + [number | string, number | string, number | string] | string } declare type ____ViewStyle_Internal = Readonly< ____ViewStyle_InternalCore & ____ViewStyle_InternalOverrides @@ -1018,12 +986,7 @@ declare type AccessibilityActionInfo = { readonly name: AccessibilityActionName | string } declare type AccessibilityActionName = - | "activate" - | "decrement" - | "escape" - | "increment" - | "longpress" - | "magicTap" + "activate" | "decrement" | "escape" | "increment" | "longpress" | "magicTap" declare type AccessibilityEventDefinitions = AccessibilityEventDefinitionsAndroid & AccessibilityEventDefinitionsIOS & { @@ -1049,10 +1012,7 @@ declare type AccessibilityEventDefinitionsIOS = { reduceTransparencyChanged: [boolean] } declare type AccessibilityEventTypes = - | "click" - | "focus" - | "viewHoverEnter" - | "windowStateChange" + "click" | "focus" | "viewHoverEnter" | "windowStateChange" declare type AccessibilityInfo = typeof AccessibilityInfo declare type AccessibilityProps = Readonly< AccessibilityPropsAndroid & @@ -1080,16 +1040,12 @@ declare type AccessibilityProps = Readonly< > declare type AccessibilityPropsAndroid = { readonly accessibilityLabelledBy?: - | (Array | undefined) - | (string | undefined) + (Array | undefined) | (string | undefined) readonly accessibilityLiveRegion?: "assertive" | "none" | "polite" readonly "aria-labelledby"?: string readonly "aria-live"?: "assertive" | "off" | "polite" readonly importantForAccessibility?: - | "auto" - | "no-hide-descendants" - | "no" - | "yes" + "auto" | "no-hide-descendants" | "no" | "yes" readonly screenReaderFocusable?: boolean } declare type AccessibilityPropsIOS = { @@ -1163,8 +1119,7 @@ declare type ActionSheetIOSOptions = { readonly cancelButtonIndex?: number readonly cancelButtonTintColor?: ColorValue | ProcessedColorValue readonly destructiveButtonIndex?: - | (Array | undefined) - | (number | undefined) + (Array | undefined) | (number | undefined) readonly disabledButtonIndices?: Array readonly disabledButtonTintColor?: ColorValue | ProcessedColorValue readonly message?: string @@ -1182,8 +1137,9 @@ declare type ActivityIndicatorInstance = HostInstance declare type ActivityIndicatorIOSProps = { readonly hidesWhenStopped?: boolean } -declare interface ActivityIndicatorProps - extends Readonly { +declare interface ActivityIndicatorProps extends Readonly< + ViewProps & ActivityIndicatorIOSProps +> { readonly animating?: boolean readonly color?: ColorValue readonly size?: IndicatorSize @@ -1203,9 +1159,7 @@ declare class Alert { title: null | string | undefined, message?: null | string | undefined, callbackOrButtons?: - | (((text: string) => void) | AlertButtons) - | null - | undefined, + (((text: string) => void) | AlertButtons) | null | undefined, type?: AlertType | null | undefined, defaultValue?: string, keyboardType?: string, @@ -1226,10 +1180,7 @@ declare type AlertOptions = { userInterfaceStyle?: "dark" | "light" | "unspecified" } declare type AlertType = - | "default" - | "login-password" - | "plain-text" - | "secure-text" + "default" | "login-password" | "plain-text" | "secure-text" declare type AndroidDrawable = AndroidDrawableRipple | AndroidDrawableThemeAttr declare type AndroidDrawableRipple = { readonly alpha?: number @@ -1640,11 +1591,7 @@ declare class AppStateImpl { constructor() } declare type AppStateStatus = - | "active" - | "background" - | "extension" - | "inactive" - | "unknown" + "active" | "background" | "extension" | "inactive" | "unknown" declare interface ArrayLike_2 extends Iterable { [indexer: number]: T readonly length: number @@ -1739,10 +1686,7 @@ declare interface ButtonProps { readonly disabled?: boolean readonly hasTVPreferredFocus?: boolean readonly importantForAccessibility?: - | "auto" - | "no-hide-descendants" - | "no" - | "yes" + "auto" | "no-hide-descendants" | "no" | "yes" readonly nextFocusDown?: number readonly nextFocusForward?: number readonly nextFocusLeft?: number @@ -2123,9 +2067,7 @@ declare type EnterKeyHintType = "done" | "go" | "next" | "search" | "send" declare type EnterKeyHintTypeAndroid = "previous" declare type EnterKeyHintTypeIOS = "enter" declare type EnterKeyHintTypeOptions = - | EnterKeyHintType - | EnterKeyHintTypeAndroid - | EnterKeyHintTypeIOS + EnterKeyHintType | EnterKeyHintTypeAndroid | EnterKeyHintTypeIOS declare type ErrorHandler = (error: unknown, isFatal: boolean) => void declare type ErrorUtils = { applyWithGuard, TOut>( @@ -2167,8 +2109,7 @@ declare class EventEmitter< TEventToArgsMap extends Readonly< Record> > = Readonly>>, -> implements IEventEmitter -{ +> implements IEventEmitter { addListener( eventType: TEvent, listener: (...args: TEventToArgsMap[TEvent]) => unknown, @@ -2311,19 +2252,18 @@ declare class FlatList extends React.PureComponent< declare type FlatListBaseProps = RequiredFlatListProps & OptionalFlatListProps declare type FlatListInstance = FlatList -declare interface FlatListProps - extends Readonly< - Omit< - VirtualizedListProps, - | "data" - | "getItem" - | "getItemCount" - | "getItemLayout" - | "keyExtractor" - | "renderItem" - > & - FlatListBaseProps - > {} +declare interface FlatListProps extends Readonly< + Omit< + VirtualizedListProps, + | "data" + | "getItem" + | "getItemCount" + | "getItemLayout" + | "keyExtractor" + | "renderItem" + > & + FlatListBaseProps +> {} declare type flatten = typeof flatten declare type FlattenDepthLimiter = [void, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] declare function flattenStyle_default< @@ -2492,8 +2432,9 @@ declare class ImageBackground extends React.Component { setNativeProps(props: {}): void } declare type ImageBackgroundInstance = ImageBackground -declare interface ImageBackgroundProps - extends Readonly> { +declare interface ImageBackgroundProps extends Readonly< + Omit +> { readonly children?: React.ReactNode readonly imageRef?: React.Ref> readonly imageStyle?: ImageStyleProp @@ -2573,19 +2514,18 @@ declare type ImagePropsAndroid = { readonly resizeMethod?: "auto" | "none" | "resize" | "scale" readonly resizeMultiplier?: number } -declare interface ImagePropsBase - extends Readonly< - Omit< - Omit, - | "accessibilityLabel" - | "accessible" - | "aria-label" - | "aria-labelledby" - | "children" - | "onLayout" - | "testID" - > - > { +declare interface ImagePropsBase extends Readonly< + Omit< + Omit, + | "accessibilityLabel" + | "accessible" + | "aria-label" + | "aria-labelledby" + | "children" + | "onLayout" + | "testID" + > +> { readonly accessibilityLabel?: string readonly accessible?: boolean readonly alt?: string @@ -2626,21 +2566,14 @@ declare type ImagePropsIOS = { } declare type ImageRequireSource = number declare type ImageResizeMode = - | "center" - | "contain" - | "cover" - | "none" - | "repeat" - | "stretch" + "center" | "contain" | "cover" | "none" | "repeat" | "stretch" declare type ImageResolvedAssetSource = ResolvedAssetSource declare type ImageSize = { height: number width: number } declare type ImageSource = - | ImageRequireSource - | ImageURISource - | ReadonlyArray + ImageRequireSource | ImageURISource | ReadonlyArray declare type ImageSourcePropType = ImageSource declare type ImageStyle = ____ImageStyle_Internal declare type ImageStyleProp = ____ImageStyleProp_Internal @@ -2691,18 +2624,9 @@ declare interface InputAccessoryViewProps { readonly style?: ViewStyleProp } declare type InputModeOptions = - | "decimal" - | "email" - | "none" - | "numeric" - | "search" - | "tel" - | "text" - | "url" + "decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" declare type InputValue = - | (ColorValue | RgbaAnimatedValue | RgbaValue) - | null - | undefined + (ColorValue | RgbaAnimatedValue | RgbaValue) | null | undefined declare type Insets = Rect declare type Int32 = number declare type InternalInstanceHandle = symbol & { @@ -2714,9 +2638,7 @@ declare type InternalTextInput = ( }, ) => React.ReactNode declare type InterpolationConfigSupportedOutputType = - | NativeColorValue - | number - | string + NativeColorValue | number | string declare type InterpolationConfigType< OutputT extends InterpolationConfigSupportedOutputType, > = Readonly< @@ -2837,11 +2759,7 @@ declare type KeyboardEventDefinitions = { keyboardWillShow: [KeyboardEvent] } declare type KeyboardEventEasing = - | "easeIn" - | "easeInEaseOut" - | "easeOut" - | "keyboard" - | "linear" + "easeIn" | "easeInEaseOut" | "easeOut" | "keyboard" | "linear" declare type KeyboardEventName = keyof KeyboardEventDefinitions declare class KeyboardImpl { addListener( @@ -2881,9 +2799,7 @@ declare type KeyboardTypeIOS = | "twitter" | "web-search" declare type KeyboardTypeOptions = - | KeyboardType - | KeyboardTypeAndroid - | KeyboardTypeIOS + KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS declare type KeyDownEvent = NativeSyntheticEvent declare type KeyEvent = { readonly altKey: boolean @@ -2923,17 +2839,9 @@ declare type LayoutAnimationProperties = Readonly<{ [prop in LayoutAnimationProperty]: prop }> declare type LayoutAnimationProperty = - | "opacity" - | "scaleX" - | "scaleXY" - | "scaleY" + "opacity" | "scaleX" | "scaleXY" | "scaleY" declare type LayoutAnimationType = - | "easeIn" - | "easeInEaseOut" - | "easeOut" - | "keyboard" - | "linear" - | "spring" + "easeIn" | "easeInEaseOut" | "easeOut" | "keyboard" | "linear" | "spring" declare type LayoutAnimationTypes = Readonly<{ [type in LayoutAnimationType]: type }> @@ -3134,10 +3042,7 @@ declare type ModalPropsIOS = { onDismiss?: () => void onOrientationChange?: DirectEventHandler presentationStyle?: - | "formSheet" - | "fullScreen" - | "overFullScreen" - | "pageSheet" + "formSheet" | "fullScreen" | "overFullScreen" | "pageSheet" supportedOrientations?: ReadonlyArray< | "landscape-left" | "landscape-right" @@ -3191,8 +3096,7 @@ declare class NativeEventEmitter< TEventToArgsMap extends Readonly< Record> > = Readonly>>, -> implements IEventEmitter -{ +> implements IEventEmitter { addListener( eventType: TEvent, listener: (...args: TEventToArgsMap[TEvent]) => unknown, @@ -3633,23 +3537,14 @@ declare type Platform = typeof Platform declare function PlatformColor(...names: Array): NativeColorValue declare type PlatformConfig = {} declare type PlatformOSType = - | "android" - | "ios" - | "macos" - | "native" - | "web" - | "windows" + "android" | "ios" | "macos" | "native" | "web" | "windows" declare type PlatformSelectSpec = | (Omit, "default"> & { default: T }) | OptionalPlatformSelectSpec declare type PlatformType = - | AndroidPlatform - | IOSPlatform - | MacOSPlatform - | WebPlatform - | WindowsPlatform + AndroidPlatform | IOSPlatform | MacOSPlatform | WebPlatform | WindowsPlatform declare type PointerEvent = NativeSyntheticEvent declare type PointerEventProps = { readonly onClick?: (event: PointerEvent) => void @@ -3753,8 +3648,7 @@ declare type PressableBaseProps = { readonly blockNativeResponder?: boolean readonly cancelable?: boolean readonly children?: - | ((state: PressableStateCallbackType) => React.ReactNode) - | React.ReactNode + ((state: PressableStateCallbackType) => React.ReactNode) | React.ReactNode readonly delayHoverIn?: number readonly delayHoverOut?: number readonly delayLongPress?: number @@ -3770,16 +3664,14 @@ declare type PressableBaseProps = { readonly onPressOut?: (event: GestureResponderEvent) => unknown readonly pressRetentionOffset?: RectOrSize readonly style?: - | ((state: PressableStateCallbackType) => ViewStyleProp) - | ViewStyleProp + ((state: PressableStateCallbackType) => ViewStyleProp) | ViewStyleProp readonly testID?: string readonly testOnly_pressed?: boolean } declare type PressableInstance = HostInstance -declare interface PressableProps - extends Readonly< - Omit & PressableBaseProps - > {} +declare interface PressableProps extends Readonly< + Omit & PressableBaseProps +> {} declare type PressableStateCallbackType = { readonly pressed: boolean } @@ -3890,10 +3782,7 @@ declare type PushNotificationPermissions = { sound: boolean } declare type RadialExtent = - | "closest-corner" - | "closest-side" - | "farthest-corner" - | "farthest-side" + "closest-corner" | "closest-side" | "farthest-corner" | "farthest-side" declare type RadialGradientPosition = | { bottom: number | string @@ -4128,13 +4017,12 @@ declare type RefreshControlBaseProps = { readonly refreshing: boolean } declare type RefreshControlInstance = RefreshControl -declare interface RefreshControlProps - extends Readonly< - ViewProps & - RefreshControlPropsIOS & - RefreshControlPropsAndroid & - RefreshControlBaseProps - > {} +declare interface RefreshControlProps extends Readonly< + ViewProps & + RefreshControlPropsIOS & + RefreshControlPropsAndroid & + RefreshControlBaseProps +> {} declare type RefreshControlPropsAndroid = { readonly colors?: ReadonlyArray readonly enabled?: boolean @@ -4254,16 +4142,9 @@ declare type ResponderSyntheticEvent = Readonly< declare type ReturnKeyType = "done" | "go" | "next" | "search" | "send" declare type ReturnKeyTypeAndroid = "none" | "previous" declare type ReturnKeyTypeIOS = - | "default" - | "emergency-call" - | "google" - | "join" - | "route" - | "yahoo" + "default" | "emergency-call" | "google" | "join" | "route" | "yahoo" declare type ReturnKeyTypeOptions = - | ReturnKeyType - | ReturnKeyTypeAndroid - | ReturnKeyTypeIOS + ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS declare type RgbaAnimatedValue = { readonly a: AnimatedValue_default readonly b: AnimatedValue_default @@ -4455,15 +4336,10 @@ declare interface ScrollViewImperativeMethods { ) => void } declare interface ScrollViewInstance - extends HostInstance, - ScrollViewImperativeMethods {} -declare interface ScrollViewProps - extends Readonly< - ViewProps & - ScrollViewPropsIOS & - ScrollViewPropsAndroid & - ScrollViewBaseProps - > {} + extends HostInstance, ScrollViewImperativeMethods {} +declare interface ScrollViewProps extends Readonly< + ViewProps & ScrollViewPropsIOS & ScrollViewPropsAndroid & ScrollViewBaseProps +> {} declare type ScrollViewPropsAndroid = { readonly endFillColor?: ColorValue readonly fadingEdgeLength?: @@ -4490,10 +4366,7 @@ declare type ScrollViewPropsIOS = { readonly centerContent?: boolean readonly contentInset?: EdgeInsetsProp readonly contentInsetAdjustmentBehavior?: - | "always" - | "automatic" - | "never" - | "scrollableAxes" + "always" | "automatic" | "never" | "scrollableAxes" readonly directionalLockEnabled?: boolean readonly disableScrollViewPanResponder?: boolean readonly indicatorStyle?: "black" | "default" | "white" @@ -4565,15 +4438,17 @@ declare type SectionListData< | (SectionBase & SectionT) | SectionT declare type SectionListInstance = SectionList -declare interface SectionListProps - extends Readonly< - Omit< - VirtualizedSectionListProps, - "getItem" | "getItemCount" | "keyExtractor" | "renderItem" - > & - RequiredSectionListProps & - OptionalSectionListProps - > {} +declare interface SectionListProps< + ItemT, + SectionT = DefaultSectionT, +> extends Readonly< + Omit< + VirtualizedSectionListProps, + "getItem" | "getItemCount" | "keyExtractor" | "renderItem" + > & + RequiredSectionListProps & + OptionalSectionListProps +> {} declare type SectionListRenderItem = ( info: SectionListRenderItemInfo, ) => null | React.ReactNode @@ -4896,12 +4771,7 @@ declare type StickyHeaderComponentType = ( }, ) => React.ReactNode declare type StyleProp = - | "" - | false - | null - | ReadonlyArray> - | T - | void + "" | false | null | ReadonlyArray> | T | void declare namespace StyleSheet { export { AbsoluteFillStyle, @@ -4922,8 +4792,9 @@ declare type SwitchChangeEventData = { readonly value: boolean } declare type SwitchInstance = HostInstance -declare interface SwitchProps - extends Readonly {} +declare interface SwitchProps extends Readonly< + ViewProps & SwitchPropsIOS & SwitchPropsBase +> {} declare type SwitchPropsBase = { disabled?: boolean ios_backgroundColor?: ColorValue @@ -5056,11 +4927,7 @@ declare type TextInputAndroidProps = { readonly cursorColor?: ColorValue readonly disableFullscreenUI?: boolean readonly importantForAutofill?: - | "auto" - | "no" - | "noExcludeDescendants" - | "yes" - | "yesExcludeDescendants" + "auto" | "no" | "noExcludeDescendants" | "yes" | "yesExcludeDescendants" readonly inlineImageLeft?: string readonly inlineImagePadding?: number readonly numberOfLines?: number @@ -5226,31 +5093,19 @@ declare type TextInputFocusEvent = FocusEvent declare type TextInputInstance = _TextInputInstance declare type TextInputIOSProps = { readonly clearButtonMode?: - | "always" - | "never" - | "unless-editing" - | "while-editing" + "always" | "never" | "unless-editing" | "while-editing" readonly clearTextOnFocus?: boolean readonly dataDetectorTypes?: - | (DataDetectorTypesType | undefined) - | ReadonlyArray + (DataDetectorTypesType | undefined) | ReadonlyArray readonly disableKeyboardShortcuts?: boolean readonly enablesReturnKeyAutomatically?: boolean readonly inputAccessoryViewButtonLabel?: string readonly inputAccessoryViewID?: string readonly keyboardAppearance?: "dark" | "default" | "light" readonly lineBreakModeIOS?: - | "char" - | "clip" - | "head" - | "middle" - | "tail" - | "wordWrapping" + "char" | "clip" | "head" | "middle" | "tail" | "wordWrapping" readonly lineBreakStrategyIOS?: - | "hangul-word" - | "none" - | "push-out" - | "standard" + "hangul-word" | "none" | "push-out" | "standard" readonly passwordRules?: PasswordRules readonly rejectResponderTermination?: boolean readonly scrollEnabled?: boolean @@ -5267,13 +5122,12 @@ declare type TextInputKeyPressEventData = Readonly< target?: number } > -declare interface TextInputProps - extends Readonly< - Omit & - TextInputIOSProps & - TextInputAndroidProps & - TextInputBaseProps - > {} +declare interface TextInputProps extends Readonly< + Omit & + TextInputIOSProps & + TextInputAndroidProps & + TextInputBaseProps +> {} declare type TextInputSelectionChangeEvent = NativeSyntheticEvent declare type TextInputSelectionChangeEventData = Readonly< @@ -5309,14 +5163,13 @@ declare type TextPointerEventProps = { readonly onPointerLeave?: (event: PointerEvent) => void readonly onPointerMove?: (event: PointerEvent) => void } -declare interface TextProps - extends Readonly< - TextPointerEventProps & - TextPropsIOS & - TextPropsAndroid & - TextBaseProps & - AccessibilityProps - > {} +declare interface TextProps extends Readonly< + TextPointerEventProps & + TextPropsIOS & + TextPropsAndroid & + TextBaseProps & + AccessibilityProps +> {} declare type TextPropsAndroid = { adjustsFontSizeToFit?: boolean dataDetectorType?: "all" | "email" | "link" | "none" | "phoneNumber" @@ -5383,13 +5236,12 @@ declare type TouchableHighlightBaseProps = { readonly underlayColor?: ColorValue } declare type TouchableHighlightInstance = HostInstance -declare interface TouchableHighlightProps - extends Readonly< - TouchableWithoutFeedbackProps & - AndroidProps & - IOSProps & - TouchableHighlightBaseProps - > {} +declare interface TouchableHighlightProps extends Readonly< + TouchableWithoutFeedbackProps & + AndroidProps & + IOSProps & + TouchableHighlightBaseProps +> {} declare class TouchableNativeFeedback extends React.Component< TouchableNativeFeedbackProps, TouchableNativeFeedbackState @@ -5433,8 +5285,7 @@ declare type TouchableNativeFeedbackProps = Readonly< background?: | { readonly attribute: - | "selectableItemBackground" - | "selectableItemBackgroundBorderless" + "selectableItemBackground" | "selectableItemBackgroundBorderless" readonly rippleRadius: number | undefined readonly type: "ThemeAttrAndroid" } @@ -5490,12 +5341,11 @@ declare type TouchableState = declare function TouchableWithoutFeedback( props: TouchableWithoutFeedbackProps, ): React.ReactNode -declare interface TouchableWithoutFeedbackProps - extends Readonly< - TouchableWithoutFeedbackPropsAndroid & - TouchableWithoutFeedbackPropsIOS & - AccessibilityProps - > { +declare interface TouchableWithoutFeedbackProps extends Readonly< + TouchableWithoutFeedbackPropsAndroid & + TouchableWithoutFeedbackPropsIOS & + AccessibilityProps +> { readonly children?: React.ReactNode readonly delayLongPress?: number readonly delayPressIn?: number @@ -5505,10 +5355,7 @@ declare interface TouchableWithoutFeedbackProps readonly hitSlop?: EdgeInsetsOrSizeProp readonly id?: string readonly importantForAccessibility?: - | "auto" - | "no-hide-descendants" - | "no" - | "yes" + "auto" | "no-hide-descendants" | "no" | "yes" readonly nativeID?: string readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown readonly onBlur?: (event: BlurEvent) => unknown @@ -5703,20 +5550,19 @@ declare type ViewConfig = { readonly validAttributes: AttributeConfiguration } declare type ViewInstance = HostInstance -declare interface ViewProps - extends Readonly< - DirectEventProps & - GestureResponderHandlers & - MouseEventProps & - PointerEventProps & - FocusEventProps & - KeyEventProps & - TouchEventProps & - ViewPropsAndroid & - ViewPropsIOS & - AccessibilityProps & - ViewBaseProps - > {} +declare interface ViewProps extends Readonly< + DirectEventProps & + GestureResponderHandlers & + MouseEventProps & + PointerEventProps & + FocusEventProps & + KeyEventProps & + TouchEventProps & + ViewPropsAndroid & + ViewPropsIOS & + AccessibilityProps & + ViewBaseProps +> {} declare type ViewPropsAndroid = { readonly focusable?: boolean readonly hasTVPreferredFocus?: boolean @@ -5873,20 +5719,19 @@ declare type WindowsPlatform = { declare type WithAnimatedValue = T extends Builtin | Nullable ? T : T extends Primitive - ? - | AnimatedAddition_default - | AnimatedDiffClamp_default - | AnimatedDivision_default - | AnimatedInterpolation_default - | AnimatedInterpolation_default - | AnimatedInterpolation_default - | AnimatedInterpolation_default - | AnimatedModulo_default - | AnimatedMultiplication_default - | AnimatedNode_default - | AnimatedSubtraction_default - | AnimatedValue_default - | T + ? | AnimatedAddition_default + | AnimatedDiffClamp_default + | AnimatedDivision_default + | AnimatedInterpolation_default + | AnimatedInterpolation_default + | AnimatedInterpolation_default + | AnimatedInterpolation_default + | AnimatedModulo_default + | AnimatedMultiplication_default + | AnimatedNode_default + | AnimatedSubtraction_default + | AnimatedValue_default + | T : T extends ReadonlyArray ? ReadonlyArray> : T extends {} diff --git a/packages/react-native/__typetests__/fabric-component-sample.ts b/packages/react-native/__typetests__/fabric-component-sample.ts index 91e8b8137c8c..c2f515c9bc3a 100644 --- a/packages/react-native/__typetests__/fabric-component-sample.ts +++ b/packages/react-native/__typetests__/fabric-component-sample.ts @@ -24,8 +24,7 @@ interface NativeProps extends ViewProps { number?: number | undefined; boolean?: boolean | undefined; default?: - | CodegenTypes.WithDefault<'option1' | 'option2', 'option1'> - | undefined; + CodegenTypes.WithDefault<'option1' | 'option2', 'option1'> | undefined; double?: CodegenTypes.Double | undefined; float?: CodegenTypes.Float | undefined; int32?: CodegenTypes.Int32 | undefined; diff --git a/packages/react-native/metro.config.js b/packages/react-native/metro.config.js index d3a136dd0a36..892b54a2f452 100644 --- a/packages/react-native/metro.config.js +++ b/packages/react-native/metro.config.js @@ -39,7 +39,9 @@ const config = { }, }; -module.exports = mergeConfig( +const mergedConfig /*: ConfigT */ = mergeConfig( getDefaultConfig(__dirname), config, -) /*:: as ConfigT */; +); + +module.exports = mergedConfig; diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor/index.js b/packages/react-native/scripts/codegen/generate-artifacts-executor/index.js index 780f58c03955..b75b39cc5230 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor/index.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor/index.js @@ -225,7 +225,7 @@ function computeBaseOutputPath( ) { return process.env.RCT_SCRIPT_OUTPUT_DIR; } - let baseOutputPath /*: string */; + let baseOutputPath; if (optionalBaseOutputPath == null) { const outputDirFromPkgJson = readOutputDirFromPkgJson(pkgJson, platform); if (outputDirFromPkgJson != null) { diff --git a/packages/react-native/scripts/compose-source-maps.js b/packages/react-native/scripts/compose-source-maps.js index 034b7165af1b..dd1c39999b1f 100755 --- a/packages/react-native/scripts/compose-source-maps.js +++ b/packages/react-native/scripts/compose-source-maps.js @@ -15,7 +15,7 @@ const fs = require('fs'); const {composeSourceMaps} = require('metro-source-map'); const argv = process.argv.slice(2); -let outputPath /*: ?string */; +let outputPath; for (let i = 0; i < argv.length; ) { if (argv[i] === '-o') { outputPath = argv[i + 1]; diff --git a/packages/react-native/scripts/packager-reporter.js b/packages/react-native/scripts/packager-reporter.js index dc4066c967e7..0bda84f1017c 100644 --- a/packages/react-native/scripts/packager-reporter.js +++ b/packages/react-native/scripts/packager-reporter.js @@ -10,7 +10,8 @@ 'use strict'; -let reporter /*: $FlowFixMe */; +// $FlowFixMe[signature-verification-failure] +let reporter; const logPath = process.env.RCT_PACKAGER_LOG_PATH; if (logPath != null && logPath !== '') { diff --git a/packages/react-native/src/types/globals.d.ts b/packages/react-native/src/types/globals.d.ts index 76f45042ee28..98f824c62b84 100644 --- a/packages/react-native/src/types/globals.d.ts +++ b/packages/react-native/src/types/globals.d.ts @@ -322,12 +322,7 @@ declare global { type RequestCredentials_ = 'omit' | 'same-origin' | 'include'; type RequestMode_ = 'navigate' | 'same-origin' | 'no-cors' | 'cors'; type ResponseType_ = - | 'basic' - | 'cors' - | 'default' - | 'error' - | 'opaque' - | 'opaqueredirect'; + 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'; // #endregion // #region XMLHttpRequest @@ -429,8 +424,7 @@ declare global { } interface XMLHttpRequestUpload - extends EventTarget, - XMLHttpRequestEventTarget { + extends EventTarget, XMLHttpRequestEventTarget { addEventListener( type: K, listener: ( @@ -453,12 +447,7 @@ declare global { }; type XMLHttpRequestResponseType = - | '' - | 'arraybuffer' - | 'blob' - | 'document' - | 'json' - | 'text'; + '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text'; interface URL { readonly hash: string; @@ -690,14 +679,11 @@ declare global { onerror: ((this: FileReader, ev: ProgressEvent) => any) | null; onload: ((this: FileReader, ev: ProgressEvent) => any) | null; onloadend: - | ((this: FileReader, ev: ProgressEvent) => any) - | null; + ((this: FileReader, ev: ProgressEvent) => any) | null; onloadstart: - | ((this: FileReader, ev: ProgressEvent) => any) - | null; + ((this: FileReader, ev: ProgressEvent) => any) | null; onprogress: - | ((this: FileReader, ev: ProgressEvent) => any) - | null; + ((this: FileReader, ev: ProgressEvent) => any) | null; readonly readyState: number; readonly result: string | ArrayBuffer; abort(): void; diff --git a/packages/react-native/types/public/ReactNativeRenderer.d.ts b/packages/react-native/types/public/ReactNativeRenderer.d.ts index eb136cbc3996..aa2959a04c99 100644 --- a/packages/react-native/types/public/ReactNativeRenderer.d.ts +++ b/packages/react-native/types/public/ReactNativeRenderer.d.ts @@ -44,15 +44,13 @@ export interface GestureResponderHandlers { * Does this view want to become responder on the start of a touch? */ onStartShouldSetResponder?: - | ((event: GestureResponderEvent) => boolean) - | undefined; + ((event: GestureResponderEvent) => boolean) | undefined; /** * Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness? */ onMoveShouldSetResponder?: - | ((event: GestureResponderEvent) => boolean) - | undefined; + ((event: GestureResponderEvent) => boolean) | undefined; /** * If the View returns true and attempts to become the responder, one of the following will happen: @@ -92,8 +90,7 @@ export interface GestureResponderHandlers { * Should this view release the responder? Returning true allows release */ onResponderTerminationRequest?: - | ((event: GestureResponderEvent) => boolean) - | undefined; + ((event: GestureResponderEvent) => boolean) | undefined; /** * The responder has been taken from the View. @@ -116,8 +113,7 @@ export interface GestureResponderHandlers { * it should have a onStartShouldSetResponderCapture handler which returns true. */ onStartShouldSetResponderCapture?: - | ((event: GestureResponderEvent) => boolean) - | undefined; + ((event: GestureResponderEvent) => boolean) | undefined; /** * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, @@ -133,8 +129,7 @@ export interface GestureResponderHandlers { * it should have a onStartShouldSetResponderCapture handler which returns true. */ onMoveShouldSetResponderCapture?: - | ((event: GestureResponderEvent) => boolean) - | undefined; + ((event: GestureResponderEvent) => boolean) | undefined; } /** diff --git a/packages/react-native/types/public/ReactNativeTypes.d.ts b/packages/react-native/types/public/ReactNativeTypes.d.ts index 74d7602d017a..beeb86c2cc47 100644 --- a/packages/react-native/types/public/ReactNativeTypes.d.ts +++ b/packages/react-native/types/public/ReactNativeTypes.d.ts @@ -130,11 +130,10 @@ export type NativeMethodsMixinType = NativeMethods; * @todo This should eventually be defined as an AbstractComponent, but that * should first be introduced in the React typings. */ -export interface HostComponent

- extends Pick< - React.ComponentClass

, - Exclude, 'new'> - > { +export interface HostComponent

extends Pick< + React.ComponentClass

, + Exclude, 'new'> +> { new (props: P, context?: any): React.Component

& HostInstance; } diff --git a/packages/virtualized-lists/Lists/VirtualizedList.d.ts b/packages/virtualized-lists/Lists/VirtualizedList.d.ts index 31a95a3b4ad9..87ef2ba8e082 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.d.ts +++ b/packages/virtualized-lists/Lists/VirtualizedList.d.ts @@ -142,41 +142,34 @@ export class VirtualizedList extends React.Component< * @see https://reactnative.dev/docs/virtualizedlist#props */ -export interface VirtualizedListProps - extends VirtualizedListWithoutRenderItemProps { +export interface VirtualizedListProps< + ItemT, +> extends VirtualizedListWithoutRenderItemProps { renderItem: ListRenderItem | null | undefined; } -export interface VirtualizedListWithoutRenderItemProps - extends ScrollViewProps { +export interface VirtualizedListWithoutRenderItemProps< + ItemT, +> extends ScrollViewProps { /** * Rendered in between each item, but not at the top or bottom */ ItemSeparatorComponent?: - | React.ComponentType - | React.ReactElement - | null - | undefined; + React.ComponentType | React.ReactElement | null | undefined; /** * Rendered when the list is empty. Can be a React Component Class, a render function, or * a rendered element. */ ListEmptyComponent?: - | React.ComponentType - | React.ReactElement - | null - | undefined; + React.ComponentType | React.ReactElement | null | undefined; /** * Rendered at the bottom of all the items. Can be a React Component Class, a render function, or * a rendered element. */ ListFooterComponent?: - | React.ComponentType - | React.ReactElement - | null - | undefined; + React.ComponentType | React.ReactElement | null | undefined; /** * Styling for internal View for ListFooterComponent @@ -188,10 +181,7 @@ export interface VirtualizedListWithoutRenderItemProps * a rendered element. */ ListHeaderComponent?: - | React.ComponentType - | React.ReactElement - | null - | undefined; + React.ComponentType | React.ReactElement | null | undefined; /** * Styling for internal View for ListHeaderComponent @@ -316,9 +306,7 @@ export interface VirtualizedListWithoutRenderItemProps * from the logical start of the list. */ onStartReached?: - | ((info: {distanceFromStart: number}) => void) - | null - | undefined; + ((info: {distanceFromStart: number}) => void) | null | undefined; /** * How far from the start (in units of visible length of the list) the leading edge of the @@ -391,7 +379,5 @@ export interface VirtualizedListWithoutRenderItemProps * notify VirtualizedList of changes within the cell. */ CellRendererComponent?: - | React.ComponentType> - | null - | undefined; + React.ComponentType> | null | undefined; } diff --git a/private/helloworld/.prettierrc.js b/private/helloworld/.prettierrc.js index b31d9b06b2a9..4d779e02f83c 100644 --- a/private/helloworld/.prettierrc.js +++ b/private/helloworld/.prettierrc.js @@ -7,23 +7,17 @@ * @format */ -let plugins = ['prettier-plugin-hermes-parser']; -try { - plugins = require('../../.prettier-plugins.fb.js'); -} catch {} - module.exports = { arrowParens: 'avoid', bracketSameLine: true, bracketSpacing: false, singleQuote: true, trailingComma: 'all', - plugins, overrides: [ { files: ['*.js', '*.js.flow'], options: { - parser: 'hermes', + parser: 'flow', }, }, ], diff --git a/private/helloworld/metro.config.js b/private/helloworld/metro.config.js index a3d6323f8bc0..0bdd4933ebef 100644 --- a/private/helloworld/metro.config.js +++ b/private/helloworld/metro.config.js @@ -43,7 +43,9 @@ const config = { }, }; -module.exports = mergeConfig( +const mergedConfig /*: Readonly */ = mergeConfig( getDefaultConfig(__dirname), config, -) /*:: as Readonly */; +); + +module.exports = mergedConfig; diff --git a/private/react-native-fantom/config/metro.config.js b/private/react-native-fantom/config/metro.config.js index 282eb6e8b9d9..18afbea82c97 100644 --- a/private/react-native-fantom/config/metro.config.js +++ b/private/react-native-fantom/config/metro.config.js @@ -74,4 +74,6 @@ const config /*: InputConfigT */ = { : [], }; -module.exports = mergeConfig(rnTesterConfig, config) /*:: as ConfigT */; +const mergedConfig /*: ConfigT */ = mergeConfig(rnTesterConfig, config); + +module.exports = mergedConfig; diff --git a/yarn.lock b/yarn.lock index a6ff74db2d2d..305197286a82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7570,15 +7570,15 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier-plugin-hermes-parser@0.36.0: - version "0.36.0" - resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.36.0.tgz#8839207d3a4290b7afe1bd54fbc5154f963b8cf2" - integrity sha512-CtlJ5l0DC48SN3OWSht5jAEIFU92xwHSe87/Bl005/9TlHyN2aAmPa6T/A2JLiIgRT/lGsCtc6srwEMM3/5k4w== - -prettier@3.6.2: - version "3.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" - integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== +prettier-plugin-hermes-parser@0.37.0: + version "0.37.0" + resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.37.0.tgz#454ec7317a1d26d049b7ed0c06117a0aaaff03a6" + integrity sha512-qVPK/q4Unp9/sGBTiqkg5aPno7tKgHZK7SEvaWFpy8ircHiapeOM9PUPaS0uu2DvNjgPlINoJHGiHtgEEooT3w== + +prettier@3.9.4: + version "3.9.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.9.4.tgz#a9c477cf1614376bd1f6bbc593d8c0d414bcec87" + integrity sha512-yWG/o/4oJfo036EKAfK6ACAoDOfHeRHx4tuxkfBZiauURiaSmYwlpOr5LQqKtIkRD2z1PLteme2WoxEnj4tHTg== pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0"