Skip to content

Commit

Permalink
Remove usage of Styles type
Browse files Browse the repository at this point in the history
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
  • Loading branch information
elicwhite authored and facebook-github-bot committed Mar 8, 2018
1 parent d89517d commit 852084a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Libraries/StyleSheet/StyleSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export type ____ImageStyleProp_Internal = GenericStyleProp<
$ReadOnly<$Shape<ImageStyle>>,
>;

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

Expand Down

0 comments on commit 852084a

Please sign in to comment.