diff --git a/flow-typed/babel.js.flow b/flow-typed/babel.js.flow index ddfcf8ae..5893a444 100644 --- a/flow-typed/babel.js.flow +++ b/flow-typed/babel.js.flow @@ -89,7 +89,9 @@ type __TransformOptions = { type _TransformOptions = __TransformOptions & {env?: {[key: string]: __TransformOptions}}; -declare class Ast {} + +type Ast = {}; + type TransformResult = { ast: Ast, code: ?string, @@ -101,7 +103,7 @@ type VisitFn = (path: Object, state: State) => any; declare module 'babel-core' { declare type Plugins = _Plugins; declare type SourceMap = _SourceMap; - declare type Ast = Ast; + declare type Ast = {}; declare type TransformOptions = _TransformOptions; declare function transform( code: string, diff --git a/packages/metro/src/JSTransformer/worker/index.js b/packages/metro/src/JSTransformer/worker/index.js index b8843bb1..135da666 100644 --- a/packages/metro/src/JSTransformer/worker/index.js +++ b/packages/metro/src/JSTransformer/worker/index.js @@ -47,7 +47,7 @@ export type TransformArgs = {| |}; export type TransformResults = { - ast: ?Ast, + ast: Ast, }; export type Transform = ( diff --git a/packages/metro/src/assetTransformer.js b/packages/metro/src/assetTransformer.js index de34c76a..f4817ca1 100644 --- a/packages/metro/src/assetTransformer.js +++ b/packages/metro/src/assetTransformer.js @@ -15,6 +15,7 @@ const {getAssetData} = require('./Assets'); const {generateAssetCodeFileAst} = require('./Bundler/util'); import type {TransformOptions} from './JSTransformer/worker'; +import type {Ast} from 'babel-core'; type Params = { localPath: string,