7
7
* @flow
8
8
*/
9
9
10
- import type { ResponderEvent , ResponderContext } from 'events/EventTypes' ;
10
+ import type {
11
+ ReactResponderEvent ,
12
+ ReactResponderContext ,
13
+ } from 'shared/ReactTypes' ;
11
14
import { REACT_EVENT_COMPONENT_TYPE } from 'shared/ReactSymbols' ;
12
15
13
16
type PressProps = {
@@ -89,7 +92,7 @@ function createPressEvent(
89
92
}
90
93
91
94
function dispatchEvent (
92
- context : ResponderContext ,
95
+ context : ReactResponderContext ,
93
96
state : PressState ,
94
97
name : PressEventType ,
95
98
listener : ( e : Object ) = > void ,
@@ -100,7 +103,7 @@ function dispatchEvent(
100
103
}
101
104
102
105
function dispatchPressChangeEvent (
103
- context : ResponderContext ,
106
+ context : ReactResponderContext ,
104
107
props : PressProps ,
105
108
state : PressState ,
106
109
) : void {
@@ -111,7 +114,7 @@ function dispatchPressChangeEvent(
111
114
}
112
115
113
116
function dispatchLongPressChangeEvent (
114
- context : ResponderContext ,
117
+ context : ReactResponderContext ,
115
118
props : PressProps ,
116
119
state : PressState ,
117
120
) : void {
@@ -150,7 +153,7 @@ function deactivate(context, props, state) {
150
153
}
151
154
152
155
function dispatchPressStartEvents (
153
- context : ResponderContext ,
156
+ context : ReactResponderContext ,
154
157
props : PressProps ,
155
158
state : PressState ,
156
159
) : void {
@@ -212,7 +215,7 @@ function dispatchPressStartEvents(
212
215
}
213
216
214
217
function dispatchPressEndEvents (
215
- context : ResponderContext ,
218
+ context : ReactResponderContext ,
216
219
props : PressProps ,
217
220
state : PressState ,
218
221
) : void {
@@ -265,7 +268,7 @@ function calculateDelayMS(delay: ?number, min = 0, fallback = 0) {
265
268
}
266
269
267
270
function unmountResponder (
268
- context : ResponderContext ,
271
+ context : ReactResponderContext ,
269
272
props : PressProps ,
270
273
state : PressState ,
271
274
) : void {
@@ -293,8 +296,8 @@ const PressResponder = {
293
296
} ;
294
297
} ,
295
298
onEvent (
296
- event : ResponderEvent ,
297
- context : ResponderContext ,
299
+ event : ReactResponderEvent ,
300
+ context : ReactResponderContext ,
298
301
props : PressProps ,
299
302
state : PressState ,
300
303
) : void {
@@ -491,12 +494,16 @@ const PressResponder = {
491
494
}
492
495
}
493
496
} ,
494
- onUnmount ( context : ResponderContext , props : PressProps , state : PressState ) {
497
+ onUnmount (
498
+ context : ReactResponderContext ,
499
+ props : PressProps ,
500
+ state : PressState ,
501
+ ) {
495
502
unmountResponder ( context , props , state ) ;
496
503
} ,
497
504
// TODO This method doesn't work as of yet
498
505
onOwnershipChange (
499
- context : ResponderContext ,
506
+ context : ReactResponderContext ,
500
507
props : PressProps ,
501
508
state : PressState ,
502
509
) {
0 commit comments