Remove Unused Exports from StyleSheetTypes

Summary: These types were barely used and unnecessary.

Reviewed By: yungsters

Differential Revision: D7177287

fbshipit-source-id: 63cb6d3aae4889a92b2c23f0df864b5657e6e1ee
This commit is contained in:
Eli White 2018-03-06 23:21:59 -08:00 committed by Facebook Github Bot
parent 135637ce24
commit b58e377961
3 changed files with 13 additions and 22 deletions

View File

@ -20,14 +20,13 @@ import type {
StyleSheetStyle as _StyleSheetStyle,
Styles as _Styles,
StyleSheet as _StyleSheet,
StyleValue as _StyleValue,
StyleObj,
LayoutStyle
} from 'StyleSheetTypes';
export type StyleProp = StyleObj;
export type Styles = _Styles;
export type StyleSheet<S> = _StyleSheet<S>;
export type StyleValue = _StyleValue;
export type StyleSheetStyle = _StyleSheetStyle;
let hairlineWidth = PixelRatio.roundToNearestPixel(0.4);
@ -35,14 +34,14 @@ if (hairlineWidth === 0) {
hairlineWidth = 1 / PixelRatio.get();
}
const absoluteFillObject = {
position: ('absolute': 'absolute'),
const absoluteFillObject: LayoutStyle = {
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0,
};
const absoluteFill: typeof absoluteFillObject =
const absoluteFill: StyleSheetStyle =
ReactNativePropRegistry.register(absoluteFillObject); // This also freezes it
/**

View File

@ -220,7 +220,7 @@ export type Style = {
+overlayColor?: string,
};
export type StyleProp<+T> =
type GenericStyleProp<+T> =
| null
| void
| T
@ -228,26 +228,18 @@ export type StyleProp<+T> =
| number
| false
| ''
| $ReadOnlyArray<StyleProp<T>>;
| $ReadOnlyArray<GenericStyleProp<T>>;
// export type ViewStyleProp = StyleProp<$Shape<ViewStyle<DimensionValue>>>;
// export type TextStyleProp = StyleProp<
// $Shape<TextStyle<DimensionValue, ColorValue>>,
// >;
// export type ImageStyleProp = StyleProp<
// $Shape<ImageStyle<DimensionValue, ColorValue>>,
// >;
export type StyleObj = GenericStyleProp<$Shape<Style>>;
export type StyleObj = StyleProp<$Shape<Style>>;
export type StyleValue = StyleObj;
export type ViewStyleProp = StyleProp<$ReadOnly<$Shape<ViewStyle>>>;
export type TextStyleProp = StyleProp<$ReadOnly<$Shape<TextStyle>>>;
export type ImageStyleProp = StyleProp<$ReadOnly<$Shape<ImageStyle>>>;
export type ViewStyleProp = GenericStyleProp<$ReadOnly<$Shape<ViewStyle>>>;
export type TextStyleProp = GenericStyleProp<$ReadOnly<$Shape<TextStyle>>>;
export type ImageStyleProp = GenericStyleProp<$ReadOnly<$Shape<ImageStyle>>>;
export type Styles = {
+[key: string]: $Shape<Style>,
};
export type StyleSheet<+S: Styles> = $ObjMap<S, (Object) => StyleSheetStyle>;
/*

View File

@ -11,7 +11,7 @@
var ReactNativePropRegistry;
import type { StyleProp, Style } from 'StyleSheetTypes';
import type { StyleObj, Style } from 'StyleSheetTypes';
function getStyle(style) {
if (ReactNativePropRegistry === undefined) {
@ -23,7 +23,7 @@ function getStyle(style) {
return style;
}
function flattenStyle(style: ?StyleProp<Style>): ?Style {
function flattenStyle(style: ?StyleObj): ?Style {
if (style == null) {
return undefined;
}