Skip to content

Commit 39ab067

Browse files
committed
Make generated props and style types augmentable
1 parent 8a75a4d commit 39ab067

6 files changed

Lines changed: 299 additions & 314 deletions

File tree

‎packages/react-native/Libraries/StyleSheet/StyleSheet.js‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ export type TypeForStyleKey<
136136
* object of styles to pass to a View that can't be precomputed with
137137
* StyleSheet.create.
138138
*/
139-
/** @build-types emit-as-interface react-native-web compatibility */
140-
export type ViewStyle = ____ViewStyle_Internal;
139+
export type {____ViewStyle_Internal as ViewStyle} from './StyleSheetTypes';
141140

142141
/**
143142
* This type is an object of the different possible style
@@ -154,8 +153,7 @@ export type ViewStyle = ____ViewStyle_Internal;
154153
* object of styles to pass to a Text that can't be precomputed with
155154
* StyleSheet.create.
156155
*/
157-
/** @build-types emit-as-interface react-native-web compatibility */
158-
export type TextStyle = ____TextStyle_Internal;
156+
export type {____TextStyle_Internal as TextStyle} from './StyleSheetTypes';
159157

160158
/**
161159
* This type is an object of the different possible style
@@ -172,8 +170,7 @@ export type TextStyle = ____TextStyle_Internal;
172170
* object of styles to pass to an Image that can't be precomputed with
173171
* StyleSheet.create.
174172
*/
175-
/** @build-types emit-as-interface react-native-web compatibility */
176-
export type ImageStyle = ____ImageStyle_Internal;
173+
export type {____ImageStyle_Internal as ImageStyle} from './StyleSheetTypes';
177174

178175
/**
179176
* WARNING: You probably shouldn't be using this type. This type is an object

‎packages/react-native/Libraries/StyleSheet/StyleSheet.js.flow‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ export type TypeForStyleKey<
137137
* object of styles to pass to a View that can't be precomputed with
138138
* StyleSheet.create.
139139
*/
140-
/** @build-types emit-as-interface react-native-web compatibility */
141-
export type ViewStyle = ____ViewStyle_Internal;
140+
export type {____ViewStyle_Internal as ViewStyle} from './StyleSheetTypes';
142141

143142
/**
144143
* This type is an object of the different possible style
@@ -155,8 +154,7 @@ export type ViewStyle = ____ViewStyle_Internal;
155154
* object of styles to pass to a Text that can't be precomputed with
156155
* StyleSheet.create.
157156
*/
158-
/** @build-types emit-as-interface react-native-web compatibility */
159-
export type TextStyle = ____TextStyle_Internal;
157+
export type {____TextStyle_Internal as TextStyle} from './StyleSheetTypes';
160158

161159
/**
162160
* This type is an object of the different possible style
@@ -173,8 +171,7 @@ export type TextStyle = ____TextStyle_Internal;
173171
* object of styles to pass to an Image that can't be precomputed with
174172
* StyleSheet.create.
175173
*/
176-
/** @build-types emit-as-interface react-native-web compatibility */
177-
export type ImageStyle = ____ImageStyle_Internal;
174+
export type {____ImageStyle_Internal as ImageStyle} from './StyleSheetTypes';
178175

179176
/**
180177
* WARNING: You probably shouldn't be using this type. This type is an object

‎packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ export type ____ViewStyle_InternalCore = Readonly<{
910910
...____ViewStyle_InternalBase,
911911
}>;
912912

913+
/** @build-types emit-as-interface react-native-web compatibility */
913914
export type ____ViewStyle_Internal = Readonly<{
914915
...____ViewStyle_InternalCore,
915916
...____ViewStyle_InternalOverrides,
@@ -1051,6 +1052,7 @@ export type ____TextStyle_InternalCore = Readonly<{
10511052
...____TextStyle_InternalBase,
10521053
}>;
10531054

1055+
/** @build-types emit-as-interface react-native-web compatibility */
10541056
export type ____TextStyle_Internal = Readonly<{
10551057
...____TextStyle_InternalCore,
10561058
...____TextStyle_InternalOverrides,
@@ -1065,6 +1067,7 @@ export type ____ImageStyle_InternalCore = Readonly<{
10651067
overflow?: 'visible' | 'hidden',
10661068
}>;
10671069

1070+
/** @build-types emit-as-interface react-native-web compatibility */
10681071
export type ____ImageStyle_Internal = Readonly<{
10691072
...____ImageStyle_InternalCore,
10701073
...____ImageStyle_InternalOverrides,

0 commit comments

Comments
 (0)