@@ -23,7 +23,7 @@ const jsonStableStringify = require('json-stable-stringify');
23
23
24
24
const { join : joinPath , relative : relativePath , extname} = require ( 'path' ) ;
25
25
26
- import type { TransformedCode } from '../JSTransformer/worker/worker' ;
26
+ import type { TransformedCode , Options as TransformOptions } from '../JSTransformer/worker/worker' ;
27
27
import type { ReadTransformProps } from '../lib/TransformCache' ;
28
28
import type Cache from './Cache' ;
29
29
import type DependencyGraphHelpers from './DependencyGraph/DependencyGraphHelpers' ;
@@ -40,7 +40,7 @@ type ReadResult = {
40
40
export type TransformCode = (
41
41
module : Module ,
42
42
sourceCode : string ,
43
- transformOptions : mixed ,
43
+ transformOptions : TransformOptions ,
44
44
) => Promise < TransformedCode > ;
45
45
46
46
export type Options = {
@@ -118,11 +118,11 @@ class Module {
118
118
) ;
119
119
}
120
120
121
- getCode ( transformOptions : Object ) {
121
+ getCode ( transformOptions : TransformOptions ) {
122
122
return this . read ( transformOptions ) . then ( ( { code} ) => code ) ;
123
123
}
124
124
125
- getMap ( transformOptions : Object ) {
125
+ getMap ( transformOptions : TransformOptions ) {
126
126
return this . read ( transformOptions ) . then ( ( { map} ) => map ) ;
127
127
}
128
128
@@ -158,7 +158,7 @@ class Module {
158
158
return this . _moduleCache . getPackageForModule ( this ) ;
159
159
}
160
160
161
- getDependencies ( transformOptions : Object ) {
161
+ getDependencies ( transformOptions : TransformOptions ) {
162
162
return this . read ( transformOptions ) . then ( ( { dependencies} ) => dependencies ) ;
163
163
}
164
164
@@ -281,7 +281,7 @@ class Module {
281
281
* dependencies, etc. The overall process is to read the cache first, and if
282
282
* it's a miss, we let the worker write to the cache and read it again.
283
283
*/
284
- read ( transformOptions : Object ) : Promise < ReadResult > {
284
+ read ( transformOptions : TransformOptions ) : Promise < ReadResult > {
285
285
const key = stableObjectHash ( transformOptions || { } ) ;
286
286
const promise = this . _readPromises . get ( key ) ;
287
287
if ( promise != null ) {
0 commit comments