Permalink
Browse files

Remove usage of Internal StyleSheet type

Summary: This type shouldn't be necessary from outside code. All callsites were able to be fixed by using the other types like TextStyleProp

Reviewed By: yungsters

Differential Revision: D7187551

fbshipit-source-id: 34fb7fb5f5e72e6cfcb9748157cb5eb6ad3e1f46
  • Loading branch information...
TheSavior authored and facebook-github-bot committed Mar 8, 2018
1 parent 5f497ca commit d89517d60a8a6cabc9013b603fa3f63a1face6a2
Showing with 5 additions and 7 deletions.
  1. +3 −5 Libraries/StyleSheet/StyleSheet.js
  2. +2 −2 Libraries/StyleSheet/StyleSheetTypes.js
@@ -17,7 +17,7 @@ const StyleSheetValidation = require('StyleSheetValidation');
const flatten = require('flattenStyle');
import type {
StyleSheetStyle as _StyleSheetStyle,
____StyleSheetInternalStyleIdentifier_Internal as StyleSheetInternalStyleIdentifier,
Styles as _Styles,
____StyleObj_Internal,
____ViewStyleProp_Internal,
@@ -32,8 +32,6 @@ export type TextStyleProp = ____TextStyleProp_Internal;
export type ImageStyleProp = ____ImageStyleProp_Internal;
export type Styles = _Styles;
export type StyleSheetStyle = _StyleSheetStyle;
type StyleSheet<+S: Styles> = $ObjMap<S, (Object) => StyleSheetStyle>;
let hairlineWidth = PixelRatio.roundToNearestPixel(0.4);
if (hairlineWidth === 0) {
@@ -47,7 +45,7 @@ const absoluteFillObject: LayoutStyle = {
top: 0,
bottom: 0,
};
const absoluteFill: StyleSheetStyle =
const absoluteFill: StyleSheetInternalStyleIdentifier =
ReactNativePropRegistry.register(absoluteFillObject); // This also freezes it
/**
@@ -223,7 +221,7 @@ module.exports = {
/**
* Creates a StyleSheet style reference from the given object.
*/
create<S: Styles>(obj: S): StyleSheet<S> {
create<+S: Styles>(obj: S): $ObjMap<S, (Object) => StyleSheetInternalStyleIdentifier> {
const result = {};
for (const key in obj) {
StyleSheetValidation.validateStyle(key, obj);
@@ -13,7 +13,7 @@
import AnimatedNode from 'AnimatedNode';
export opaque type StyleSheetStyle: number = number;
export opaque type ____StyleSheetInternalStyleIdentifier_Internal: number = number;
export type ColorValue = null | string;
export type DimensionValue = null | number | string | AnimatedNode;
@@ -224,7 +224,7 @@ type GenericStyleProp<+T> =
| null
| void
| T
| StyleSheetStyle
| ____StyleSheetInternalStyleIdentifier_Internal
| number
| false
| ''

0 comments on commit d89517d

Please sign in to comment.