@@ -50,7 +50,7 @@ function genModule(
5050 return { name : moduleName } ;
5151 }
5252
53- const module : { [ string ] : mixed } = { } ;
53+ const module : { [ string ] : unknown } = { } ;
5454 methods &&
5555 methods . forEach ( ( methodName , methodID ) => {
5656 const isPromise =
@@ -99,7 +99,7 @@ function loadModule(name: string, moduleID: number): ?{...} {
9999function genMethod ( moduleID : number , methodID : number , type : MethodType ) {
100100 let fn = null ;
101101 if ( type === 'promise' ) {
102- fn = function promiseMethodWrapper ( ...args : Array < mixed > ) {
102+ fn = function promiseMethodWrapper ( ...args : Array < unknown > ) {
103103 // In case we reject, capture a useful stack trace here.
104104 /* $FlowFixMe[class-object-subtyping] added when improving typing for
105105 * this parameters */
@@ -122,7 +122,7 @@ function genMethod(moduleID: number, methodID: number, type: MethodType) {
122122 } ) ;
123123 } ;
124124 } else {
125- fn = function nonPromiseMethodWrapper ( ...args : Array < mixed > ) {
125+ fn = function nonPromiseMethodWrapper ( ...args : Array < unknown > ) {
126126 const lastArg = args . length > 0 ? args [ args . length - 1 ] : null ;
127127 const secondLastArg = args . length > 1 ? args [ args . length - 2 ] : null ;
128128 const hasSuccessCallback = typeof lastArg === 'function' ;
@@ -133,9 +133,11 @@ function genMethod(moduleID: number, methodID: number, type: MethodType) {
133133 'Cannot have a non-function arg after a function arg.' ,
134134 ) ;
135135 // $FlowFixMe[incompatible-type]
136- const onSuccess : ?( mixed ) = > void = hasSuccessCallback ? lastArg : null ;
137- // $FlowFixMe[incompatible-type]
138- const onFail : ?( mixed ) = > void = hasErrorCallback ? secondLastArg : null ;
136+ const onSuccess : ?( unknown ) = > void = hasSuccessCallback ? lastArg : null ;
137+ const onFail : ?( unknown ) = > void = hasErrorCallback
138+ ? // $FlowFixMe[incompatible-type]
139+ secondLastArg
140+ : null ;
139141 // $FlowFixMe[unsafe-addition]
140142 const callbackCount = hasSuccessCallback + hasErrorCallback ;
141143 const newArgs = args . slice ( 0 , args . length - callbackCount ) ;
0 commit comments