From 7ff9456f2e5fd72286f5be52598988707eaef69c Mon Sep 17 00:00:00 2001 From: danibonilha Date: Tue, 29 Jan 2019 00:06:28 -0800 Subject: [PATCH] - create missing AndroidDrawable flow types in ViewPropTypes.js. (#23192) Summary: Related to #22100 Enhance last ViewPropTypes flow types. - [x] yarn run prettier - [x] yarn run flow-check-ios - [x] yarn run flow-check-android [GENERAL] [ENHANCEMENT] [ViewPropTypes.js] - Enhance Flow types definitions Pull Request resolved: https://github.com/facebook/react-native/pull/23192 Differential Revision: D13858907 Pulled By: cpojer fbshipit-source-id: 3633eb019eca2076bb68393b09d06555876f2c48 --- Libraries/Components/View/ViewPropTypes.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index a630144d7..259dd91ea 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @format - * @flow + * @flow strict-local */ 'use strict'; @@ -205,9 +205,22 @@ type GestureResponderEventProps = $ReadOnly<{| onStartShouldSetResponderCapture?: ?(e: PressEvent) => boolean, |}>; +type AndroidDrawableThemeAttr = $ReadOnly<{| + type: 'ThemeAttrAndroid', + attribute: string, +|}>; + +type AndroidDrawableRipple = $ReadOnly<{| + type: 'RippleAndroid', + color?: ?number, + borderless?: ?boolean, +|}>; + +type AndroidDrawable = AndroidDrawableThemeAttr | AndroidDrawableRipple; + type AndroidViewProps = $ReadOnly<{| - nativeBackgroundAndroid?: ?Object, - nativeForegroundAndroid?: ?Object, + nativeBackgroundAndroid?: ?AndroidDrawable, + nativeForegroundAndroid?: ?AndroidDrawable, /** * Whether this `View` should render itself (and all of its children) into a