Add support for flow's export type * from (#617)

This commit is contained in:
Nicolò Ribaudo
2017-07-12 05:56:04 +02:00
committed by Brian Ng
parent ff513df283
commit b0c3a9dcdd
10 changed files with 252 additions and 16 deletions

View File

@@ -110,7 +110,8 @@
"raw": "\"bar\""
},
"value": "bar"
}
},
"exportKind": "value"
}
]
},

View File

@@ -0,0 +1 @@
declare module "foo" { declare export type * from "bar"; }

View File

@@ -0,0 +1,123 @@
{
"type": "File",
"start": 0,
"end": 58,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 58
}
},
"program": {
"type": "Program",
"start": 0,
"end": 58,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 58
}
},
"sourceType": "module",
"body": [
{
"type": "DeclareModule",
"start": 0,
"end": 58,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 58
}
},
"id": {
"type": "StringLiteral",
"start": 15,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 20
}
},
"extra": {
"rawValue": "foo",
"raw": "\"foo\""
},
"value": "foo"
},
"body": {
"type": "BlockStatement",
"start": 21,
"end": 58,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 58
}
},
"body": [
{
"type": "DeclareExportAllDeclaration",
"start": 23,
"end": 56,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 56
}
},
"exportKind": "type",
"source": {
"type": "StringLiteral",
"start": 50,
"end": 55,
"loc": {
"start": {
"line": 1,
"column": 50
},
"end": {
"line": 1,
"column": 55
}
},
"extra": {
"rawValue": "bar",
"raw": "\"bar\""
},
"value": "bar"
}
}
]
},
"kind": "ES"
}
],
"directives": []
}
}

View File

@@ -0,0 +1 @@
export type * as fooTypes from "foo";

View File

@@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["flow","exportExtensions"],
"throws": "Unexpected token (1:14)"
}

View File

@@ -0,0 +1 @@
export type * from "foo";

View File

@@ -0,0 +1,70 @@
{
"type": "File",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"program": {
"type": "Program",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"sourceType": "module",
"body": [
{
"type": "ExportAllDeclaration",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"exportKind": "type",
"source": {
"type": "StringLiteral",
"start": 19,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 24
}
},
"extra": {
"rawValue": "foo",
"raw": "\"foo\""
},
"value": "foo"
}
}
],
"directives": []
}
}