@@ -18,7 +18,7 @@ import type {
1818 MockData ,
1919} from 'types/HasteMap' ;
2020
21- import typeof { worker } from './worker' ;
21+ import { worker } from './worker' ;
2222
2323// eslint-disable-next-line import/no-duplicates
2424import typeof HType from './constants' ;
@@ -87,7 +87,7 @@ type Watcher = {
8787 close ( callback : ( ) => void ) : void ,
8888} ;
8989
90- type WorkerInterface = { worker : worker } ;
90+ type WorkerInterface = { worker : typeof worker } ;
9191
9292export type ModuleMap = HasteModuleMap ;
9393export type FS = HasteFS ;
@@ -199,7 +199,7 @@ const getWhiteList = (list: ?Array<string>): ?RegExp => {
199199class HasteMap extends EventEmitter {
200200 _buildPromise : ?Promise < HasteMapObject > ;
201201 _cachePath : Path ;
202- _changeInterval : number ;
202+ _changeInterval : IntervalID ;
203203 _console : Console ;
204204 _options : InternalOptions ;
205205 _watchers : Array < Watcher > ;
@@ -519,14 +519,14 @@ class HasteMap extends EventEmitter {
519519 _getWorker ( options : ?{ forceInBand : boolean } ) : WorkerInterface {
520520 if ( ! this . _worker ) {
521521 if ( ( options && options . forceInBand ) || this . _options . maxWorkers <= 1 ) {
522- this . _worker = require ( './ worker' ) ;
522+ this . _worker = { worker} ;
523523 } else {
524524 // $FlowFixMe: assignment of a worker with custom properties.
525- this . _worker = new Worker ( require . resolve ( './worker' ) , {
525+ this . _worker = ( new Worker ( require . resolve ( './worker' ) , {
526526 exposedMethods : [ 'worker' ] ,
527527 maxRetries : 3 ,
528528 numWorkers : this . _options . maxWorkers ,
529- } ) ;
529+ } ) : { worker : typeof worker } ) ;
530530 }
531531 }
532532
0 commit comments