Skip to content

Commit d89517d

Browse files
elicwhitefacebook-github-bot
authored andcommitted
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
1 parent 5f497ca commit d89517d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Libraries/StyleSheet/StyleSheet.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const StyleSheetValidation = require('StyleSheetValidation');
1717
const flatten = require('flattenStyle');
1818

1919
import type {
20-
StyleSheetStyle as _StyleSheetStyle,
20+
____StyleSheetInternalStyleIdentifier_Internal as StyleSheetInternalStyleIdentifier,
2121
Styles as _Styles,
2222
____StyleObj_Internal,
2323
____ViewStyleProp_Internal,
@@ -32,8 +32,6 @@ export type TextStyleProp = ____TextStyleProp_Internal;
3232
export type ImageStyleProp = ____ImageStyleProp_Internal;
3333

3434
export type Styles = _Styles;
35-
export type StyleSheetStyle = _StyleSheetStyle;
36-
type StyleSheet<+S: Styles> = $ObjMap<S, (Object) => StyleSheetStyle>;
3735

3836
let hairlineWidth = PixelRatio.roundToNearestPixel(0.4);
3937
if (hairlineWidth === 0) {
@@ -47,7 +45,7 @@ const absoluteFillObject: LayoutStyle = {
4745
top: 0,
4846
bottom: 0,
4947
};
50-
const absoluteFill: StyleSheetStyle =
48+
const absoluteFill: StyleSheetInternalStyleIdentifier =
5149
ReactNativePropRegistry.register(absoluteFillObject); // This also freezes it
5250

5351
/**
@@ -223,7 +221,7 @@ module.exports = {
223221
/**
224222
* Creates a StyleSheet style reference from the given object.
225223
*/
226-
create<S: Styles>(obj: S): StyleSheet<S> {
224+
create<+S: Styles>(obj: S): $ObjMap<S, (Object) => StyleSheetInternalStyleIdentifier> {
227225
const result = {};
228226
for (const key in obj) {
229227
StyleSheetValidation.validateStyle(key, obj);

Libraries/StyleSheet/StyleSheetTypes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import AnimatedNode from 'AnimatedNode';
1515

16-
export opaque type StyleSheetStyle: number = number;
16+
export opaque type ____StyleSheetInternalStyleIdentifier_Internal: number = number;
1717

1818
export type ColorValue = null | string;
1919
export type DimensionValue = null | number | string | AnimatedNode;
@@ -224,7 +224,7 @@ type GenericStyleProp<+T> =
224224
| null
225225
| void
226226
| T
227-
| StyleSheetStyle
227+
| ____StyleSheetInternalStyleIdentifier_Internal
228228
| number
229229
| false
230230
| ''

0 commit comments

Comments
 (0)