Skip to content

Commit 852084a

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Remove usage of Styles type
Summary: This type was often used when (View|Text|Image)StyleProp should have been used instead. Since there were no valid usages of it in our codebase, we are not making it public anymore. Reviewed By: yungsters Differential Revision: D7188658 fbshipit-source-id: 7112cc4a7da7b007b5c758a0890d2e0b8fe1797a
1 parent d89517d commit 852084a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Libraries/StyleSheet/StyleSheet.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const flatten = require('flattenStyle');
1818

1919
import type {
2020
____StyleSheetInternalStyleIdentifier_Internal as StyleSheetInternalStyleIdentifier,
21-
Styles as _Styles,
21+
____Styles_Internal,
2222
____StyleObj_Internal,
2323
____ViewStyleProp_Internal,
2424
____TextStyleProp_Internal,
@@ -31,8 +31,6 @@ export type ViewStyleProp = ____ViewStyleProp_Internal;
3131
export type TextStyleProp = ____TextStyleProp_Internal;
3232
export type ImageStyleProp = ____ImageStyleProp_Internal;
3333

34-
export type Styles = _Styles;
35-
3634
let hairlineWidth = PixelRatio.roundToNearestPixel(0.4);
3735
if (hairlineWidth === 0) {
3836
hairlineWidth = 1 / PixelRatio.get();
@@ -221,7 +219,7 @@ module.exports = {
221219
/**
222220
* Creates a StyleSheet style reference from the given object.
223221
*/
224-
create<+S: Styles>(obj: S): $ObjMap<S, (Object) => StyleSheetInternalStyleIdentifier> {
222+
create<+S: ____Styles_Internal>(obj: S): $ObjMap<S, (Object) => StyleSheetInternalStyleIdentifier> {
225223
const result = {};
226224
for (const key in obj) {
227225
StyleSheetValidation.validateStyle(key, obj);

Libraries/StyleSheet/StyleSheetTypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export type ____ImageStyleProp_Internal = GenericStyleProp<
241241
$ReadOnly<$Shape<ImageStyle>>,
242242
>;
243243

244-
export type Styles = {
244+
export type ____Styles_Internal = {
245245
+[key: string]: $Shape<Style>,
246246
};
247247

0 commit comments

Comments
 (0)