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:
@@ -60,6 +60,8 @@ pp.flowParseDeclare = function (node) {
|
||||
return this.flowParseDeclareModule(node);
|
||||
} else if (this.isContextual("type")) {
|
||||
return this.flowParseDeclareTypeAlias(node);
|
||||
} else if (this.isContextual("interface")) {
|
||||
return this.flowParseDeclareInterface(node);
|
||||
} else {
|
||||
this.unexpected();
|
||||
}
|
||||
@@ -104,6 +106,12 @@ pp.flowParseDeclareTypeAlias = function (node) {
|
||||
return this.finishNode(node, "DeclareTypeAlias");
|
||||
};
|
||||
|
||||
pp.flowParseDeclareInterface = function (node) {
|
||||
this.next();
|
||||
this.flowParseInterfaceish(node);
|
||||
return this.finishNode(node, "DeclareInterface");
|
||||
}
|
||||
|
||||
|
||||
// Interfaces
|
||||
|
||||
|
||||
Reference in New Issue
Block a user