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
This commit is contained in:
Eli White 2018-03-08 00:35:53 -08:00 committed by Facebook Github Bot
parent d89517d60a
commit 852084ad45
2 changed files with 3 additions and 5 deletions

View File

@ -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<S, (Object) => StyleSheetInternalStyleIdentifier> {
create<+S: ____Styles_Internal>(obj: S): $ObjMap<S, (Object) => StyleSheetInternalStyleIdentifier> {
const result = {};
for (const key in obj) {
StyleSheetValidation.validateStyle(key, obj);

View File

@ -241,7 +241,7 @@ export type ____ImageStyleProp_Internal = GenericStyleProp<
$ReadOnly<$Shape<ImageStyle>>,
>;
export type Styles = {
export type ____Styles_Internal = {
+[key: string]: $Shape<Style>,
};