Flow opaque type aliases (#5990)

This commit is contained in:
jbrown215
2017-08-02 17:30:19 -04:00
committed by Brian Ng
parent 0f823beeb1
commit 4e9a25e34a
14 changed files with 193 additions and 6 deletions

View File

@@ -88,6 +88,14 @@ defineType("DeclareTypeAlias", {
},
});
defineType("DeclareOpaqueType", {
visitor: ["id", "typeParameters", "supertype"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
// todo
},
});
defineType("DeclareVariable", {
visitor: ["id"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
@@ -252,6 +260,14 @@ defineType("TypeAlias", {
},
});
defineType("OpaqueType", {
visitor: ["id", "typeParameters", "supertype", "impltype"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
// todo
},
});
defineType("TypeCastExpression", {
visitor: ["expression", "typeAnnotation"],
aliases: ["Flow", "ExpressionWrapper", "Expression"],

View File

@@ -70,6 +70,7 @@ getBindingIdentifiers.keys = {
DeclareVariable: ["id"],
InterfaceDeclaration: ["id"],
TypeAlias: ["id"],
OpaqueType: ["id"],
CatchClause: ["param"],
LabeledStatement: ["label"],