From fdb2c25846c0ea21a4e07569008d6d32dd9b8d6f Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 22:34:33 -0300 Subject: [PATCH] [react-native] Support Layout Props (#25083) Support some styles as View and Image props, e.g. --- types/react-native/index.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index a76bdb6e4c..fe73c7abae 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -536,6 +536,7 @@ type FlexAlignType = "flex-start" | "flex-end" | "center" | "stretch" | "baselin /** * Flex Prop Types * @see https://facebook.github.io/react-native/docs/flexbox.html#proptypes + * @see https://facebook.github.io/react-native/docs/layout-props.html * @see LayoutPropTypes.js */ export interface FlexStyle { @@ -598,6 +599,14 @@ export interface FlexStyle { direction?: "inherit" | "ltr" | "rtl"; } + +/** + * Layout Prop Types + * @see https://facebook.github.io/react-native/docs/layout-props.html + * @see LayoutPropTypes.js + */ +export interface LayoutProperties extends FlexStyle {} + /** * @see ShadowPropTypesIOS.js */ @@ -1752,7 +1761,7 @@ type AccessibilityTraits = * @see https://facebook.github.io/react-native/docs/view.html#props */ export interface ViewProperties - extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, AccessibilityProperties { + extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, AccessibilityProperties, LayoutProperties { /** * This defines how far a touch event can start away from the view. * Typical interface guidelines recommend touch targets that are at least @@ -3344,7 +3353,7 @@ interface ImagePropertiesAndroid { * @see https://facebook.github.io/react-native/docs/image.html */ export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; -export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties { +export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties, LayoutProperties { /** * onLayout function *