Skip to content

Commit 2574863

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Extend emit-as-interface coverage for Uniwind compatibility (#56811)
Summary: Pull Request resolved: #56811 Extends the set of component props types annotated with `build-types emit-as-interface` to cover all types augmented by Uniwind. This is a follow-up to D104808984, which added coverage for NativeWind and Expo. The additional types converted to `interface` declarations are: * `ActivityIndicatorProps` * `ButtonProps` * `ImageBackgroundProps` * `KeyboardAvoidingViewProps` * `ModalBaseProps` * `PressableProps` * `RefreshControlProps` * `SectionListProps` * `TextInputProps` * `TextProps` * `TouchableHighlightProps` See https://github.com/uni-stack/uniwind/blob/a2406b8e04f5597b32a44febe01159c5223ee3c6/packages/uniwind/types.d.ts. Changelog: [General][Changed] - **Strict TypeScript API**: Additional component props types are now `interface` declarations, enabling module augmentation by libraries like Uniwind (preserve compatibility) Reviewed By: robhogan Differential Revision: D105028014 fbshipit-source-id: c0af13a9c764a9105206ce0677e06c46f8f8ef65
1 parent db89600 commit 2574863

12 files changed

Lines changed: 100 additions & 85 deletions

File tree

packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type ActivityIndicatorIOSProps = Readonly<{
3434
*/
3535
hidesWhenStopped?: ?boolean,
3636
}>;
37+
/** @build-types emit-as-interface Uniwind compatibility */
3738
export type ActivityIndicatorProps = Readonly<{
3839
...ViewProps,
3940
...ActivityIndicatorIOSProps,

packages/react-native/Libraries/Components/Button.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import View from './View/View';
2727
import invariant from 'invariant';
2828
import * as React from 'react';
2929

30+
/** @build-types emit-as-interface Uniwind compatibility */
3031
export type ButtonProps = Readonly<{
3132
/**
3233
Text to display inside the button. On Android the given title will be

packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import Keyboard from './Keyboard';
2626
import * as React from 'react';
2727
import {createRef} from 'react';
2828

29+
/** @build-types emit-as-interface Uniwind compatibility */
2930
export type KeyboardAvoidingViewProps = Readonly<{
3031
...ViewProps,
3132

packages/react-native/Libraries/Components/Pressable/Pressable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ type PressableBaseProps = Readonly<{
156156
unstable_pressDelay?: ?number,
157157
}>;
158158

159+
/** @build-types emit-as-interface Uniwind compatibility */
159160
export type PressableProps = Readonly<{
160161
// Pressability may override `onMouseEnter` and `onMouseLeave` to
161162
// implement `onHoverIn` and `onHoverOut` in a platform-agnostic way.

packages/react-native/Libraries/Components/RefreshControl/RefreshControl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ type RefreshControlBaseProps = Readonly<{
7272
progressViewOffset?: ?number,
7373
}>;
7474

75+
/** @build-types emit-as-interface Uniwind compatibility */
7576
export type RefreshControlProps = Readonly<{
7677
...ViewProps,
7778
...RefreshControlPropsIOS,

packages/react-native/Libraries/Components/TextInput/TextInput.flow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ type TextInputBaseProps = Readonly<{
10561056
textAlign?: ?('left' | 'center' | 'right'),
10571057
}>;
10581058

1059+
/** @build-types emit-as-interface Uniwind compatibility */
10591060
export type TextInputProps = Readonly<{
10601061
...Omit<ViewProps, 'style' | 'experimental_accessibilityOrder'>,
10611062
...TextInputIOSProps,

packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ type TouchableHighlightBaseProps = Readonly<{
6363
hostRef?: React.RefSetter<React.ElementRef<typeof View>>,
6464
}>;
6565

66+
/** @build-types emit-as-interface Uniwind compatibility */
6667
export type TouchableHighlightProps = Readonly<{
6768
...TouchableWithoutFeedbackProps,
6869
...AndroidProps,

packages/react-native/Libraries/Image/ImageProps.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ export type ImageProps = Readonly<{
343343
style?: ?ImageStyleProp,
344344
}>;
345345

346+
/** @build-types emit-as-interface Uniwind compatibility */
346347
export type ImageBackgroundProps = Readonly<{
347348
...ImageProps,
348349
children?: React.Node,

packages/react-native/Libraries/Lists/SectionList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ type OptionalSectionListProps<ItemT, SectionT = DefaultSectionT> = {
105105
removeClippedSubviews?: boolean,
106106
};
107107

108+
/** @build-types emit-as-interface Uniwind compatibility */
108109
export type SectionListProps<ItemT, SectionT = DefaultSectionT> = {
109110
...Omit<
110111
VirtualizedSectionListProps<ItemT, SectionT>,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ type OrientationChangeEvent = Readonly<{
6363
orientation: 'portrait' | 'landscape',
6464
}>;
6565

66+
/** @build-types emit-as-interface Uniwind compatibility */
6667
export type ModalBaseProps = {
6768
/**
6869
* @deprecated Use animationType instead

0 commit comments

Comments
 (0)