@@ -112,31 +112,32 @@ export interface INativeMethods {
112
112
measure ( callback : MeasureOnSuccessCallback ) : void ;
113
113
measureInWindow ( callback : MeasureInWindowOnSuccessCallback ) : void ;
114
114
measureLayout (
115
- relativeToNativeNode : number | ElementRef < HostComponent < mixed >> ,
115
+ relativeToNativeNode : number | HostInstance ,
116
116
onSuccess : MeasureLayoutOnSuccessCallback ,
117
117
onFail ?: ( ) => void ,
118
118
) : void ;
119
119
setNativeProps ( nativeProps : { ...} ) : void ;
120
120
}
121
121
122
- export type NativeMethods = $ReadOnly < { |
122
+ export type NativeMethods = $ReadOnly < {
123
123
blur ( ) : void ,
124
124
focus ( ) : void ,
125
125
measure ( callback : MeasureOnSuccessCallback ) : void ,
126
126
measureInWindow ( callback : MeasureInWindowOnSuccessCallback ) : void ,
127
127
measureLayout (
128
- relativeToNativeNode : number | ElementRef < HostComponent < mixed >> ,
128
+ relativeToNativeNode : number | HostInstance ,
129
129
onSuccess : MeasureLayoutOnSuccessCallback ,
130
130
onFail ?: ( ) => void ,
131
131
) : void ,
132
132
setNativeProps ( nativeProps : { ...} ) : void ,
133
- | } > ;
133
+ } > ;
134
134
135
135
// This validates that INativeMethods and NativeMethods stay in sync using Flow!
136
136
declare const ensureNativeMethodsAreSynced: NativeMethods ;
137
137
( ensureNativeMethodsAreSynced : INativeMethods ) ;
138
138
139
- export type HostComponent < T > = AbstractComponent < T , $ReadOnly < NativeMethods >> ;
139
+ export type HostInstance = NativeMethods ;
140
+ export type HostComponent < Config > = AbstractComponent < Config , HostInstance > ;
140
141
141
142
type SecretInternalsType = {
142
143
computeComponentStackForErrorReporting ( tag : number ) : string ,
@@ -209,7 +210,7 @@ export type RenderRootOptions = {
209
210
export type ReactNativeType = {
210
211
findHostInstance_DEPRECATED< TElementType : ElementType > (
211
212
componentOrHandle : ?( ElementRef < TElementType > | number ) ,
212
- ) : ?ElementRef < HostComponent < mixed >> ,
213
+ ) : ?HostInstance ,
213
214
findNodeHandle < TElementType : ElementType > (
214
215
componentOrHandle : ?( ElementRef < TElementType > | number ) ,
215
216
) : ?number ,
@@ -218,14 +219,11 @@ export type ReactNativeType = {
218
219
child : PublicInstance | HostComponent < mixed > ,
219
220
) : boolean ,
220
221
dispatchCommand (
221
- handle : ElementRef < HostComponent < mixed >> ,
222
+ handle : HostInstance ,
222
223
command : string ,
223
224
args : Array < mixed > ,
224
225
) : void ,
225
- sendAccessibilityEvent (
226
- handle : ElementRef < HostComponent < mixed >> ,
227
- eventType : string ,
228
- ) : void ,
226
+ sendAccessibilityEvent ( handle : HostInstance , eventType : string ) : void ,
229
227
render (
230
228
element : MixedElement ,
231
229
containerTag : number ,
@@ -247,20 +245,17 @@ type PublicTextInstance = mixed;
247
245
export type ReactFabricType = {
248
246
findHostInstance_DEPRECATED < TElementType : ElementType > (
249
247
componentOrHandle: ?(ElementRef< TElementType > | number),
250
- ): ?ElementRef < HostComponent < mixed > > ,
248
+ ): ?HostInstance ,
251
249
findNodeHandle< TElementType : ElementType > (
252
250
componentOrHandle: ?(ElementRef< TElementType > | number),
253
251
): ?number,
254
252
dispatchCommand(
255
- handle: ElementRef < HostComponent < mixed > > ,
253
+ handle: HostInstance ,
256
254
command: string,
257
255
args: Array< mixed > ,
258
256
): void,
259
257
isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
260
- sendAccessibilityEvent(
261
- handle: ElementRef< HostComponent < mixed > > ,
262
- eventType : string ,
263
- ) : void ,
258
+ sendAccessibilityEvent(handle: HostInstance, eventType: string): void,
264
259
render(
265
260
element: MixedElement,
266
261
containerTag: number,
0 commit comments