Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 7 additions & 2 deletions packages/debugger-frontend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,4 +38,4 @@ if (process.env.REACT_NATIVE_DEBUGGER_FRONTEND_PATH != null) {
);
}

module.exports = frontEndPath /*:: as string */;
module.exports = frontEndPath;
2 changes: 1 addition & 1 deletion packages/eslint-config-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
},
"devDependencies": {
"eslint": "^8.57.0",
"prettier": "3.6.2"
"prettier": "3.9.4"
}
}
2 changes: 1 addition & 1 deletion packages/react-native-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 1 addition & 4 deletions packages/react-native/Libraries/Alert/Alert.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
14 changes: 5 additions & 9 deletions packages/react-native/Libraries/Animated/Animated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -542,8 +538,7 @@ export namespace Animated {
): (...args: any[]) => void;

export type ComponentProps<T> = T extends
| React.ComponentType<infer P>
| React.Component<infer P>
React.ComponentType<infer P> | React.Component<infer P>
? P
: never;

Expand Down Expand Up @@ -586,8 +581,9 @@ export namespace Animated {
: WithAnimatedValue<T[key]>;
};

export interface AnimatedComponent<T extends React.ComponentType<any>>
extends React.FC<AnimatedProps<React.ComponentPropsWithRef<T>>> {}
export interface AnimatedComponent<
T extends React.ComponentType<any>,
> extends React.FC<AnimatedProps<React.ComponentPropsWithRef<T>>> {}

export type AnimatedComponentOptions = {
collapsable?: boolean | undefined;
Expand Down
6 changes: 1 addition & 5 deletions packages/react-native/Libraries/AppState/AppState.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ type AccessibilityAnnouncementFinishedEventHandler = (
) => void;

type AccessibilityEventTypes =
| 'click'
| 'focus'
| 'viewHoverEnter'
| 'windowStateChange';
'click' | 'focus' | 'viewHoverEnter' | 'windowStateChange';

/**
* @see https://reactnative.dev/docs/accessibilityinfo
Expand Down
31 changes: 15 additions & 16 deletions packages/react-native/Libraries/Components/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import {
} from '../../Types/CoreEventTypes';
import {ViewProps} from '../View/ViewPropTypes';

export interface DrawerSlideEvent
extends NativeSyntheticEvent<NativeTouchEvent> {}
export interface DrawerSlideEvent extends NativeSyntheticEvent<NativeTouchEvent> {}

/**
* DrawerLayoutAndroid is deprecated and will be removed in a future release.
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export interface PressableAndroidRippleConfig {
}

export interface PressableProps
extends AccessibilityProps,
extends
AccessibilityProps,
Omit<ViewProps, 'children' | 'style' | 'hitSlop'> {
/**
* Called when the hover is activated to provide visual feedback.
Expand Down Expand Up @@ -76,18 +77,14 @@ export interface PressableProps
* @platform macos windows
*/
onBlur?:
| null
| ((event: NativeSyntheticEvent<TargetedEvent>) => void)
| undefined;
null | ((event: NativeSyntheticEvent<TargetedEvent>) => void) | undefined;

/**
* Called after the element is focused.
* @platform macos windows
*/
onFocus?:
| null
| ((event: NativeSyntheticEvent<TargetedEvent>) => void)
| undefined;
null | ((event: NativeSyntheticEvent<TargetedEvent>) => void) | undefined;

/**
* Either children or a render prop that receives a boolean reflecting whether
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ export interface RefreshControlPropsAndroid extends ViewProps {
}

export interface RefreshControlProps
extends RefreshControlPropsIOS,
RefreshControlPropsAndroid {
extends RefreshControlPropsIOS, RefreshControlPropsAndroid {
/**
* Called when the view starts refreshing.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export interface PointProp {
y: number;
}

export interface ScrollResponderEvent
extends NativeSyntheticEvent<NativeTouchEvent> {}
export interface ScrollResponderEvent extends NativeSyntheticEvent<NativeTouchEvent> {}

interface SubscribableMixin {
/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -523,8 +518,7 @@ export interface ScrollViewPropsIOS {
* @platform ios
*/
onScrollToTop?:
| ((event: NativeSyntheticEvent<NativeScrollEvent>) => void)
| undefined;
((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;

/**
* The current scale of the scroll view content. The default value is 1.0.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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<NativeScrollEvent>) => void)
| undefined;
((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;

/**
* Fires if a user initiates a scroll gesture.
*/
onScrollBeginDrag?:
| ((event: NativeSyntheticEvent<NativeScrollEvent>) => void)
| undefined;
((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;

/**
* Fires when a user has finished scrolling.
*/
onScrollEndDrag?:
| ((event: NativeSyntheticEvent<NativeScrollEvent>) => void)
| undefined;
((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;

/**
* Fires when scroll view has finished moving
*/
onMomentumScrollEnd?:
| ((event: NativeSyntheticEvent<NativeScrollEvent>) => void)
| undefined;
((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;

/**
* Fires when scroll view has begun moving
*/
onMomentumScrollBegin?:
| ((event: NativeSyntheticEvent<NativeScrollEvent>) => void)
| undefined;
((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;

/**
* When true the scroll view stops on multiples of the scroll view's size
Expand Down Expand Up @@ -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<ScrollViewProps> {}
export declare const ScrollViewBase: Constructor<ScrollResponderMixin> &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
7 changes: 2 additions & 5 deletions packages/react-native/Libraries/Components/Switch/Switch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ export interface SwitchChangeEventData extends TargetedEvent {
value: boolean;
}

export interface SwitchChangeEvent
extends NativeSyntheticEvent<SwitchChangeEventData> {}
export interface SwitchChangeEvent extends NativeSyntheticEvent<SwitchChangeEventData> {}

export interface SwitchProps extends SwitchPropsIOS {
/**
Expand Down Expand Up @@ -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> | void)
| null
| undefined;
((event: SwitchChangeEvent) => Promise<void> | void) | null | undefined;

/**
* Invoked with the new value when the value changes.
Expand Down
Loading
Loading