Add support for export type star in babel-generator (#5985)

* Add support for export type star in babel-generator

* Bump babylon
This commit is contained in:
Brian Ng
2017-07-25 10:37:27 -05:00
committed by Henry Zhu
parent fb9a752262
commit 55aea26f13
8 changed files with 19 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
import * as t from "babel-types";
import { ExportAllDeclaration } from "./modules";
export function AnyTypeAnnotation() {
this.word("any");
@@ -100,17 +101,10 @@ export function DeclareExportDeclaration(node: Object) {
FlowExportDeclaration.apply(this, arguments);
}
export function DeclareExportAllDeclaration(node: Object) {
export function DeclareExportAllDeclaration(/*node: Object*/) {
this.word("declare");
this.space();
this.word("export");
this.space();
this.token("*");
this.space();
this.word("from");
this.space();
this.print(node.source, node);
this.semicolon();
ExportAllDeclaration.apply(this, arguments);
}
function FlowExportDeclaration(node: Object) {

View File

@@ -44,6 +44,10 @@ export function ExportNamespaceSpecifier(node: Object) {
export function ExportAllDeclaration(node: Object) {
this.word("export");
this.space();
if (node.exportKind === "type") {
this.word("type");
this.space();
}
this.token("*");
this.space();
this.word("from");

View File

@@ -22,3 +22,5 @@ declare module B {
declare export type B = {};
declare export interface Moon {}
}
declare module "foo" { declare export type * from "bar"; }

View File

@@ -29,4 +29,7 @@ declare export { c, d } from 'bar';
declare module B {
declare export type B = {};
declare export interface Moon {}
}
declare module "foo" {
declare export type * from "bar";
}

View File

@@ -123,3 +123,4 @@ var a: {| subtract: (x: number, ...y: Array<string>) => void |};
var a: {| id<T>(x: T): T; |};
function foo(numVal: number = 2) {}
function foo(numVal?: number = 2) {}
export type * from "foo";

View File

@@ -286,4 +286,6 @@ var a: {|
function foo(numVal: number = 2) {}
function foo(numVal?: number = 2) {}
function foo(numVal?: number = 2) {}
export type * from "foo";

View File

@@ -12,4 +12,5 @@ declare export class A { static () : number }
declare export class A mixins B<T>, C {}
declare export default class A {}
declare export default function foo(): void;
declare export default string
declare export default string
declare module "foo" { declare export type * from "bar"; }

View File

@@ -105,3 +105,4 @@ import {typeof V3, V4} from "foo";
export interface foo5 { p: number }
export interface foo6<T> { p: T }
import 'foo';
export type * from "foo";