@typescript-deploys/pr-build 5.4.0-pr-57230-11 → 5.4.0-pr-57207-3

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/typescript.js CHANGED
@@ -3863,12 +3863,13 @@ ${lanes.join("\n")}
3863
3863
  SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 355] = "JSDocPropertyTag";
3864
3864
  SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 356] = "JSDocThrowsTag";
3865
3865
  SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 357] = "JSDocSatisfiesTag";
3866
- SyntaxKind5[SyntaxKind5["SyntaxList"] = 358] = "SyntaxList";
3867
- SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 359] = "NotEmittedStatement";
3868
- SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 360] = "PartiallyEmittedExpression";
3869
- SyntaxKind5[SyntaxKind5["CommaListExpression"] = 361] = "CommaListExpression";
3870
- SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 362] = "SyntheticReferenceExpression";
3871
- SyntaxKind5[SyntaxKind5["Count"] = 363] = "Count";
3866
+ SyntaxKind5[SyntaxKind5["JSDocImportTypeTag"] = 358] = "JSDocImportTypeTag";
3867
+ SyntaxKind5[SyntaxKind5["SyntaxList"] = 359] = "SyntaxList";
3868
+ SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 360] = "NotEmittedStatement";
3869
+ SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 361] = "PartiallyEmittedExpression";
3870
+ SyntaxKind5[SyntaxKind5["CommaListExpression"] = 362] = "CommaListExpression";
3871
+ SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression";
3872
+ SyntaxKind5[SyntaxKind5["Count"] = 364] = "Count";
3872
3873
  SyntaxKind5[SyntaxKind5["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
3873
3874
  SyntaxKind5[SyntaxKind5["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
3874
3875
  SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -3897,9 +3898,9 @@ ${lanes.join("\n")}
3897
3898
  SyntaxKind5[SyntaxKind5["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement";
3898
3899
  SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
3899
3900
  SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 316 /* JSDocTypeExpression */] = "FirstJSDocNode";
3900
- SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocNode";
3901
+ SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 358 /* JSDocImportTypeTag */] = "LastJSDocNode";
3901
3902
  SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 334 /* JSDocTag */] = "FirstJSDocTagNode";
3902
- SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocTagNode";
3903
+ SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 358 /* JSDocImportTypeTag */] = "LastJSDocTagNode";
3903
3904
  SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword";
3904
3905
  SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
3905
3906
  return SyntaxKind5;
@@ -12590,8 +12591,8 @@ ${lanes.join("\n")}
12590
12591
  case 230 /* SpreadElement */:
12591
12592
  case 234 /* AsExpression */:
12592
12593
  case 232 /* OmittedExpression */:
12593
- case 361 /* CommaListExpression */:
12594
- case 360 /* PartiallyEmittedExpression */:
12594
+ case 362 /* CommaListExpression */:
12595
+ case 361 /* PartiallyEmittedExpression */:
12595
12596
  case 238 /* SatisfiesExpression */:
12596
12597
  return true;
12597
12598
  default:
@@ -12776,7 +12777,7 @@ ${lanes.join("\n")}
12776
12777
  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 */;
12777
12778
  }
12778
12779
  function isStatementKindButNotDeclarationKind(kind) {
12779
- 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 === 359 /* NotEmittedStatement */;
12780
+ 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 === 360 /* NotEmittedStatement */;
12780
12781
  }
12781
12782
  function isDeclaration(node) {
12782
12783
  if (node.kind === 168 /* TypeParameter */) {
@@ -12837,13 +12838,13 @@ ${lanes.join("\n")}
12837
12838
  return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */;
12838
12839
  }
12839
12840
  function isJSDocNode(node) {
12840
- return node.kind >= 316 /* FirstJSDocNode */ && node.kind <= 357 /* LastJSDocNode */;
12841
+ return node.kind >= 316 /* FirstJSDocNode */ && node.kind <= 358 /* LastJSDocNode */;
12841
12842
  }
12842
12843
  function isJSDocCommentContainingNode(node) {
12843
12844
  return node.kind === 327 /* JSDoc */ || node.kind === 326 /* JSDocNamepathType */ || node.kind === 328 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
12844
12845
  }
12845
12846
  function isJSDocTag(node) {
12846
- return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <= 357 /* LastJSDocTagNode */;
12847
+ return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <= 358 /* LastJSDocTagNode */;
12847
12848
  }
12848
12849
  function isSetAccessor(node) {
12849
12850
  return node.kind === 178 /* SetAccessor */;
@@ -13345,7 +13346,7 @@ ${lanes.join("\n")}
13345
13346
  if (includeJsDoc && hasJSDocNodes(node)) {
13346
13347
  return getTokenPosOfNode(node.jsDoc[0], sourceFile);
13347
13348
  }
13348
- if (node.kind === 358 /* SyntaxList */ && node._children.length > 0) {
13349
+ if (node.kind === 359 /* SyntaxList */ && node._children.length > 0) {
13349
13350
  return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
13350
13351
  }
13351
13352
  return skipTrivia(
@@ -14971,6 +14972,7 @@ ${lanes.join("\n")}
14971
14972
  ))) == null ? void 0 : _a.arguments[0];
14972
14973
  case 272 /* ImportDeclaration */:
14973
14974
  case 278 /* ExportDeclaration */:
14975
+ case 358 /* JSDocImportTypeTag */:
14974
14976
  return tryCast(node.moduleSpecifier, isStringLiteralLike);
14975
14977
  case 271 /* ImportEqualsDeclaration */:
14976
14978
  return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
@@ -14995,6 +14997,7 @@ ${lanes.join("\n")}
14995
14997
  switch (node.parent.kind) {
14996
14998
  case 272 /* ImportDeclaration */:
14997
14999
  case 278 /* ExportDeclaration */:
15000
+ case 358 /* JSDocImportTypeTag */:
14998
15001
  return node.parent;
14999
15002
  case 283 /* ExternalModuleReference */:
15000
15003
  return node.parent.parent;
@@ -15015,6 +15018,7 @@ ${lanes.join("\n")}
15015
15018
  switch (node.kind) {
15016
15019
  case 272 /* ImportDeclaration */:
15017
15020
  case 278 /* ExportDeclaration */:
15021
+ case 358 /* JSDocImportTypeTag */:
15018
15022
  return node.moduleSpecifier;
15019
15023
  case 271 /* ImportEqualsDeclaration */:
15020
15024
  return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
@@ -15884,7 +15888,7 @@ ${lanes.join("\n")}
15884
15888
  }
15885
15889
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
15886
15890
  switch (nodeKind) {
15887
- case 361 /* CommaListExpression */:
15891
+ case 362 /* CommaListExpression */:
15888
15892
  return 0 /* Comma */;
15889
15893
  case 230 /* SpreadElement */:
15890
15894
  return 1 /* Spread */;
@@ -17562,7 +17566,7 @@ ${lanes.join("\n")}
17562
17566
  case 212 /* ElementAccessExpression */:
17563
17567
  case 211 /* PropertyAccessExpression */:
17564
17568
  case 235 /* NonNullExpression */:
17565
- case 360 /* PartiallyEmittedExpression */:
17569
+ case 361 /* PartiallyEmittedExpression */:
17566
17570
  case 238 /* SatisfiesExpression */:
17567
17571
  node = node.expression;
17568
17572
  continue;
@@ -18705,7 +18709,7 @@ ${lanes.join("\n")}
18705
18709
  return parent2.types;
18706
18710
  case 189 /* TupleType */:
18707
18711
  case 209 /* ArrayLiteralExpression */:
18708
- case 361 /* CommaListExpression */:
18712
+ case 362 /* CommaListExpression */:
18709
18713
  case 275 /* NamedImports */:
18710
18714
  case 279 /* NamedExports */:
18711
18715
  return parent2.elements;
@@ -20722,6 +20726,8 @@ ${lanes.join("\n")}
20722
20726
  updateJSDocImplementsTag,
20723
20727
  createJSDocSeeTag,
20724
20728
  updateJSDocSeeTag,
20729
+ createJSDocImportTypeTag,
20730
+ updateJSDocImportTypeTag,
20725
20731
  createJSDocNameReference,
20726
20732
  updateJSDocNameReference,
20727
20733
  createJSDocMemberName,
@@ -23500,6 +23506,16 @@ ${lanes.join("\n")}
23500
23506
  function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
23501
23507
  return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
23502
23508
  }
23509
+ function createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment) {
23510
+ const node = createBaseJSDocTag(358 /* JSDocImportTypeTag */, tagName ?? createIdentifier("importType"), comment);
23511
+ node.importClause = importClause;
23512
+ node.moduleSpecifier = moduleSpecifier;
23513
+ node.comment = comment;
23514
+ return node;
23515
+ }
23516
+ function updateJSDocImportTypeTag(node, tagName, importClause, moduleSpecifier, comment) {
23517
+ return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier ? update(createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment), node) : node;
23518
+ }
23503
23519
  function createJSDocText(text) {
23504
23520
  const node = createBaseNode(328 /* JSDocText */);
23505
23521
  node.text = text;
@@ -23938,18 +23954,18 @@ ${lanes.join("\n")}
23938
23954
  return node;
23939
23955
  }
23940
23956
  function createSyntaxList3(children) {
23941
- const node = createBaseNode(358 /* SyntaxList */);
23957
+ const node = createBaseNode(359 /* SyntaxList */);
23942
23958
  node._children = children;
23943
23959
  return node;
23944
23960
  }
23945
23961
  function createNotEmittedStatement(original) {
23946
- const node = createBaseNode(359 /* NotEmittedStatement */);
23962
+ const node = createBaseNode(360 /* NotEmittedStatement */);
23947
23963
  node.original = original;
23948
23964
  setTextRange(node, original);
23949
23965
  return node;
23950
23966
  }
23951
23967
  function createPartiallyEmittedExpression(expression, original) {
23952
- const node = createBaseNode(360 /* PartiallyEmittedExpression */);
23968
+ const node = createBaseNode(361 /* PartiallyEmittedExpression */);
23953
23969
  node.expression = expression;
23954
23970
  node.original = original;
23955
23971
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -23971,7 +23987,7 @@ ${lanes.join("\n")}
23971
23987
  return node;
23972
23988
  }
23973
23989
  function createCommaListExpression(elements) {
23974
- const node = createBaseNode(361 /* CommaListExpression */);
23990
+ const node = createBaseNode(362 /* CommaListExpression */);
23975
23991
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
23976
23992
  node.transformFlags |= propagateChildrenFlags(node.elements);
23977
23993
  return node;
@@ -23980,7 +23996,7 @@ ${lanes.join("\n")}
23980
23996
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
23981
23997
  }
23982
23998
  function createSyntheticReferenceExpression(expression, thisArg) {
23983
- const node = createBaseNode(362 /* SyntheticReferenceExpression */);
23999
+ const node = createBaseNode(363 /* SyntheticReferenceExpression */);
23984
24000
  node.expression = expression;
23985
24001
  node.thisArg = thisArg;
23986
24002
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -24226,7 +24242,7 @@ ${lanes.join("\n")}
24226
24242
  return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
24227
24243
  case 235 /* NonNullExpression */:
24228
24244
  return updateNonNullExpression(outerExpression, expression);
24229
- case 360 /* PartiallyEmittedExpression */:
24245
+ case 361 /* PartiallyEmittedExpression */:
24230
24246
  return updatePartiallyEmittedExpression(outerExpression, expression);
24231
24247
  }
24232
24248
  }
@@ -24636,6 +24652,8 @@ ${lanes.join("\n")}
24636
24652
  return "augments";
24637
24653
  case 336 /* JSDocImplementsTag */:
24638
24654
  return "implements";
24655
+ case 358 /* JSDocImportTypeTag */:
24656
+ return "importType";
24639
24657
  default:
24640
24658
  return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
24641
24659
  }
@@ -24774,7 +24792,7 @@ ${lanes.join("\n")}
24774
24792
  case 216 /* TypeAssertionExpression */:
24775
24793
  case 238 /* SatisfiesExpression */:
24776
24794
  case 234 /* AsExpression */:
24777
- case 360 /* PartiallyEmittedExpression */:
24795
+ case 361 /* PartiallyEmittedExpression */:
24778
24796
  case 217 /* ParenthesizedExpression */:
24779
24797
  case 108 /* SuperKeyword */:
24780
24798
  return -2147483648 /* OuterExpressionExcludes */;
@@ -26802,10 +26820,10 @@ ${lanes.join("\n")}
26802
26820
  return node.kind === 237 /* SyntheticExpression */;
26803
26821
  }
26804
26822
  function isPartiallyEmittedExpression(node) {
26805
- return node.kind === 360 /* PartiallyEmittedExpression */;
26823
+ return node.kind === 361 /* PartiallyEmittedExpression */;
26806
26824
  }
26807
26825
  function isCommaListExpression(node) {
26808
- return node.kind === 361 /* CommaListExpression */;
26826
+ return node.kind === 362 /* CommaListExpression */;
26809
26827
  }
26810
26828
  function isTemplateSpan(node) {
26811
26829
  return node.kind === 239 /* TemplateSpan */;
@@ -26955,10 +26973,10 @@ ${lanes.join("\n")}
26955
26973
  return node.kind === 282 /* MissingDeclaration */;
26956
26974
  }
26957
26975
  function isNotEmittedStatement(node) {
26958
- return node.kind === 359 /* NotEmittedStatement */;
26976
+ return node.kind === 360 /* NotEmittedStatement */;
26959
26977
  }
26960
26978
  function isSyntheticReference(node) {
26961
- return node.kind === 362 /* SyntheticReferenceExpression */;
26979
+ return node.kind === 363 /* SyntheticReferenceExpression */;
26962
26980
  }
26963
26981
  function isExternalModuleReference(node) {
26964
26982
  return node.kind === 283 /* ExternalModuleReference */;
@@ -27158,8 +27176,11 @@ ${lanes.join("\n")}
27158
27176
  function isJSDocThrowsTag(node) {
27159
27177
  return node.kind === 356 /* JSDocThrowsTag */;
27160
27178
  }
27179
+ function isJSDocImportTypeTag(node) {
27180
+ return node.kind === 358 /* JSDocImportTypeTag */;
27181
+ }
27161
27182
  function isSyntaxList(n) {
27162
- return n.kind === 358 /* SyntaxList */;
27183
+ return n.kind === 359 /* SyntaxList */;
27163
27184
  }
27164
27185
  var init_nodeTests = __esm({
27165
27186
  "src/compiler/factory/nodeTests.ts"() {
@@ -27560,7 +27581,7 @@ ${lanes.join("\n")}
27560
27581
  return (kinds & 2 /* TypeAssertions */) !== 0;
27561
27582
  case 235 /* NonNullExpression */:
27562
27583
  return (kinds & 4 /* NonNullAssertions */) !== 0;
27563
- case 360 /* PartiallyEmittedExpression */:
27584
+ case 361 /* PartiallyEmittedExpression */:
27564
27585
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
27565
27586
  }
27566
27587
  return false;
@@ -28372,6 +28393,9 @@ ${lanes.join("\n")}
28372
28393
  function forEachChildInJSDocTag(node, cbNode, cbNodes) {
28373
28394
  return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
28374
28395
  }
28396
+ function forEachChildInJSDocImportTypeTag(node, cbNode, cbNodes) {
28397
+ return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
28398
+ }
28375
28399
  function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
28376
28400
  return visitNode2(cbNode, node.expression);
28377
28401
  }
@@ -29080,7 +29104,7 @@ ${lanes.join("\n")}
29080
29104
  [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
29081
29105
  return visitNodes(cbNode, cbNodes, node.modifiers);
29082
29106
  },
29083
- [361 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
29107
+ [362 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
29084
29108
  return visitNodes(cbNode, cbNodes, node.elements);
29085
29109
  },
29086
29110
  [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -29175,7 +29199,8 @@ ${lanes.join("\n")}
29175
29199
  [343 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
29176
29200
  [338 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
29177
29201
  [344 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
29178
- [360 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
29202
+ [358 /* JSDocImportTypeTag */]: forEachChildInJSDocImportTypeTag,
29203
+ [361 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
29179
29204
  };
29180
29205
  ((Parser2) => {
29181
29206
  var scanner2 = createScanner(
@@ -35290,6 +35315,9 @@ ${lanes.join("\n")}
35290
35315
  case "throws":
35291
35316
  tag = parseThrowsTag(start2, tagName, margin, indentText);
35292
35317
  break;
35318
+ case "importType":
35319
+ tag = parseImportTypeTag(start2, tagName, margin, indentText);
35320
+ break;
35293
35321
  default:
35294
35322
  tag = parseUnknownTag(start2, tagName, margin, indentText);
35295
35323
  break;
@@ -35609,6 +35637,27 @@ ${lanes.join("\n")}
35609
35637
  const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
35610
35638
  return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
35611
35639
  }
35640
+ function parseImportTypeTag(start2, tagName, margin, indentText) {
35641
+ const afterImportTypeTagPos = scanner2.getTokenFullStart();
35642
+ let identifier;
35643
+ if (isIdentifier2()) {
35644
+ identifier = parseIdentifier();
35645
+ }
35646
+ let importClause;
35647
+ if (identifier || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */) {
35648
+ importClause = parseImportClause(
35649
+ identifier,
35650
+ afterImportTypeTagPos,
35651
+ /*isTypeOnly*/
35652
+ true
35653
+ );
35654
+ parseExpected(161 /* FromKeyword */);
35655
+ }
35656
+ Debug.assert(importClause);
35657
+ const moduleSpecifier = parseModuleSpecifier();
35658
+ const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
35659
+ return finishNode(factory2.createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comments2), start2);
35660
+ }
35612
35661
  function parseExpressionWithTypeArgumentsForAugments() {
35613
35662
  const usedBrace = parseOptional(19 /* OpenBraceToken */);
35614
35663
  const pos = getNodePos();
@@ -49410,7 +49459,7 @@ ${lanes.join("\n")}
49410
49459
  return ambientModule;
49411
49460
  }
49412
49461
  const currentSourceFile = getSourceFileOfNode(location);
49413
- 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(
49462
+ 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) && isJSDocImportTypeTag(location) ? location.moduleSpecifier : void 0) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
49414
49463
  location.initializer,
49415
49464
  /*requireStringLiteralLikeArgument*/
49416
49465
  true
@@ -53711,6 +53760,7 @@ ${lanes.join("\n")}
53711
53760
  case 273 /* ImportClause */: {
53712
53761
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
53713
53762
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
53763
+ const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
53714
53764
  addResult(
53715
53765
  factory.createImportDeclaration(
53716
53766
  /*modifiers*/
@@ -53723,7 +53773,7 @@ ${lanes.join("\n")}
53723
53773
  void 0
53724
53774
  ),
53725
53775
  specifier2,
53726
- node.parent.attributes
53776
+ attributes
53727
53777
  ),
53728
53778
  0 /* None */
53729
53779
  );
@@ -53732,6 +53782,7 @@ ${lanes.join("\n")}
53732
53782
  case 274 /* NamespaceImport */: {
53733
53783
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
53734
53784
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
53785
+ const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
53735
53786
  addResult(
53736
53787
  factory.createImportDeclaration(
53737
53788
  /*modifiers*/
@@ -53744,7 +53795,7 @@ ${lanes.join("\n")}
53744
53795
  factory.createNamespaceImport(factory.createIdentifier(localName))
53745
53796
  ),
53746
53797
  specifier2,
53747
- node.parent.attributes
53798
+ attributes
53748
53799
  ),
53749
53800
  0 /* None */
53750
53801
  );
@@ -53766,6 +53817,7 @@ ${lanes.join("\n")}
53766
53817
  case 276 /* ImportSpecifier */: {
53767
53818
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
53768
53819
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
53820
+ const attributes = isImportDeclaration(node.parent.parent.parent) ? node.parent.parent.parent.attributes : void 0;
53769
53821
  addResult(
53770
53822
  factory.createImportDeclaration(
53771
53823
  /*modifiers*/
@@ -53785,7 +53837,7 @@ ${lanes.join("\n")}
53785
53837
  ])
53786
53838
  ),
53787
53839
  specifier2,
53788
- node.parent.parent.parent.attributes
53840
+ attributes
53789
53841
  ),
53790
53842
  0 /* None */
53791
53843
  );
@@ -85046,7 +85098,7 @@ ${lanes.join("\n")}
85046
85098
  return void 0;
85047
85099
  case 11 /* StringLiteral */:
85048
85100
  case 15 /* NoSubstitutionTemplateLiteral */:
85049
- 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(
85101
+ 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) && isJSDocImportTypeTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
85050
85102
  node.parent,
85051
85103
  /*requireStringLiteralLikeArgument*/
85052
85104
  false
@@ -89424,13 +89476,13 @@ ${lanes.join("\n")}
89424
89476
  );
89425
89477
  },
89426
89478
  // Transformation nodes
89427
- [360 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
89479
+ [361 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
89428
89480
  return context.factory.updatePartiallyEmittedExpression(
89429
89481
  node,
89430
89482
  Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
89431
89483
  );
89432
89484
  },
89433
- [361 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
89485
+ [362 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
89434
89486
  return context.factory.updateCommaListExpression(
89435
89487
  node,
89436
89488
  nodesVisitor(node.elements, visitor, isExpression)
@@ -93300,7 +93352,7 @@ ${lanes.join("\n")}
93300
93352
  /*discarded*/
93301
93353
  true
93302
93354
  );
93303
- case 361 /* CommaListExpression */:
93355
+ case 362 /* CommaListExpression */:
93304
93356
  return visitCommaListExpression(
93305
93357
  node,
93306
93358
  /*discarded*/
@@ -96411,7 +96463,7 @@ ${lanes.join("\n")}
96411
96463
  return visitForStatement(node);
96412
96464
  case 244 /* ExpressionStatement */:
96413
96465
  return visitExpressionStatement(node);
96414
- case 361 /* CommaListExpression */:
96466
+ case 362 /* CommaListExpression */:
96415
96467
  return visitCommaListExpression(
96416
96468
  node,
96417
96469
  /*discarded*/
@@ -96423,7 +96475,7 @@ ${lanes.join("\n")}
96423
96475
  /*discarded*/
96424
96476
  false
96425
96477
  );
96426
- case 360 /* PartiallyEmittedExpression */:
96478
+ case 361 /* PartiallyEmittedExpression */:
96427
96479
  return visitPartiallyEmittedExpression(
96428
96480
  node,
96429
96481
  /*discarded*/
@@ -96509,7 +96561,7 @@ ${lanes.join("\n")}
96509
96561
  /*discarded*/
96510
96562
  true
96511
96563
  );
96512
- case 361 /* CommaListExpression */:
96564
+ case 362 /* CommaListExpression */:
96513
96565
  return visitCommaListExpression(
96514
96566
  node,
96515
96567
  /*discarded*/
@@ -99112,7 +99164,7 @@ ${lanes.join("\n")}
99112
99164
  return visitObjectLiteralExpression(node);
99113
99165
  case 226 /* BinaryExpression */:
99114
99166
  return visitBinaryExpression(node, expressionResultIsUnused2);
99115
- case 361 /* CommaListExpression */:
99167
+ case 362 /* CommaListExpression */:
99116
99168
  return visitCommaListExpression(node, expressionResultIsUnused2);
99117
99169
  case 299 /* CatchClause */:
99118
99170
  return visitCatchClause(node);
@@ -102378,7 +102430,7 @@ ${lanes.join("\n")}
102378
102430
  return visitParenthesizedExpression(node, expressionResultIsUnused2);
102379
102431
  case 226 /* BinaryExpression */:
102380
102432
  return visitBinaryExpression(node, expressionResultIsUnused2);
102381
- case 361 /* CommaListExpression */:
102433
+ case 362 /* CommaListExpression */:
102382
102434
  return visitCommaListExpression(node, expressionResultIsUnused2);
102383
102435
  case 15 /* NoSubstitutionTemplateLiteral */:
102384
102436
  case 16 /* TemplateHead */:
@@ -105756,7 +105808,7 @@ ${lanes.join("\n")}
105756
105808
  switch (node.kind) {
105757
105809
  case 226 /* BinaryExpression */:
105758
105810
  return visitBinaryExpression(node);
105759
- case 361 /* CommaListExpression */:
105811
+ case 362 /* CommaListExpression */:
105760
105812
  return visitCommaListExpression(node);
105761
105813
  case 227 /* ConditionalExpression */:
105762
105814
  return visitConditionalExpression(node);
@@ -108142,7 +108194,7 @@ ${lanes.join("\n")}
108142
108194
  return visitExpressionStatement(node);
108143
108195
  case 217 /* ParenthesizedExpression */:
108144
108196
  return visitParenthesizedExpression(node, valueIsDiscarded);
108145
- case 360 /* PartiallyEmittedExpression */:
108197
+ case 361 /* PartiallyEmittedExpression */:
108146
108198
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
108147
108199
  case 213 /* CallExpression */:
108148
108200
  if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
@@ -110553,7 +110605,7 @@ ${lanes.join("\n")}
110553
110605
  return visitExpressionStatement(node);
110554
110606
  case 217 /* ParenthesizedExpression */:
110555
110607
  return visitParenthesizedExpression(node, valueIsDiscarded);
110556
- case 360 /* PartiallyEmittedExpression */:
110608
+ case 361 /* PartiallyEmittedExpression */:
110557
110609
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
110558
110610
  case 226 /* BinaryExpression */:
110559
110611
  if (isDestructuringAssignment(node)) {
@@ -112692,6 +112744,8 @@ ${lanes.join("\n")}
112692
112744
  }
112693
112745
  if (isDeclaration(input) && isDeclarationAndNotVisible(input))
112694
112746
  return;
112747
+ if (isJSDocImportTypeTag(input))
112748
+ return;
112695
112749
  if (isFunctionLike(input) && resolver.isImplementationOfOverload(input))
112696
112750
  return;
112697
112751
  let previousEnclosingDeclaration;
@@ -113350,7 +113404,7 @@ ${lanes.join("\n")}
113350
113404
  }
113351
113405
  function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
113352
113406
  var _a, _b;
113353
- const enabledSyntaxKindFeatures = new Array(363 /* Count */);
113407
+ const enabledSyntaxKindFeatures = new Array(364 /* Count */);
113354
113408
  let lexicalEnvironmentVariableDeclarations;
113355
113409
  let lexicalEnvironmentFunctionDeclarations;
113356
113410
  let lexicalEnvironmentStatements;
@@ -115211,7 +115265,9 @@ ${lanes.join("\n")}
115211
115265
  return emitJSDocTypedefTag(node);
115212
115266
  case 354 /* JSDocSeeTag */:
115213
115267
  return emitJSDocSeeTag(node);
115214
- case 359 /* NotEmittedStatement */:
115268
+ case 358 /* JSDocImportTypeTag */:
115269
+ return emitJSDocImportTypeTag(node);
115270
+ case 360 /* NotEmittedStatement */:
115215
115271
  return;
115216
115272
  }
115217
115273
  if (isExpression(node)) {
@@ -115312,15 +115368,15 @@ ${lanes.join("\n")}
115312
115368
  return emitJsxSelfClosingElement(node);
115313
115369
  case 288 /* JsxFragment */:
115314
115370
  return emitJsxFragment(node);
115315
- case 358 /* SyntaxList */:
115371
+ case 359 /* SyntaxList */:
115316
115372
  return Debug.fail("SyntaxList should not be printed");
115317
- case 359 /* NotEmittedStatement */:
115373
+ case 360 /* NotEmittedStatement */:
115318
115374
  return;
115319
- case 360 /* PartiallyEmittedExpression */:
115375
+ case 361 /* PartiallyEmittedExpression */:
115320
115376
  return emitPartiallyEmittedExpression(node);
115321
- case 361 /* CommaListExpression */:
115377
+ case 362 /* CommaListExpression */:
115322
115378
  return emitCommaList(node);
115323
- case 362 /* SyntheticReferenceExpression */:
115379
+ case 363 /* SyntheticReferenceExpression */:
115324
115380
  return Debug.fail("SyntheticReferenceExpression should not be printed");
115325
115381
  }
115326
115382
  }
@@ -117218,6 +117274,16 @@ ${lanes.join("\n")}
117218
117274
  emit(tag.name);
117219
117275
  emitJSDocComment(tag.comment);
117220
117276
  }
117277
+ function emitJSDocImportTypeTag(tag) {
117278
+ emitJSDocTagName(tag.tagName);
117279
+ writeSpace();
117280
+ emit(tag.importClause);
117281
+ writeSpace();
117282
+ emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag);
117283
+ writeSpace();
117284
+ emitExpression(tag.moduleSpecifier);
117285
+ emitJSDocComment(tag.comment);
117286
+ }
117221
117287
  function emitJSDocNameReference(node) {
117222
117288
  writeSpace();
117223
117289
  writePunctuation("{");
@@ -118717,7 +118783,7 @@ ${lanes.join("\n")}
118717
118783
  emitLeadingComments(
118718
118784
  pos,
118719
118785
  /*isEmittedNode*/
118720
- node.kind !== 359 /* NotEmittedStatement */
118786
+ node.kind !== 360 /* NotEmittedStatement */
118721
118787
  );
118722
118788
  }
118723
118789
  if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
@@ -118741,7 +118807,7 @@ ${lanes.join("\n")}
118741
118807
  containerPos = savedContainerPos;
118742
118808
  containerEnd = savedContainerEnd;
118743
118809
  declarationListContainerEnd = savedDeclarationListContainerEnd;
118744
- if (!skipTrailingComments && node.kind !== 359 /* NotEmittedStatement */) {
118810
+ if (!skipTrailingComments && node.kind !== 360 /* NotEmittedStatement */) {
118745
118811
  emitTrailingComments(end);
118746
118812
  }
118747
118813
  }
@@ -119013,7 +119079,7 @@ ${lanes.join("\n")}
119013
119079
  }
119014
119080
  } else {
119015
119081
  const source = sourceMapRange.source || sourceMapSource;
119016
- if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
119082
+ if (node.kind !== 360 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
119017
119083
  emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
119018
119084
  }
119019
119085
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
@@ -119028,7 +119094,7 @@ ${lanes.join("\n")}
119028
119094
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
119029
119095
  sourceMapsDisabled = false;
119030
119096
  }
119031
- if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
119097
+ if (node.kind !== 360 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
119032
119098
  emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
119033
119099
  }
119034
119100
  }
@@ -121914,6 +121980,9 @@ ${lanes.join("\n")}
121914
121980
  if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
121915
121981
  collectDynamicImportOrRequireCalls(file);
121916
121982
  }
121983
+ if (isJavaScriptFile) {
121984
+ collectJsDocImportTypeReferences(file);
121985
+ }
121917
121986
  file.imports = imports || emptyArray;
121918
121987
  file.moduleAugmentations = moduleAugmentations || emptyArray;
121919
121988
  file.ambientModuleNames = ambientModules || emptyArray;
@@ -121988,6 +122057,23 @@ ${lanes.join("\n")}
121988
122057
  }
121989
122058
  }
121990
122059
  }
122060
+ function collectJsDocImportTypeReferences(file2) {
122061
+ const r = /@importType/g;
122062
+ while (r.exec(file2.text) !== null) {
122063
+ const node = getNodeAtPosition(file2, r.lastIndex);
122064
+ if (isJSDocImportTypeTag(node)) {
122065
+ const moduleNameExpr = getExternalModuleName(node);
122066
+ if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) {
122067
+ setParentRecursive(
122068
+ node,
122069
+ /*incremental*/
122070
+ false
122071
+ );
122072
+ imports = append(imports, moduleNameExpr);
122073
+ }
122074
+ }
122075
+ }
122076
+ }
121991
122077
  function getNodeAtPosition(sourceFile, position) {
121992
122078
  let current = sourceFile;
121993
122079
  const getContainingChild = (child) => {
@@ -132418,7 +132504,7 @@ ${lanes.join("\n")}
132418
132504
  });
132419
132505
  }
132420
132506
  function isModuleSpecifierLike(node) {
132421
- return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) || isRequireCall(
132507
+ return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) || isJSDocImportTypeTag(node.parent) || isRequireCall(
132422
132508
  node.parent,
132423
132509
  /*requireStringLiteralLikeArgument*/
132424
132510
  false
@@ -138351,7 +138437,8 @@ ${lanes.join("\n")}
138351
138437
  factory.createIdentifier(name)
138352
138438
  ));
138353
138439
  });
138354
- const importDecl = toConvert.parent.parent;
138440
+ const importDecl = tryCast(toConvert.parent.parent, isImportDeclaration);
138441
+ Debug.assert(importDecl, "Unexpected declaration");
138355
138442
  if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports) {
138356
138443
  changes.insertNodeAfter(sourceFile, importDecl, updateImport(
138357
138444
  importDecl,
@@ -138371,7 +138458,10 @@ ${lanes.join("\n")}
138371
138458
  }
138372
138459
  function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConvert, shouldUseDefault = getShouldUseDefault(program, toConvert.parent)) {
138373
138460
  const checker = program.getTypeChecker();
138374
- const importDecl = toConvert.parent.parent;
138461
+ const importDecl = tryCast(toConvert.parent.parent, isImportDeclaration);
138462
+ if (importDecl === void 0) {
138463
+ Debug.assert(importDecl, "Unexpected declaration");
138464
+ }
138375
138465
  const { moduleSpecifier } = importDecl;
138376
138466
  const toConvertSymbols = /* @__PURE__ */ new Set();
138377
138467
  toConvert.elements.forEach((namedImport) => {
@@ -143907,7 +143997,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
143907
143997
  }
143908
143998
  }
143909
143999
  function createSyntaxList(nodes, parent2) {
143910
- const list = createNode(358 /* SyntaxList */, nodes.pos, nodes.end, parent2);
144000
+ const list = createNode(359 /* SyntaxList */, nodes.pos, nodes.end, parent2);
143911
144001
  list._children = [];
143912
144002
  let pos = nodes.pos;
143913
144003
  for (const node of nodes) {
@@ -145436,7 +145526,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
145436
145526
  if (!children.length) {
145437
145527
  return void 0;
145438
145528
  }
145439
- const child = find(children, (kid) => kid.kind < 316 /* FirstJSDocNode */ || kid.kind > 357 /* LastJSDocNode */);
145529
+ const child = find(children, (kid) => kid.kind < 316 /* FirstJSDocNode */ || kid.kind > 358 /* LastJSDocNode */);
145440
145530
  return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
145441
145531
  }
145442
145532
  getLastToken(sourceFile) {
@@ -149846,7 +149936,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149846
149936
  const declaration = getDeclaration2(context.sourceFile, context.span.start);
149847
149937
  if (declaration) {
149848
149938
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration));
149849
- const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0;
149939
+ const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && isImportDeclaration(declaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0;
149850
149940
  const mainAction = createCodeFixAction(
149851
149941
  fixId13,
149852
149942
  changes,
@@ -149872,7 +149962,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149872
149962
  if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 272 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) {
149873
149963
  doChange11(changes, diag2.file, errorDeclaration);
149874
149964
  fixedImportDeclarations.add(errorDeclaration);
149875
- } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) {
149965
+ } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && isImportDeclaration(errorDeclaration.parent.parent.parent) && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) {
149876
149966
  doChange11(changes, diag2.file, errorDeclaration.parent.parent.parent);
149877
149967
  fixedImportDeclarations.add(errorDeclaration.parent.parent.parent);
149878
149968
  } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */) {
@@ -157287,7 +157377,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157287
157377
  const { parent: parent2 } = name;
157288
157378
  if (isImportEqualsDeclaration(parent2) && isExternalModuleReference(parent2.moduleReference)) {
157289
157379
  return { importNode: parent2, name, moduleSpecifier: parent2.moduleReference.expression };
157290
- } else if (isNamespaceImport(parent2)) {
157380
+ } else if (isNamespaceImport(parent2) && isImportDeclaration(parent2.parent.parent)) {
157291
157381
  const importNode = parent2.parent.parent;
157292
157382
  return { importNode, name, moduleSpecifier: importNode.moduleSpecifier };
157293
157383
  }
@@ -159915,6 +160005,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159915
160005
  const insideComment = isInComment(sourceFile, position, currentToken);
159916
160006
  log("getCompletionData: Is inside comment: " + (timestamp() - start));
159917
160007
  let insideJsDocTagTypeExpression = false;
160008
+ let insideJsDocImportTypeTag = false;
159918
160009
  let isInSnippetScope = false;
159919
160010
  if (insideComment) {
159920
160011
  if (hasDocComment(sourceFile, position)) {
@@ -159932,24 +160023,28 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159932
160023
  if (tag.tagName.pos <= position && position <= tag.tagName.end) {
159933
160024
  return { kind: 1 /* JsDocTagName */ };
159934
160025
  }
159935
- const typeExpression = tryGetTypeExpressionFromTag(tag);
159936
- if (typeExpression) {
159937
- currentToken = getTokenAtPosition(sourceFile, position);
159938
- if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 355 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
159939
- insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
160026
+ if (isJSDocImportTypeTag(tag)) {
160027
+ insideJsDocImportTypeTag = true;
160028
+ } else {
160029
+ const typeExpression = tryGetTypeExpressionFromTag(tag);
160030
+ if (typeExpression) {
160031
+ currentToken = getTokenAtPosition(sourceFile, position);
160032
+ if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 355 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
160033
+ insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
160034
+ }
160035
+ }
160036
+ if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {
160037
+ return { kind: 3 /* JsDocParameterName */, tag };
159940
160038
  }
159941
- }
159942
- if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {
159943
- return { kind: 3 /* JsDocParameterName */, tag };
159944
160039
  }
159945
160040
  }
159946
- if (!insideJsDocTagTypeExpression) {
160041
+ if (!insideJsDocTagTypeExpression && !insideJsDocImportTypeTag) {
159947
160042
  log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");
159948
160043
  return void 0;
159949
160044
  }
159950
160045
  }
159951
160046
  start = timestamp();
159952
- const isJsOnlyLocation = !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile);
160047
+ const isJsOnlyLocation = !insideJsDocTagTypeExpression && !insideJsDocImportTypeTag && isSourceFileJS(sourceFile);
159953
160048
  const tokens = getRelevantTokens(position, sourceFile);
159954
160049
  const previousToken = tokens.previousToken;
159955
160050
  let contextToken = tokens.contextToken;
@@ -160462,7 +160557,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160462
160557
  }
160463
160558
  }
160464
160559
  function isTypeOnlyCompletion() {
160465
- return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
160560
+ return insideJsDocTagTypeExpression || insideJsDocImportTypeTag || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
160466
160561
  }
160467
160562
  function isContextTokenValueLocation(contextToken2) {
160468
160563
  return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */);
@@ -161471,7 +161566,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
161471
161566
  }
161472
161567
  function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
161473
161568
  switch (location.kind) {
161474
- case 358 /* SyntaxList */:
161569
+ case 359 /* SyntaxList */:
161475
161570
  return tryCast(location.parent, isObjectTypeDeclaration);
161476
161571
  case 1 /* EndOfFileToken */:
161477
161572
  const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration);
@@ -161702,13 +161797,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
161702
161797
  var _a;
161703
161798
  if (!node)
161704
161799
  return void 0;
161705
- const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)) ?? node;
161800
+ const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration, isJSDocImportTypeTag)) ?? node;
161706
161801
  const sourceFile = top.getSourceFile();
161707
161802
  if (rangeIsOnSingleLine(top, sourceFile)) {
161708
161803
  return createTextSpanFromNode(top, sourceFile);
161709
161804
  }
161710
161805
  Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 276 /* ImportSpecifier */);
161711
- const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference;
161806
+ const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ || top.kind === 358 /* JSDocImportTypeTag */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference;
161712
161807
  const withoutModuleSpecifier = {
161713
161808
  pos: top.getFirstToken().getStart(),
161714
161809
  end: potentialSplitPoint.pos
@@ -162070,6 +162165,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162070
162165
  case 272 /* ImportDeclaration */:
162071
162166
  case 278 /* ExportDeclaration */:
162072
162167
  case 283 /* ExternalModuleReference */:
162168
+ case 358 /* JSDocImportTypeTag */:
162073
162169
  return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) };
162074
162170
  case 296 /* CaseClause */:
162075
162171
  const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses);
@@ -162849,6 +162945,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162849
162945
  );
162850
162946
  break;
162851
162947
  case 272 /* ImportDeclaration */:
162948
+ case 358 /* JSDocImportTypeTag */:
162852
162949
  directImports.push(direct);
162853
162950
  const namedBindings = direct.importClause && direct.importClause.namedBindings;
162854
162951
  if (namedBindings && namedBindings.kind === 274 /* NamespaceImport */) {
@@ -166984,6 +167081,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166984
167081
  "host",
166985
167082
  "ignore",
166986
167083
  "implements",
167084
+ "importType",
166987
167085
  "inheritdoc",
166988
167086
  "inner",
166989
167087
  "instance",
@@ -187356,6 +187454,7 @@ ${e.message}`;
187356
187454
  isJSDocEnumTag: () => isJSDocEnumTag,
187357
187455
  isJSDocFunctionType: () => isJSDocFunctionType,
187358
187456
  isJSDocImplementsTag: () => isJSDocImplementsTag,
187457
+ isJSDocImportTypeTag: () => isJSDocImportTypeTag,
187359
187458
  isJSDocIndexSignature: () => isJSDocIndexSignature,
187360
187459
  isJSDocLikeText: () => isJSDocLikeText,
187361
187460
  isJSDocLink: () => isJSDocLink,
@@ -189777,6 +189876,7 @@ ${e.message}`;
189777
189876
  isJSDocEnumTag: () => isJSDocEnumTag,
189778
189877
  isJSDocFunctionType: () => isJSDocFunctionType,
189779
189878
  isJSDocImplementsTag: () => isJSDocImplementsTag,
189879
+ isJSDocImportTypeTag: () => isJSDocImportTypeTag,
189780
189880
  isJSDocIndexSignature: () => isJSDocIndexSignature,
189781
189881
  isJSDocLikeText: () => isJSDocLikeText,
189782
189882
  isJSDocLink: () => isJSDocLink,