diff --git a/Libraries/StyleSheet/StyleSheet.js b/Libraries/StyleSheet/StyleSheet.js index 48f4418b8..bb4e57d2c 100644 --- a/Libraries/StyleSheet/StyleSheet.js +++ b/Libraries/StyleSheet/StyleSheet.js @@ -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 = _StyleSheet; -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 /** diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 93090e399..f23fc1f29 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -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>; + | $ReadOnlyArray>; -// export type ViewStyleProp = StyleProp<$Shape>>; -// export type TextStyleProp = StyleProp< -// $Shape>, -// >; -// export type ImageStyleProp = StyleProp< -// $Shape>, -// >; +export type StyleObj = GenericStyleProp<$Shape