From 852084ad454565bb856e85f09e098f1a4a0771a6 Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 8 Mar 2018 00:35:53 -0800 Subject: [PATCH] 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 --- Libraries/StyleSheet/StyleSheet.js | 6 ++---- Libraries/StyleSheet/StyleSheetTypes.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Libraries/StyleSheet/StyleSheet.js b/Libraries/StyleSheet/StyleSheet.js index d607d74eb36cf7..3223b033e3d4e8 100644 --- a/Libraries/StyleSheet/StyleSheet.js +++ b/Libraries/StyleSheet/StyleSheet.js @@ -18,7 +18,7 @@ const flatten = require('flattenStyle'); import type { ____StyleSheetInternalStyleIdentifier_Internal as StyleSheetInternalStyleIdentifier, - Styles as _Styles, + ____Styles_Internal, ____StyleObj_Internal, ____ViewStyleProp_Internal, ____TextStyleProp_Internal, @@ -31,8 +31,6 @@ export type ViewStyleProp = ____ViewStyleProp_Internal; export type TextStyleProp = ____TextStyleProp_Internal; export type ImageStyleProp = ____ImageStyleProp_Internal; -export type Styles = _Styles; - let hairlineWidth = PixelRatio.roundToNearestPixel(0.4); if (hairlineWidth === 0) { hairlineWidth = 1 / PixelRatio.get(); @@ -221,7 +219,7 @@ module.exports = { /** * Creates a StyleSheet style reference from the given object. */ - create<+S: Styles>(obj: S): $ObjMap StyleSheetInternalStyleIdentifier> { + create<+S: ____Styles_Internal>(obj: S): $ObjMap StyleSheetInternalStyleIdentifier> { const result = {}; for (const key in obj) { StyleSheetValidation.validateStyle(key, obj); diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 4aeaf0623a059e..72db60b2c361cc 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -241,7 +241,7 @@ export type ____ImageStyleProp_Internal = GenericStyleProp< $ReadOnly<$Shape>, >; -export type Styles = { +export type ____Styles_Internal = { +[key: string]: $Shape