@@ -24,42 +24,42 @@ import * as React from 'react';
2424
2525export type AttributeType < T , V > =
2626 | true
27- | $ReadOnly < {
27+ | Readonly < {
2828 diff ?: ( arg1 : T , arg2 : T ) => boolean ,
2929 process ?: ( arg1 : V ) => T ,
3030 } > ;
3131
32- // We either force that `diff` and `process` always use mixed ,
32+ // We either force that `diff` and `process` always use unknown ,
3333// or we allow them to define specific types and use this hack
3434export type AnyAttributeType = AttributeType < $FlowFixMe , $FlowFixMe > ;
3535
36- export type AttributeConfiguration = $ReadOnly < {
36+ export type AttributeConfiguration = Readonly < {
3737 [ propName : string ] : AnyAttributeType | void ,
38- style ?: $ReadOnly < {
38+ style ?: Readonly < {
3939 [ propName : string ] : AnyAttributeType ,
4040 ...
4141 } > ,
4242 ...
4343} > ;
4444
45- export type ViewConfig = $ReadOnly < {
46- Commands ?: $ReadOnly < { [ commandName : string ] : number , ...} > ,
47- Constants ?: $ReadOnly < { [ name : string ] : mixed , ...} > ,
45+ export type ViewConfig = Readonly < {
46+ Commands ?: Readonly < { [ commandName : string ] : number , ...} > ,
47+ Constants ?: Readonly < { [ name : string ] : unknown , ...} > ,
4848 Manager ?: string ,
49- NativeProps ?: $ReadOnly < { [ propName : string ] : string , ...} > ,
49+ NativeProps ?: Readonly < { [ propName : string ] : string , ...} > ,
5050 baseModuleName ?: ?string ,
51- bubblingEventTypes ?: $ReadOnly < {
52- [ eventName : string ] : $ReadOnly < {
53- phasedRegistrationNames : $ReadOnly < {
51+ bubblingEventTypes ?: Readonly < {
52+ [ eventName : string ] : Readonly < {
53+ phasedRegistrationNames : Readonly < {
5454 captured : string ,
5555 bubbled : string ,
5656 skipBubbling ?: ?boolean ,
5757 } > ,
5858 } > ,
5959 ...
6060 } > ,
61- directEventTypes ?: $ReadOnly < {
62- [ eventName : string ] : $ReadOnly < {
61+ directEventTypes ?: Readonly < {
62+ [ eventName : string ] : Readonly < {
6363 registrationName : string ,
6464 } > ,
6565 ...
@@ -69,30 +69,30 @@ export type ViewConfig = $ReadOnly<{
6969 validAttributes : AttributeConfiguration ,
7070} > ;
7171
72- export type PartialViewConfig = $ReadOnly < {
72+ export type PartialViewConfig = Readonly < {
7373 bubblingEventTypes ?: ViewConfig [ 'bubblingEventTypes' ] ,
7474 directEventTypes ?: ViewConfig [ 'directEventTypes' ] ,
7575 supportsRawText ?: boolean ,
7676 uiViewClassName : string ,
7777 validAttributes ?: AttributeConfiguration ,
7878} > ;
7979
80- type InspectorDataProps = $ReadOnly < {
80+ type InspectorDataProps = Readonly < {
8181 [ propName : string ] : string ,
8282 ...
8383} > ;
8484
8585type InspectorDataGetter = (
86- < TElementType : React . ElementType > (
86+ < TElementType extends React . ElementType > (
8787 componentOrHandle: React.ElementRef< TElementType > | number,
8888 ) => ?number ,
89- ) => $ReadOnly < {
89+ ) => Readonly < {
9090 measure : ( callback : MeasureOnSuccessCallback ) => void ,
9191 props : InspectorDataProps ,
9292} > ;
9393
94- export type InspectorData = $ReadOnly < {
95- closestInstance ?: mixed ,
94+ export type InspectorData = Readonly < {
95+ closestInstance ?: unknown ,
9696 hierarchy : Array < {
9797 name : ?string ,
9898 getInspectorData : InspectorDataGetter ,
@@ -102,11 +102,11 @@ export type InspectorData = $ReadOnly<{
102102 componentStack : string ,
103103} > ;
104104
105- export type TouchedViewDataAtPoint = $ReadOnly <
105+ export type TouchedViewDataAtPoint = Readonly <
106106 {
107107 pointerY : number ,
108108 touchedViewTag ?: number ,
109- frame : $ReadOnly < {
109+ frame : Readonly < {
110110 top : number ,
111111 left : number ,
112112 width : number ,
@@ -118,39 +118,39 @@ export type TouchedViewDataAtPoint = $ReadOnly<
118118
119119export type RenderRootOptions = {
120120 onUncaughtError ?: (
121- error : mixed ,
122- errorInfo : { + componentStack ?: ?string } ,
121+ error : unknown ,
122+ errorInfo : { readonly componentStack ?: ?string } ,
123123 ) => void ,
124124 onCaughtError ?: (
125- error : mixed ,
125+ error : unknown ,
126126 errorInfo : {
127- + componentStack ?: ?string ,
127+ readonly componentStack ?: ?string ,
128128 // $FlowFixMe[unclear-type] unknown props and state.
129129 // $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
130- + errorBoundary ?: ?React . Component < any , any > ,
130+ readonly errorBoundary ?: ?React . Component < any , any> ,
131131 } ,
132132 ) => void ,
133133 onRecoverableError ?: (
134- error : mixed ,
135- errorInfo : { + componentStack ?: ?string } ,
134+ error : unknown ,
135+ errorInfo : { readonly componentStack ?: ?string } ,
136136 ) => void ,
137137 onDefaultTransitionIndicator ?: ( ) => void | ( ( ) => void ) ,
138138} ;
139139
140- export opaque type Node = mixed ;
141- export opaque type InternalInstanceHandle = mixed ;
140+ export opaque type Node = unknown ;
141+ export opaque type InternalInstanceHandle = unknown ;
142142
143143export type ReactFabricType = {
144- findHostInstance_DEPRECATED < TElementType : React . ElementType > (
144+ findHostInstance_DEPRECATED < TElementType extends React . ElementType > (
145145 componentOrHandle: ?(React.ElementRef< TElementType > | number),
146146 ): ?PublicInstance,
147- findNodeHandle < TElementType : React . ElementType > (
147+ findNodeHandle< TElementType extends React . ElementType > (
148148 componentOrHandle: ?(React.ElementRef< TElementType > | number),
149149 ): ?number,
150150 dispatchCommand(
151151 handle: PublicInstance,
152152 command: string,
153- args : Array < mixed > ,
153+ args: Array< unknown > ,
154154 ): void,
155155 isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
156156 sendAccessibilityEvent(handle: PublicInstance, eventType: string): void,
@@ -210,7 +210,7 @@ export type LayoutAnimationProperty =
210210 | 'scaleY'
211211 | 'scaleXY';
212212
213- export type LayoutAnimationAnimationConfig = $ReadOnly < {
213+ export type LayoutAnimationAnimationConfig = Readonly < {
214214 duration ? : number ,
215215 delay ? : number ,
216216 springDamping ? : number ,
@@ -219,7 +219,7 @@ export type LayoutAnimationAnimationConfig = $ReadOnly<{
219219 property ? : LayoutAnimationProperty ,
220220} > ;
221221
222- export type LayoutAnimationConfig = $ReadOnly < {
222+ export type LayoutAnimationConfig = Readonly < {
223223 duration : number ,
224224 create ?: LayoutAnimationAnimationConfig ,
225225 update ?: LayoutAnimationAnimationConfig ,
0 commit comments