From 188b118b6075be1614c553596b85d430767f2dbc Mon Sep 17 00:00:00 2001 From: Eli White Date: Sat, 12 May 2018 10:25:16 -0700 Subject: [PATCH] Flow Type KeyboardAvoidingView Reviewed By: yungsters Differential Revision: D7978494 fbshipit-source-id: e21b4910470d3dc3fd35027f2f975b6842baa6ab --- .../Components/Keyboard/KeyboardAvoidingView.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index c559608d34c6a4..64ab0551f7c9c3 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -24,7 +24,8 @@ const View = require('View'); const ViewPropTypes = require('ViewPropTypes'); import type EmitterSubscription from 'EmitterSubscription'; -import type {ViewLayout, ViewLayoutEvent} from 'ViewPropTypes'; +import type {ViewStyleProp} from 'StyleSheet'; +import type {ViewProps, ViewLayout, ViewLayoutEvent} from 'ViewPropTypes'; type ScreenRect = { screenX: number, @@ -39,13 +40,21 @@ type KeyboardChangeEvent = { easing?: string, }; +type Props = $ReadOnly<{| + ...ViewProps, + behavior?: ?('height' | 'position' | 'padding'), + contentContainerStyle?: ?ViewStyleProp, + enabled?: ?boolean, + keyboardVerticalOffset?: ?number, +|}>; + const viewRef = 'VIEW'; /** * This is a component to solve the common problem of views that need to move out of the way of the virtual keyboard. * It can automatically adjust either its height, position or bottom padding based on the position of the keyboard. */ -const KeyboardAvoidingView = createReactClass({ +const KeyboardAvoidingView = ((createReactClass({ displayName: 'KeyboardAvoidingView', mixins: [TimerMixin], @@ -229,6 +238,6 @@ const KeyboardAvoidingView = createReactClass({ ); } }, -}); +}): any): React.ComponentType); module.exports = KeyboardAvoidingView;