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:
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -22,3 +22,5 @@ declare module B {
|
||||
declare export type B = {};
|
||||
declare export interface Moon {}
|
||||
}
|
||||
|
||||
declare module "foo" { declare export type * from "bar"; }
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
@@ -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"; }
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user