Support Flow's inline interface syntax (#7973)

* Support Flow's inline interface syntax

* Fix babel-generator
This commit is contained in:
Sam Goldman
2018-05-18 14:11:27 +01:00
committed by Brian Ng
parent a40f54f847
commit 6baa36cdc5
11 changed files with 625 additions and 0 deletions

View File

@@ -211,6 +211,15 @@ defineType("InterfaceExtends", {
defineInterfaceishType("InterfaceDeclaration");
defineType("InterfaceTypeAnnotation", {
visitor: ["extends", "body"],
aliases: ["Flow", "FlowType"],
fields: {
extends: validateOptional(arrayOfType("InterfaceExtends")),
body: validateType("ObjectTypeAnnotation"),
},
});
defineType("IntersectionTypeAnnotation", {
visitor: ["types"],
aliases: ["Flow", "FlowType"],