Add support for "declare interface" Flow syntax

This has been a feature in Flow for a long time (couldn't easily find a
specific commit adding this). Interfaces are basically undocumented, though, so
it's easy to see how this was missed.
This commit is contained in:
Sam Goldman
2016-01-04 11:50:12 -08:00
parent e764346d5f
commit 26c97c4069
10 changed files with 316 additions and 0 deletions

View File

@@ -66,6 +66,14 @@ defineType("DeclareFunction", {
}
});
defineType("DeclareInterface", {
visitor: ["id", "typeParameters", "extends", "body"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
// todo
}
});
defineType("DeclareModule", {
visitor: ["id", "body"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],