66 *
77 * @noformat
88 * @flow strict
9- * @generated SignedSource<<265b342f0d29323bebb711ba0bc882ec >>
9+ * @generated SignedSource<<7dc3ed81183377055bac08760fcd775b >>
1010 *
1111 * This file was sync'd from the facebook/react repository.
1212 */
@@ -98,7 +98,23 @@ export type PartialViewConfig = $ReadOnly<{
9898 validAttributes ?: PartialAttributeConfiguration ,
9999} > ;
100100
101- export type NativeMethods = $ReadOnly < {
101+ /**
102+ * Current usages should migrate to this definition
103+ */
104+ export interface INativeMethods {
105+ blur ( ) : void ;
106+ focus ( ) : void ;
107+ measure ( callback : MeasureOnSuccessCallback ) : void ;
108+ measureInWindow ( callback : MeasureInWindowOnSuccessCallback ) : void ;
109+ measureLayout (
110+ relativeToNativeNode : number | ElementRef < HostComponent < mixed >> ,
111+ onSuccess : MeasureLayoutOnSuccessCallback ,
112+ onFail ?: ( ) => void ,
113+ ) : void ;
114+ setNativeProps ( nativeProps : { ...} ) : void ;
115+ }
116+
117+ export type NativeMethods = $ReadOnly < { |
102118 blur ( ) : void ,
103119 focus ( ) : void ,
104120 measure ( callback : MeasureOnSuccessCallback ) : void ,
@@ -109,7 +125,11 @@ export type NativeMethods = $ReadOnly<{
109125 onFail ?: ( ) => void ,
110126 ) : void ,
111127 setNativeProps ( nativeProps : { ...} ) : void ,
112- } > ;
128+ | } > ;
129+
130+ // This validates that INativeMethods and NativeMethods stay in sync using Flow!
131+ declare var ensureNativeMethodsAreSynced : NativeMethods ;
132+ ( ensureNativeMethodsAreSynced : INativeMethods ) ;
113133
114134export type HostComponent < T > = AbstractComponent < T , $ReadOnly < NativeMethods >> ;
115135
@@ -195,6 +215,10 @@ export type ReactNativeType = {
195215 ...
196216} ;
197217
218+ export opaque type Node = mixed ;
219+ type InternalInstanceHandle = mixed ;
220+ type PublicInstance = mixed ;
221+
198222export type ReactFabricType = {
199223 findHostInstance_DEPRECATED < TElementType : ElementType > (
200224 componentOrHandle : ?( ElementRef < TElementType > | number ) ,
@@ -218,18 +242,12 @@ export type ReactFabricType = {
218242 concurrentRoot : ?boolean ,
219243 ) : ?ElementRef < ElementType > ,
220244 unmountComponentAtNode ( containerTag : number ) : void ,
221- ...
222- } ;
223-
224- export type ReactNativeEventTarget = {
225- node : { ...} ,
226- canonical : {
227- _nativeTag : number ,
228- viewConfig : ViewConfig ,
229- currentProps : { ...} ,
230- _internalInstanceHandle : { ...} ,
231- ...
232- } ,
245+ getNodeFromInternalInstanceHandle (
246+ internalInstanceHandle : InternalInstanceHandle ,
247+ ) : ?Node ,
248+ getPublicInstanceFromInternalInstanceHandle (
249+ internalInstanceHandle : InternalInstanceHandle ,
250+ ) : PublicInstance ,
233251 ...
234252} ;
235253
0 commit comments