Support TypeScript mapped type 'as' clauses (#12129)
This commit is contained in:
@@ -620,6 +620,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
|
||||
this.expect(tt.bracketL);
|
||||
node.typeParameter = this.tsParseMappedTypeParameter();
|
||||
node.nameType = this.eatContextual("as") ? this.tsParseType() : null;
|
||||
|
||||
this.expect(tt.bracketR);
|
||||
|
||||
if (this.match(tt.plusMin)) {
|
||||
|
||||
@@ -1340,6 +1340,7 @@ export type TsMappedType = TsTypeBase & {
|
||||
typeParameter: TsTypeParameter,
|
||||
optional?: true | "+" | "-",
|
||||
typeAnnotation: ?TsType,
|
||||
nameType: ?TsType,
|
||||
};
|
||||
|
||||
export type TsLiteralType = TsTypeBase & {
|
||||
|
||||
Reference in New Issue
Block a user