@typescript-deploys/pr-build 5.5.0-pr-57403-34 → 5.5.0-pr-57207-16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.5";
21
- var version = `${versionMajorMinor}.0-insiders.20240305`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240307`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -3340,12 +3340,13 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3340
3340
  SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 348] = "JSDocPropertyTag";
3341
3341
  SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 349] = "JSDocThrowsTag";
3342
3342
  SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 350] = "JSDocSatisfiesTag";
3343
- SyntaxKind4[SyntaxKind4["SyntaxList"] = 351] = "SyntaxList";
3344
- SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 352] = "NotEmittedStatement";
3345
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 353] = "PartiallyEmittedExpression";
3346
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 354] = "CommaListExpression";
3347
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 355] = "SyntheticReferenceExpression";
3348
- SyntaxKind4[SyntaxKind4["Count"] = 356] = "Count";
3343
+ SyntaxKind4[SyntaxKind4["JSDocImportTag"] = 351] = "JSDocImportTag";
3344
+ SyntaxKind4[SyntaxKind4["SyntaxList"] = 352] = "SyntaxList";
3345
+ SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 353] = "NotEmittedStatement";
3346
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 354] = "PartiallyEmittedExpression";
3347
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 355] = "CommaListExpression";
3348
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 356] = "SyntheticReferenceExpression";
3349
+ SyntaxKind4[SyntaxKind4["Count"] = 357] = "Count";
3349
3350
  SyntaxKind4[SyntaxKind4["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
3350
3351
  SyntaxKind4[SyntaxKind4["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
3351
3352
  SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -3374,9 +3375,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3374
3375
  SyntaxKind4[SyntaxKind4["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement";
3375
3376
  SyntaxKind4[SyntaxKind4["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
3376
3377
  SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 309 /* JSDocTypeExpression */] = "FirstJSDocNode";
3377
- SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 350 /* JSDocSatisfiesTag */] = "LastJSDocNode";
3378
+ SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 351 /* JSDocImportTag */] = "LastJSDocNode";
3378
3379
  SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 327 /* JSDocTag */] = "FirstJSDocTagNode";
3379
- SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 350 /* JSDocSatisfiesTag */] = "LastJSDocTagNode";
3380
+ SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 351 /* JSDocImportTag */] = "LastJSDocTagNode";
3380
3381
  SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword";
3381
3382
  SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
3382
3383
  return SyntaxKind4;
@@ -3692,7 +3693,6 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
3692
3693
  ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
3693
3694
  ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
3694
3695
  ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
3695
- ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType";
3696
3696
  ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
3697
3697
  ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
3698
3698
  ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
@@ -7555,6 +7555,7 @@ var Diagnostics = {
7555
7555
  Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
7556
7556
  Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
7557
7557
  Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
7558
+ Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
7558
7559
  Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
7559
7560
  Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
7560
7561
  Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -8436,7 +8437,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8436
8437
  var tokenValue;
8437
8438
  var tokenFlags;
8438
8439
  var commentDirectives;
8439
- var inJSDocType = 0;
8440
+ var skipJsDocLeadingAsterisks = 0;
8440
8441
  var scriptKind = 0 /* Unknown */;
8441
8442
  var jsDocParsingMode = 0 /* ParseAll */;
8442
8443
  setText(text, start, length2);
@@ -8487,7 +8488,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8487
8488
  setOnError,
8488
8489
  resetTokenState,
8489
8490
  setTextPos: resetTokenState,
8490
- setInJSDocType,
8491
+ setSkipJsDocLeadingAsterisks,
8491
8492
  tryScan,
8492
8493
  lookAhead,
8493
8494
  scanRange
@@ -9203,7 +9204,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9203
9204
  return pos += 2, token = 43 /* AsteriskAsteriskToken */;
9204
9205
  }
9205
9206
  pos++;
9206
- if (inJSDocType && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
9207
+ if (skipJsDocLeadingAsterisks && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
9207
9208
  asteriskSeen = true;
9208
9209
  continue;
9209
9210
  }
@@ -9981,8 +9982,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9981
9982
  tokenValue = void 0;
9982
9983
  tokenFlags = 0 /* None */;
9983
9984
  }
9984
- function setInJSDocType(inType) {
9985
- inJSDocType += inType ? 1 : -1;
9985
+ function setSkipJsDocLeadingAsterisks(skip) {
9986
+ skipJsDocLeadingAsterisks += skip ? 1 : -1;
9986
9987
  }
9987
9988
  }
9988
9989
  function codePointAt(s, i) {
@@ -11035,8 +11036,8 @@ function isExpressionKind(kind) {
11035
11036
  case 230 /* SpreadElement */:
11036
11037
  case 234 /* AsExpression */:
11037
11038
  case 232 /* OmittedExpression */:
11038
- case 354 /* CommaListExpression */:
11039
- case 353 /* PartiallyEmittedExpression */:
11039
+ case 355 /* CommaListExpression */:
11040
+ case 354 /* PartiallyEmittedExpression */:
11040
11041
  case 238 /* SatisfiesExpression */:
11041
11042
  return true;
11042
11043
  default:
@@ -11207,7 +11208,7 @@ function isDeclarationStatementKind(kind) {
11207
11208
  return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */;
11208
11209
  }
11209
11210
  function isStatementKindButNotDeclarationKind(kind) {
11210
- return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 352 /* NotEmittedStatement */;
11211
+ return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 353 /* NotEmittedStatement */;
11211
11212
  }
11212
11213
  function isDeclaration(node) {
11213
11214
  if (node.kind === 168 /* TypeParameter */) {
@@ -11268,10 +11269,10 @@ function isCaseOrDefaultClause(node) {
11268
11269
  return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */;
11269
11270
  }
11270
11271
  function isJSDocNode(node) {
11271
- return node.kind >= 309 /* FirstJSDocNode */ && node.kind <= 350 /* LastJSDocNode */;
11272
+ return node.kind >= 309 /* FirstJSDocNode */ && node.kind <= 351 /* LastJSDocNode */;
11272
11273
  }
11273
11274
  function isJSDocTag(node) {
11274
- return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <= 350 /* LastJSDocTagNode */;
11275
+ return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <= 351 /* LastJSDocTagNode */;
11275
11276
  }
11276
11277
  function isSetAccessor(node) {
11277
11278
  return node.kind === 178 /* SetAccessor */;
@@ -11712,7 +11713,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
11712
11713
  if (includeJsDoc && hasJSDocNodes(node)) {
11713
11714
  return getTokenPosOfNode(node.jsDoc[0], sourceFile);
11714
11715
  }
11715
- if (node.kind === 351 /* SyntaxList */ && node._children.length > 0) {
11716
+ if (node.kind === 352 /* SyntaxList */ && node._children.length > 0) {
11716
11717
  return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
11717
11718
  }
11718
11719
  return skipTrivia(
@@ -13663,6 +13664,7 @@ function tryGetModuleSpecifierFromDeclaration(node) {
13663
13664
  ))) == null ? void 0 : _a.arguments[0];
13664
13665
  case 272 /* ImportDeclaration */:
13665
13666
  case 278 /* ExportDeclaration */:
13667
+ case 351 /* JSDocImportTag */:
13666
13668
  return tryCast(node.moduleSpecifier, isStringLiteralLike);
13667
13669
  case 271 /* ImportEqualsDeclaration */:
13668
13670
  return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
@@ -13684,6 +13686,7 @@ function getExternalModuleName(node) {
13684
13686
  switch (node.kind) {
13685
13687
  case 272 /* ImportDeclaration */:
13686
13688
  case 278 /* ExportDeclaration */:
13689
+ case 351 /* JSDocImportTag */:
13687
13690
  return node.moduleSpecifier;
13688
13691
  case 271 /* ImportEqualsDeclaration */:
13689
13692
  return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
@@ -13710,7 +13713,7 @@ function getNamespaceDeclarationNode(node) {
13710
13713
  }
13711
13714
  }
13712
13715
  function isDefaultImport(node) {
13713
- return node.kind === 272 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
13716
+ return (node.kind === 272 /* ImportDeclaration */ || node.kind === 351 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name;
13714
13717
  }
13715
13718
  function hasQuestionToken(node) {
13716
13719
  if (node) {
@@ -14483,7 +14486,7 @@ function getOperator(expression) {
14483
14486
  }
14484
14487
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
14485
14488
  switch (nodeKind) {
14486
- case 354 /* CommaListExpression */:
14489
+ case 355 /* CommaListExpression */:
14487
14490
  return 0 /* Comma */;
14488
14491
  case 230 /* SpreadElement */:
14489
14492
  return 1 /* Spread */;
@@ -16032,7 +16035,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
16032
16035
  case 212 /* ElementAccessExpression */:
16033
16036
  case 211 /* PropertyAccessExpression */:
16034
16037
  case 235 /* NonNullExpression */:
16035
- case 353 /* PartiallyEmittedExpression */:
16038
+ case 354 /* PartiallyEmittedExpression */:
16036
16039
  case 238 /* SatisfiesExpression */:
16037
16040
  node = node.expression;
16038
16041
  continue;
@@ -17419,7 +17422,7 @@ function getContainingNodeArray(node) {
17419
17422
  return parent.types;
17420
17423
  case 189 /* TupleType */:
17421
17424
  case 209 /* ArrayLiteralExpression */:
17422
- case 354 /* CommaListExpression */:
17425
+ case 355 /* CommaListExpression */:
17423
17426
  case 275 /* NamedImports */:
17424
17427
  case 279 /* NamedExports */:
17425
17428
  return parent.elements;
@@ -18604,6 +18607,8 @@ function createNodeFactory(flags, baseFactory2) {
18604
18607
  updateJSDocImplementsTag,
18605
18608
  createJSDocSeeTag,
18606
18609
  updateJSDocSeeTag,
18610
+ createJSDocImportTag,
18611
+ updateJSDocImportTag,
18607
18612
  createJSDocNameReference,
18608
18613
  updateJSDocNameReference,
18609
18614
  createJSDocMemberName,
@@ -21376,6 +21381,17 @@ function createNodeFactory(flags, baseFactory2) {
21376
21381
  function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
21377
21382
  return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
21378
21383
  }
21384
+ function createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) {
21385
+ const node = createBaseJSDocTag(351 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment);
21386
+ node.importClause = importClause;
21387
+ node.moduleSpecifier = moduleSpecifier;
21388
+ node.attributes = attributes;
21389
+ node.comment = comment;
21390
+ return node;
21391
+ }
21392
+ function updateJSDocImportTag(node, tagName, importClause, moduleSpecifier, attributes, comment) {
21393
+ return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment), node) : node;
21394
+ }
21379
21395
  function createJSDocText(text) {
21380
21396
  const node = createBaseNode(321 /* JSDocText */);
21381
21397
  node.text = text;
@@ -21773,18 +21789,18 @@ function createNodeFactory(flags, baseFactory2) {
21773
21789
  return node;
21774
21790
  }
21775
21791
  function createSyntaxList(children) {
21776
- const node = createBaseNode(351 /* SyntaxList */);
21792
+ const node = createBaseNode(352 /* SyntaxList */);
21777
21793
  node._children = children;
21778
21794
  return node;
21779
21795
  }
21780
21796
  function createNotEmittedStatement(original) {
21781
- const node = createBaseNode(352 /* NotEmittedStatement */);
21797
+ const node = createBaseNode(353 /* NotEmittedStatement */);
21782
21798
  node.original = original;
21783
21799
  setTextRange(node, original);
21784
21800
  return node;
21785
21801
  }
21786
21802
  function createPartiallyEmittedExpression(expression, original) {
21787
- const node = createBaseNode(353 /* PartiallyEmittedExpression */);
21803
+ const node = createBaseNode(354 /* PartiallyEmittedExpression */);
21788
21804
  node.expression = expression;
21789
21805
  node.original = original;
21790
21806
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -21806,7 +21822,7 @@ function createNodeFactory(flags, baseFactory2) {
21806
21822
  return node;
21807
21823
  }
21808
21824
  function createCommaListExpression(elements) {
21809
- const node = createBaseNode(354 /* CommaListExpression */);
21825
+ const node = createBaseNode(355 /* CommaListExpression */);
21810
21826
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
21811
21827
  node.transformFlags |= propagateChildrenFlags(node.elements);
21812
21828
  return node;
@@ -21815,7 +21831,7 @@ function createNodeFactory(flags, baseFactory2) {
21815
21831
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
21816
21832
  }
21817
21833
  function createSyntheticReferenceExpression(expression, thisArg) {
21818
- const node = createBaseNode(355 /* SyntheticReferenceExpression */);
21834
+ const node = createBaseNode(356 /* SyntheticReferenceExpression */);
21819
21835
  node.expression = expression;
21820
21836
  node.thisArg = thisArg;
21821
21837
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -22061,7 +22077,7 @@ function createNodeFactory(flags, baseFactory2) {
22061
22077
  return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
22062
22078
  case 235 /* NonNullExpression */:
22063
22079
  return updateNonNullExpression(outerExpression, expression);
22064
- case 353 /* PartiallyEmittedExpression */:
22080
+ case 354 /* PartiallyEmittedExpression */:
22065
22081
  return updatePartiallyEmittedExpression(outerExpression, expression);
22066
22082
  }
22067
22083
  }
@@ -22471,6 +22487,8 @@ function getDefaultTagNameForKind(kind) {
22471
22487
  return "augments";
22472
22488
  case 329 /* JSDocImplementsTag */:
22473
22489
  return "implements";
22490
+ case 351 /* JSDocImportTag */:
22491
+ return "import";
22474
22492
  default:
22475
22493
  return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
22476
22494
  }
@@ -22611,7 +22629,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
22611
22629
  case 216 /* TypeAssertionExpression */:
22612
22630
  case 238 /* SatisfiesExpression */:
22613
22631
  case 234 /* AsExpression */:
22614
- case 353 /* PartiallyEmittedExpression */:
22632
+ case 354 /* PartiallyEmittedExpression */:
22615
22633
  case 217 /* ParenthesizedExpression */:
22616
22634
  case 108 /* SuperKeyword */:
22617
22635
  return -2147483648 /* OuterExpressionExcludes */;
@@ -24249,10 +24267,10 @@ function isMetaProperty(node) {
24249
24267
  return node.kind === 236 /* MetaProperty */;
24250
24268
  }
24251
24269
  function isPartiallyEmittedExpression(node) {
24252
- return node.kind === 353 /* PartiallyEmittedExpression */;
24270
+ return node.kind === 354 /* PartiallyEmittedExpression */;
24253
24271
  }
24254
24272
  function isCommaListExpression(node) {
24255
- return node.kind === 354 /* CommaListExpression */;
24273
+ return node.kind === 355 /* CommaListExpression */;
24256
24274
  }
24257
24275
  function isTemplateSpan(node) {
24258
24276
  return node.kind === 239 /* TemplateSpan */;
@@ -24375,10 +24393,10 @@ function isExportSpecifier(node) {
24375
24393
  return node.kind === 281 /* ExportSpecifier */;
24376
24394
  }
24377
24395
  function isNotEmittedStatement(node) {
24378
- return node.kind === 352 /* NotEmittedStatement */;
24396
+ return node.kind === 353 /* NotEmittedStatement */;
24379
24397
  }
24380
24398
  function isSyntheticReference(node) {
24381
- return node.kind === 355 /* SyntheticReferenceExpression */;
24399
+ return node.kind === 356 /* SyntheticReferenceExpression */;
24382
24400
  }
24383
24401
  function isExternalModuleReference(node) {
24384
24402
  return node.kind === 283 /* ExternalModuleReference */;
@@ -24545,6 +24563,9 @@ function isJSDocImplementsTag(node) {
24545
24563
  function isJSDocSatisfiesTag(node) {
24546
24564
  return node.kind === 350 /* JSDocSatisfiesTag */;
24547
24565
  }
24566
+ function isJSDocImportTag(node) {
24567
+ return node.kind === 351 /* JSDocImportTag */;
24568
+ }
24548
24569
 
24549
24570
  // src/compiler/factory/utilities.ts
24550
24571
  function createEmptyExports(factory2) {
@@ -24927,7 +24948,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
24927
24948
  return (kinds & 2 /* TypeAssertions */) !== 0;
24928
24949
  case 235 /* NonNullExpression */:
24929
24950
  return (kinds & 4 /* NonNullAssertions */) !== 0;
24930
- case 353 /* PartiallyEmittedExpression */:
24951
+ case 354 /* PartiallyEmittedExpression */:
24931
24952
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
24932
24953
  }
24933
24954
  return false;
@@ -26003,7 +26024,7 @@ var forEachChildTable = {
26003
26024
  [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
26004
26025
  return visitNodes(cbNode, cbNodes, node.modifiers);
26005
26026
  },
26006
- [354 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
26027
+ [355 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
26007
26028
  return visitNodes(cbNode, cbNodes, node.elements);
26008
26029
  },
26009
26030
  [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -26098,7 +26119,8 @@ var forEachChildTable = {
26098
26119
  [336 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
26099
26120
  [331 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
26100
26121
  [337 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
26101
- [353 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
26122
+ [351 /* JSDocImportTag */]: forEachChildInJSDocImportTag,
26123
+ [354 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
26102
26124
  };
26103
26125
  function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
26104
26126
  return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -26149,6 +26171,9 @@ function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
26149
26171
  function forEachChildInJSDocTag(node, cbNode, cbNodes) {
26150
26172
  return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
26151
26173
  }
26174
+ function forEachChildInJSDocImportTag(node, cbNode, cbNodes) {
26175
+ return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
26176
+ }
26152
26177
  function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
26153
26178
  return visitNode2(cbNode, node.expression);
26154
26179
  }
@@ -28141,7 +28166,7 @@ var Parser;
28141
28166
  );
28142
28167
  }
28143
28168
  function parseJSDocType() {
28144
- scanner.setInJSDocType(true);
28169
+ scanner.setSkipJsDocLeadingAsterisks(true);
28145
28170
  const pos = getNodePos();
28146
28171
  if (parseOptional(144 /* ModuleKeyword */)) {
28147
28172
  const moduleTag = factory2.createJSDocNamepathType(
@@ -28160,12 +28185,12 @@ var Parser;
28160
28185
  nextTokenJSDoc();
28161
28186
  }
28162
28187
  }
28163
- scanner.setInJSDocType(false);
28188
+ scanner.setSkipJsDocLeadingAsterisks(false);
28164
28189
  return finishNode(moduleTag, pos);
28165
28190
  }
28166
28191
  const hasDotDotDot = parseOptional(26 /* DotDotDotToken */);
28167
28192
  let type = parseTypeOrTypePredicate();
28168
- scanner.setInJSDocType(false);
28193
+ scanner.setSkipJsDocLeadingAsterisks(false);
28169
28194
  if (hasDotDotDot) {
28170
28195
  type = finishNode(factory2.createJSDocVariadicType(type), pos);
28171
28196
  }
@@ -31728,22 +31753,28 @@ var Parser;
31728
31753
  if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) {
31729
31754
  return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly);
31730
31755
  }
31756
+ const importClause = tryParseImportClause(identifier, afterImportPos, isTypeOnly);
31757
+ const moduleSpecifier = parseModuleSpecifier();
31758
+ const attributes = tryParseImportAttributes();
31759
+ parseSemicolon();
31760
+ const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
31761
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
31762
+ }
31763
+ function tryParseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks = false) {
31731
31764
  let importClause;
31732
31765
  if (identifier || // import id
31733
31766
  token() === 42 /* AsteriskToken */ || // import *
31734
31767
  token() === 19 /* OpenBraceToken */) {
31735
- importClause = parseImportClause(identifier, afterImportPos, isTypeOnly);
31768
+ importClause = parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks);
31736
31769
  parseExpected(161 /* FromKeyword */);
31737
31770
  }
31738
- const moduleSpecifier = parseModuleSpecifier();
31771
+ return importClause;
31772
+ }
31773
+ function tryParseImportAttributes() {
31739
31774
  const currentToken2 = token();
31740
- let attributes;
31741
31775
  if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
31742
- attributes = parseImportAttributes(currentToken2);
31776
+ return parseImportAttributes(currentToken2);
31743
31777
  }
31744
- parseSemicolon();
31745
- const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
31746
- return withJSDoc(finishNode(node, pos), hasJSDoc);
31747
31778
  }
31748
31779
  function parseImportAttribute() {
31749
31780
  const pos = getNodePos();
@@ -31810,10 +31841,14 @@ var Parser;
31810
31841
  const finished = withJSDoc(finishNode(node, pos), hasJSDoc);
31811
31842
  return finished;
31812
31843
  }
31813
- function parseImportClause(identifier, pos, isTypeOnly) {
31844
+ function parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks) {
31814
31845
  let namedBindings;
31815
31846
  if (!identifier || parseOptional(28 /* CommaToken */)) {
31847
+ if (skipJsDocLeadingAsterisks)
31848
+ scanner.setSkipJsDocLeadingAsterisks(true);
31816
31849
  namedBindings = token() === 42 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(275 /* NamedImports */);
31850
+ if (skipJsDocLeadingAsterisks)
31851
+ scanner.setSkipJsDocLeadingAsterisks(false);
31817
31852
  }
31818
31853
  return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
31819
31854
  }
@@ -32384,6 +32419,9 @@ var Parser;
32384
32419
  case "throws":
32385
32420
  tag = parseThrowsTag(start2, tagName, margin, indentText);
32386
32421
  break;
32422
+ case "import":
32423
+ tag = parseImportTag(start2, tagName, margin, indentText);
32424
+ break;
32387
32425
  default:
32388
32426
  tag = parseUnknownTag(start2, tagName, margin, indentText);
32389
32427
  break;
@@ -32703,13 +32741,32 @@ var Parser;
32703
32741
  const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
32704
32742
  return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
32705
32743
  }
32744
+ function parseImportTag(start2, tagName, margin, indentText) {
32745
+ const afterImportTagPos = scanner.getTokenFullStart();
32746
+ let identifier;
32747
+ if (isIdentifier2()) {
32748
+ identifier = parseIdentifier();
32749
+ }
32750
+ const importClause = tryParseImportClause(
32751
+ identifier,
32752
+ afterImportTagPos,
32753
+ /*isTypeOnly*/
32754
+ true,
32755
+ /*skipJsDocLeadingAsterisks*/
32756
+ true
32757
+ );
32758
+ const moduleSpecifier = parseModuleSpecifier();
32759
+ const attributes = tryParseImportAttributes();
32760
+ const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
32761
+ return finishNode(factory2.createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comments2), start2);
32762
+ }
32706
32763
  function parseExpressionWithTypeArgumentsForAugments() {
32707
32764
  const usedBrace = parseOptional(19 /* OpenBraceToken */);
32708
32765
  const pos = getNodePos();
32709
32766
  const expression = parsePropertyAccessEntityNameExpression();
32710
- scanner.setInJSDocType(true);
32767
+ scanner.setSkipJsDocLeadingAsterisks(true);
32711
32768
  const typeArguments = tryParseTypeArguments();
32712
- scanner.setInJSDocType(false);
32769
+ scanner.setSkipJsDocLeadingAsterisks(false);
32713
32770
  const node = factory2.createExpressionWithTypeArguments(expression, typeArguments);
32714
32771
  const res = finishNode(node, pos);
32715
32772
  if (usedBrace) {
@@ -39385,6 +39442,7 @@ function createBinder() {
39385
39442
  var lastContainer;
39386
39443
  var delayedTypeAliases;
39387
39444
  var seenThisKeyword;
39445
+ var jsDocImports;
39388
39446
  var currentFlow;
39389
39447
  var currentBreakTarget;
39390
39448
  var currentContinueTarget;
@@ -39432,6 +39490,7 @@ function createBinder() {
39432
39490
  file.symbolCount = symbolCount;
39433
39491
  file.classifiableNames = classifiableNames;
39434
39492
  delayedBindJSDocTypedefTag();
39493
+ bindJSDocImports();
39435
39494
  }
39436
39495
  file = void 0;
39437
39496
  options = void 0;
@@ -39442,6 +39501,7 @@ function createBinder() {
39442
39501
  blockScopeContainer = void 0;
39443
39502
  lastContainer = void 0;
39444
39503
  delayedTypeAliases = void 0;
39504
+ jsDocImports = void 0;
39445
39505
  seenThisKeyword = false;
39446
39506
  currentFlow = void 0;
39447
39507
  currentBreakTarget = void 0;
@@ -39876,6 +39936,9 @@ function createBinder() {
39876
39936
  case 340 /* JSDocEnumTag */:
39877
39937
  bindJSDocTypeAlias(node);
39878
39938
  break;
39939
+ case 351 /* JSDocImportTag */:
39940
+ bindJSDocImportTag(node);
39941
+ break;
39879
39942
  case 307 /* SourceFile */: {
39880
39943
  bindEachFunctionsFirst(node.statements);
39881
39944
  bind(node.endOfFileToken);
@@ -40608,6 +40671,12 @@ function createBinder() {
40608
40671
  addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
40609
40672
  }
40610
40673
  }
40674
+ function bindJSDocImportTag(node) {
40675
+ bind(node.tagName);
40676
+ if (typeof node.comment !== "string") {
40677
+ bindEach(node.comment);
40678
+ }
40679
+ }
40611
40680
  function bindOptionalExpression(node, trueTarget, falseTarget) {
40612
40681
  doWithConditionalBranches(bind, node, trueTarget, falseTarget);
40613
40682
  if (!isOptionalChain(node) || isOutermostOptionalChain(node)) {
@@ -40924,6 +40993,31 @@ function createBinder() {
40924
40993
  parent = saveParent;
40925
40994
  currentFlow = saveCurrentFlow;
40926
40995
  }
40996
+ function bindJSDocImports() {
40997
+ if (jsDocImports === void 0) {
40998
+ return;
40999
+ }
41000
+ const saveContainer = container;
41001
+ const saveLastContainer = lastContainer;
41002
+ const saveBlockScopeContainer = blockScopeContainer;
41003
+ const saveParent = parent;
41004
+ const saveCurrentFlow = currentFlow;
41005
+ for (const jsDocImportTag of jsDocImports) {
41006
+ const host = getJSDocHost(jsDocImportTag);
41007
+ const enclosingContainer = host ? getEnclosingContainer(host) : void 0;
41008
+ const enclosingBlockScopeContainer = host ? getEnclosingBlockScopeContainer(host) : void 0;
41009
+ container = enclosingContainer || file;
41010
+ blockScopeContainer = enclosingBlockScopeContainer || file;
41011
+ currentFlow = initFlowNode({ flags: 2 /* Start */ });
41012
+ parent = jsDocImportTag;
41013
+ bind(jsDocImportTag.importClause);
41014
+ }
41015
+ container = saveContainer;
41016
+ lastContainer = saveLastContainer;
41017
+ blockScopeContainer = saveBlockScopeContainer;
41018
+ parent = saveParent;
41019
+ currentFlow = saveCurrentFlow;
41020
+ }
40927
41021
  function checkContextualIdentifier(node) {
40928
41022
  if (!file.parseDiagnostics.length && !(node.flags & 33554432 /* Ambient */) && !(node.flags & 16777216 /* JSDoc */) && !isIdentifierName(node)) {
40929
41023
  const originalKeywordKind = identifierToKeywordKind(node);
@@ -41348,6 +41442,8 @@ function createBinder() {
41348
41442
  return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
41349
41443
  case 339 /* JSDocOverloadTag */:
41350
41444
  return bind(node.typeExpression);
41445
+ case 351 /* JSDocImportTag */:
41446
+ return (jsDocImports || (jsDocImports = [])).push(node);
41351
41447
  }
41352
41448
  }
41353
41449
  function bindPropertyWorker(node) {
@@ -45027,6 +45123,7 @@ function createTypeChecker(host) {
45027
45123
  case 346 /* JSDocTypedefTag */:
45028
45124
  case 338 /* JSDocCallbackTag */:
45029
45125
  case 340 /* JSDocEnumTag */:
45126
+ case 351 /* JSDocImportTag */:
45030
45127
  const root = getJSDocRoot(location);
45031
45128
  if (root) {
45032
45129
  location = root.parent;
@@ -46519,7 +46616,7 @@ function createTypeChecker(host) {
46519
46616
  return ambientModule;
46520
46617
  }
46521
46618
  const currentSourceFile = getSourceFileOfNode(location);
46522
- const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
46619
+ const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isInJSFile(location) && isJSDocImportTag(location) ? location.moduleSpecifier : void 0) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
46523
46620
  location.initializer,
46524
46621
  /*requireStringLiteralLikeArgument*/
46525
46622
  true
@@ -48378,7 +48475,7 @@ function createTypeChecker(host) {
48378
48475
  }
48379
48476
  const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
48380
48477
  if (some(abstractSignatures)) {
48381
- const types = map(abstractSignatures, (s) => getOrCreateTypeFromSignature(s));
48478
+ const types = map(abstractSignatures, getOrCreateTypeFromSignature);
48382
48479
  const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
48383
48480
  // the logic in `createTypeNodesFromResolvedType`.
48384
48481
  (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
@@ -50820,19 +50917,20 @@ function createTypeChecker(host) {
50820
50917
  case 273 /* ImportClause */: {
50821
50918
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50822
50919
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
50920
+ const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
50921
+ const isTypeOnly = isJSDocImportTag(node.parent);
50823
50922
  addResult(
50824
50923
  factory.createImportDeclaration(
50825
50924
  /*modifiers*/
50826
50925
  void 0,
50827
50926
  factory.createImportClause(
50828
- /*isTypeOnly*/
50829
- false,
50927
+ isTypeOnly,
50830
50928
  factory.createIdentifier(localName),
50831
50929
  /*namedBindings*/
50832
50930
  void 0
50833
50931
  ),
50834
50932
  specifier2,
50835
- node.parent.attributes
50933
+ attributes
50836
50934
  ),
50837
50935
  0 /* None */
50838
50936
  );
@@ -50841,13 +50939,13 @@ function createTypeChecker(host) {
50841
50939
  case 274 /* NamespaceImport */: {
50842
50940
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50843
50941
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
50942
+ const isTypeOnly = isJSDocImportTag(node.parent.parent);
50844
50943
  addResult(
50845
50944
  factory.createImportDeclaration(
50846
50945
  /*modifiers*/
50847
50946
  void 0,
50848
50947
  factory.createImportClause(
50849
- /*isTypeOnly*/
50850
- false,
50948
+ isTypeOnly,
50851
50949
  /*name*/
50852
50950
  void 0,
50853
50951
  factory.createNamespaceImport(factory.createIdentifier(localName))
@@ -50875,13 +50973,13 @@ function createTypeChecker(host) {
50875
50973
  case 276 /* ImportSpecifier */: {
50876
50974
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50877
50975
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
50976
+ const isTypeOnly = isJSDocImportTag(node.parent.parent.parent);
50878
50977
  addResult(
50879
50978
  factory.createImportDeclaration(
50880
50979
  /*modifiers*/
50881
50980
  void 0,
50882
50981
  factory.createImportClause(
50883
- /*isTypeOnly*/
50884
- false,
50982
+ isTypeOnly,
50885
50983
  /*name*/
50886
50984
  void 0,
50887
50985
  factory.createNamedImports([
@@ -55779,12 +55877,6 @@ function createTypeChecker(host) {
55779
55877
  isInJSFile(signature.declaration)
55780
55878
  );
55781
55879
  }
55782
- function getImplementationSignature(signature) {
55783
- return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature;
55784
- }
55785
- function createImplementationSignature(signature) {
55786
- return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature;
55787
- }
55788
55880
  function getBaseSignature(signature) {
55789
55881
  const typeParameters = signature.typeParameters;
55790
55882
  if (typeParameters) {
@@ -55807,22 +55899,12 @@ function createTypeChecker(host) {
55807
55899
  }
55808
55900
  return signature;
55809
55901
  }
55810
- function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
55902
+ function getOrCreateTypeFromSignature(signature) {
55811
55903
  var _a;
55812
55904
  if (!signature.isolatedSignatureType) {
55813
55905
  const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
55814
55906
  const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
55815
- const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
55816
- if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
55817
- type.symbol.declarations = [signature.declaration];
55818
- type.symbol.valueDeclaration = signature.declaration;
55819
- }
55820
- outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters(
55821
- signature.declaration,
55822
- /*includeThisTypes*/
55823
- true
55824
- ));
55825
- type.outerTypeParameters = outerTypeParameters;
55907
+ const type = createObjectType(16 /* Anonymous */);
55826
55908
  type.members = emptySymbols;
55827
55909
  type.properties = emptyArray;
55828
55910
  type.callSignatures = !isConstructor ? [signature] : emptyArray;
@@ -59218,7 +59300,7 @@ function createTypeChecker(host) {
59218
59300
  const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
59219
59301
  const links = getNodeLinks(declaration);
59220
59302
  const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
59221
- let typeParameters = type.objectFlags & 134217728 /* SingleSignatureType */ ? type.outerTypeParameters : links.outerTypeParameters;
59303
+ let typeParameters = links.outerTypeParameters;
59222
59304
  if (!typeParameters) {
59223
59305
  let outerTypeParameters = getOuterTypeParameters(
59224
59306
  declaration,
@@ -59399,9 +59481,6 @@ function createTypeChecker(host) {
59399
59481
  if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
59400
59482
  result.node = type.node;
59401
59483
  }
59402
- if (type.objectFlags & 134217728 /* SingleSignatureType */) {
59403
- result.outerTypeParameters = type.outerTypeParameters;
59404
- }
59405
59484
  result.target = type;
59406
59485
  result.mapper = mapper;
59407
59486
  result.aliasSymbol = aliasSymbol || type.aliasSymbol;
@@ -64022,7 +64101,7 @@ function createTypeChecker(host) {
64022
64101
  if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
64023
64102
  return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
64024
64103
  }
64025
- const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 134217728 /* SingleSignatureType */ && !!length(type.outerTypeParameters) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
64104
+ const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
64026
64105
  if (type.flags & 3899393 /* ObjectFlagsType */) {
64027
64106
  type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
64028
64107
  }
@@ -64304,9 +64383,6 @@ function createTypeChecker(host) {
64304
64383
  pos = p;
64305
64384
  }
64306
64385
  }
64307
- function isTupleOfSelf(typeParameter, type) {
64308
- return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1");
64309
- }
64310
64386
  function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
64311
64387
  let bivariant = false;
64312
64388
  let propagationType;
@@ -64392,9 +64468,6 @@ function createTypeChecker(host) {
64392
64468
  inference.priority = priority;
64393
64469
  }
64394
64470
  if (priority === inference.priority) {
64395
- if (isTupleOfSelf(inference.typeParameter, candidate)) {
64396
- return;
64397
- }
64398
64471
  if (contravariant && !bivariant) {
64399
64472
  if (!contains(inference.contraCandidates, candidate)) {
64400
64473
  inference.contraCandidates = append(inference.contraCandidates, candidate);
@@ -71317,7 +71390,7 @@ function createTypeChecker(host) {
71317
71390
  argument = skipParentheses(argument);
71318
71391
  return isSatisfiesExpression(argument) ? skipParentheses(argument.expression) : argument;
71319
71392
  }
71320
- function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) {
71393
+ function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) {
71321
71394
  const errorOutputContainer = { errors: void 0, skipLogging: true };
71322
71395
  if (isJsxOpeningLikeElement(node)) {
71323
71396
  if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer)) {
@@ -71351,8 +71424,7 @@ function createTypeChecker(host) {
71351
71424
  void 0,
71352
71425
  checkMode
71353
71426
  );
71354
- const regularArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
71355
- const checkArgType = inferenceContext ? instantiateType(regularArgType, inferenceContext.nonFixingMapper) : regularArgType;
71427
+ const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
71356
71428
  const effectiveCheckArgumentNode = getEffectiveCheckNode(arg);
71357
71429
  if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) {
71358
71430
  Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
@@ -71761,9 +71833,7 @@ function createTypeChecker(host) {
71761
71833
  0 /* Normal */,
71762
71834
  /*reportErrors*/
71763
71835
  true,
71764
- () => chain,
71765
- /*inferenceContext*/
71766
- void 0
71836
+ () => chain
71767
71837
  );
71768
71838
  if (diags) {
71769
71839
  for (const d of diags) {
@@ -71799,9 +71869,7 @@ function createTypeChecker(host) {
71799
71869
  0 /* Normal */,
71800
71870
  /*reportErrors*/
71801
71871
  true,
71802
- chain2,
71803
- /*inferenceContext*/
71804
- void 0
71872
+ chain2
71805
71873
  );
71806
71874
  if (diags2) {
71807
71875
  if (diags2.length <= min2) {
@@ -71892,8 +71960,6 @@ function createTypeChecker(host) {
71892
71960
  /*reportErrors*/
71893
71961
  false,
71894
71962
  /*containingMessageChain*/
71895
- void 0,
71896
- /*inferenceContext*/
71897
71963
  void 0
71898
71964
  )) {
71899
71965
  candidatesForArgumentError = [candidate];
@@ -71902,16 +71968,13 @@ function createTypeChecker(host) {
71902
71968
  return candidate;
71903
71969
  }
71904
71970
  for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) {
71905
- let candidate = candidates2[candidateIndex];
71971
+ const candidate = candidates2[candidateIndex];
71906
71972
  if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
71907
71973
  continue;
71908
71974
  }
71909
71975
  let checkCandidate;
71910
71976
  let inferenceContext;
71911
71977
  if (candidate.typeParameters) {
71912
- if (candidate.declaration && findAncestor(node, (a) => a === candidate.declaration)) {
71913
- candidate = getImplementationSignature(candidate);
71914
- }
71915
71978
  let typeArgumentTypes;
71916
71979
  if (some(typeArguments)) {
71917
71980
  typeArgumentTypes = checkTypeArguments(
@@ -71931,7 +71994,7 @@ function createTypeChecker(host) {
71931
71994
  /*flags*/
71932
71995
  isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
71933
71996
  );
71934
- typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext), inferenceContext.nonFixingMapper);
71997
+ typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
71935
71998
  argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
71936
71999
  }
71937
72000
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
@@ -71951,8 +72014,7 @@ function createTypeChecker(host) {
71951
72014
  /*reportErrors*/
71952
72015
  false,
71953
72016
  /*containingMessageChain*/
71954
- void 0,
71955
- inferenceContext
72017
+ void 0
71956
72018
  )) {
71957
72019
  (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
71958
72020
  continue;
@@ -71960,7 +72022,7 @@ function createTypeChecker(host) {
71960
72022
  if (argCheckMode) {
71961
72023
  argCheckMode = 0 /* Normal */;
71962
72024
  if (inferenceContext) {
71963
- const typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext), inferenceContext.mapper);
72025
+ const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
71964
72026
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
71965
72027
  if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
71966
72028
  candidateForArgumentArityError = checkCandidate;
@@ -71976,8 +72038,7 @@ function createTypeChecker(host) {
71976
72038
  /*reportErrors*/
71977
72039
  false,
71978
72040
  /*containingMessageChain*/
71979
- void 0,
71980
- inferenceContext
72041
+ void 0
71981
72042
  )) {
71982
72043
  (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
71983
72044
  continue;
@@ -75674,7 +75735,7 @@ function createTypeChecker(host) {
75674
75735
  }
75675
75736
  }
75676
75737
  }
75677
- return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context), flatMap(inferenceContexts, (c) => c && map(c.inferences, (i) => i.typeParameter)).slice());
75738
+ return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));
75678
75739
  }
75679
75740
  }
75680
75741
  }
@@ -77653,6 +77714,9 @@ function createTypeChecker(host) {
77653
77714
  error(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
77654
77715
  }
77655
77716
  }
77717
+ function checkJSDocImportTag(node) {
77718
+ checkImportAttributes(node);
77719
+ }
77656
77720
  function checkJSDocImplementsTag(node) {
77657
77721
  const classLike = getEffectiveJSDocHost(node);
77658
77722
  if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) {
@@ -80894,7 +80958,7 @@ function createTypeChecker(host) {
80894
80958
  const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
80895
80959
  return grammarErrorOnNode(node, message);
80896
80960
  }
80897
- if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
80961
+ if (isImportDeclaration(declaration) || isJSDocImportTag(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
80898
80962
  return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
80899
80963
  }
80900
80964
  if (override) {
@@ -81345,6 +81409,8 @@ function createTypeChecker(host) {
81345
81409
  return checkJSDocSatisfiesTag(node);
81346
81410
  case 343 /* JSDocThisTag */:
81347
81411
  return checkJSDocThisTag(node);
81412
+ case 351 /* JSDocImportTag */:
81413
+ return checkJSDocImportTag(node);
81348
81414
  case 199 /* IndexedAccessType */:
81349
81415
  return checkIndexedAccessType(node);
81350
81416
  case 200 /* MappedType */:
@@ -82148,7 +82214,7 @@ function createTypeChecker(host) {
82148
82214
  return void 0;
82149
82215
  case 11 /* StringLiteral */:
82150
82216
  case 15 /* NoSubstitutionTemplateLiteral */:
82151
- if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
82217
+ if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
82152
82218
  node.parent,
82153
82219
  /*requireStringLiteralLikeArgument*/
82154
82220
  false
@@ -86390,13 +86456,13 @@ var visitEachChildTable = {
86390
86456
  );
86391
86457
  },
86392
86458
  // Transformation nodes
86393
- [353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
86459
+ [354 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
86394
86460
  return context.factory.updatePartiallyEmittedExpression(
86395
86461
  node,
86396
86462
  Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
86397
86463
  );
86398
86464
  },
86399
- [354 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
86465
+ [355 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
86400
86466
  return context.factory.updateCommaListExpression(
86401
86467
  node,
86402
86468
  nodesVisitor(node.elements, visitor, isExpression)
@@ -86852,6 +86918,7 @@ function collectExternalModuleInfo(context, sourceFile) {
86852
86918
  const exportedBindings = [];
86853
86919
  const uniqueExports = /* @__PURE__ */ new Map();
86854
86920
  let exportedNames;
86921
+ let exportedFunctions;
86855
86922
  let hasExportDefault = false;
86856
86923
  let exportEquals;
86857
86924
  let hasExportStarsToExportValues = false;
@@ -86910,6 +86977,7 @@ function collectExternalModuleInfo(context, sourceFile) {
86910
86977
  break;
86911
86978
  case 262 /* FunctionDeclaration */:
86912
86979
  if (hasSyntacticModifier(node, 32 /* Export */)) {
86980
+ exportedFunctions = append(exportedFunctions, node);
86913
86981
  if (hasSyntacticModifier(node, 2048 /* Default */)) {
86914
86982
  if (!hasExportDefault) {
86915
86983
  multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
@@ -86920,7 +86988,6 @@ function collectExternalModuleInfo(context, sourceFile) {
86920
86988
  if (!uniqueExports.get(idText(name))) {
86921
86989
  multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
86922
86990
  uniqueExports.set(idText(name), true);
86923
- exportedNames = append(exportedNames, name);
86924
86991
  }
86925
86992
  }
86926
86993
  }
@@ -86948,7 +87015,7 @@ function collectExternalModuleInfo(context, sourceFile) {
86948
87015
  if (externalHelpersImportDeclaration) {
86949
87016
  externalImports.unshift(externalHelpersImportDeclaration);
86950
87017
  }
86951
- return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, externalHelpersImportDeclaration };
87018
+ return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
86952
87019
  function addExportedNamesForExportDeclaration(node) {
86953
87020
  for (const specifier of cast(node.exportClause, isNamedExports).elements) {
86954
87021
  if (!uniqueExports.get(idText(specifier.name))) {
@@ -90051,7 +90118,7 @@ function transformClassFields(context) {
90051
90118
  /*discarded*/
90052
90119
  true
90053
90120
  );
90054
- case 354 /* CommaListExpression */:
90121
+ case 355 /* CommaListExpression */:
90055
90122
  return visitCommaListExpression(
90056
90123
  node,
90057
90124
  /*discarded*/
@@ -93144,7 +93211,7 @@ function transformESDecorators(context) {
93144
93211
  return visitForStatement(node);
93145
93212
  case 244 /* ExpressionStatement */:
93146
93213
  return visitExpressionStatement(node);
93147
- case 354 /* CommaListExpression */:
93214
+ case 355 /* CommaListExpression */:
93148
93215
  return visitCommaListExpression(
93149
93216
  node,
93150
93217
  /*discarded*/
@@ -93156,7 +93223,7 @@ function transformESDecorators(context) {
93156
93223
  /*discarded*/
93157
93224
  false
93158
93225
  );
93159
- case 353 /* PartiallyEmittedExpression */:
93226
+ case 354 /* PartiallyEmittedExpression */:
93160
93227
  return visitPartiallyEmittedExpression(
93161
93228
  node,
93162
93229
  /*discarded*/
@@ -93242,7 +93309,7 @@ function transformESDecorators(context) {
93242
93309
  /*discarded*/
93243
93310
  true
93244
93311
  );
93245
- case 354 /* CommaListExpression */:
93312
+ case 355 /* CommaListExpression */:
93246
93313
  return visitCommaListExpression(
93247
93314
  node,
93248
93315
  /*discarded*/
@@ -95833,7 +95900,7 @@ function transformES2018(context) {
95833
95900
  return visitObjectLiteralExpression(node);
95834
95901
  case 226 /* BinaryExpression */:
95835
95902
  return visitBinaryExpression(node, expressionResultIsUnused2);
95836
- case 354 /* CommaListExpression */:
95903
+ case 355 /* CommaListExpression */:
95837
95904
  return visitCommaListExpression(node, expressionResultIsUnused2);
95838
95905
  case 299 /* CatchClause */:
95839
95906
  return visitCatchClause(node);
@@ -99056,7 +99123,7 @@ function transformES2015(context) {
99056
99123
  return visitParenthesizedExpression(node, expressionResultIsUnused2);
99057
99124
  case 226 /* BinaryExpression */:
99058
99125
  return visitBinaryExpression(node, expressionResultIsUnused2);
99059
- case 354 /* CommaListExpression */:
99126
+ case 355 /* CommaListExpression */:
99060
99127
  return visitCommaListExpression(node, expressionResultIsUnused2);
99061
99128
  case 15 /* NoSubstitutionTemplateLiteral */:
99062
99129
  case 16 /* TemplateHead */:
@@ -102351,7 +102418,7 @@ function transformGenerators(context) {
102351
102418
  switch (node.kind) {
102352
102419
  case 226 /* BinaryExpression */:
102353
102420
  return visitBinaryExpression(node);
102354
- case 354 /* CommaListExpression */:
102421
+ case 355 /* CommaListExpression */:
102355
102422
  return visitCommaListExpression(node);
102356
102423
  case 227 /* ConditionalExpression */:
102357
102424
  return visitConditionalExpression(node);
@@ -104279,7 +104346,7 @@ function transformModule(context) {
104279
104346
  if (shouldEmitUnderscoreUnderscoreESModule()) {
104280
104347
  append(statements, createUnderscoreUnderscoreESModule());
104281
104348
  }
104282
- if (length(currentModuleInfo.exportedNames)) {
104349
+ if (some(currentModuleInfo.exportedNames)) {
104283
104350
  const chunkSize = 50;
104284
104351
  for (let i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) {
104285
104352
  append(
@@ -104294,6 +104361,11 @@ function transformModule(context) {
104294
104361
  );
104295
104362
  }
104296
104363
  }
104364
+ if (some(currentModuleInfo.exportedFunctions)) {
104365
+ for (const f of currentModuleInfo.exportedFunctions) {
104366
+ appendExportsOfHoistedDeclaration(statements, f);
104367
+ }
104368
+ }
104297
104369
  append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
104298
104370
  addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
104299
104371
  addExportEqualsIfNeeded(
@@ -104606,9 +104678,14 @@ function transformModule(context) {
104606
104678
  if (shouldEmitUnderscoreUnderscoreESModule()) {
104607
104679
  append(statements, createUnderscoreUnderscoreESModule());
104608
104680
  }
104609
- if (length(currentModuleInfo.exportedNames)) {
104681
+ if (some(currentModuleInfo.exportedNames)) {
104610
104682
  append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
104611
104683
  }
104684
+ if (some(currentModuleInfo.exportedFunctions)) {
104685
+ for (const f of currentModuleInfo.exportedFunctions) {
104686
+ appendExportsOfHoistedDeclaration(statements, f);
104687
+ }
104688
+ }
104612
104689
  append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
104613
104690
  if (moduleKind === 2 /* AMD */) {
104614
104691
  addRange(statements, mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport));
@@ -104731,7 +104808,7 @@ function transformModule(context) {
104731
104808
  return visitExpressionStatement(node);
104732
104809
  case 217 /* ParenthesizedExpression */:
104733
104810
  return visitParenthesizedExpression(node, valueIsDiscarded);
104734
- case 353 /* PartiallyEmittedExpression */:
104811
+ case 354 /* PartiallyEmittedExpression */:
104735
104812
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
104736
104813
  case 213 /* CallExpression */:
104737
104814
  if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
@@ -105579,7 +105656,6 @@ function transformModule(context) {
105579
105656
  } else {
105580
105657
  statements = append(statements, visitEachChild(node, visitor, context));
105581
105658
  }
105582
- statements = appendExportsOfHoistedDeclaration(statements, node);
105583
105659
  return singleOrMany(statements);
105584
105660
  }
105585
105661
  function visitClassDeclaration(node) {
@@ -106322,7 +106398,7 @@ function transformSystemModule(context) {
106322
106398
  if (!moduleInfo.hasExportStarsToExportValues) {
106323
106399
  return;
106324
106400
  }
106325
- if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
106401
+ if (!some(moduleInfo.exportedNames) && !some(moduleInfo.exportedFunctions) && moduleInfo.exportSpecifiers.size === 0) {
106326
106402
  let hasExportDeclarationWithExportClause = false;
106327
106403
  for (const externalImport of moduleInfo.externalImports) {
106328
106404
  if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
@@ -106353,6 +106429,20 @@ function transformSystemModule(context) {
106353
106429
  );
106354
106430
  }
106355
106431
  }
106432
+ if (moduleInfo.exportedFunctions) {
106433
+ for (const f of moduleInfo.exportedFunctions) {
106434
+ if (hasSyntacticModifier(f, 2048 /* Default */)) {
106435
+ continue;
106436
+ }
106437
+ Debug.assert(!!f.name);
106438
+ exportedNames.push(
106439
+ factory2.createPropertyAssignment(
106440
+ factory2.createStringLiteralFromNode(f.name),
106441
+ factory2.createTrue()
106442
+ )
106443
+ );
106444
+ }
106445
+ }
106356
106446
  const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
106357
106447
  statements.push(
106358
106448
  factory2.createVariableStatement(
@@ -107111,7 +107201,7 @@ function transformSystemModule(context) {
107111
107201
  return visitExpressionStatement(node);
107112
107202
  case 217 /* ParenthesizedExpression */:
107113
107203
  return visitParenthesizedExpression(node, valueIsDiscarded);
107114
- case 353 /* PartiallyEmittedExpression */:
107204
+ case 354 /* PartiallyEmittedExpression */:
107115
107205
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
107116
107206
  case 226 /* BinaryExpression */:
107117
107207
  if (isDestructuringAssignment(node)) {
@@ -109219,6 +109309,8 @@ function transformDeclarations(context) {
109219
109309
  }
109220
109310
  if (isDeclaration(input) && isDeclarationAndNotVisible(input))
109221
109311
  return;
109312
+ if (isJSDocImportTag(input))
109313
+ return;
109222
109314
  if (isFunctionLike(input) && resolver.isImplementationOfOverload(input))
109223
109315
  return;
109224
109316
  let previousEnclosingDeclaration;
@@ -109866,7 +109958,7 @@ function noEmitNotification(hint, node, callback) {
109866
109958
  }
109867
109959
  function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
109868
109960
  var _a, _b;
109869
- const enabledSyntaxKindFeatures = new Array(356 /* Count */);
109961
+ const enabledSyntaxKindFeatures = new Array(357 /* Count */);
109870
109962
  let lexicalEnvironmentVariableDeclarations;
109871
109963
  let lexicalEnvironmentFunctionDeclarations;
109872
109964
  let lexicalEnvironmentStatements;
@@ -111439,7 +111531,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111439
111531
  return emitJSDocTypedefTag(node);
111440
111532
  case 347 /* JSDocSeeTag */:
111441
111533
  return emitJSDocSeeTag(node);
111442
- case 352 /* NotEmittedStatement */:
111534
+ case 351 /* JSDocImportTag */:
111535
+ return emitJSDocImportTag(node);
111536
+ case 353 /* NotEmittedStatement */:
111443
111537
  return;
111444
111538
  }
111445
111539
  if (isExpression(node)) {
@@ -111540,15 +111634,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111540
111634
  return emitJsxSelfClosingElement(node);
111541
111635
  case 288 /* JsxFragment */:
111542
111636
  return emitJsxFragment(node);
111543
- case 351 /* SyntaxList */:
111637
+ case 352 /* SyntaxList */:
111544
111638
  return Debug.fail("SyntaxList should not be printed");
111545
- case 352 /* NotEmittedStatement */:
111639
+ case 353 /* NotEmittedStatement */:
111546
111640
  return;
111547
- case 353 /* PartiallyEmittedExpression */:
111641
+ case 354 /* PartiallyEmittedExpression */:
111548
111642
  return emitPartiallyEmittedExpression(node);
111549
- case 354 /* CommaListExpression */:
111643
+ case 355 /* CommaListExpression */:
111550
111644
  return emitCommaList(node);
111551
- case 355 /* SyntheticReferenceExpression */:
111645
+ case 356 /* SyntheticReferenceExpression */:
111552
111646
  return Debug.fail("SyntheticReferenceExpression should not be printed");
111553
111647
  }
111554
111648
  }
@@ -113392,6 +113486,21 @@ function createPrinter(printerOptions = {}, handlers = {}) {
113392
113486
  emit(tag.name);
113393
113487
  emitJSDocComment(tag.comment);
113394
113488
  }
113489
+ function emitJSDocImportTag(tag) {
113490
+ emitJSDocTagName(tag.tagName);
113491
+ writeSpace();
113492
+ if (tag.importClause) {
113493
+ emit(tag.importClause);
113494
+ writeSpace();
113495
+ emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag);
113496
+ writeSpace();
113497
+ }
113498
+ emitExpression(tag.moduleSpecifier);
113499
+ if (tag.attributes) {
113500
+ emitWithLeadingSpace(tag.attributes);
113501
+ }
113502
+ emitJSDocComment(tag.comment);
113503
+ }
113395
113504
  function emitJSDocNameReference(node) {
113396
113505
  writeSpace();
113397
113506
  writePunctuation("{");
@@ -114806,7 +114915,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114806
114915
  emitLeadingComments(
114807
114916
  pos,
114808
114917
  /*isEmittedNode*/
114809
- node.kind !== 352 /* NotEmittedStatement */
114918
+ node.kind !== 353 /* NotEmittedStatement */
114810
114919
  );
114811
114920
  }
114812
114921
  if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
@@ -114830,7 +114939,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114830
114939
  containerPos = savedContainerPos;
114831
114940
  containerEnd = savedContainerEnd;
114832
114941
  declarationListContainerEnd = savedDeclarationListContainerEnd;
114833
- if (!skipTrailingComments && node.kind !== 352 /* NotEmittedStatement */) {
114942
+ if (!skipTrailingComments && node.kind !== 353 /* NotEmittedStatement */) {
114834
114943
  emitTrailingComments(end);
114835
114944
  }
114836
114945
  }
@@ -115082,7 +115191,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115082
115191
  const emitFlags = getEmitFlags(node);
115083
115192
  const sourceMapRange = getSourceMapRange(node);
115084
115193
  const source = sourceMapRange.source || sourceMapSource;
115085
- if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
115194
+ if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
115086
115195
  emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
115087
115196
  }
115088
115197
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
@@ -115095,7 +115204,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115095
115204
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
115096
115205
  sourceMapsDisabled = false;
115097
115206
  }
115098
- if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
115207
+ if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
115099
115208
  emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
115100
115209
  }
115101
115210
  }
@@ -117977,7 +118086,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117977
118086
  );
117978
118087
  }
117979
118088
  if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
117980
- collectDynamicImportOrRequireCalls(file);
118089
+ collectDynamicImportOrRequireOrJsDocImportCalls(file);
117981
118090
  }
117982
118091
  file.imports = imports || emptyArray;
117983
118092
  file.moduleAugmentations = moduleAugmentations || emptyArray;
@@ -118021,7 +118130,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118021
118130
  }
118022
118131
  }
118023
118132
  }
118024
- function collectDynamicImportOrRequireCalls(file2) {
118133
+ function collectDynamicImportOrRequireOrJsDocImportCalls(file2) {
118025
118134
  const r = /import|require/g;
118026
118135
  while (r.exec(file2.text) !== null) {
118027
118136
  const node = getNodeAtPosition(file2, r.lastIndex);
@@ -118050,6 +118159,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118050
118159
  false
118051
118160
  );
118052
118161
  imports = append(imports, node.argument.literal);
118162
+ } else if (isJavaScriptFile && isJSDocImportTag(node)) {
118163
+ const moduleNameExpr = getExternalModuleName(node);
118164
+ if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) {
118165
+ setParentRecursive(
118166
+ node,
118167
+ /*incremental*/
118168
+ false
118169
+ );
118170
+ imports = append(imports, moduleNameExpr);
118171
+ }
118053
118172
  }
118054
118173
  }
118055
118174
  }