From d86b47c09e6a4aa6538d47ec30d8d8b895672473 Mon Sep 17 00:00:00 2001 From: Ryan Thomas Date: Mon, 11 Sep 2017 19:09:56 -0500 Subject: [PATCH 1/2] ReactNative OnPress Signatures - Updated the TextProperties onLongPress/onPress method signatures and the TouchableWithoutFeedbackProperties onLongPress/onPress/onPressIn/onPressOut method signatures to include the event object as a parameter --- types/react-native/index.d.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index f07b6df158..b71b2e75f1 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -6,6 +6,7 @@ // Kyle Roach // Tim Wang // Kamal Mahyuddin +// Ryan Thomas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -892,13 +893,13 @@ export interface TextProperties extends TextPropertiesIOS, TextPropertiesAndroid * This function is called on press. * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting). */ - onPress?: () => void + onPress?: (event: GestureResponderEvent) => void /** * This function is called on long press. * e.g., `onLongPress={this.increaseSize}>`` */ - onLongPress?: () => void + onLongPress?: (event: GestureResponderEvent) => void /** * @see https://facebook.github.io/react-native/docs/text.html#style @@ -4548,17 +4549,17 @@ export interface TouchableWithoutFeedbackProperties extends TouchableWithoutFeed */ onLayout?: (event: LayoutChangeEvent) => void - onLongPress?: () => void; + onLongPress?: (event: GestureResponderEvent) => void; /** * Called when the touch is released, * but not if cancelled (e.g. by a scroll that steals the responder lock). */ - onPress?: () => void; + onPress?: (event: GestureResponderEvent) => void; - onPressIn?: () => void; + onPressIn?: (event: GestureResponderEvent) => void; - onPressOut?: () => void; + onPressOut?: (event: GestureResponderEvent) => void; /** * //FIXME: not in doc but available in examples From 566bf1a85ed2765aef421535c9b3eb298d0a3390 Mon Sep 17 00:00:00 2001 From: Ryan Thomas Date: Tue, 12 Sep 2017 06:11:18 -0500 Subject: [PATCH 2/2] react-native - Removed name from definitions by header --- types/react-native/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index b71b2e75f1..553ae094b4 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -6,7 +6,6 @@ // Kyle Roach // Tim Wang // Kamal Mahyuddin -// Ryan Thomas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3