diff --git a/packages/metro-bundler/src/ModuleGraph/worker.js b/packages/metro-bundler/src/ModuleGraph/worker.js index 906f39fd..ec1635c4 100644 --- a/packages/metro-bundler/src/ModuleGraph/worker.js +++ b/packages/metro-bundler/src/ModuleGraph/worker.js @@ -21,4 +21,4 @@ import type {WorkerFnWithIO} from './worker/wrap-worker-fn'; exports.optimizeModule = (wrapWorkerFn(optimizeModule): WorkerFnWithIO); exports.transformModule = - (wrapWorkerFn(transformModule): WorkerFnWithIO); + (wrapWorkerFn(transformModule): WorkerFnWithIO>); diff --git a/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js b/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js index 81be5da8..809ba72c 100644 --- a/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js +++ b/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js @@ -33,11 +33,11 @@ import type { } from '../types.flow'; import type {Ast} from 'babel-core'; -export type TransformOptions = {| +export type TransformOptions = {| filename: string, hasteImpl?: HasteImpl, polyfill?: boolean, - transformer: Transformer<*>, + transformer: Transformer, variants?: TransformVariants, |}; @@ -56,7 +56,7 @@ const ASSET_EXTENSIONS = new Set(defaults.assetExts); function transformModule( content: Buffer, - options: TransformOptions, + options: TransformOptions<{+retainLines?: boolean}>, ): TransformedSourceFile { if (ASSET_EXTENSIONS.has(path.extname(options.filename).substr(1))) { return transformAsset(content, options); @@ -143,9 +143,9 @@ function transformJSON(json, options): TransformedSourceFile { return {type: 'code', details: result}; } -function transformAsset( +function transformAsset( content: Buffer, - options: TransformOptions, + options: TransformOptions, ): TransformedSourceFile { return { details: {