From 98129c4978a839b7a435f3f31961226bcb32c30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 7 Feb 2023 13:23:02 +0100 Subject: [PATCH] Add test for expressions --- .../src/plugins/typescript/index.ts | 2 +- .../const-type-parameters-babel-7/input.ts | 8 + .../const-type-parameters-babel-7/output.json | 445 ++++++++++++--- .../types/const-type-parameters/input.ts | 8 + .../types/const-type-parameters/output.json | 517 ++++++++++++++---- 5 files changed, 805 insertions(+), 175 deletions(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.ts b/packages/babel-parser/src/plugins/typescript/index.ts index 61eae5d827c1..a08b38e56048 100644 --- a/packages/babel-parser/src/plugins/typescript/index.ts +++ b/packages/babel-parser/src/plugins/typescript/index.ts @@ -666,7 +666,7 @@ export default (superClass: ClassWithMixin) => tsParseConstModifier = this.tsParseModifiers.bind(this, { allowedModifiers: ["const"], - // for better error recover + // for better error recovery disallowedModifiers: ["in", "out"], errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions, }); diff --git a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/input.ts b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/input.ts index 0e9aa76b39c1..8134608f85e4 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/input.ts @@ -4,12 +4,20 @@ function c() {} declare function d(); () => {}; () => {}; +(function () {}); +(function () {}); +(function () {}); class A {} class B {} class C {} class D {} class E {} +(class {}); +(class {}); +(class {}); +(class {}); +(class {}); interface I {} interface J {} diff --git a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/output.json index 5347298fe4a2..70bb5e5b0b9d 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/output.json @@ -1,9 +1,9 @@ { "type": "File", - "start":0,"end":521,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":24,"column":1,"index":521}}, + "start":0,"end":744,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":32,"column":1,"index":744}}, "program": { "type": "Program", - "start":0,"end":521,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":24,"column":1,"index":521}}, + "start":0,"end":744,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":32,"column":1,"index":744}}, "sourceType": "module", "interpreter": null, "body": [ @@ -205,21 +205,137 @@ } } }, + { + "type": "ExpressionStatement", + "start":167,"end":193,"loc":{"start":{"line":7,"column":0,"index":167},"end":{"line":7,"column":26,"index":193}}, + "expression": { + "type": "FunctionExpression", + "start":168,"end":191,"loc":{"start":{"line":7,"column":1,"index":168},"end":{"line":7,"column":24,"index":191}}, + "id": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":177,"end":186,"loc":{"start":{"line":7,"column":10,"index":177},"end":{"line":7,"column":19,"index":186}}, + "params": [ + { + "type": "TSTypeParameter", + "start":178,"end":185,"loc":{"start":{"line":7,"column":11,"index":178},"end":{"line":7,"column":18,"index":185}}, + "const": true, + "name": "T" + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start":189,"end":191,"loc":{"start":{"line":7,"column":22,"index":189},"end":{"line":7,"column":24,"index":191}}, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 167 + } + } + }, + { + "type": "ExpressionStatement", + "start":194,"end":230,"loc":{"start":{"line":8,"column":0,"index":194},"end":{"line":8,"column":36,"index":230}}, + "expression": { + "type": "FunctionExpression", + "start":195,"end":228,"loc":{"start":{"line":8,"column":1,"index":195},"end":{"line":8,"column":34,"index":228}}, + "id": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":204,"end":223,"loc":{"start":{"line":8,"column":10,"index":204},"end":{"line":8,"column":29,"index":223}}, + "params": [ + { + "type": "TSTypeParameter", + "start":205,"end":222,"loc":{"start":{"line":8,"column":11,"index":205},"end":{"line":8,"column":28,"index":222}}, + "const": true, + "name": "T", + "constraint": { + "type": "TSTypeReference", + "start":221,"end":222,"loc":{"start":{"line":8,"column":27,"index":221},"end":{"line":8,"column":28,"index":222}}, + "typeName": { + "type": "Identifier", + "start":221,"end":222,"loc":{"start":{"line":8,"column":27,"index":221},"end":{"line":8,"column":28,"index":222},"identifierName":"U"}, + "name": "U" + } + } + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start":226,"end":228,"loc":{"start":{"line":8,"column":32,"index":226},"end":{"line":8,"column":34,"index":228}}, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 194 + } + } + }, + { + "type": "ExpressionStatement", + "start":231,"end":260,"loc":{"start":{"line":9,"column":0,"index":231},"end":{"line":9,"column":29,"index":260}}, + "expression": { + "type": "FunctionExpression", + "start":232,"end":258,"loc":{"start":{"line":9,"column":1,"index":232},"end":{"line":9,"column":27,"index":258}}, + "id": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":241,"end":253,"loc":{"start":{"line":9,"column":10,"index":241},"end":{"line":9,"column":22,"index":253}}, + "params": [ + { + "type": "TSTypeParameter", + "start":242,"end":243,"loc":{"start":{"line":9,"column":11,"index":242},"end":{"line":9,"column":12,"index":243}}, + "name": "T" + }, + { + "type": "TSTypeParameter", + "start":245,"end":252,"loc":{"start":{"line":9,"column":14,"index":245},"end":{"line":9,"column":21,"index":252}}, + "const": true, + "name": "U" + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start":256,"end":258,"loc":{"start":{"line":9,"column":25,"index":256},"end":{"line":9,"column":27,"index":258}}, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 231 + } + } + }, { "type": "ClassDeclaration", - "start":168,"end":187,"loc":{"start":{"line":8,"column":0,"index":168},"end":{"line":8,"column":19,"index":187}}, + "start":262,"end":281,"loc":{"start":{"line":11,"column":0,"index":262},"end":{"line":11,"column":19,"index":281}}, "id": { "type": "Identifier", - "start":174,"end":175,"loc":{"start":{"line":8,"column":6,"index":174},"end":{"line":8,"column":7,"index":175},"identifierName":"A"}, + "start":268,"end":269,"loc":{"start":{"line":11,"column":6,"index":268},"end":{"line":11,"column":7,"index":269},"identifierName":"A"}, "name": "A" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":175,"end":184,"loc":{"start":{"line":8,"column":7,"index":175},"end":{"line":8,"column":16,"index":184}}, + "start":269,"end":278,"loc":{"start":{"line":11,"column":7,"index":269},"end":{"line":11,"column":16,"index":278}}, "params": [ { "type": "TSTypeParameter", - "start":176,"end":183,"loc":{"start":{"line":8,"column":8,"index":176},"end":{"line":8,"column":15,"index":183}}, + "start":270,"end":277,"loc":{"start":{"line":11,"column":8,"index":270},"end":{"line":11,"column":15,"index":277}}, "const": true, "name": "T" } @@ -228,33 +344,33 @@ "superClass": null, "body": { "type": "ClassBody", - "start":185,"end":187,"loc":{"start":{"line":8,"column":17,"index":185},"end":{"line":8,"column":19,"index":187}}, + "start":279,"end":281,"loc":{"start":{"line":11,"column":17,"index":279},"end":{"line":11,"column":19,"index":281}}, "body": [] } }, { "type": "ClassDeclaration", - "start":188,"end":217,"loc":{"start":{"line":9,"column":0,"index":188},"end":{"line":9,"column":29,"index":217}}, + "start":282,"end":311,"loc":{"start":{"line":12,"column":0,"index":282},"end":{"line":12,"column":29,"index":311}}, "id": { "type": "Identifier", - "start":194,"end":195,"loc":{"start":{"line":9,"column":6,"index":194},"end":{"line":9,"column":7,"index":195},"identifierName":"B"}, + "start":288,"end":289,"loc":{"start":{"line":12,"column":6,"index":288},"end":{"line":12,"column":7,"index":289},"identifierName":"B"}, "name": "B" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":195,"end":214,"loc":{"start":{"line":9,"column":7,"index":195},"end":{"line":9,"column":26,"index":214}}, + "start":289,"end":308,"loc":{"start":{"line":12,"column":7,"index":289},"end":{"line":12,"column":26,"index":308}}, "params": [ { "type": "TSTypeParameter", - "start":196,"end":213,"loc":{"start":{"line":9,"column":8,"index":196},"end":{"line":9,"column":25,"index":213}}, + "start":290,"end":307,"loc":{"start":{"line":12,"column":8,"index":290},"end":{"line":12,"column":25,"index":307}}, "const": true, "name": "T", "constraint": { "type": "TSTypeReference", - "start":212,"end":213,"loc":{"start":{"line":9,"column":24,"index":212},"end":{"line":9,"column":25,"index":213}}, + "start":306,"end":307,"loc":{"start":{"line":12,"column":24,"index":306},"end":{"line":12,"column":25,"index":307}}, "typeName": { "type": "Identifier", - "start":212,"end":213,"loc":{"start":{"line":9,"column":24,"index":212},"end":{"line":9,"column":25,"index":213},"identifierName":"U"}, + "start":306,"end":307,"loc":{"start":{"line":12,"column":24,"index":306},"end":{"line":12,"column":25,"index":307},"identifierName":"U"}, "name": "U" } } @@ -264,30 +380,30 @@ "superClass": null, "body": { "type": "ClassBody", - "start":215,"end":217,"loc":{"start":{"line":9,"column":27,"index":215},"end":{"line":9,"column":29,"index":217}}, + "start":309,"end":311,"loc":{"start":{"line":12,"column":27,"index":309},"end":{"line":12,"column":29,"index":311}}, "body": [] } }, { "type": "ClassDeclaration", - "start":218,"end":240,"loc":{"start":{"line":10,"column":0,"index":218},"end":{"line":10,"column":22,"index":240}}, + "start":312,"end":334,"loc":{"start":{"line":13,"column":0,"index":312},"end":{"line":13,"column":22,"index":334}}, "id": { "type": "Identifier", - "start":224,"end":225,"loc":{"start":{"line":10,"column":6,"index":224},"end":{"line":10,"column":7,"index":225},"identifierName":"C"}, + "start":318,"end":319,"loc":{"start":{"line":13,"column":6,"index":318},"end":{"line":13,"column":7,"index":319},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":225,"end":237,"loc":{"start":{"line":10,"column":7,"index":225},"end":{"line":10,"column":19,"index":237}}, + "start":319,"end":331,"loc":{"start":{"line":13,"column":7,"index":319},"end":{"line":13,"column":19,"index":331}}, "params": [ { "type": "TSTypeParameter", - "start":226,"end":227,"loc":{"start":{"line":10,"column":8,"index":226},"end":{"line":10,"column":9,"index":227}}, + "start":320,"end":321,"loc":{"start":{"line":13,"column":8,"index":320},"end":{"line":13,"column":9,"index":321}}, "name": "T" }, { "type": "TSTypeParameter", - "start":229,"end":236,"loc":{"start":{"line":10,"column":11,"index":229},"end":{"line":10,"column":18,"index":236}}, + "start":323,"end":330,"loc":{"start":{"line":13,"column":11,"index":323},"end":{"line":13,"column":18,"index":330}}, "const": true, "name": "U" } @@ -296,25 +412,25 @@ "superClass": null, "body": { "type": "ClassBody", - "start":238,"end":240,"loc":{"start":{"line":10,"column":20,"index":238},"end":{"line":10,"column":22,"index":240}}, + "start":332,"end":334,"loc":{"start":{"line":13,"column":20,"index":332},"end":{"line":13,"column":22,"index":334}}, "body": [] } }, { "type": "ClassDeclaration", - "start":241,"end":263,"loc":{"start":{"line":11,"column":0,"index":241},"end":{"line":11,"column":22,"index":263}}, + "start":335,"end":357,"loc":{"start":{"line":14,"column":0,"index":335},"end":{"line":14,"column":22,"index":357}}, "id": { "type": "Identifier", - "start":247,"end":248,"loc":{"start":{"line":11,"column":6,"index":247},"end":{"line":11,"column":7,"index":248},"identifierName":"D"}, + "start":341,"end":342,"loc":{"start":{"line":14,"column":6,"index":341},"end":{"line":14,"column":7,"index":342},"identifierName":"D"}, "name": "D" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":248,"end":260,"loc":{"start":{"line":11,"column":7,"index":248},"end":{"line":11,"column":19,"index":260}}, + "start":342,"end":354,"loc":{"start":{"line":14,"column":7,"index":342},"end":{"line":14,"column":19,"index":354}}, "params": [ { "type": "TSTypeParameter", - "start":249,"end":259,"loc":{"start":{"line":11,"column":8,"index":249},"end":{"line":11,"column":18,"index":259}}, + "start":343,"end":353,"loc":{"start":{"line":14,"column":8,"index":343},"end":{"line":14,"column":18,"index":353}}, "in": true, "const": true, "name": "T" @@ -324,25 +440,25 @@ "superClass": null, "body": { "type": "ClassBody", - "start":261,"end":263,"loc":{"start":{"line":11,"column":20,"index":261},"end":{"line":11,"column":22,"index":263}}, + "start":355,"end":357,"loc":{"start":{"line":14,"column":20,"index":355},"end":{"line":14,"column":22,"index":357}}, "body": [] } }, { "type": "ClassDeclaration", - "start":264,"end":286,"loc":{"start":{"line":12,"column":0,"index":264},"end":{"line":12,"column":22,"index":286}}, + "start":358,"end":380,"loc":{"start":{"line":15,"column":0,"index":358},"end":{"line":15,"column":22,"index":380}}, "id": { "type": "Identifier", - "start":270,"end":271,"loc":{"start":{"line":12,"column":6,"index":270},"end":{"line":12,"column":7,"index":271},"identifierName":"E"}, + "start":364,"end":365,"loc":{"start":{"line":15,"column":6,"index":364},"end":{"line":15,"column":7,"index":365},"identifierName":"E"}, "name": "E" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":271,"end":283,"loc":{"start":{"line":12,"column":7,"index":271},"end":{"line":12,"column":19,"index":283}}, + "start":365,"end":377,"loc":{"start":{"line":15,"column":7,"index":365},"end":{"line":15,"column":19,"index":377}}, "params": [ { "type": "TSTypeParameter", - "start":272,"end":282,"loc":{"start":{"line":12,"column":8,"index":272},"end":{"line":12,"column":18,"index":282}}, + "start":366,"end":376,"loc":{"start":{"line":15,"column":8,"index":366},"end":{"line":15,"column":18,"index":376}}, "const": true, "in": true, "name": "T" @@ -352,25 +468,196 @@ "superClass": null, "body": { "type": "ClassBody", - "start":284,"end":286,"loc":{"start":{"line":12,"column":20,"index":284},"end":{"line":12,"column":22,"index":286}}, + "start":378,"end":380,"loc":{"start":{"line":15,"column":20,"index":378},"end":{"line":15,"column":22,"index":380}}, "body": [] } }, + { + "type": "ExpressionStatement", + "start":381,"end":402,"loc":{"start":{"line":16,"column":0,"index":381},"end":{"line":16,"column":21,"index":402}}, + "expression": { + "type": "ClassExpression", + "start":382,"end":400,"loc":{"start":{"line":16,"column":1,"index":382},"end":{"line":16,"column":19,"index":400}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":388,"end":397,"loc":{"start":{"line":16,"column":7,"index":388},"end":{"line":16,"column":16,"index":397}}, + "params": [ + { + "type": "TSTypeParameter", + "start":389,"end":396,"loc":{"start":{"line":16,"column":8,"index":389},"end":{"line":16,"column":15,"index":396}}, + "const": true, + "name": "T" + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":398,"end":400,"loc":{"start":{"line":16,"column":17,"index":398},"end":{"line":16,"column":19,"index":400}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 381 + } + } + }, + { + "type": "ExpressionStatement", + "start":403,"end":434,"loc":{"start":{"line":17,"column":0,"index":403},"end":{"line":17,"column":31,"index":434}}, + "expression": { + "type": "ClassExpression", + "start":404,"end":432,"loc":{"start":{"line":17,"column":1,"index":404},"end":{"line":17,"column":29,"index":432}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":410,"end":429,"loc":{"start":{"line":17,"column":7,"index":410},"end":{"line":17,"column":26,"index":429}}, + "params": [ + { + "type": "TSTypeParameter", + "start":411,"end":428,"loc":{"start":{"line":17,"column":8,"index":411},"end":{"line":17,"column":25,"index":428}}, + "const": true, + "name": "T", + "constraint": { + "type": "TSTypeReference", + "start":427,"end":428,"loc":{"start":{"line":17,"column":24,"index":427},"end":{"line":17,"column":25,"index":428}}, + "typeName": { + "type": "Identifier", + "start":427,"end":428,"loc":{"start":{"line":17,"column":24,"index":427},"end":{"line":17,"column":25,"index":428},"identifierName":"U"}, + "name": "U" + } + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":430,"end":432,"loc":{"start":{"line":17,"column":27,"index":430},"end":{"line":17,"column":29,"index":432}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 403 + } + } + }, + { + "type": "ExpressionStatement", + "start":435,"end":459,"loc":{"start":{"line":18,"column":0,"index":435},"end":{"line":18,"column":24,"index":459}}, + "expression": { + "type": "ClassExpression", + "start":436,"end":457,"loc":{"start":{"line":18,"column":1,"index":436},"end":{"line":18,"column":22,"index":457}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":442,"end":454,"loc":{"start":{"line":18,"column":7,"index":442},"end":{"line":18,"column":19,"index":454}}, + "params": [ + { + "type": "TSTypeParameter", + "start":443,"end":444,"loc":{"start":{"line":18,"column":8,"index":443},"end":{"line":18,"column":9,"index":444}}, + "name": "T" + }, + { + "type": "TSTypeParameter", + "start":446,"end":453,"loc":{"start":{"line":18,"column":11,"index":446},"end":{"line":18,"column":18,"index":453}}, + "const": true, + "name": "U" + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":455,"end":457,"loc":{"start":{"line":18,"column":20,"index":455},"end":{"line":18,"column":22,"index":457}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 435 + } + } + }, + { + "type": "ExpressionStatement", + "start":460,"end":484,"loc":{"start":{"line":19,"column":0,"index":460},"end":{"line":19,"column":24,"index":484}}, + "expression": { + "type": "ClassExpression", + "start":461,"end":482,"loc":{"start":{"line":19,"column":1,"index":461},"end":{"line":19,"column":22,"index":482}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":467,"end":479,"loc":{"start":{"line":19,"column":7,"index":467},"end":{"line":19,"column":19,"index":479}}, + "params": [ + { + "type": "TSTypeParameter", + "start":468,"end":478,"loc":{"start":{"line":19,"column":8,"index":468},"end":{"line":19,"column":18,"index":478}}, + "in": true, + "const": true, + "name": "T" + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":480,"end":482,"loc":{"start":{"line":19,"column":20,"index":480},"end":{"line":19,"column":22,"index":482}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 460 + } + } + }, + { + "type": "ExpressionStatement", + "start":485,"end":509,"loc":{"start":{"line":20,"column":0,"index":485},"end":{"line":20,"column":24,"index":509}}, + "expression": { + "type": "ClassExpression", + "start":486,"end":507,"loc":{"start":{"line":20,"column":1,"index":486},"end":{"line":20,"column":22,"index":507}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":492,"end":504,"loc":{"start":{"line":20,"column":7,"index":492},"end":{"line":20,"column":19,"index":504}}, + "params": [ + { + "type": "TSTypeParameter", + "start":493,"end":503,"loc":{"start":{"line":20,"column":8,"index":493},"end":{"line":20,"column":18,"index":503}}, + "const": true, + "in": true, + "name": "T" + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":505,"end":507,"loc":{"start":{"line":20,"column":20,"index":505},"end":{"line":20,"column":22,"index":507}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 485 + } + } + }, { "type": "TSInterfaceDeclaration", - "start":288,"end":311,"loc":{"start":{"line":14,"column":0,"index":288},"end":{"line":14,"column":23,"index":311}}, + "start":511,"end":534,"loc":{"start":{"line":22,"column":0,"index":511},"end":{"line":22,"column":23,"index":534}}, "id": { "type": "Identifier", - "start":298,"end":299,"loc":{"start":{"line":14,"column":10,"index":298},"end":{"line":14,"column":11,"index":299},"identifierName":"I"}, + "start":521,"end":522,"loc":{"start":{"line":22,"column":10,"index":521},"end":{"line":22,"column":11,"index":522},"identifierName":"I"}, "name": "I" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":299,"end":308,"loc":{"start":{"line":14,"column":11,"index":299},"end":{"line":14,"column":20,"index":308}}, + "start":522,"end":531,"loc":{"start":{"line":22,"column":11,"index":522},"end":{"line":22,"column":20,"index":531}}, "params": [ { "type": "TSTypeParameter", - "start":300,"end":307,"loc":{"start":{"line":14,"column":12,"index":300},"end":{"line":14,"column":19,"index":307}}, + "start":523,"end":530,"loc":{"start":{"line":22,"column":12,"index":523},"end":{"line":22,"column":19,"index":530}}, "const": true, "name": "T" } @@ -378,33 +665,33 @@ }, "body": { "type": "TSInterfaceBody", - "start":309,"end":311,"loc":{"start":{"line":14,"column":21,"index":309},"end":{"line":14,"column":23,"index":311}}, + "start":532,"end":534,"loc":{"start":{"line":22,"column":21,"index":532},"end":{"line":22,"column":23,"index":534}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":312,"end":345,"loc":{"start":{"line":15,"column":0,"index":312},"end":{"line":15,"column":33,"index":345}}, + "start":535,"end":568,"loc":{"start":{"line":23,"column":0,"index":535},"end":{"line":23,"column":33,"index":568}}, "id": { "type": "Identifier", - "start":322,"end":323,"loc":{"start":{"line":15,"column":10,"index":322},"end":{"line":15,"column":11,"index":323},"identifierName":"J"}, + "start":545,"end":546,"loc":{"start":{"line":23,"column":10,"index":545},"end":{"line":23,"column":11,"index":546},"identifierName":"J"}, "name": "J" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":323,"end":342,"loc":{"start":{"line":15,"column":11,"index":323},"end":{"line":15,"column":30,"index":342}}, + "start":546,"end":565,"loc":{"start":{"line":23,"column":11,"index":546},"end":{"line":23,"column":30,"index":565}}, "params": [ { "type": "TSTypeParameter", - "start":324,"end":341,"loc":{"start":{"line":15,"column":12,"index":324},"end":{"line":15,"column":29,"index":341}}, + "start":547,"end":564,"loc":{"start":{"line":23,"column":12,"index":547},"end":{"line":23,"column":29,"index":564}}, "const": true, "name": "T", "constraint": { "type": "TSTypeReference", - "start":340,"end":341,"loc":{"start":{"line":15,"column":28,"index":340},"end":{"line":15,"column":29,"index":341}}, + "start":563,"end":564,"loc":{"start":{"line":23,"column":28,"index":563},"end":{"line":23,"column":29,"index":564}}, "typeName": { "type": "Identifier", - "start":340,"end":341,"loc":{"start":{"line":15,"column":28,"index":340},"end":{"line":15,"column":29,"index":341},"identifierName":"U"}, + "start":563,"end":564,"loc":{"start":{"line":23,"column":28,"index":563},"end":{"line":23,"column":29,"index":564},"identifierName":"U"}, "name": "U" } } @@ -413,30 +700,30 @@ }, "body": { "type": "TSInterfaceBody", - "start":343,"end":345,"loc":{"start":{"line":15,"column":31,"index":343},"end":{"line":15,"column":33,"index":345}}, + "start":566,"end":568,"loc":{"start":{"line":23,"column":31,"index":566},"end":{"line":23,"column":33,"index":568}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":346,"end":372,"loc":{"start":{"line":16,"column":0,"index":346},"end":{"line":16,"column":26,"index":372}}, + "start":569,"end":595,"loc":{"start":{"line":24,"column":0,"index":569},"end":{"line":24,"column":26,"index":595}}, "id": { "type": "Identifier", - "start":356,"end":357,"loc":{"start":{"line":16,"column":10,"index":356},"end":{"line":16,"column":11,"index":357},"identifierName":"K"}, + "start":579,"end":580,"loc":{"start":{"line":24,"column":10,"index":579},"end":{"line":24,"column":11,"index":580},"identifierName":"K"}, "name": "K" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":357,"end":369,"loc":{"start":{"line":16,"column":11,"index":357},"end":{"line":16,"column":23,"index":369}}, + "start":580,"end":592,"loc":{"start":{"line":24,"column":11,"index":580},"end":{"line":24,"column":23,"index":592}}, "params": [ { "type": "TSTypeParameter", - "start":358,"end":359,"loc":{"start":{"line":16,"column":12,"index":358},"end":{"line":16,"column":13,"index":359}}, + "start":581,"end":582,"loc":{"start":{"line":24,"column":12,"index":581},"end":{"line":24,"column":13,"index":582}}, "name": "T" }, { "type": "TSTypeParameter", - "start":361,"end":368,"loc":{"start":{"line":16,"column":15,"index":361},"end":{"line":16,"column":22,"index":368}}, + "start":584,"end":591,"loc":{"start":{"line":24,"column":15,"index":584},"end":{"line":24,"column":22,"index":591}}, "const": true, "name": "U" } @@ -444,25 +731,25 @@ }, "body": { "type": "TSInterfaceBody", - "start":370,"end":372,"loc":{"start":{"line":16,"column":24,"index":370},"end":{"line":16,"column":26,"index":372}}, + "start":593,"end":595,"loc":{"start":{"line":24,"column":24,"index":593},"end":{"line":24,"column":26,"index":595}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":373,"end":399,"loc":{"start":{"line":17,"column":0,"index":373},"end":{"line":17,"column":26,"index":399}}, + "start":596,"end":622,"loc":{"start":{"line":25,"column":0,"index":596},"end":{"line":25,"column":26,"index":622}}, "id": { "type": "Identifier", - "start":383,"end":384,"loc":{"start":{"line":17,"column":10,"index":383},"end":{"line":17,"column":11,"index":384},"identifierName":"L"}, + "start":606,"end":607,"loc":{"start":{"line":25,"column":10,"index":606},"end":{"line":25,"column":11,"index":607},"identifierName":"L"}, "name": "L" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":384,"end":396,"loc":{"start":{"line":17,"column":11,"index":384},"end":{"line":17,"column":23,"index":396}}, + "start":607,"end":619,"loc":{"start":{"line":25,"column":11,"index":607},"end":{"line":25,"column":23,"index":619}}, "params": [ { "type": "TSTypeParameter", - "start":385,"end":395,"loc":{"start":{"line":17,"column":12,"index":385},"end":{"line":17,"column":22,"index":395}}, + "start":608,"end":618,"loc":{"start":{"line":25,"column":12,"index":608},"end":{"line":25,"column":22,"index":618}}, "in": true, "const": true, "name": "T" @@ -471,25 +758,25 @@ }, "body": { "type": "TSInterfaceBody", - "start":397,"end":399,"loc":{"start":{"line":17,"column":24,"index":397},"end":{"line":17,"column":26,"index":399}}, + "start":620,"end":622,"loc":{"start":{"line":25,"column":24,"index":620},"end":{"line":25,"column":26,"index":622}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":400,"end":426,"loc":{"start":{"line":18,"column":0,"index":400},"end":{"line":18,"column":26,"index":426}}, + "start":623,"end":649,"loc":{"start":{"line":26,"column":0,"index":623},"end":{"line":26,"column":26,"index":649}}, "id": { "type": "Identifier", - "start":410,"end":411,"loc":{"start":{"line":18,"column":10,"index":410},"end":{"line":18,"column":11,"index":411},"identifierName":"M"}, + "start":633,"end":634,"loc":{"start":{"line":26,"column":10,"index":633},"end":{"line":26,"column":11,"index":634},"identifierName":"M"}, "name": "M" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":411,"end":423,"loc":{"start":{"line":18,"column":11,"index":411},"end":{"line":18,"column":23,"index":423}}, + "start":634,"end":646,"loc":{"start":{"line":26,"column":11,"index":634},"end":{"line":26,"column":23,"index":646}}, "params": [ { "type": "TSTypeParameter", - "start":412,"end":422,"loc":{"start":{"line":18,"column":12,"index":412},"end":{"line":18,"column":22,"index":422}}, + "start":635,"end":645,"loc":{"start":{"line":26,"column":12,"index":635},"end":{"line":26,"column":22,"index":645}}, "const": true, "in": true, "name": "T" @@ -498,41 +785,41 @@ }, "body": { "type": "TSInterfaceBody", - "start":424,"end":426,"loc":{"start":{"line":18,"column":24,"index":424},"end":{"line":18,"column":26,"index":426}}, + "start":647,"end":649,"loc":{"start":{"line":26,"column":24,"index":647},"end":{"line":26,"column":26,"index":649}}, "body": [] } }, { "type": "ClassDeclaration", - "start":428,"end":521,"loc":{"start":{"line":20,"column":0,"index":428},"end":{"line":24,"column":1,"index":521}}, + "start":651,"end":744,"loc":{"start":{"line":28,"column":0,"index":651},"end":{"line":32,"column":1,"index":744}}, "id": { "type": "Identifier", - "start":434,"end":435,"loc":{"start":{"line":20,"column":6,"index":434},"end":{"line":20,"column":7,"index":435},"identifierName":"_"}, + "start":657,"end":658,"loc":{"start":{"line":28,"column":6,"index":657},"end":{"line":28,"column":7,"index":658},"identifierName":"_"}, "name": "_" }, "superClass": null, "body": { "type": "ClassBody", - "start":436,"end":521,"loc":{"start":{"line":20,"column":8,"index":436},"end":{"line":24,"column":1,"index":521}}, + "start":659,"end":744,"loc":{"start":{"line":28,"column":8,"index":659},"end":{"line":32,"column":1,"index":744}}, "body": [ { "type": "ClassMethod", - "start":440,"end":460,"loc":{"start":{"line":21,"column":2,"index":440},"end":{"line":21,"column":22,"index":460}}, + "start":663,"end":683,"loc":{"start":{"line":29,"column":2,"index":663},"end":{"line":29,"column":22,"index":683}}, "static": false, "key": { "type": "Identifier", - "start":440,"end":446,"loc":{"start":{"line":21,"column":2,"index":440},"end":{"line":21,"column":8,"index":446},"identifierName":"method"}, + "start":663,"end":669,"loc":{"start":{"line":29,"column":2,"index":663},"end":{"line":29,"column":8,"index":669},"identifierName":"method"}, "name": "method" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":446,"end":455,"loc":{"start":{"line":21,"column":8,"index":446},"end":{"line":21,"column":17,"index":455}}, + "start":669,"end":678,"loc":{"start":{"line":29,"column":8,"index":669},"end":{"line":29,"column":17,"index":678}}, "params": [ { "type": "TSTypeParameter", - "start":447,"end":454,"loc":{"start":{"line":21,"column":9,"index":447},"end":{"line":21,"column":16,"index":454}}, + "start":670,"end":677,"loc":{"start":{"line":29,"column":9,"index":670},"end":{"line":29,"column":16,"index":677}}, "const": true, "name": "T" } @@ -544,37 +831,37 @@ "params": [], "body": { "type": "BlockStatement", - "start":458,"end":460,"loc":{"start":{"line":21,"column":20,"index":458},"end":{"line":21,"column":22,"index":460}}, + "start":681,"end":683,"loc":{"start":{"line":29,"column":20,"index":681},"end":{"line":29,"column":22,"index":683}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start":463,"end":493,"loc":{"start":{"line":22,"column":2,"index":463},"end":{"line":22,"column":32,"index":493}}, + "start":686,"end":716,"loc":{"start":{"line":30,"column":2,"index":686},"end":{"line":30,"column":32,"index":716}}, "static": false, "key": { "type": "Identifier", - "start":463,"end":469,"loc":{"start":{"line":22,"column":2,"index":463},"end":{"line":22,"column":8,"index":469},"identifierName":"method"}, + "start":686,"end":692,"loc":{"start":{"line":30,"column":2,"index":686},"end":{"line":30,"column":8,"index":692},"identifierName":"method"}, "name": "method" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":469,"end":488,"loc":{"start":{"line":22,"column":8,"index":469},"end":{"line":22,"column":27,"index":488}}, + "start":692,"end":711,"loc":{"start":{"line":30,"column":8,"index":692},"end":{"line":30,"column":27,"index":711}}, "params": [ { "type": "TSTypeParameter", - "start":470,"end":487,"loc":{"start":{"line":22,"column":9,"index":470},"end":{"line":22,"column":26,"index":487}}, + "start":693,"end":710,"loc":{"start":{"line":30,"column":9,"index":693},"end":{"line":30,"column":26,"index":710}}, "const": true, "name": "T", "constraint": { "type": "TSTypeReference", - "start":486,"end":487,"loc":{"start":{"line":22,"column":25,"index":486},"end":{"line":22,"column":26,"index":487}}, + "start":709,"end":710,"loc":{"start":{"line":30,"column":25,"index":709},"end":{"line":30,"column":26,"index":710}}, "typeName": { "type": "Identifier", - "start":486,"end":487,"loc":{"start":{"line":22,"column":25,"index":486},"end":{"line":22,"column":26,"index":487},"identifierName":"U"}, + "start":709,"end":710,"loc":{"start":{"line":30,"column":25,"index":709},"end":{"line":30,"column":26,"index":710},"identifierName":"U"}, "name": "U" } } @@ -587,34 +874,34 @@ "params": [], "body": { "type": "BlockStatement", - "start":491,"end":493,"loc":{"start":{"line":22,"column":30,"index":491},"end":{"line":22,"column":32,"index":493}}, + "start":714,"end":716,"loc":{"start":{"line":30,"column":30,"index":714},"end":{"line":30,"column":32,"index":716}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start":496,"end":519,"loc":{"start":{"line":23,"column":2,"index":496},"end":{"line":23,"column":25,"index":519}}, + "start":719,"end":742,"loc":{"start":{"line":31,"column":2,"index":719},"end":{"line":31,"column":25,"index":742}}, "static": false, "key": { "type": "Identifier", - "start":496,"end":502,"loc":{"start":{"line":23,"column":2,"index":496},"end":{"line":23,"column":8,"index":502},"identifierName":"method"}, + "start":719,"end":725,"loc":{"start":{"line":31,"column":2,"index":719},"end":{"line":31,"column":8,"index":725},"identifierName":"method"}, "name": "method" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":502,"end":514,"loc":{"start":{"line":23,"column":8,"index":502},"end":{"line":23,"column":20,"index":514}}, + "start":725,"end":737,"loc":{"start":{"line":31,"column":8,"index":725},"end":{"line":31,"column":20,"index":737}}, "params": [ { "type": "TSTypeParameter", - "start":503,"end":504,"loc":{"start":{"line":23,"column":9,"index":503},"end":{"line":23,"column":10,"index":504}}, + "start":726,"end":727,"loc":{"start":{"line":31,"column":9,"index":726},"end":{"line":31,"column":10,"index":727}}, "name": "T" }, { "type": "TSTypeParameter", - "start":506,"end":513,"loc":{"start":{"line":23,"column":12,"index":506},"end":{"line":23,"column":19,"index":513}}, + "start":729,"end":736,"loc":{"start":{"line":31,"column":12,"index":729},"end":{"line":31,"column":19,"index":736}}, "const": true, "name": "U" } @@ -626,7 +913,7 @@ "params": [], "body": { "type": "BlockStatement", - "start":517,"end":519,"loc":{"start":{"line":23,"column":23,"index":517},"end":{"line":23,"column":25,"index":519}}, + "start":740,"end":742,"loc":{"start":{"line":31,"column":23,"index":740},"end":{"line":31,"column":25,"index":742}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/input.ts b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/input.ts index 0e9aa76b39c1..8134608f85e4 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/input.ts @@ -4,12 +4,20 @@ function c() {} declare function d(); () => {}; () => {}; +(function () {}); +(function () {}); +(function () {}); class A {} class B {} class C {} class D {} class E {} +(class {}); +(class {}); +(class {}); +(class {}); +(class {}); interface I {} interface J {} diff --git a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/output.json index 9b681fd4eec7..ba550fe8c335 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/output.json @@ -1,9 +1,9 @@ { "type": "File", - "start":0,"end":521,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":24,"column":1,"index":521}}, + "start":0,"end":744,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":32,"column":1,"index":744}}, "program": { "type": "Program", - "start":0,"end":521,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":24,"column":1,"index":521}}, + "start":0,"end":744,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":32,"column":1,"index":744}}, "sourceType": "module", "interpreter": null, "body": [ @@ -233,25 +233,157 @@ } } }, + { + "type": "ExpressionStatement", + "start":167,"end":193,"loc":{"start":{"line":7,"column":0,"index":167},"end":{"line":7,"column":26,"index":193}}, + "expression": { + "type": "FunctionExpression", + "start":168,"end":191,"loc":{"start":{"line":7,"column":1,"index":168},"end":{"line":7,"column":24,"index":191}}, + "id": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":177,"end":186,"loc":{"start":{"line":7,"column":10,"index":177},"end":{"line":7,"column":19,"index":186}}, + "params": [ + { + "type": "TSTypeParameter", + "start":178,"end":185,"loc":{"start":{"line":7,"column":11,"index":178},"end":{"line":7,"column":18,"index":185}}, + "const": true, + "name": { + "type": "Identifier", + "start":184,"end":185,"loc":{"start":{"line":7,"column":17,"index":184},"end":{"line":7,"column":18,"index":185},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start":189,"end":191,"loc":{"start":{"line":7,"column":22,"index":189},"end":{"line":7,"column":24,"index":191}}, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 167 + } + } + }, + { + "type": "ExpressionStatement", + "start":194,"end":230,"loc":{"start":{"line":8,"column":0,"index":194},"end":{"line":8,"column":36,"index":230}}, + "expression": { + "type": "FunctionExpression", + "start":195,"end":228,"loc":{"start":{"line":8,"column":1,"index":195},"end":{"line":8,"column":34,"index":228}}, + "id": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":204,"end":223,"loc":{"start":{"line":8,"column":10,"index":204},"end":{"line":8,"column":29,"index":223}}, + "params": [ + { + "type": "TSTypeParameter", + "start":205,"end":222,"loc":{"start":{"line":8,"column":11,"index":205},"end":{"line":8,"column":28,"index":222}}, + "const": true, + "name": { + "type": "Identifier", + "start":211,"end":212,"loc":{"start":{"line":8,"column":17,"index":211},"end":{"line":8,"column":18,"index":212},"identifierName":"T"}, + "name": "T" + }, + "constraint": { + "type": "TSTypeReference", + "start":221,"end":222,"loc":{"start":{"line":8,"column":27,"index":221},"end":{"line":8,"column":28,"index":222}}, + "typeName": { + "type": "Identifier", + "start":221,"end":222,"loc":{"start":{"line":8,"column":27,"index":221},"end":{"line":8,"column":28,"index":222},"identifierName":"U"}, + "name": "U" + } + } + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start":226,"end":228,"loc":{"start":{"line":8,"column":32,"index":226},"end":{"line":8,"column":34,"index":228}}, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 194 + } + } + }, + { + "type": "ExpressionStatement", + "start":231,"end":260,"loc":{"start":{"line":9,"column":0,"index":231},"end":{"line":9,"column":29,"index":260}}, + "expression": { + "type": "FunctionExpression", + "start":232,"end":258,"loc":{"start":{"line":9,"column":1,"index":232},"end":{"line":9,"column":27,"index":258}}, + "id": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":241,"end":253,"loc":{"start":{"line":9,"column":10,"index":241},"end":{"line":9,"column":22,"index":253}}, + "params": [ + { + "type": "TSTypeParameter", + "start":242,"end":243,"loc":{"start":{"line":9,"column":11,"index":242},"end":{"line":9,"column":12,"index":243}}, + "name": { + "type": "Identifier", + "start":242,"end":243,"loc":{"start":{"line":9,"column":11,"index":242},"end":{"line":9,"column":12,"index":243},"identifierName":"T"}, + "name": "T" + } + }, + { + "type": "TSTypeParameter", + "start":245,"end":252,"loc":{"start":{"line":9,"column":14,"index":245},"end":{"line":9,"column":21,"index":252}}, + "const": true, + "name": { + "type": "Identifier", + "start":251,"end":252,"loc":{"start":{"line":9,"column":20,"index":251},"end":{"line":9,"column":21,"index":252},"identifierName":"U"}, + "name": "U" + } + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start":256,"end":258,"loc":{"start":{"line":9,"column":25,"index":256},"end":{"line":9,"column":27,"index":258}}, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 231 + } + } + }, { "type": "ClassDeclaration", - "start":168,"end":187,"loc":{"start":{"line":8,"column":0,"index":168},"end":{"line":8,"column":19,"index":187}}, + "start":262,"end":281,"loc":{"start":{"line":11,"column":0,"index":262},"end":{"line":11,"column":19,"index":281}}, "id": { "type": "Identifier", - "start":174,"end":175,"loc":{"start":{"line":8,"column":6,"index":174},"end":{"line":8,"column":7,"index":175},"identifierName":"A"}, + "start":268,"end":269,"loc":{"start":{"line":11,"column":6,"index":268},"end":{"line":11,"column":7,"index":269},"identifierName":"A"}, "name": "A" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":175,"end":184,"loc":{"start":{"line":8,"column":7,"index":175},"end":{"line":8,"column":16,"index":184}}, + "start":269,"end":278,"loc":{"start":{"line":11,"column":7,"index":269},"end":{"line":11,"column":16,"index":278}}, "params": [ { "type": "TSTypeParameter", - "start":176,"end":183,"loc":{"start":{"line":8,"column":8,"index":176},"end":{"line":8,"column":15,"index":183}}, + "start":270,"end":277,"loc":{"start":{"line":11,"column":8,"index":270},"end":{"line":11,"column":15,"index":277}}, "const": true, "name": { "type": "Identifier", - "start":182,"end":183,"loc":{"start":{"line":8,"column":14,"index":182},"end":{"line":8,"column":15,"index":183},"identifierName":"T"}, + "start":276,"end":277,"loc":{"start":{"line":11,"column":14,"index":276},"end":{"line":11,"column":15,"index":277},"identifierName":"T"}, "name": "T" } } @@ -260,37 +392,37 @@ "superClass": null, "body": { "type": "ClassBody", - "start":185,"end":187,"loc":{"start":{"line":8,"column":17,"index":185},"end":{"line":8,"column":19,"index":187}}, + "start":279,"end":281,"loc":{"start":{"line":11,"column":17,"index":279},"end":{"line":11,"column":19,"index":281}}, "body": [] } }, { "type": "ClassDeclaration", - "start":188,"end":217,"loc":{"start":{"line":9,"column":0,"index":188},"end":{"line":9,"column":29,"index":217}}, + "start":282,"end":311,"loc":{"start":{"line":12,"column":0,"index":282},"end":{"line":12,"column":29,"index":311}}, "id": { "type": "Identifier", - "start":194,"end":195,"loc":{"start":{"line":9,"column":6,"index":194},"end":{"line":9,"column":7,"index":195},"identifierName":"B"}, + "start":288,"end":289,"loc":{"start":{"line":12,"column":6,"index":288},"end":{"line":12,"column":7,"index":289},"identifierName":"B"}, "name": "B" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":195,"end":214,"loc":{"start":{"line":9,"column":7,"index":195},"end":{"line":9,"column":26,"index":214}}, + "start":289,"end":308,"loc":{"start":{"line":12,"column":7,"index":289},"end":{"line":12,"column":26,"index":308}}, "params": [ { "type": "TSTypeParameter", - "start":196,"end":213,"loc":{"start":{"line":9,"column":8,"index":196},"end":{"line":9,"column":25,"index":213}}, + "start":290,"end":307,"loc":{"start":{"line":12,"column":8,"index":290},"end":{"line":12,"column":25,"index":307}}, "const": true, "name": { "type": "Identifier", - "start":202,"end":203,"loc":{"start":{"line":9,"column":14,"index":202},"end":{"line":9,"column":15,"index":203},"identifierName":"T"}, + "start":296,"end":297,"loc":{"start":{"line":12,"column":14,"index":296},"end":{"line":12,"column":15,"index":297},"identifierName":"T"}, "name": "T" }, "constraint": { "type": "TSTypeReference", - "start":212,"end":213,"loc":{"start":{"line":9,"column":24,"index":212},"end":{"line":9,"column":25,"index":213}}, + "start":306,"end":307,"loc":{"start":{"line":12,"column":24,"index":306},"end":{"line":12,"column":25,"index":307}}, "typeName": { "type": "Identifier", - "start":212,"end":213,"loc":{"start":{"line":9,"column":24,"index":212},"end":{"line":9,"column":25,"index":213},"identifierName":"U"}, + "start":306,"end":307,"loc":{"start":{"line":12,"column":24,"index":306},"end":{"line":12,"column":25,"index":307},"identifierName":"U"}, "name": "U" } } @@ -300,38 +432,38 @@ "superClass": null, "body": { "type": "ClassBody", - "start":215,"end":217,"loc":{"start":{"line":9,"column":27,"index":215},"end":{"line":9,"column":29,"index":217}}, + "start":309,"end":311,"loc":{"start":{"line":12,"column":27,"index":309},"end":{"line":12,"column":29,"index":311}}, "body": [] } }, { "type": "ClassDeclaration", - "start":218,"end":240,"loc":{"start":{"line":10,"column":0,"index":218},"end":{"line":10,"column":22,"index":240}}, + "start":312,"end":334,"loc":{"start":{"line":13,"column":0,"index":312},"end":{"line":13,"column":22,"index":334}}, "id": { "type": "Identifier", - "start":224,"end":225,"loc":{"start":{"line":10,"column":6,"index":224},"end":{"line":10,"column":7,"index":225},"identifierName":"C"}, + "start":318,"end":319,"loc":{"start":{"line":13,"column":6,"index":318},"end":{"line":13,"column":7,"index":319},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":225,"end":237,"loc":{"start":{"line":10,"column":7,"index":225},"end":{"line":10,"column":19,"index":237}}, + "start":319,"end":331,"loc":{"start":{"line":13,"column":7,"index":319},"end":{"line":13,"column":19,"index":331}}, "params": [ { "type": "TSTypeParameter", - "start":226,"end":227,"loc":{"start":{"line":10,"column":8,"index":226},"end":{"line":10,"column":9,"index":227}}, + "start":320,"end":321,"loc":{"start":{"line":13,"column":8,"index":320},"end":{"line":13,"column":9,"index":321}}, "name": { "type": "Identifier", - "start":226,"end":227,"loc":{"start":{"line":10,"column":8,"index":226},"end":{"line":10,"column":9,"index":227},"identifierName":"T"}, + "start":320,"end":321,"loc":{"start":{"line":13,"column":8,"index":320},"end":{"line":13,"column":9,"index":321},"identifierName":"T"}, "name": "T" } }, { "type": "TSTypeParameter", - "start":229,"end":236,"loc":{"start":{"line":10,"column":11,"index":229},"end":{"line":10,"column":18,"index":236}}, + "start":323,"end":330,"loc":{"start":{"line":13,"column":11,"index":323},"end":{"line":13,"column":18,"index":330}}, "const": true, "name": { "type": "Identifier", - "start":235,"end":236,"loc":{"start":{"line":10,"column":17,"index":235},"end":{"line":10,"column":18,"index":236},"identifierName":"U"}, + "start":329,"end":330,"loc":{"start":{"line":13,"column":17,"index":329},"end":{"line":13,"column":18,"index":330},"identifierName":"U"}, "name": "U" } } @@ -340,30 +472,30 @@ "superClass": null, "body": { "type": "ClassBody", - "start":238,"end":240,"loc":{"start":{"line":10,"column":20,"index":238},"end":{"line":10,"column":22,"index":240}}, + "start":332,"end":334,"loc":{"start":{"line":13,"column":20,"index":332},"end":{"line":13,"column":22,"index":334}}, "body": [] } }, { "type": "ClassDeclaration", - "start":241,"end":263,"loc":{"start":{"line":11,"column":0,"index":241},"end":{"line":11,"column":22,"index":263}}, + "start":335,"end":357,"loc":{"start":{"line":14,"column":0,"index":335},"end":{"line":14,"column":22,"index":357}}, "id": { "type": "Identifier", - "start":247,"end":248,"loc":{"start":{"line":11,"column":6,"index":247},"end":{"line":11,"column":7,"index":248},"identifierName":"D"}, + "start":341,"end":342,"loc":{"start":{"line":14,"column":6,"index":341},"end":{"line":14,"column":7,"index":342},"identifierName":"D"}, "name": "D" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":248,"end":260,"loc":{"start":{"line":11,"column":7,"index":248},"end":{"line":11,"column":19,"index":260}}, + "start":342,"end":354,"loc":{"start":{"line":14,"column":7,"index":342},"end":{"line":14,"column":19,"index":354}}, "params": [ { "type": "TSTypeParameter", - "start":249,"end":259,"loc":{"start":{"line":11,"column":8,"index":249},"end":{"line":11,"column":18,"index":259}}, + "start":343,"end":353,"loc":{"start":{"line":14,"column":8,"index":343},"end":{"line":14,"column":18,"index":353}}, "in": true, "const": true, "name": { "type": "Identifier", - "start":258,"end":259,"loc":{"start":{"line":11,"column":17,"index":258},"end":{"line":11,"column":18,"index":259},"identifierName":"T"}, + "start":352,"end":353,"loc":{"start":{"line":14,"column":17,"index":352},"end":{"line":14,"column":18,"index":353},"identifierName":"T"}, "name": "T" } } @@ -372,30 +504,30 @@ "superClass": null, "body": { "type": "ClassBody", - "start":261,"end":263,"loc":{"start":{"line":11,"column":20,"index":261},"end":{"line":11,"column":22,"index":263}}, + "start":355,"end":357,"loc":{"start":{"line":14,"column":20,"index":355},"end":{"line":14,"column":22,"index":357}}, "body": [] } }, { "type": "ClassDeclaration", - "start":264,"end":286,"loc":{"start":{"line":12,"column":0,"index":264},"end":{"line":12,"column":22,"index":286}}, + "start":358,"end":380,"loc":{"start":{"line":15,"column":0,"index":358},"end":{"line":15,"column":22,"index":380}}, "id": { "type": "Identifier", - "start":270,"end":271,"loc":{"start":{"line":12,"column":6,"index":270},"end":{"line":12,"column":7,"index":271},"identifierName":"E"}, + "start":364,"end":365,"loc":{"start":{"line":15,"column":6,"index":364},"end":{"line":15,"column":7,"index":365},"identifierName":"E"}, "name": "E" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":271,"end":283,"loc":{"start":{"line":12,"column":7,"index":271},"end":{"line":12,"column":19,"index":283}}, + "start":365,"end":377,"loc":{"start":{"line":15,"column":7,"index":365},"end":{"line":15,"column":19,"index":377}}, "params": [ { "type": "TSTypeParameter", - "start":272,"end":282,"loc":{"start":{"line":12,"column":8,"index":272},"end":{"line":12,"column":18,"index":282}}, + "start":366,"end":376,"loc":{"start":{"line":15,"column":8,"index":366},"end":{"line":15,"column":18,"index":376}}, "const": true, "in": true, "name": { "type": "Identifier", - "start":281,"end":282,"loc":{"start":{"line":12,"column":17,"index":281},"end":{"line":12,"column":18,"index":282},"identifierName":"T"}, + "start":375,"end":376,"loc":{"start":{"line":15,"column":17,"index":375},"end":{"line":15,"column":18,"index":376},"identifierName":"T"}, "name": "T" } } @@ -404,29 +536,224 @@ "superClass": null, "body": { "type": "ClassBody", - "start":284,"end":286,"loc":{"start":{"line":12,"column":20,"index":284},"end":{"line":12,"column":22,"index":286}}, + "start":378,"end":380,"loc":{"start":{"line":15,"column":20,"index":378},"end":{"line":15,"column":22,"index":380}}, "body": [] } }, + { + "type": "ExpressionStatement", + "start":381,"end":402,"loc":{"start":{"line":16,"column":0,"index":381},"end":{"line":16,"column":21,"index":402}}, + "expression": { + "type": "ClassExpression", + "start":382,"end":400,"loc":{"start":{"line":16,"column":1,"index":382},"end":{"line":16,"column":19,"index":400}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":388,"end":397,"loc":{"start":{"line":16,"column":7,"index":388},"end":{"line":16,"column":16,"index":397}}, + "params": [ + { + "type": "TSTypeParameter", + "start":389,"end":396,"loc":{"start":{"line":16,"column":8,"index":389},"end":{"line":16,"column":15,"index":396}}, + "const": true, + "name": { + "type": "Identifier", + "start":395,"end":396,"loc":{"start":{"line":16,"column":14,"index":395},"end":{"line":16,"column":15,"index":396},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":398,"end":400,"loc":{"start":{"line":16,"column":17,"index":398},"end":{"line":16,"column":19,"index":400}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 381 + } + } + }, + { + "type": "ExpressionStatement", + "start":403,"end":434,"loc":{"start":{"line":17,"column":0,"index":403},"end":{"line":17,"column":31,"index":434}}, + "expression": { + "type": "ClassExpression", + "start":404,"end":432,"loc":{"start":{"line":17,"column":1,"index":404},"end":{"line":17,"column":29,"index":432}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":410,"end":429,"loc":{"start":{"line":17,"column":7,"index":410},"end":{"line":17,"column":26,"index":429}}, + "params": [ + { + "type": "TSTypeParameter", + "start":411,"end":428,"loc":{"start":{"line":17,"column":8,"index":411},"end":{"line":17,"column":25,"index":428}}, + "const": true, + "name": { + "type": "Identifier", + "start":417,"end":418,"loc":{"start":{"line":17,"column":14,"index":417},"end":{"line":17,"column":15,"index":418},"identifierName":"T"}, + "name": "T" + }, + "constraint": { + "type": "TSTypeReference", + "start":427,"end":428,"loc":{"start":{"line":17,"column":24,"index":427},"end":{"line":17,"column":25,"index":428}}, + "typeName": { + "type": "Identifier", + "start":427,"end":428,"loc":{"start":{"line":17,"column":24,"index":427},"end":{"line":17,"column":25,"index":428},"identifierName":"U"}, + "name": "U" + } + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":430,"end":432,"loc":{"start":{"line":17,"column":27,"index":430},"end":{"line":17,"column":29,"index":432}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 403 + } + } + }, + { + "type": "ExpressionStatement", + "start":435,"end":459,"loc":{"start":{"line":18,"column":0,"index":435},"end":{"line":18,"column":24,"index":459}}, + "expression": { + "type": "ClassExpression", + "start":436,"end":457,"loc":{"start":{"line":18,"column":1,"index":436},"end":{"line":18,"column":22,"index":457}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":442,"end":454,"loc":{"start":{"line":18,"column":7,"index":442},"end":{"line":18,"column":19,"index":454}}, + "params": [ + { + "type": "TSTypeParameter", + "start":443,"end":444,"loc":{"start":{"line":18,"column":8,"index":443},"end":{"line":18,"column":9,"index":444}}, + "name": { + "type": "Identifier", + "start":443,"end":444,"loc":{"start":{"line":18,"column":8,"index":443},"end":{"line":18,"column":9,"index":444},"identifierName":"T"}, + "name": "T" + } + }, + { + "type": "TSTypeParameter", + "start":446,"end":453,"loc":{"start":{"line":18,"column":11,"index":446},"end":{"line":18,"column":18,"index":453}}, + "const": true, + "name": { + "type": "Identifier", + "start":452,"end":453,"loc":{"start":{"line":18,"column":17,"index":452},"end":{"line":18,"column":18,"index":453},"identifierName":"U"}, + "name": "U" + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":455,"end":457,"loc":{"start":{"line":18,"column":20,"index":455},"end":{"line":18,"column":22,"index":457}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 435 + } + } + }, + { + "type": "ExpressionStatement", + "start":460,"end":484,"loc":{"start":{"line":19,"column":0,"index":460},"end":{"line":19,"column":24,"index":484}}, + "expression": { + "type": "ClassExpression", + "start":461,"end":482,"loc":{"start":{"line":19,"column":1,"index":461},"end":{"line":19,"column":22,"index":482}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":467,"end":479,"loc":{"start":{"line":19,"column":7,"index":467},"end":{"line":19,"column":19,"index":479}}, + "params": [ + { + "type": "TSTypeParameter", + "start":468,"end":478,"loc":{"start":{"line":19,"column":8,"index":468},"end":{"line":19,"column":18,"index":478}}, + "in": true, + "const": true, + "name": { + "type": "Identifier", + "start":477,"end":478,"loc":{"start":{"line":19,"column":17,"index":477},"end":{"line":19,"column":18,"index":478},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":480,"end":482,"loc":{"start":{"line":19,"column":20,"index":480},"end":{"line":19,"column":22,"index":482}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 460 + } + } + }, + { + "type": "ExpressionStatement", + "start":485,"end":509,"loc":{"start":{"line":20,"column":0,"index":485},"end":{"line":20,"column":24,"index":509}}, + "expression": { + "type": "ClassExpression", + "start":486,"end":507,"loc":{"start":{"line":20,"column":1,"index":486},"end":{"line":20,"column":22,"index":507}}, + "id": null, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":492,"end":504,"loc":{"start":{"line":20,"column":7,"index":492},"end":{"line":20,"column":19,"index":504}}, + "params": [ + { + "type": "TSTypeParameter", + "start":493,"end":503,"loc":{"start":{"line":20,"column":8,"index":493},"end":{"line":20,"column":18,"index":503}}, + "const": true, + "in": true, + "name": { + "type": "Identifier", + "start":502,"end":503,"loc":{"start":{"line":20,"column":17,"index":502},"end":{"line":20,"column":18,"index":503},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":505,"end":507,"loc":{"start":{"line":20,"column":20,"index":505},"end":{"line":20,"column":22,"index":507}}, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 485 + } + } + }, { "type": "TSInterfaceDeclaration", - "start":288,"end":311,"loc":{"start":{"line":14,"column":0,"index":288},"end":{"line":14,"column":23,"index":311}}, + "start":511,"end":534,"loc":{"start":{"line":22,"column":0,"index":511},"end":{"line":22,"column":23,"index":534}}, "id": { "type": "Identifier", - "start":298,"end":299,"loc":{"start":{"line":14,"column":10,"index":298},"end":{"line":14,"column":11,"index":299},"identifierName":"I"}, + "start":521,"end":522,"loc":{"start":{"line":22,"column":10,"index":521},"end":{"line":22,"column":11,"index":522},"identifierName":"I"}, "name": "I" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":299,"end":308,"loc":{"start":{"line":14,"column":11,"index":299},"end":{"line":14,"column":20,"index":308}}, + "start":522,"end":531,"loc":{"start":{"line":22,"column":11,"index":522},"end":{"line":22,"column":20,"index":531}}, "params": [ { "type": "TSTypeParameter", - "start":300,"end":307,"loc":{"start":{"line":14,"column":12,"index":300},"end":{"line":14,"column":19,"index":307}}, + "start":523,"end":530,"loc":{"start":{"line":22,"column":12,"index":523},"end":{"line":22,"column":19,"index":530}}, "const": true, "name": { "type": "Identifier", - "start":306,"end":307,"loc":{"start":{"line":14,"column":18,"index":306},"end":{"line":14,"column":19,"index":307},"identifierName":"T"}, + "start":529,"end":530,"loc":{"start":{"line":22,"column":18,"index":529},"end":{"line":22,"column":19,"index":530},"identifierName":"T"}, "name": "T" } } @@ -434,37 +761,37 @@ }, "body": { "type": "TSInterfaceBody", - "start":309,"end":311,"loc":{"start":{"line":14,"column":21,"index":309},"end":{"line":14,"column":23,"index":311}}, + "start":532,"end":534,"loc":{"start":{"line":22,"column":21,"index":532},"end":{"line":22,"column":23,"index":534}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":312,"end":345,"loc":{"start":{"line":15,"column":0,"index":312},"end":{"line":15,"column":33,"index":345}}, + "start":535,"end":568,"loc":{"start":{"line":23,"column":0,"index":535},"end":{"line":23,"column":33,"index":568}}, "id": { "type": "Identifier", - "start":322,"end":323,"loc":{"start":{"line":15,"column":10,"index":322},"end":{"line":15,"column":11,"index":323},"identifierName":"J"}, + "start":545,"end":546,"loc":{"start":{"line":23,"column":10,"index":545},"end":{"line":23,"column":11,"index":546},"identifierName":"J"}, "name": "J" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":323,"end":342,"loc":{"start":{"line":15,"column":11,"index":323},"end":{"line":15,"column":30,"index":342}}, + "start":546,"end":565,"loc":{"start":{"line":23,"column":11,"index":546},"end":{"line":23,"column":30,"index":565}}, "params": [ { "type": "TSTypeParameter", - "start":324,"end":341,"loc":{"start":{"line":15,"column":12,"index":324},"end":{"line":15,"column":29,"index":341}}, + "start":547,"end":564,"loc":{"start":{"line":23,"column":12,"index":547},"end":{"line":23,"column":29,"index":564}}, "const": true, "name": { "type": "Identifier", - "start":330,"end":331,"loc":{"start":{"line":15,"column":18,"index":330},"end":{"line":15,"column":19,"index":331},"identifierName":"T"}, + "start":553,"end":554,"loc":{"start":{"line":23,"column":18,"index":553},"end":{"line":23,"column":19,"index":554},"identifierName":"T"}, "name": "T" }, "constraint": { "type": "TSTypeReference", - "start":340,"end":341,"loc":{"start":{"line":15,"column":28,"index":340},"end":{"line":15,"column":29,"index":341}}, + "start":563,"end":564,"loc":{"start":{"line":23,"column":28,"index":563},"end":{"line":23,"column":29,"index":564}}, "typeName": { "type": "Identifier", - "start":340,"end":341,"loc":{"start":{"line":15,"column":28,"index":340},"end":{"line":15,"column":29,"index":341},"identifierName":"U"}, + "start":563,"end":564,"loc":{"start":{"line":23,"column":28,"index":563},"end":{"line":23,"column":29,"index":564},"identifierName":"U"}, "name": "U" } } @@ -473,38 +800,38 @@ }, "body": { "type": "TSInterfaceBody", - "start":343,"end":345,"loc":{"start":{"line":15,"column":31,"index":343},"end":{"line":15,"column":33,"index":345}}, + "start":566,"end":568,"loc":{"start":{"line":23,"column":31,"index":566},"end":{"line":23,"column":33,"index":568}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":346,"end":372,"loc":{"start":{"line":16,"column":0,"index":346},"end":{"line":16,"column":26,"index":372}}, + "start":569,"end":595,"loc":{"start":{"line":24,"column":0,"index":569},"end":{"line":24,"column":26,"index":595}}, "id": { "type": "Identifier", - "start":356,"end":357,"loc":{"start":{"line":16,"column":10,"index":356},"end":{"line":16,"column":11,"index":357},"identifierName":"K"}, + "start":579,"end":580,"loc":{"start":{"line":24,"column":10,"index":579},"end":{"line":24,"column":11,"index":580},"identifierName":"K"}, "name": "K" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":357,"end":369,"loc":{"start":{"line":16,"column":11,"index":357},"end":{"line":16,"column":23,"index":369}}, + "start":580,"end":592,"loc":{"start":{"line":24,"column":11,"index":580},"end":{"line":24,"column":23,"index":592}}, "params": [ { "type": "TSTypeParameter", - "start":358,"end":359,"loc":{"start":{"line":16,"column":12,"index":358},"end":{"line":16,"column":13,"index":359}}, + "start":581,"end":582,"loc":{"start":{"line":24,"column":12,"index":581},"end":{"line":24,"column":13,"index":582}}, "name": { "type": "Identifier", - "start":358,"end":359,"loc":{"start":{"line":16,"column":12,"index":358},"end":{"line":16,"column":13,"index":359},"identifierName":"T"}, + "start":581,"end":582,"loc":{"start":{"line":24,"column":12,"index":581},"end":{"line":24,"column":13,"index":582},"identifierName":"T"}, "name": "T" } }, { "type": "TSTypeParameter", - "start":361,"end":368,"loc":{"start":{"line":16,"column":15,"index":361},"end":{"line":16,"column":22,"index":368}}, + "start":584,"end":591,"loc":{"start":{"line":24,"column":15,"index":584},"end":{"line":24,"column":22,"index":591}}, "const": true, "name": { "type": "Identifier", - "start":367,"end":368,"loc":{"start":{"line":16,"column":21,"index":367},"end":{"line":16,"column":22,"index":368},"identifierName":"U"}, + "start":590,"end":591,"loc":{"start":{"line":24,"column":21,"index":590},"end":{"line":24,"column":22,"index":591},"identifierName":"U"}, "name": "U" } } @@ -512,30 +839,30 @@ }, "body": { "type": "TSInterfaceBody", - "start":370,"end":372,"loc":{"start":{"line":16,"column":24,"index":370},"end":{"line":16,"column":26,"index":372}}, + "start":593,"end":595,"loc":{"start":{"line":24,"column":24,"index":593},"end":{"line":24,"column":26,"index":595}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":373,"end":399,"loc":{"start":{"line":17,"column":0,"index":373},"end":{"line":17,"column":26,"index":399}}, + "start":596,"end":622,"loc":{"start":{"line":25,"column":0,"index":596},"end":{"line":25,"column":26,"index":622}}, "id": { "type": "Identifier", - "start":383,"end":384,"loc":{"start":{"line":17,"column":10,"index":383},"end":{"line":17,"column":11,"index":384},"identifierName":"L"}, + "start":606,"end":607,"loc":{"start":{"line":25,"column":10,"index":606},"end":{"line":25,"column":11,"index":607},"identifierName":"L"}, "name": "L" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":384,"end":396,"loc":{"start":{"line":17,"column":11,"index":384},"end":{"line":17,"column":23,"index":396}}, + "start":607,"end":619,"loc":{"start":{"line":25,"column":11,"index":607},"end":{"line":25,"column":23,"index":619}}, "params": [ { "type": "TSTypeParameter", - "start":385,"end":395,"loc":{"start":{"line":17,"column":12,"index":385},"end":{"line":17,"column":22,"index":395}}, + "start":608,"end":618,"loc":{"start":{"line":25,"column":12,"index":608},"end":{"line":25,"column":22,"index":618}}, "in": true, "const": true, "name": { "type": "Identifier", - "start":394,"end":395,"loc":{"start":{"line":17,"column":21,"index":394},"end":{"line":17,"column":22,"index":395},"identifierName":"T"}, + "start":617,"end":618,"loc":{"start":{"line":25,"column":21,"index":617},"end":{"line":25,"column":22,"index":618},"identifierName":"T"}, "name": "T" } } @@ -543,30 +870,30 @@ }, "body": { "type": "TSInterfaceBody", - "start":397,"end":399,"loc":{"start":{"line":17,"column":24,"index":397},"end":{"line":17,"column":26,"index":399}}, + "start":620,"end":622,"loc":{"start":{"line":25,"column":24,"index":620},"end":{"line":25,"column":26,"index":622}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start":400,"end":426,"loc":{"start":{"line":18,"column":0,"index":400},"end":{"line":18,"column":26,"index":426}}, + "start":623,"end":649,"loc":{"start":{"line":26,"column":0,"index":623},"end":{"line":26,"column":26,"index":649}}, "id": { "type": "Identifier", - "start":410,"end":411,"loc":{"start":{"line":18,"column":10,"index":410},"end":{"line":18,"column":11,"index":411},"identifierName":"M"}, + "start":633,"end":634,"loc":{"start":{"line":26,"column":10,"index":633},"end":{"line":26,"column":11,"index":634},"identifierName":"M"}, "name": "M" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":411,"end":423,"loc":{"start":{"line":18,"column":11,"index":411},"end":{"line":18,"column":23,"index":423}}, + "start":634,"end":646,"loc":{"start":{"line":26,"column":11,"index":634},"end":{"line":26,"column":23,"index":646}}, "params": [ { "type": "TSTypeParameter", - "start":412,"end":422,"loc":{"start":{"line":18,"column":12,"index":412},"end":{"line":18,"column":22,"index":422}}, + "start":635,"end":645,"loc":{"start":{"line":26,"column":12,"index":635},"end":{"line":26,"column":22,"index":645}}, "const": true, "in": true, "name": { "type": "Identifier", - "start":421,"end":422,"loc":{"start":{"line":18,"column":21,"index":421},"end":{"line":18,"column":22,"index":422},"identifierName":"T"}, + "start":644,"end":645,"loc":{"start":{"line":26,"column":21,"index":644},"end":{"line":26,"column":22,"index":645},"identifierName":"T"}, "name": "T" } } @@ -574,45 +901,45 @@ }, "body": { "type": "TSInterfaceBody", - "start":424,"end":426,"loc":{"start":{"line":18,"column":24,"index":424},"end":{"line":18,"column":26,"index":426}}, + "start":647,"end":649,"loc":{"start":{"line":26,"column":24,"index":647},"end":{"line":26,"column":26,"index":649}}, "body": [] } }, { "type": "ClassDeclaration", - "start":428,"end":521,"loc":{"start":{"line":20,"column":0,"index":428},"end":{"line":24,"column":1,"index":521}}, + "start":651,"end":744,"loc":{"start":{"line":28,"column":0,"index":651},"end":{"line":32,"column":1,"index":744}}, "id": { "type": "Identifier", - "start":434,"end":435,"loc":{"start":{"line":20,"column":6,"index":434},"end":{"line":20,"column":7,"index":435},"identifierName":"_"}, + "start":657,"end":658,"loc":{"start":{"line":28,"column":6,"index":657},"end":{"line":28,"column":7,"index":658},"identifierName":"_"}, "name": "_" }, "superClass": null, "body": { "type": "ClassBody", - "start":436,"end":521,"loc":{"start":{"line":20,"column":8,"index":436},"end":{"line":24,"column":1,"index":521}}, + "start":659,"end":744,"loc":{"start":{"line":28,"column":8,"index":659},"end":{"line":32,"column":1,"index":744}}, "body": [ { "type": "ClassMethod", - "start":440,"end":460,"loc":{"start":{"line":21,"column":2,"index":440},"end":{"line":21,"column":22,"index":460}}, + "start":663,"end":683,"loc":{"start":{"line":29,"column":2,"index":663},"end":{"line":29,"column":22,"index":683}}, "static": false, "key": { "type": "Identifier", - "start":440,"end":446,"loc":{"start":{"line":21,"column":2,"index":440},"end":{"line":21,"column":8,"index":446},"identifierName":"method"}, + "start":663,"end":669,"loc":{"start":{"line":29,"column":2,"index":663},"end":{"line":29,"column":8,"index":669},"identifierName":"method"}, "name": "method" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":446,"end":455,"loc":{"start":{"line":21,"column":8,"index":446},"end":{"line":21,"column":17,"index":455}}, + "start":669,"end":678,"loc":{"start":{"line":29,"column":8,"index":669},"end":{"line":29,"column":17,"index":678}}, "params": [ { "type": "TSTypeParameter", - "start":447,"end":454,"loc":{"start":{"line":21,"column":9,"index":447},"end":{"line":21,"column":16,"index":454}}, + "start":670,"end":677,"loc":{"start":{"line":29,"column":9,"index":670},"end":{"line":29,"column":16,"index":677}}, "const": true, "name": { "type": "Identifier", - "start":453,"end":454,"loc":{"start":{"line":21,"column":15,"index":453},"end":{"line":21,"column":16,"index":454},"identifierName":"T"}, + "start":676,"end":677,"loc":{"start":{"line":29,"column":15,"index":676},"end":{"line":29,"column":16,"index":677},"identifierName":"T"}, "name": "T" } } @@ -624,41 +951,41 @@ "params": [], "body": { "type": "BlockStatement", - "start":458,"end":460,"loc":{"start":{"line":21,"column":20,"index":458},"end":{"line":21,"column":22,"index":460}}, + "start":681,"end":683,"loc":{"start":{"line":29,"column":20,"index":681},"end":{"line":29,"column":22,"index":683}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start":463,"end":493,"loc":{"start":{"line":22,"column":2,"index":463},"end":{"line":22,"column":32,"index":493}}, + "start":686,"end":716,"loc":{"start":{"line":30,"column":2,"index":686},"end":{"line":30,"column":32,"index":716}}, "static": false, "key": { "type": "Identifier", - "start":463,"end":469,"loc":{"start":{"line":22,"column":2,"index":463},"end":{"line":22,"column":8,"index":469},"identifierName":"method"}, + "start":686,"end":692,"loc":{"start":{"line":30,"column":2,"index":686},"end":{"line":30,"column":8,"index":692},"identifierName":"method"}, "name": "method" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":469,"end":488,"loc":{"start":{"line":22,"column":8,"index":469},"end":{"line":22,"column":27,"index":488}}, + "start":692,"end":711,"loc":{"start":{"line":30,"column":8,"index":692},"end":{"line":30,"column":27,"index":711}}, "params": [ { "type": "TSTypeParameter", - "start":470,"end":487,"loc":{"start":{"line":22,"column":9,"index":470},"end":{"line":22,"column":26,"index":487}}, + "start":693,"end":710,"loc":{"start":{"line":30,"column":9,"index":693},"end":{"line":30,"column":26,"index":710}}, "const": true, "name": { "type": "Identifier", - "start":476,"end":477,"loc":{"start":{"line":22,"column":15,"index":476},"end":{"line":22,"column":16,"index":477},"identifierName":"T"}, + "start":699,"end":700,"loc":{"start":{"line":30,"column":15,"index":699},"end":{"line":30,"column":16,"index":700},"identifierName":"T"}, "name": "T" }, "constraint": { "type": "TSTypeReference", - "start":486,"end":487,"loc":{"start":{"line":22,"column":25,"index":486},"end":{"line":22,"column":26,"index":487}}, + "start":709,"end":710,"loc":{"start":{"line":30,"column":25,"index":709},"end":{"line":30,"column":26,"index":710}}, "typeName": { "type": "Identifier", - "start":486,"end":487,"loc":{"start":{"line":22,"column":25,"index":486},"end":{"line":22,"column":26,"index":487},"identifierName":"U"}, + "start":709,"end":710,"loc":{"start":{"line":30,"column":25,"index":709},"end":{"line":30,"column":26,"index":710},"identifierName":"U"}, "name": "U" } } @@ -671,42 +998,42 @@ "params": [], "body": { "type": "BlockStatement", - "start":491,"end":493,"loc":{"start":{"line":22,"column":30,"index":491},"end":{"line":22,"column":32,"index":493}}, + "start":714,"end":716,"loc":{"start":{"line":30,"column":30,"index":714},"end":{"line":30,"column":32,"index":716}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start":496,"end":519,"loc":{"start":{"line":23,"column":2,"index":496},"end":{"line":23,"column":25,"index":519}}, + "start":719,"end":742,"loc":{"start":{"line":31,"column":2,"index":719},"end":{"line":31,"column":25,"index":742}}, "static": false, "key": { "type": "Identifier", - "start":496,"end":502,"loc":{"start":{"line":23,"column":2,"index":496},"end":{"line":23,"column":8,"index":502},"identifierName":"method"}, + "start":719,"end":725,"loc":{"start":{"line":31,"column":2,"index":719},"end":{"line":31,"column":8,"index":725},"identifierName":"method"}, "name": "method" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":502,"end":514,"loc":{"start":{"line":23,"column":8,"index":502},"end":{"line":23,"column":20,"index":514}}, + "start":725,"end":737,"loc":{"start":{"line":31,"column":8,"index":725},"end":{"line":31,"column":20,"index":737}}, "params": [ { "type": "TSTypeParameter", - "start":503,"end":504,"loc":{"start":{"line":23,"column":9,"index":503},"end":{"line":23,"column":10,"index":504}}, + "start":726,"end":727,"loc":{"start":{"line":31,"column":9,"index":726},"end":{"line":31,"column":10,"index":727}}, "name": { "type": "Identifier", - "start":503,"end":504,"loc":{"start":{"line":23,"column":9,"index":503},"end":{"line":23,"column":10,"index":504},"identifierName":"T"}, + "start":726,"end":727,"loc":{"start":{"line":31,"column":9,"index":726},"end":{"line":31,"column":10,"index":727},"identifierName":"T"}, "name": "T" } }, { "type": "TSTypeParameter", - "start":506,"end":513,"loc":{"start":{"line":23,"column":12,"index":506},"end":{"line":23,"column":19,"index":513}}, + "start":729,"end":736,"loc":{"start":{"line":31,"column":12,"index":729},"end":{"line":31,"column":19,"index":736}}, "const": true, "name": { "type": "Identifier", - "start":512,"end":513,"loc":{"start":{"line":23,"column":18,"index":512},"end":{"line":23,"column":19,"index":513},"identifierName":"U"}, + "start":735,"end":736,"loc":{"start":{"line":31,"column":18,"index":735},"end":{"line":31,"column":19,"index":736},"identifierName":"U"}, "name": "U" } } @@ -718,7 +1045,7 @@ "params": [], "body": { "type": "BlockStatement", - "start":517,"end":519,"loc":{"start":{"line":23,"column":23,"index":517},"end":{"line":23,"column":25,"index":519}}, + "start":740,"end":742,"loc":{"start":{"line":31,"column":23,"index":740},"end":{"line":31,"column":25,"index":742}}, "body": [], "directives": [] }