From c4d09a5d1c0f09c27bceaebc7b96bd060234dd8c Mon Sep 17 00:00:00 2001 From: bgrieder Date: Mon, 9 Nov 2015 12:16:08 +0100 Subject: [PATCH] More Fixes + TouchableHighlight + TouchableOpacity + TouchableWithoutFeedback --- react-native/react-native.d.ts | 131 ++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts index 7f5832749..92ad7a217 100644 --- a/react-native/react-native.d.ts +++ b/react-native/react-native.d.ts @@ -369,7 +369,7 @@ declare namespace ReactNative { /** * @see https://facebook.github.io/react-native/docs/textinput.html#props */ - export interface TextInputProperties extends TextInputIOSProperties, TextInputAndroidProperties { + export interface TextInputProperties extends TextInputIOSProperties, TextInputAndroidProperties, React.Props { /** * Can tell TextInput to automatically capitalize certain characters. @@ -438,7 +438,7 @@ declare namespace ReactNative { * Callback that is called when the text input's text changes. * Changed text is passed as an argument to the callback handler. */ - onChangeText?: () => void + onChangeText?: (text: string) => void /** * Callback that is called when text input ends. @@ -496,6 +496,10 @@ declare namespace ReactNative { value?: string } + export interface TextInputStatic extends React.ComponentClass { + + } + export interface AccessibilityTraits { // TODO } @@ -658,7 +662,7 @@ declare namespace ReactNative { testID?: string; } - interface ViewStatic extends React.ComponentClass { + export interface ViewStatic extends React.ComponentClass { } @@ -823,7 +827,7 @@ declare namespace ReactNative { style?: ViewStyle } - interface NavigatorIOSStatic extends React.ComponentClass { + export interface NavigatorIOSStatic extends React.ComponentClass { } @@ -885,7 +889,7 @@ declare namespace ReactNative { value?: number; } - interface SliderIOSStatic extends React.ComponentClass { + export interface SliderIOSStatic extends React.ComponentClass { } @@ -1000,7 +1004,7 @@ declare namespace ReactNative { } /** - * @see + * @see https://facebook.github.io/react-native/docs/listview.html#props */ export interface ListViewProperties extends ScrollViewProperties, React.Props{ @@ -1111,47 +1115,12 @@ declare namespace ReactNative { scrollRenderAheadDistance?: number } - /** - * @see https://facebook.github.io/react-native/docs/touchablehighlight.html#props - */ - export interface TouchableHighlightProperties { - /** - * activeOpacity number - * - * Determines what the opacity of the wrapped view should be when touch is active. - */ - activeOpacity?: number; - - /** - * onHideUnderlay function - * - * Called immediately after the underlay is hidden - */ - - onHideUnderlay?: () => void; - - - /** - * onShowUnderlay function - * - * Called immediately after the underlay is shown - */ - - /** - * @see https://facebook.github.io/react-native/docs/view.html#style - */ - style?: ViewStyle; - - - /** - * underlayColor string - * - * The color of the underlay that will show through when the touch is active. - */ - underlayColor?: string; - + export interface ListViewStatic extends React.ComponentClass { + DataSource: ListViewDataSource; } + + /** * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html */ @@ -1205,10 +1174,65 @@ declare namespace ReactNative { } + export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackProperties, React.Props { + + } + + export interface TouchableWithoutFeedbackStatic extends React.ComponentClass { + + } + + + /** + * @see https://facebook.github.io/react-native/docs/touchablehighlight.html#props + */ + export interface TouchableHighlightProperties extends TouchableWithoutFeedbackProperties, React.Props { + /** + * activeOpacity number + * + * Determines what the opacity of the wrapped view should be when touch is active. + */ + activeOpacity?: number + + /** + * onHideUnderlay function + * + * Called immediately after the underlay is hidden + */ + + onHideUnderlay?: () => void + + + /** + * onShowUnderlay function + * + * Called immediately after the underlay is shown + */ + onShowUnderlay?: () => void + + /** + * @see https://facebook.github.io/react-native/docs/view.html#style + */ + style?: ViewStyle + + + /** + * underlayColor string + * + * The color of the underlay that will show through when the touch is active. + */ + underlayColor?: string + + } + + export interface TouchableHighlightStatic extends React.ComponentClass { + } + + /** * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props */ - export interface TouchableOpacityProperties { + export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProperties, React.Props { /** * activeOpacity number * @@ -1217,6 +1241,10 @@ declare namespace ReactNative { activeOpacity?: number; } + export interface TouchableOpacityStatic extends React.ComponentClass { + } + + export interface LeftToRightGesture { @@ -1382,9 +1410,6 @@ declare namespace ReactNative { getSectionHeaderData( sectionIndex: number ): any } - export interface ListViewStatic extends React.ComponentClass { - DataSource: ListViewDataSource; - } export interface ImageStatic extends React.ComponentClass { uri: string; @@ -1879,16 +1904,16 @@ declare namespace ReactNative { export var StyleSheet: StyleSheetStatic; export var TabBarIOS: TabBarIOSStatic; export type TabBarIOS = TabBarIOSStatic; + export var TextInput: TextInputStatic + export var TouchableHighlight: TouchableHighlightStatic; + export var TouchableOpacity:TouchableOpacityStatic; + export var TouchableWithoutFeedback: TouchableWithoutFeedbackStatic; export var View: ViewStatic; export var Text: React.ComponentClass; - export var TextInput: React.ComponentClass; export var AlertIOS: React.ComponentClass; export var SegmentedControlIOS: React.ComponentClass; export var SwitchIOS: React.ComponentClass; - export var TouchableHighlight: React.ComponentClass; - export var TouchableOpacity: React.ComponentClass; - export var TouchableWithoutFeedback: React.ComponentClass; export var ActivityIndicatorIOS: React.ComponentClass;