@@ -99,7 +99,30 @@ import * as React from 'react';
9999 * }
100100 */
101101
102- // Default amount "active" region protrudes beyond box
102+ /**
103+ * Touchable states.
104+ */
105+
106+ const States = {
107+ NOT_RESPONDER : 'NOT_RESPONDER' , // Not the responder
108+ RESPONDER_INACTIVE_PRESS_IN : 'RESPONDER_INACTIVE_PRESS_IN' , // Responder, inactive, in the `PressRect`
109+ RESPONDER_INACTIVE_PRESS_OUT : 'RESPONDER_INACTIVE_PRESS_OUT' , // Responder, inactive, out of `PressRect`
110+ RESPONDER_ACTIVE_PRESS_IN : 'RESPONDER_ACTIVE_PRESS_IN' , // Responder, active, in the `PressRect`
111+ RESPONDER_ACTIVE_PRESS_OUT : 'RESPONDER_ACTIVE_PRESS_OUT' , // Responder, active, out of `PressRect`
112+ RESPONDER_ACTIVE_LONG_PRESS_IN : 'RESPONDER_ACTIVE_LONG_PRESS_IN' , // Responder, active, in the `PressRect`, after long press threshold
113+ RESPONDER_ACTIVE_LONG_PRESS_OUT : 'RESPONDER_ACTIVE_LONG_PRESS_OUT' , // Responder, active, out of `PressRect`, after long press threshold
114+ ERROR : 'ERROR' ,
115+ } ;
116+
117+ type State =
118+ | typeof States . NOT_RESPONDER
119+ | typeof States . RESPONDER_INACTIVE_PRESS_IN
120+ | typeof States . RESPONDER_INACTIVE_PRESS_OUT
121+ | typeof States . RESPONDER_ACTIVE_PRESS_IN
122+ | typeof States . RESPONDER_ACTIVE_PRESS_OUT
123+ | typeof States . RESPONDER_ACTIVE_LONG_PRESS_IN
124+ | typeof States . RESPONDER_ACTIVE_LONG_PRESS_OUT
125+ | typeof States . ERROR ;
103126
104127/**
105128 * By convention, methods prefixed with underscores are meant to be @private,
@@ -200,9 +223,12 @@ interface TouchableMixinType {
200223 * @return {object } State object to be placed inside of
201224 * `this.state.touchable`.
202225 */
203- touchableGetInitialState: ( ) => $TEMPORARY$object < { |
204- touchable : $TEMPORARY$object < { | responderID : null , touchState : void | } > ,
205- | } > ;
226+ touchableGetInitialState: ( ) => {
227+ touchable: {
228+ touchState: ?State ,
229+ responderID : ?PressEvent [ 'currentTarget' ] ,
230+ } ,
231+ } ;
206232
207233 // ==== Hooks to Gesture Responder system ====
208234 /**
0 commit comments