typescript 5.5.0-dev.20240326 → 5.5.0-dev.20240327

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-dev.20240326`;
21
+ var version = `${versionMajorMinor}.0-dev.20240327`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -3346,12 +3346,13 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3346
3346
  SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 348] = "JSDocPropertyTag";
3347
3347
  SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 349] = "JSDocThrowsTag";
3348
3348
  SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 350] = "JSDocSatisfiesTag";
3349
- SyntaxKind4[SyntaxKind4["SyntaxList"] = 351] = "SyntaxList";
3350
- SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 352] = "NotEmittedStatement";
3351
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 353] = "PartiallyEmittedExpression";
3352
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 354] = "CommaListExpression";
3353
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 355] = "SyntheticReferenceExpression";
3354
- SyntaxKind4[SyntaxKind4["Count"] = 356] = "Count";
3349
+ SyntaxKind4[SyntaxKind4["JSDocImportTag"] = 351] = "JSDocImportTag";
3350
+ SyntaxKind4[SyntaxKind4["SyntaxList"] = 352] = "SyntaxList";
3351
+ SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 353] = "NotEmittedStatement";
3352
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 354] = "PartiallyEmittedExpression";
3353
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 355] = "CommaListExpression";
3354
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 356] = "SyntheticReferenceExpression";
3355
+ SyntaxKind4[SyntaxKind4["Count"] = 357] = "Count";
3355
3356
  SyntaxKind4[SyntaxKind4["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
3356
3357
  SyntaxKind4[SyntaxKind4["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
3357
3358
  SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -3380,9 +3381,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3380
3381
  SyntaxKind4[SyntaxKind4["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement";
3381
3382
  SyntaxKind4[SyntaxKind4["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
3382
3383
  SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 309 /* JSDocTypeExpression */] = "FirstJSDocNode";
3383
- SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 350 /* JSDocSatisfiesTag */] = "LastJSDocNode";
3384
+ SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 351 /* JSDocImportTag */] = "LastJSDocNode";
3384
3385
  SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 327 /* JSDocTag */] = "FirstJSDocTagNode";
3385
- SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 350 /* JSDocSatisfiesTag */] = "LastJSDocTagNode";
3386
+ SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 351 /* JSDocImportTag */] = "LastJSDocTagNode";
3386
3387
  SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword";
3387
3388
  SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
3388
3389
  return SyntaxKind4;
@@ -8466,7 +8467,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8466
8467
  var tokenValue;
8467
8468
  var tokenFlags;
8468
8469
  var commentDirectives;
8469
- var inJSDocType = 0;
8470
+ var skipJsDocLeadingAsterisks = 0;
8470
8471
  var scriptKind = 0 /* Unknown */;
8471
8472
  var jsDocParsingMode = 0 /* ParseAll */;
8472
8473
  setText(text, start, length2);
@@ -8517,7 +8518,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8517
8518
  setOnError,
8518
8519
  resetTokenState,
8519
8520
  setTextPos: resetTokenState,
8520
- setInJSDocType,
8521
+ setSkipJsDocLeadingAsterisks,
8521
8522
  tryScan,
8522
8523
  lookAhead,
8523
8524
  scanRange
@@ -9233,7 +9234,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9233
9234
  return pos += 2, token = 43 /* AsteriskAsteriskToken */;
9234
9235
  }
9235
9236
  pos++;
9236
- if (inJSDocType && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
9237
+ if (skipJsDocLeadingAsterisks && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
9237
9238
  asteriskSeen = true;
9238
9239
  continue;
9239
9240
  }
@@ -10011,8 +10012,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10011
10012
  tokenValue = void 0;
10012
10013
  tokenFlags = 0 /* None */;
10013
10014
  }
10014
- function setInJSDocType(inType) {
10015
- inJSDocType += inType ? 1 : -1;
10015
+ function setSkipJsDocLeadingAsterisks(skip) {
10016
+ skipJsDocLeadingAsterisks += skip ? 1 : -1;
10016
10017
  }
10017
10018
  }
10018
10019
  function codePointAt(s, i) {
@@ -11065,8 +11066,8 @@ function isExpressionKind(kind) {
11065
11066
  case 230 /* SpreadElement */:
11066
11067
  case 234 /* AsExpression */:
11067
11068
  case 232 /* OmittedExpression */:
11068
- case 354 /* CommaListExpression */:
11069
- case 353 /* PartiallyEmittedExpression */:
11069
+ case 355 /* CommaListExpression */:
11070
+ case 354 /* PartiallyEmittedExpression */:
11070
11071
  case 238 /* SatisfiesExpression */:
11071
11072
  return true;
11072
11073
  default:
@@ -11237,7 +11238,7 @@ function isDeclarationStatementKind(kind) {
11237
11238
  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 */;
11238
11239
  }
11239
11240
  function isStatementKindButNotDeclarationKind(kind) {
11240
- 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 */;
11241
+ 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 */;
11241
11242
  }
11242
11243
  function isDeclaration(node) {
11243
11244
  if (node.kind === 168 /* TypeParameter */) {
@@ -11298,10 +11299,10 @@ function isCaseOrDefaultClause(node) {
11298
11299
  return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */;
11299
11300
  }
11300
11301
  function isJSDocNode(node) {
11301
- return node.kind >= 309 /* FirstJSDocNode */ && node.kind <= 350 /* LastJSDocNode */;
11302
+ return node.kind >= 309 /* FirstJSDocNode */ && node.kind <= 351 /* LastJSDocNode */;
11302
11303
  }
11303
11304
  function isJSDocTag(node) {
11304
- return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <= 350 /* LastJSDocTagNode */;
11305
+ return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <= 351 /* LastJSDocTagNode */;
11305
11306
  }
11306
11307
  function isSetAccessor(node) {
11307
11308
  return node.kind === 178 /* SetAccessor */;
@@ -11742,7 +11743,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
11742
11743
  if (includeJsDoc && hasJSDocNodes(node)) {
11743
11744
  return getTokenPosOfNode(node.jsDoc[0], sourceFile);
11744
11745
  }
11745
- if (node.kind === 351 /* SyntaxList */ && node._children.length > 0) {
11746
+ if (node.kind === 352 /* SyntaxList */ && node._children.length > 0) {
11746
11747
  return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
11747
11748
  }
11748
11749
  return skipTrivia(
@@ -13696,6 +13697,7 @@ function tryGetModuleSpecifierFromDeclaration(node) {
13696
13697
  ))) == null ? void 0 : _a.arguments[0];
13697
13698
  case 272 /* ImportDeclaration */:
13698
13699
  case 278 /* ExportDeclaration */:
13700
+ case 351 /* JSDocImportTag */:
13699
13701
  return tryCast(node.moduleSpecifier, isStringLiteralLike);
13700
13702
  case 271 /* ImportEqualsDeclaration */:
13701
13703
  return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
@@ -13717,6 +13719,7 @@ function getExternalModuleName(node) {
13717
13719
  switch (node.kind) {
13718
13720
  case 272 /* ImportDeclaration */:
13719
13721
  case 278 /* ExportDeclaration */:
13722
+ case 351 /* JSDocImportTag */:
13720
13723
  return node.moduleSpecifier;
13721
13724
  case 271 /* ImportEqualsDeclaration */:
13722
13725
  return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
@@ -13743,7 +13746,7 @@ function getNamespaceDeclarationNode(node) {
13743
13746
  }
13744
13747
  }
13745
13748
  function isDefaultImport(node) {
13746
- return node.kind === 272 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
13749
+ return (node.kind === 272 /* ImportDeclaration */ || node.kind === 351 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name;
13747
13750
  }
13748
13751
  function hasQuestionToken(node) {
13749
13752
  if (node) {
@@ -14516,7 +14519,7 @@ function getOperator(expression) {
14516
14519
  }
14517
14520
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
14518
14521
  switch (nodeKind) {
14519
- case 354 /* CommaListExpression */:
14522
+ case 355 /* CommaListExpression */:
14520
14523
  return 0 /* Comma */;
14521
14524
  case 230 /* SpreadElement */:
14522
14525
  return 1 /* Spread */;
@@ -16065,7 +16068,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
16065
16068
  case 212 /* ElementAccessExpression */:
16066
16069
  case 211 /* PropertyAccessExpression */:
16067
16070
  case 235 /* NonNullExpression */:
16068
- case 353 /* PartiallyEmittedExpression */:
16071
+ case 354 /* PartiallyEmittedExpression */:
16069
16072
  case 238 /* SatisfiesExpression */:
16070
16073
  node = node.expression;
16071
16074
  continue;
@@ -17452,7 +17455,7 @@ function getContainingNodeArray(node) {
17452
17455
  return parent.types;
17453
17456
  case 189 /* TupleType */:
17454
17457
  case 209 /* ArrayLiteralExpression */:
17455
- case 354 /* CommaListExpression */:
17458
+ case 355 /* CommaListExpression */:
17456
17459
  case 275 /* NamedImports */:
17457
17460
  case 279 /* NamedExports */:
17458
17461
  return parent.elements;
@@ -18651,6 +18654,8 @@ function createNodeFactory(flags, baseFactory2) {
18651
18654
  updateJSDocImplementsTag,
18652
18655
  createJSDocSeeTag,
18653
18656
  updateJSDocSeeTag,
18657
+ createJSDocImportTag,
18658
+ updateJSDocImportTag,
18654
18659
  createJSDocNameReference,
18655
18660
  updateJSDocNameReference,
18656
18661
  createJSDocMemberName,
@@ -21423,6 +21428,17 @@ function createNodeFactory(flags, baseFactory2) {
21423
21428
  function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
21424
21429
  return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
21425
21430
  }
21431
+ function createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) {
21432
+ const node = createBaseJSDocTag(351 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment);
21433
+ node.importClause = importClause;
21434
+ node.moduleSpecifier = moduleSpecifier;
21435
+ node.attributes = attributes;
21436
+ node.comment = comment;
21437
+ return node;
21438
+ }
21439
+ function updateJSDocImportTag(node, tagName, importClause, moduleSpecifier, attributes, comment) {
21440
+ 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;
21441
+ }
21426
21442
  function createJSDocText(text) {
21427
21443
  const node = createBaseNode(321 /* JSDocText */);
21428
21444
  node.text = text;
@@ -21820,18 +21836,18 @@ function createNodeFactory(flags, baseFactory2) {
21820
21836
  return node;
21821
21837
  }
21822
21838
  function createSyntaxList(children) {
21823
- const node = createBaseNode(351 /* SyntaxList */);
21839
+ const node = createBaseNode(352 /* SyntaxList */);
21824
21840
  node._children = children;
21825
21841
  return node;
21826
21842
  }
21827
21843
  function createNotEmittedStatement(original) {
21828
- const node = createBaseNode(352 /* NotEmittedStatement */);
21844
+ const node = createBaseNode(353 /* NotEmittedStatement */);
21829
21845
  node.original = original;
21830
21846
  setTextRange(node, original);
21831
21847
  return node;
21832
21848
  }
21833
21849
  function createPartiallyEmittedExpression(expression, original) {
21834
- const node = createBaseNode(353 /* PartiallyEmittedExpression */);
21850
+ const node = createBaseNode(354 /* PartiallyEmittedExpression */);
21835
21851
  node.expression = expression;
21836
21852
  node.original = original;
21837
21853
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -21853,7 +21869,7 @@ function createNodeFactory(flags, baseFactory2) {
21853
21869
  return node;
21854
21870
  }
21855
21871
  function createCommaListExpression(elements) {
21856
- const node = createBaseNode(354 /* CommaListExpression */);
21872
+ const node = createBaseNode(355 /* CommaListExpression */);
21857
21873
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
21858
21874
  node.transformFlags |= propagateChildrenFlags(node.elements);
21859
21875
  return node;
@@ -21862,7 +21878,7 @@ function createNodeFactory(flags, baseFactory2) {
21862
21878
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
21863
21879
  }
21864
21880
  function createSyntheticReferenceExpression(expression, thisArg) {
21865
- const node = createBaseNode(355 /* SyntheticReferenceExpression */);
21881
+ const node = createBaseNode(356 /* SyntheticReferenceExpression */);
21866
21882
  node.expression = expression;
21867
21883
  node.thisArg = thisArg;
21868
21884
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -22108,7 +22124,7 @@ function createNodeFactory(flags, baseFactory2) {
22108
22124
  return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
22109
22125
  case 235 /* NonNullExpression */:
22110
22126
  return updateNonNullExpression(outerExpression, expression);
22111
- case 353 /* PartiallyEmittedExpression */:
22127
+ case 354 /* PartiallyEmittedExpression */:
22112
22128
  return updatePartiallyEmittedExpression(outerExpression, expression);
22113
22129
  }
22114
22130
  }
@@ -22518,6 +22534,8 @@ function getDefaultTagNameForKind(kind) {
22518
22534
  return "augments";
22519
22535
  case 329 /* JSDocImplementsTag */:
22520
22536
  return "implements";
22537
+ case 351 /* JSDocImportTag */:
22538
+ return "import";
22521
22539
  default:
22522
22540
  return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
22523
22541
  }
@@ -22658,7 +22676,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
22658
22676
  case 216 /* TypeAssertionExpression */:
22659
22677
  case 238 /* SatisfiesExpression */:
22660
22678
  case 234 /* AsExpression */:
22661
- case 353 /* PartiallyEmittedExpression */:
22679
+ case 354 /* PartiallyEmittedExpression */:
22662
22680
  case 217 /* ParenthesizedExpression */:
22663
22681
  case 108 /* SuperKeyword */:
22664
22682
  return -2147483648 /* OuterExpressionExcludes */;
@@ -24296,10 +24314,10 @@ function isMetaProperty(node) {
24296
24314
  return node.kind === 236 /* MetaProperty */;
24297
24315
  }
24298
24316
  function isPartiallyEmittedExpression(node) {
24299
- return node.kind === 353 /* PartiallyEmittedExpression */;
24317
+ return node.kind === 354 /* PartiallyEmittedExpression */;
24300
24318
  }
24301
24319
  function isCommaListExpression(node) {
24302
- return node.kind === 354 /* CommaListExpression */;
24320
+ return node.kind === 355 /* CommaListExpression */;
24303
24321
  }
24304
24322
  function isTemplateSpan(node) {
24305
24323
  return node.kind === 239 /* TemplateSpan */;
@@ -24422,10 +24440,10 @@ function isExportSpecifier(node) {
24422
24440
  return node.kind === 281 /* ExportSpecifier */;
24423
24441
  }
24424
24442
  function isNotEmittedStatement(node) {
24425
- return node.kind === 352 /* NotEmittedStatement */;
24443
+ return node.kind === 353 /* NotEmittedStatement */;
24426
24444
  }
24427
24445
  function isSyntheticReference(node) {
24428
- return node.kind === 355 /* SyntheticReferenceExpression */;
24446
+ return node.kind === 356 /* SyntheticReferenceExpression */;
24429
24447
  }
24430
24448
  function isExternalModuleReference(node) {
24431
24449
  return node.kind === 283 /* ExternalModuleReference */;
@@ -24592,6 +24610,9 @@ function isJSDocImplementsTag(node) {
24592
24610
  function isJSDocSatisfiesTag(node) {
24593
24611
  return node.kind === 350 /* JSDocSatisfiesTag */;
24594
24612
  }
24613
+ function isJSDocImportTag(node) {
24614
+ return node.kind === 351 /* JSDocImportTag */;
24615
+ }
24595
24616
 
24596
24617
  // src/compiler/factory/utilities.ts
24597
24618
  function createEmptyExports(factory2) {
@@ -24974,7 +24995,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
24974
24995
  return (kinds & 2 /* TypeAssertions */) !== 0;
24975
24996
  case 235 /* NonNullExpression */:
24976
24997
  return (kinds & 4 /* NonNullAssertions */) !== 0;
24977
- case 353 /* PartiallyEmittedExpression */:
24998
+ case 354 /* PartiallyEmittedExpression */:
24978
24999
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
24979
25000
  }
24980
25001
  return false;
@@ -26050,7 +26071,7 @@ var forEachChildTable = {
26050
26071
  [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
26051
26072
  return visitNodes(cbNode, cbNodes, node.modifiers);
26052
26073
  },
26053
- [354 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
26074
+ [355 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
26054
26075
  return visitNodes(cbNode, cbNodes, node.elements);
26055
26076
  },
26056
26077
  [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -26145,7 +26166,8 @@ var forEachChildTable = {
26145
26166
  [336 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
26146
26167
  [331 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
26147
26168
  [337 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
26148
- [353 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
26169
+ [351 /* JSDocImportTag */]: forEachChildInJSDocImportTag,
26170
+ [354 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
26149
26171
  };
26150
26172
  function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
26151
26173
  return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -26196,6 +26218,9 @@ function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
26196
26218
  function forEachChildInJSDocTag(node, cbNode, cbNodes) {
26197
26219
  return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
26198
26220
  }
26221
+ function forEachChildInJSDocImportTag(node, cbNode, cbNodes) {
26222
+ 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));
26223
+ }
26199
26224
  function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
26200
26225
  return visitNode2(cbNode, node.expression);
26201
26226
  }
@@ -28188,7 +28213,7 @@ var Parser;
28188
28213
  );
28189
28214
  }
28190
28215
  function parseJSDocType() {
28191
- scanner.setInJSDocType(true);
28216
+ scanner.setSkipJsDocLeadingAsterisks(true);
28192
28217
  const pos = getNodePos();
28193
28218
  if (parseOptional(144 /* ModuleKeyword */)) {
28194
28219
  const moduleTag = factory2.createJSDocNamepathType(
@@ -28207,12 +28232,12 @@ var Parser;
28207
28232
  nextTokenJSDoc();
28208
28233
  }
28209
28234
  }
28210
- scanner.setInJSDocType(false);
28235
+ scanner.setSkipJsDocLeadingAsterisks(false);
28211
28236
  return finishNode(moduleTag, pos);
28212
28237
  }
28213
28238
  const hasDotDotDot = parseOptional(26 /* DotDotDotToken */);
28214
28239
  let type = parseTypeOrTypePredicate();
28215
- scanner.setInJSDocType(false);
28240
+ scanner.setSkipJsDocLeadingAsterisks(false);
28216
28241
  if (hasDotDotDot) {
28217
28242
  type = finishNode(factory2.createJSDocVariadicType(type), pos);
28218
28243
  }
@@ -31775,22 +31800,28 @@ var Parser;
31775
31800
  if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) {
31776
31801
  return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly);
31777
31802
  }
31803
+ const importClause = tryParseImportClause(identifier, afterImportPos, isTypeOnly);
31804
+ const moduleSpecifier = parseModuleSpecifier();
31805
+ const attributes = tryParseImportAttributes();
31806
+ parseSemicolon();
31807
+ const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
31808
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
31809
+ }
31810
+ function tryParseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks = false) {
31778
31811
  let importClause;
31779
31812
  if (identifier || // import id
31780
31813
  token() === 42 /* AsteriskToken */ || // import *
31781
31814
  token() === 19 /* OpenBraceToken */) {
31782
- importClause = parseImportClause(identifier, afterImportPos, isTypeOnly);
31815
+ importClause = parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks);
31783
31816
  parseExpected(161 /* FromKeyword */);
31784
31817
  }
31785
- const moduleSpecifier = parseModuleSpecifier();
31818
+ return importClause;
31819
+ }
31820
+ function tryParseImportAttributes() {
31786
31821
  const currentToken2 = token();
31787
- let attributes;
31788
31822
  if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
31789
- attributes = parseImportAttributes(currentToken2);
31823
+ return parseImportAttributes(currentToken2);
31790
31824
  }
31791
- parseSemicolon();
31792
- const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
31793
- return withJSDoc(finishNode(node, pos), hasJSDoc);
31794
31825
  }
31795
31826
  function parseImportAttribute() {
31796
31827
  const pos = getNodePos();
@@ -31857,10 +31888,14 @@ var Parser;
31857
31888
  const finished = withJSDoc(finishNode(node, pos), hasJSDoc);
31858
31889
  return finished;
31859
31890
  }
31860
- function parseImportClause(identifier, pos, isTypeOnly) {
31891
+ function parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks) {
31861
31892
  let namedBindings;
31862
31893
  if (!identifier || parseOptional(28 /* CommaToken */)) {
31894
+ if (skipJsDocLeadingAsterisks)
31895
+ scanner.setSkipJsDocLeadingAsterisks(true);
31863
31896
  namedBindings = token() === 42 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(275 /* NamedImports */);
31897
+ if (skipJsDocLeadingAsterisks)
31898
+ scanner.setSkipJsDocLeadingAsterisks(false);
31864
31899
  }
31865
31900
  return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
31866
31901
  }
@@ -32431,6 +32466,9 @@ var Parser;
32431
32466
  case "throws":
32432
32467
  tag = parseThrowsTag(start2, tagName, margin, indentText);
32433
32468
  break;
32469
+ case "import":
32470
+ tag = parseImportTag(start2, tagName, margin, indentText);
32471
+ break;
32434
32472
  default:
32435
32473
  tag = parseUnknownTag(start2, tagName, margin, indentText);
32436
32474
  break;
@@ -32750,13 +32788,32 @@ var Parser;
32750
32788
  const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
32751
32789
  return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
32752
32790
  }
32791
+ function parseImportTag(start2, tagName, margin, indentText) {
32792
+ const afterImportTagPos = scanner.getTokenFullStart();
32793
+ let identifier;
32794
+ if (isIdentifier2()) {
32795
+ identifier = parseIdentifier();
32796
+ }
32797
+ const importClause = tryParseImportClause(
32798
+ identifier,
32799
+ afterImportTagPos,
32800
+ /*isTypeOnly*/
32801
+ true,
32802
+ /*skipJsDocLeadingAsterisks*/
32803
+ true
32804
+ );
32805
+ const moduleSpecifier = parseModuleSpecifier();
32806
+ const attributes = tryParseImportAttributes();
32807
+ const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
32808
+ return finishNode(factory2.createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comments2), start2);
32809
+ }
32753
32810
  function parseExpressionWithTypeArgumentsForAugments() {
32754
32811
  const usedBrace = parseOptional(19 /* OpenBraceToken */);
32755
32812
  const pos = getNodePos();
32756
32813
  const expression = parsePropertyAccessEntityNameExpression();
32757
- scanner.setInJSDocType(true);
32814
+ scanner.setSkipJsDocLeadingAsterisks(true);
32758
32815
  const typeArguments = tryParseTypeArguments();
32759
- scanner.setInJSDocType(false);
32816
+ scanner.setSkipJsDocLeadingAsterisks(false);
32760
32817
  const node = factory2.createExpressionWithTypeArguments(expression, typeArguments);
32761
32818
  const res = finishNode(node, pos);
32762
32819
  if (usedBrace) {
@@ -39435,6 +39492,7 @@ function createBinder() {
39435
39492
  var lastContainer;
39436
39493
  var delayedTypeAliases;
39437
39494
  var seenThisKeyword;
39495
+ var jsDocImports;
39438
39496
  var currentFlow;
39439
39497
  var currentBreakTarget;
39440
39498
  var currentContinueTarget;
@@ -39482,6 +39540,7 @@ function createBinder() {
39482
39540
  file.symbolCount = symbolCount;
39483
39541
  file.classifiableNames = classifiableNames;
39484
39542
  delayedBindJSDocTypedefTag();
39543
+ bindJSDocImports();
39485
39544
  }
39486
39545
  file = void 0;
39487
39546
  options = void 0;
@@ -39492,6 +39551,7 @@ function createBinder() {
39492
39551
  blockScopeContainer = void 0;
39493
39552
  lastContainer = void 0;
39494
39553
  delayedTypeAliases = void 0;
39554
+ jsDocImports = void 0;
39495
39555
  seenThisKeyword = false;
39496
39556
  currentFlow = void 0;
39497
39557
  currentBreakTarget = void 0;
@@ -39926,6 +39986,9 @@ function createBinder() {
39926
39986
  case 340 /* JSDocEnumTag */:
39927
39987
  bindJSDocTypeAlias(node);
39928
39988
  break;
39989
+ case 351 /* JSDocImportTag */:
39990
+ bindJSDocImportTag(node);
39991
+ break;
39929
39992
  case 307 /* SourceFile */: {
39930
39993
  bindEachFunctionsFirst(node.statements);
39931
39994
  bind(node.endOfFileToken);
@@ -40658,6 +40721,12 @@ function createBinder() {
40658
40721
  addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
40659
40722
  }
40660
40723
  }
40724
+ function bindJSDocImportTag(node) {
40725
+ bind(node.tagName);
40726
+ if (typeof node.comment !== "string") {
40727
+ bindEach(node.comment);
40728
+ }
40729
+ }
40661
40730
  function bindOptionalExpression(node, trueTarget, falseTarget) {
40662
40731
  doWithConditionalBranches(bind, node, trueTarget, falseTarget);
40663
40732
  if (!isOptionalChain(node) || isOutermostOptionalChain(node)) {
@@ -40974,6 +41043,31 @@ function createBinder() {
40974
41043
  parent = saveParent;
40975
41044
  currentFlow = saveCurrentFlow;
40976
41045
  }
41046
+ function bindJSDocImports() {
41047
+ if (jsDocImports === void 0) {
41048
+ return;
41049
+ }
41050
+ const saveContainer = container;
41051
+ const saveLastContainer = lastContainer;
41052
+ const saveBlockScopeContainer = blockScopeContainer;
41053
+ const saveParent = parent;
41054
+ const saveCurrentFlow = currentFlow;
41055
+ for (const jsDocImportTag of jsDocImports) {
41056
+ const host = getJSDocHost(jsDocImportTag);
41057
+ const enclosingContainer = host ? getEnclosingContainer(host) : void 0;
41058
+ const enclosingBlockScopeContainer = host ? getEnclosingBlockScopeContainer(host) : void 0;
41059
+ container = enclosingContainer || file;
41060
+ blockScopeContainer = enclosingBlockScopeContainer || file;
41061
+ currentFlow = initFlowNode({ flags: 2 /* Start */ });
41062
+ parent = jsDocImportTag;
41063
+ bind(jsDocImportTag.importClause);
41064
+ }
41065
+ container = saveContainer;
41066
+ lastContainer = saveLastContainer;
41067
+ blockScopeContainer = saveBlockScopeContainer;
41068
+ parent = saveParent;
41069
+ currentFlow = saveCurrentFlow;
41070
+ }
40977
41071
  function checkContextualIdentifier(node) {
40978
41072
  if (!file.parseDiagnostics.length && !(node.flags & 33554432 /* Ambient */) && !(node.flags & 16777216 /* JSDoc */) && !isIdentifierName(node)) {
40979
41073
  const originalKeywordKind = identifierToKeywordKind(node);
@@ -41398,6 +41492,8 @@ function createBinder() {
41398
41492
  return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
41399
41493
  case 339 /* JSDocOverloadTag */:
41400
41494
  return bind(node.typeExpression);
41495
+ case 351 /* JSDocImportTag */:
41496
+ return (jsDocImports || (jsDocImports = [])).push(node);
41401
41497
  }
41402
41498
  }
41403
41499
  function bindPropertyWorker(node) {
@@ -45038,6 +45134,7 @@ function createTypeChecker(host) {
45038
45134
  case 346 /* JSDocTypedefTag */:
45039
45135
  case 338 /* JSDocCallbackTag */:
45040
45136
  case 340 /* JSDocEnumTag */:
45137
+ case 351 /* JSDocImportTag */:
45041
45138
  const root = getJSDocRoot(location);
45042
45139
  if (root) {
45043
45140
  location = root.parent;
@@ -46530,7 +46627,7 @@ function createTypeChecker(host) {
46530
46627
  return ambientModule;
46531
46628
  }
46532
46629
  const currentSourceFile = getSourceFileOfNode(location);
46533
- 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(
46630
+ 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(
46534
46631
  location.initializer,
46535
46632
  /*requireStringLiteralLikeArgument*/
46536
46633
  true
@@ -50906,19 +51003,20 @@ function createTypeChecker(host) {
50906
51003
  case 273 /* ImportClause */: {
50907
51004
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50908
51005
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
51006
+ const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
51007
+ const isTypeOnly = isJSDocImportTag(node.parent);
50909
51008
  addResult(
50910
51009
  factory.createImportDeclaration(
50911
51010
  /*modifiers*/
50912
51011
  void 0,
50913
51012
  factory.createImportClause(
50914
- /*isTypeOnly*/
50915
- false,
51013
+ isTypeOnly,
50916
51014
  factory.createIdentifier(localName),
50917
51015
  /*namedBindings*/
50918
51016
  void 0
50919
51017
  ),
50920
51018
  specifier2,
50921
- node.parent.attributes
51019
+ attributes
50922
51020
  ),
50923
51021
  0 /* None */
50924
51022
  );
@@ -50927,13 +51025,13 @@ function createTypeChecker(host) {
50927
51025
  case 274 /* NamespaceImport */: {
50928
51026
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50929
51027
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
51028
+ const isTypeOnly = isJSDocImportTag(node.parent.parent);
50930
51029
  addResult(
50931
51030
  factory.createImportDeclaration(
50932
51031
  /*modifiers*/
50933
51032
  void 0,
50934
51033
  factory.createImportClause(
50935
- /*isTypeOnly*/
50936
- false,
51034
+ isTypeOnly,
50937
51035
  /*name*/
50938
51036
  void 0,
50939
51037
  factory.createNamespaceImport(factory.createIdentifier(localName))
@@ -50961,13 +51059,13 @@ function createTypeChecker(host) {
50961
51059
  case 276 /* ImportSpecifier */: {
50962
51060
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50963
51061
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
51062
+ const isTypeOnly = isJSDocImportTag(node.parent.parent.parent);
50964
51063
  addResult(
50965
51064
  factory.createImportDeclaration(
50966
51065
  /*modifiers*/
50967
51066
  void 0,
50968
51067
  factory.createImportClause(
50969
- /*isTypeOnly*/
50970
- false,
51068
+ isTypeOnly,
50971
51069
  /*name*/
50972
51070
  void 0,
50973
51071
  factory.createNamedImports([
@@ -53647,7 +53745,7 @@ function createTypeChecker(host) {
53647
53745
  if (!lateSymbol)
53648
53746
  lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */));
53649
53747
  const earlySymbol = earlySymbols && earlySymbols.get(memberName);
53650
- if (!(parent.flags & 32 /* Class */) && (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol)) {
53748
+ if (!(parent.flags & 32 /* Class */) && lateSymbol.flags & getExcludedSymbolFlags(symbolFlags)) {
53651
53749
  const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
53652
53750
  const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
53653
53751
  forEach(declarations, (declaration) => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name));
@@ -65173,13 +65271,20 @@ function createTypeChecker(host) {
65173
65271
  return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
65174
65272
  case 166 /* QualifiedName */:
65175
65273
  const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer);
65176
- return left && left + "." + node.right.escapedText;
65274
+ return left && `${left}.${node.right.escapedText}`;
65177
65275
  case 211 /* PropertyAccessExpression */:
65178
65276
  case 212 /* ElementAccessExpression */:
65179
65277
  const propName = getAccessedPropertyName(node);
65180
65278
  if (propName !== void 0) {
65181
65279
  const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
65182
- return key && key + "." + propName;
65280
+ return key && `${key}.${propName}`;
65281
+ }
65282
+ if (isElementAccessExpression(node) && isIdentifier(node.argumentExpression)) {
65283
+ const symbol = getResolvedSymbol(node.argumentExpression);
65284
+ if (isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol)) {
65285
+ const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
65286
+ return key && `${key}.@${getSymbolId(symbol)}`;
65287
+ }
65183
65288
  }
65184
65289
  break;
65185
65290
  case 206 /* ObjectBindingPattern */:
@@ -65216,8 +65321,19 @@ function createTypeChecker(host) {
65216
65321
  case 211 /* PropertyAccessExpression */:
65217
65322
  case 212 /* ElementAccessExpression */:
65218
65323
  const sourcePropertyName = getAccessedPropertyName(source);
65219
- const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0;
65220
- return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression);
65324
+ if (sourcePropertyName !== void 0) {
65325
+ const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0;
65326
+ if (targetPropertyName !== void 0) {
65327
+ return targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression);
65328
+ }
65329
+ }
65330
+ if (isElementAccessExpression(source) && isElementAccessExpression(target) && isIdentifier(source.argumentExpression) && isIdentifier(target.argumentExpression)) {
65331
+ const symbol = getResolvedSymbol(source.argumentExpression);
65332
+ if (symbol === getResolvedSymbol(target.argumentExpression) && (isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol))) {
65333
+ return isMatchingReference(source.expression, target.expression);
65334
+ }
65335
+ }
65336
+ break;
65221
65337
  case 166 /* QualifiedName */:
65222
65338
  return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression);
65223
65339
  case 226 /* BinaryExpression */:
@@ -77848,6 +77964,9 @@ function createTypeChecker(host) {
77848
77964
  error(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
77849
77965
  }
77850
77966
  }
77967
+ function checkJSDocImportTag(node) {
77968
+ checkImportAttributes(node);
77969
+ }
77851
77970
  function checkJSDocImplementsTag(node) {
77852
77971
  const classLike = getEffectiveJSDocHost(node);
77853
77972
  if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) {
@@ -81115,7 +81234,8 @@ function createTypeChecker(host) {
81115
81234
  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;
81116
81235
  return grammarErrorOnNode(node, message);
81117
81236
  }
81118
- if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
81237
+ const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly);
81238
+ if (isTypeOnly) {
81119
81239
  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);
81120
81240
  }
81121
81241
  if (override) {
@@ -81566,6 +81686,8 @@ function createTypeChecker(host) {
81566
81686
  return checkJSDocSatisfiesTag(node);
81567
81687
  case 343 /* JSDocThisTag */:
81568
81688
  return checkJSDocThisTag(node);
81689
+ case 351 /* JSDocImportTag */:
81690
+ return checkJSDocImportTag(node);
81569
81691
  case 199 /* IndexedAccessType */:
81570
81692
  return checkIndexedAccessType(node);
81571
81693
  case 200 /* MappedType */:
@@ -82369,7 +82491,7 @@ function createTypeChecker(host) {
82369
82491
  return void 0;
82370
82492
  case 11 /* StringLiteral */:
82371
82493
  case 15 /* NoSubstitutionTemplateLiteral */:
82372
- 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(
82494
+ 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(
82373
82495
  node.parent,
82374
82496
  /*requireStringLiteralLikeArgument*/
82375
82497
  false
@@ -86510,13 +86632,13 @@ var visitEachChildTable = {
86510
86632
  );
86511
86633
  },
86512
86634
  // Transformation nodes
86513
- [353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
86635
+ [354 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
86514
86636
  return context.factory.updatePartiallyEmittedExpression(
86515
86637
  node,
86516
86638
  Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
86517
86639
  );
86518
86640
  },
86519
- [354 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
86641
+ [355 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
86520
86642
  return context.factory.updateCommaListExpression(
86521
86643
  node,
86522
86644
  nodesVisitor(node.elements, visitor, isExpression)
@@ -90173,7 +90295,7 @@ function transformClassFields(context) {
90173
90295
  /*discarded*/
90174
90296
  true
90175
90297
  );
90176
- case 354 /* CommaListExpression */:
90298
+ case 355 /* CommaListExpression */:
90177
90299
  return visitCommaListExpression(
90178
90300
  node,
90179
90301
  /*discarded*/
@@ -93266,7 +93388,7 @@ function transformESDecorators(context) {
93266
93388
  return visitForStatement(node);
93267
93389
  case 244 /* ExpressionStatement */:
93268
93390
  return visitExpressionStatement(node);
93269
- case 354 /* CommaListExpression */:
93391
+ case 355 /* CommaListExpression */:
93270
93392
  return visitCommaListExpression(
93271
93393
  node,
93272
93394
  /*discarded*/
@@ -93278,7 +93400,7 @@ function transformESDecorators(context) {
93278
93400
  /*discarded*/
93279
93401
  false
93280
93402
  );
93281
- case 353 /* PartiallyEmittedExpression */:
93403
+ case 354 /* PartiallyEmittedExpression */:
93282
93404
  return visitPartiallyEmittedExpression(
93283
93405
  node,
93284
93406
  /*discarded*/
@@ -93364,7 +93486,7 @@ function transformESDecorators(context) {
93364
93486
  /*discarded*/
93365
93487
  true
93366
93488
  );
93367
- case 354 /* CommaListExpression */:
93489
+ case 355 /* CommaListExpression */:
93368
93490
  return visitCommaListExpression(
93369
93491
  node,
93370
93492
  /*discarded*/
@@ -95955,7 +96077,7 @@ function transformES2018(context) {
95955
96077
  return visitObjectLiteralExpression(node);
95956
96078
  case 226 /* BinaryExpression */:
95957
96079
  return visitBinaryExpression(node, expressionResultIsUnused2);
95958
- case 354 /* CommaListExpression */:
96080
+ case 355 /* CommaListExpression */:
95959
96081
  return visitCommaListExpression(node, expressionResultIsUnused2);
95960
96082
  case 299 /* CatchClause */:
95961
96083
  return visitCatchClause(node);
@@ -99178,7 +99300,7 @@ function transformES2015(context) {
99178
99300
  return visitParenthesizedExpression(node, expressionResultIsUnused2);
99179
99301
  case 226 /* BinaryExpression */:
99180
99302
  return visitBinaryExpression(node, expressionResultIsUnused2);
99181
- case 354 /* CommaListExpression */:
99303
+ case 355 /* CommaListExpression */:
99182
99304
  return visitCommaListExpression(node, expressionResultIsUnused2);
99183
99305
  case 15 /* NoSubstitutionTemplateLiteral */:
99184
99306
  case 16 /* TemplateHead */:
@@ -102473,7 +102595,7 @@ function transformGenerators(context) {
102473
102595
  switch (node.kind) {
102474
102596
  case 226 /* BinaryExpression */:
102475
102597
  return visitBinaryExpression(node);
102476
- case 354 /* CommaListExpression */:
102598
+ case 355 /* CommaListExpression */:
102477
102599
  return visitCommaListExpression(node);
102478
102600
  case 227 /* ConditionalExpression */:
102479
102601
  return visitConditionalExpression(node);
@@ -104863,7 +104985,7 @@ function transformModule(context) {
104863
104985
  return visitExpressionStatement(node);
104864
104986
  case 217 /* ParenthesizedExpression */:
104865
104987
  return visitParenthesizedExpression(node, valueIsDiscarded);
104866
- case 353 /* PartiallyEmittedExpression */:
104988
+ case 354 /* PartiallyEmittedExpression */:
104867
104989
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
104868
104990
  case 213 /* CallExpression */:
104869
104991
  if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
@@ -107256,7 +107378,7 @@ function transformSystemModule(context) {
107256
107378
  return visitExpressionStatement(node);
107257
107379
  case 217 /* ParenthesizedExpression */:
107258
107380
  return visitParenthesizedExpression(node, valueIsDiscarded);
107259
- case 353 /* PartiallyEmittedExpression */:
107381
+ case 354 /* PartiallyEmittedExpression */:
107260
107382
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
107261
107383
  case 226 /* BinaryExpression */:
107262
107384
  if (isDestructuringAssignment(node)) {
@@ -109269,6 +109391,8 @@ function transformDeclarations(context) {
109269
109391
  }
109270
109392
  if (isDeclaration(input) && isDeclarationAndNotVisible(input))
109271
109393
  return;
109394
+ if (isJSDocImportTag(input))
109395
+ return;
109272
109396
  if (isFunctionLike(input) && resolver.isImplementationOfOverload(input))
109273
109397
  return;
109274
109398
  let previousEnclosingDeclaration;
@@ -109916,7 +110040,7 @@ function noEmitNotification(hint, node, callback) {
109916
110040
  }
109917
110041
  function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
109918
110042
  var _a, _b;
109919
- const enabledSyntaxKindFeatures = new Array(356 /* Count */);
110043
+ const enabledSyntaxKindFeatures = new Array(357 /* Count */);
109920
110044
  let lexicalEnvironmentVariableDeclarations;
109921
110045
  let lexicalEnvironmentFunctionDeclarations;
109922
110046
  let lexicalEnvironmentStatements;
@@ -111484,7 +111608,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111484
111608
  return emitJSDocTypedefTag(node);
111485
111609
  case 347 /* JSDocSeeTag */:
111486
111610
  return emitJSDocSeeTag(node);
111487
- case 352 /* NotEmittedStatement */:
111611
+ case 351 /* JSDocImportTag */:
111612
+ return emitJSDocImportTag(node);
111613
+ case 353 /* NotEmittedStatement */:
111488
111614
  return;
111489
111615
  }
111490
111616
  if (isExpression(node)) {
@@ -111585,15 +111711,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111585
111711
  return emitJsxSelfClosingElement(node);
111586
111712
  case 288 /* JsxFragment */:
111587
111713
  return emitJsxFragment(node);
111588
- case 351 /* SyntaxList */:
111714
+ case 352 /* SyntaxList */:
111589
111715
  return Debug.fail("SyntaxList should not be printed");
111590
- case 352 /* NotEmittedStatement */:
111716
+ case 353 /* NotEmittedStatement */:
111591
111717
  return;
111592
- case 353 /* PartiallyEmittedExpression */:
111718
+ case 354 /* PartiallyEmittedExpression */:
111593
111719
  return emitPartiallyEmittedExpression(node);
111594
- case 354 /* CommaListExpression */:
111720
+ case 355 /* CommaListExpression */:
111595
111721
  return emitCommaList(node);
111596
- case 355 /* SyntheticReferenceExpression */:
111722
+ case 356 /* SyntheticReferenceExpression */:
111597
111723
  return Debug.fail("SyntheticReferenceExpression should not be printed");
111598
111724
  }
111599
111725
  }
@@ -113437,6 +113563,21 @@ function createPrinter(printerOptions = {}, handlers = {}) {
113437
113563
  emit(tag.name);
113438
113564
  emitJSDocComment(tag.comment);
113439
113565
  }
113566
+ function emitJSDocImportTag(tag) {
113567
+ emitJSDocTagName(tag.tagName);
113568
+ writeSpace();
113569
+ if (tag.importClause) {
113570
+ emit(tag.importClause);
113571
+ writeSpace();
113572
+ emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag);
113573
+ writeSpace();
113574
+ }
113575
+ emitExpression(tag.moduleSpecifier);
113576
+ if (tag.attributes) {
113577
+ emitWithLeadingSpace(tag.attributes);
113578
+ }
113579
+ emitJSDocComment(tag.comment);
113580
+ }
113440
113581
  function emitJSDocNameReference(node) {
113441
113582
  writeSpace();
113442
113583
  writePunctuation("{");
@@ -114849,7 +114990,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114849
114990
  emitLeadingComments(
114850
114991
  pos,
114851
114992
  /*isEmittedNode*/
114852
- node.kind !== 352 /* NotEmittedStatement */
114993
+ node.kind !== 353 /* NotEmittedStatement */
114853
114994
  );
114854
114995
  }
114855
114996
  if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
@@ -114873,7 +115014,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114873
115014
  containerPos = savedContainerPos;
114874
115015
  containerEnd = savedContainerEnd;
114875
115016
  declarationListContainerEnd = savedDeclarationListContainerEnd;
114876
- if (!skipTrailingComments && node.kind !== 352 /* NotEmittedStatement */) {
115017
+ if (!skipTrailingComments && node.kind !== 353 /* NotEmittedStatement */) {
114877
115018
  emitTrailingComments(end);
114878
115019
  }
114879
115020
  }
@@ -115125,7 +115266,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115125
115266
  const emitFlags = getEmitFlags(node);
115126
115267
  const sourceMapRange = getSourceMapRange(node);
115127
115268
  const source = sourceMapRange.source || sourceMapSource;
115128
- if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
115269
+ if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
115129
115270
  emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
115130
115271
  }
115131
115272
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
@@ -115138,7 +115279,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115138
115279
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
115139
115280
  sourceMapsDisabled = false;
115140
115281
  }
115141
- if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
115282
+ if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
115142
115283
  emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
115143
115284
  }
115144
115285
  }
@@ -118019,7 +118160,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118019
118160
  );
118020
118161
  }
118021
118162
  if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
118022
- collectDynamicImportOrRequireCalls(file);
118163
+ collectDynamicImportOrRequireOrJsDocImportCalls(file);
118023
118164
  }
118024
118165
  file.imports = imports || emptyArray;
118025
118166
  file.moduleAugmentations = moduleAugmentations || emptyArray;
@@ -118063,7 +118204,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118063
118204
  }
118064
118205
  }
118065
118206
  }
118066
- function collectDynamicImportOrRequireCalls(file2) {
118207
+ function collectDynamicImportOrRequireOrJsDocImportCalls(file2) {
118067
118208
  const r = /import|require/g;
118068
118209
  while (r.exec(file2.text) !== null) {
118069
118210
  const node = getNodeAtPosition(file2, r.lastIndex);
@@ -118092,6 +118233,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118092
118233
  false
118093
118234
  );
118094
118235
  imports = append(imports, node.argument.literal);
118236
+ } else if (isJavaScriptFile && isJSDocImportTag(node)) {
118237
+ const moduleNameExpr = getExternalModuleName(node);
118238
+ if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) {
118239
+ setParentRecursive(
118240
+ node,
118241
+ /*incremental*/
118242
+ false
118243
+ );
118244
+ imports = append(imports, moduleNameExpr);
118245
+ }
118095
118246
  }
118096
118247
  }
118097
118248
  }