1
1
// @flow
2
2
3
+ import type { ReactContext } from 'shared/ReactTypes' ;
4
+ import type { Source } from 'shared/ReactElementType' ;
5
+ import type { Fiber } from 'react-reconciler/src/ReactFiber' ;
3
6
import type {
4
7
ComponentFilter ,
5
8
ElementType ,
@@ -14,69 +17,6 @@ type BundleType =
14
17
export type WorkTag = number ;
15
18
export type SideEffectTag = number ;
16
19
export type ExpirationTime = number ;
17
- export type RefObject = { |
18
- current : any ,
19
- | } ;
20
- export type Source = { |
21
- fileName : string ,
22
- lineNumber : number ,
23
- | } ;
24
-
25
- export type HookType =
26
- | 'useState'
27
- | 'useReducer'
28
- | 'useContext'
29
- | 'useRef'
30
- | 'useEffect'
31
- | 'useLayoutEffect'
32
- | 'useCallback'
33
- | 'useMemo'
34
- | 'useImperativeHandle'
35
- | 'useDebugValue' ;
36
-
37
- // The Fiber type is copied from React and should be kept in sync:
38
- // https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiber.js
39
- // The properties we don't use in DevTools are omitted.
40
- export type Fiber = { |
41
- tag : WorkTag ,
42
-
43
- key : null | string ,
44
-
45
- // Dependencies (contexts, events) for this fiber, if it has any
46
- dependencies : mixed | null ,
47
-
48
- elementType : any ,
49
-
50
- type : any ,
51
-
52
- stateNode : any ,
53
-
54
- return : Fiber | null ,
55
-
56
- child : Fiber | null ,
57
- sibling : Fiber | null ,
58
- index : number ,
59
-
60
- ref : null | ( ( ( handle : mixed ) => void ) & { _stringRef : ?string } ) | RefObject ,
61
-
62
- pendingProps : any , // This type will be more specific once we overload the tag.
63
- memoizedProps : any , // The props used to create the output.
64
-
65
- memoizedState : any ,
66
-
67
- effectTag : SideEffectTag ,
68
-
69
- alternate : Fiber | null ,
70
-
71
- actualDuration ?: number ,
72
-
73
- actualStartTime ?: number ,
74
-
75
- treeBaseDuration ?: number ,
76
-
77
- _debugSource ?: Source | null ,
78
- _debugOwner ?: Fiber | null ,
79
- | } ;
80
20
81
21
// TODO: If it's useful for the frontend to know which types of data an Element has
82
22
// (e.g. props, state, context, hooks) then we could add a bitmask field for this
@@ -103,22 +43,6 @@ export type ReactProviderType<T> = {
103
43
_context : ReactContext < T > ,
104
44
} ;
105
45
106
- export type ReactContext < T > = {
107
- $$typeof : Symbol | number ,
108
- Consumer : ReactContext < T > ,
109
- Provider : ReactProviderType < T > ,
110
-
111
- _calculateChangedBits : ( ( a : T , b : T ) => number ) | null ,
112
-
113
- _currentValue : T ,
114
- _currentValue2 : T ,
115
- _threadCount : number ,
116
-
117
- // DEV only
118
- _currentRenderer ?: Object | null ,
119
- _currentRenderer2 ?: Object | null ,
120
- } ;
121
-
122
46
export type ReactRenderer = {
123
47
findFiberByHostInstance : ( hostInstance : NativeType ) => ?Fiber ,
124
48
version : string ,
@@ -349,27 +273,3 @@ export type DevToolsHook = {
349
273
commitPriority ?: number ,
350
274
) => void ,
351
275
} ;
352
-
353
- export type ReactEventResponder < E , C > = {
354
- $$typeof : Symbol | number ,
355
- displayName : string ,
356
- targetEventTypes : null | Array < string > ,
357
- rootEventTypes : null | Array < string > ,
358
- getInitialState : null | ( ( props : Object ) => Object ) ,
359
- onEvent :
360
- | null
361
- | ( ( event : E , context : C , props : Object , state : Object ) => void ) ,
362
- onRootEvent :
363
- | null
364
- | ( ( event : E , context : C , props : Object , state : Object ) => void ) ,
365
- onMount : null | ( ( context : C , props : Object , state : Object ) => void ) ,
366
- onUnmount : null | ( ( context : C , props : Object , state : Object ) => void ) ,
367
- onOwnershipChange :
368
- | null
369
- | ( ( context : C , props : Object , state : Object ) => void ) ,
370
- } ;
371
-
372
- export type ReactEventResponderListener < E , C > = { |
373
- props : Object ,
374
- responder : ReactEventResponder < E , C > ,
375
- | } ;
0 commit comments