typescript 5.0.0-dev.20230120 → 5.0.0-dev.20230121

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
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-dev.20230120`;
26
+ var version = `${versionMajorMinor}.0-dev.20230121`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -6087,7 +6087,6 @@ var Diagnostics = {
6087
6087
  An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
6088
6088
  Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
6089
6089
  Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"),
6090
- Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."),
6091
6090
  Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."),
6092
6091
  Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."),
6093
6092
  Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
@@ -10614,19 +10613,31 @@ function isTemplateMiddleOrTemplateTail(node) {
10614
10613
  function isImportOrExportSpecifier(node) {
10615
10614
  return isImportSpecifier(node) || isExportSpecifier(node);
10616
10615
  }
10617
- function isTypeOnlyImportOrExportDeclaration(node) {
10616
+ function isTypeOnlyImportDeclaration(node) {
10618
10617
  switch (node.kind) {
10619
10618
  case 273 /* ImportSpecifier */:
10620
- case 278 /* ExportSpecifier */:
10621
10619
  return node.isTypeOnly || node.parent.parent.isTypeOnly;
10622
10620
  case 271 /* NamespaceImport */:
10623
10621
  return node.parent.isTypeOnly;
10624
10622
  case 270 /* ImportClause */:
10625
10623
  case 268 /* ImportEqualsDeclaration */:
10626
10624
  return node.isTypeOnly;
10627
- default:
10628
- return false;
10629
10625
  }
10626
+ return false;
10627
+ }
10628
+ function isTypeOnlyExportDeclaration(node) {
10629
+ switch (node.kind) {
10630
+ case 278 /* ExportSpecifier */:
10631
+ return node.isTypeOnly || node.parent.parent.isTypeOnly;
10632
+ case 275 /* ExportDeclaration */:
10633
+ return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause;
10634
+ case 277 /* NamespaceExport */:
10635
+ return node.parent.isTypeOnly;
10636
+ }
10637
+ return false;
10638
+ }
10639
+ function isTypeOnlyImportOrExportDeclaration(node) {
10640
+ return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
10630
10641
  }
10631
10642
  function isAssertionKey(node) {
10632
10643
  return isStringLiteral(node) || isIdentifier(node);
@@ -10941,8 +10952,7 @@ function isUnaryExpressionKind(kind) {
10941
10952
  }
10942
10953
  }
10943
10954
  function isLiteralTypeLiteral(node) {
10944
- node = skipPartiallyEmittedExpressions(node);
10945
- switch (skipPartiallyEmittedExpressions(node).kind) {
10955
+ switch (node.kind) {
10946
10956
  case 104 /* NullKeyword */:
10947
10957
  case 110 /* TrueKeyword */:
10948
10958
  case 95 /* FalseKeyword */:
@@ -13168,7 +13178,7 @@ function isSpecialPropertyDeclaration(expr) {
13168
13178
  }
13169
13179
  function setValueDeclaration(symbol, node) {
13170
13180
  const { valueDeclaration } = symbol;
13171
- if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) {
13181
+ if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) {
13172
13182
  symbol.valueDeclaration = node;
13173
13183
  }
13174
13184
  }
@@ -15148,14 +15158,14 @@ function directoryProbablyExists(directoryName, host) {
15148
15158
  }
15149
15159
  var carriageReturnLineFeed = "\r\n";
15150
15160
  var lineFeed = "\n";
15151
- function getNewLineCharacter(options, getNewLine) {
15161
+ function getNewLineCharacter(options) {
15152
15162
  switch (options.newLine) {
15153
15163
  case 0 /* CarriageReturnLineFeed */:
15154
15164
  return carriageReturnLineFeed;
15155
15165
  case 1 /* LineFeed */:
15166
+ case void 0:
15156
15167
  return lineFeed;
15157
15168
  }
15158
- return getNewLine ? getNewLine() : sys ? sys.newLine : carriageReturnLineFeed;
15159
15169
  }
15160
15170
  function createRange(pos, end = pos) {
15161
15171
  Debug.assert(end >= pos || end === -1);
@@ -24544,12 +24554,21 @@ function canHaveIllegalModifiers(node) {
24544
24554
  const kind = node.kind;
24545
24555
  return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
24546
24556
  }
24547
- var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
24548
- var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken);
24549
- var isIdentifierOrThisTypeNode = or(isIdentifier, isThisTypeNode);
24550
- var isReadonlyKeywordOrPlusOrMinusToken = or(isReadonlyKeyword, isPlusToken, isMinusToken);
24551
- var isQuestionOrPlusOrMinusToken = or(isQuestionToken, isPlusToken, isMinusToken);
24552
- var isModuleName = or(isIdentifier, isStringLiteral);
24557
+ function isQuestionOrExclamationToken(node) {
24558
+ return isQuestionToken(node) || isExclamationToken(node);
24559
+ }
24560
+ function isIdentifierOrThisTypeNode(node) {
24561
+ return isIdentifier(node) || isThisTypeNode(node);
24562
+ }
24563
+ function isReadonlyKeywordOrPlusOrMinusToken(node) {
24564
+ return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node);
24565
+ }
24566
+ function isQuestionOrPlusOrMinusToken(node) {
24567
+ return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node);
24568
+ }
24569
+ function isModuleName(node) {
24570
+ return isIdentifier(node) || isStringLiteral(node);
24571
+ }
24553
24572
  function isExponentiationOperator(kind) {
24554
24573
  return kind === 42 /* AsteriskAsteriskToken */;
24555
24574
  }
@@ -33776,7 +33795,7 @@ var commandOptionsWithoutBuild = [
33776
33795
  paramType: Diagnostics.NEWLINE,
33777
33796
  category: Diagnostics.Emit,
33778
33797
  description: Diagnostics.Set_the_newline_character_for_emitting_files,
33779
- defaultValueDescription: Diagnostics.Platform_specific
33798
+ defaultValueDescription: "lf"
33780
33799
  },
33781
33800
  {
33782
33801
  name: "noErrorTruncation",
@@ -33952,7 +33971,7 @@ var commandOptionsWithoutBuild = [
33952
33971
  affectsModuleResolution: true,
33953
33972
  category: Diagnostics.Interop_Constraints,
33954
33973
  description: Diagnostics.Ensure_that_casing_is_correct_in_imports,
33955
- defaultValueDescription: false
33974
+ defaultValueDescription: true
33956
33975
  },
33957
33976
  {
33958
33977
  name: "maxNodeModuleJsDepth",
@@ -34076,14 +34095,6 @@ var buildOpts = [
34076
34095
  ...optionsForBuild
34077
34096
  ];
34078
34097
  var typeAcquisitionDeclarations = [
34079
- {
34080
- /* @deprecated typingOptions.enableAutoDiscovery
34081
- * Use typeAcquisition.enable instead.
34082
- */
34083
- name: "enableAutoDiscovery",
34084
- type: "boolean",
34085
- defaultValueDescription: false
34086
- },
34087
34098
  {
34088
34099
  name: "enable",
34089
34100
  type: "boolean",
@@ -34138,16 +34149,6 @@ var defaultInitCompilerOptions = {
34138
34149
  forceConsistentCasingInFileNames: true,
34139
34150
  skipLibCheck: true
34140
34151
  };
34141
- function convertEnableAutoDiscoveryToEnable(typeAcquisition) {
34142
- if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== void 0 && typeAcquisition.enable === void 0) {
34143
- return {
34144
- enable: typeAcquisition.enableAutoDiscovery,
34145
- include: typeAcquisition.include || [],
34146
- exclude: typeAcquisition.exclude || []
34147
- };
34148
- }
34149
- return typeAcquisition;
34150
- }
34151
34152
  function createCompilerDiagnosticForInvalidCustomType(opt) {
34152
34153
  return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic);
34153
34154
  }
@@ -34518,12 +34519,6 @@ function getTsconfigRootOptionsMap() {
34518
34519
  elementOptions: getCommandLineWatchOptionsMap(),
34519
34520
  extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics
34520
34521
  },
34521
- {
34522
- name: "typingOptions",
34523
- type: "object",
34524
- elementOptions: getCommandLineTypeAcquisitionMap(),
34525
- extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
34526
- },
34527
34522
  {
34528
34523
  name: "typeAcquisition",
34529
34524
  type: "object",
@@ -35356,7 +35351,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
35356
35351
  errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
35357
35352
  }
35358
35353
  const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName);
35359
- const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName);
35354
+ const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName);
35360
35355
  const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors);
35361
35356
  json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
35362
35357
  let extendedConfigPath;
@@ -35383,7 +35378,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
35383
35378
  }
35384
35379
  function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) {
35385
35380
  const options = getDefaultCompilerOptions(configFileName);
35386
- let typeAcquisition, typingOptionstypeAcquisition;
35381
+ let typeAcquisition;
35387
35382
  let watchOptions;
35388
35383
  let extendedConfigPath;
35389
35384
  let rootCompilerOptions;
@@ -35400,9 +35395,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
35400
35395
  case "typeAcquisition":
35401
35396
  currentOption = typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName));
35402
35397
  break;
35403
- case "typingOptions":
35404
- currentOption = typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName));
35405
- break;
35406
35398
  default:
35407
35399
  Debug.fail("Unknown option");
35408
35400
  }
@@ -35455,15 +35447,7 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
35455
35447
  optionsIterator
35456
35448
  );
35457
35449
  if (!typeAcquisition) {
35458
- if (typingOptionstypeAcquisition) {
35459
- typeAcquisition = typingOptionstypeAcquisition.enableAutoDiscovery !== void 0 ? {
35460
- enable: typingOptionstypeAcquisition.enableAutoDiscovery,
35461
- include: typingOptionstypeAcquisition.include,
35462
- exclude: typingOptionstypeAcquisition.exclude
35463
- } : typingOptionstypeAcquisition;
35464
- } else {
35465
- typeAcquisition = getDefaultTypeAcquisition(configFileName);
35466
- }
35450
+ typeAcquisition = getDefaultTypeAcquisition(configFileName);
35467
35451
  }
35468
35452
  if (rootCompilerOptions && json && json.compilerOptions === void 0) {
35469
35453
  errors.push(createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, getTextOfPropertyName(rootCompilerOptions[0])));
@@ -35559,8 +35543,7 @@ function getDefaultTypeAcquisition(configFileName) {
35559
35543
  }
35560
35544
  function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
35561
35545
  const options = getDefaultTypeAcquisition(configFileName);
35562
- const typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions);
35563
- convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors);
35546
+ convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors);
35564
35547
  return options;
35565
35548
  }
35566
35549
  function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) {
@@ -39912,6 +39895,9 @@ function createBinder() {
39912
39895
  function checkContextualIdentifier(node) {
39913
39896
  if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) {
39914
39897
  const originalKeywordKind = identifierToKeywordKind(node);
39898
+ if (originalKeywordKind === void 0) {
39899
+ return;
39900
+ }
39915
39901
  if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) {
39916
39902
  file.bindDiagnostics.push(createDiagnosticForNode2(
39917
39903
  node,
@@ -43870,7 +43856,7 @@ function createTypeChecker(host) {
43870
43856
  if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) {
43871
43857
  const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */);
43872
43858
  if (typeOnlyDeclaration) {
43873
- const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
43859
+ const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
43874
43860
  const unescapedName = unescapeLeadingUnderscores(name);
43875
43861
  addTypeOnlyDeclarationRelatedInfo(
43876
43862
  error(errorLocation, message, unescapedName),
@@ -43890,7 +43876,7 @@ function createTypeChecker(host) {
43890
43876
  diagnostic,
43891
43877
  createDiagnosticForNode(
43892
43878
  typeOnlyDeclaration,
43893
- typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
43879
+ typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
43894
43880
  unescapedName
43895
43881
  )
43896
43882
  );
@@ -44269,10 +44255,10 @@ function createTypeChecker(host) {
44269
44255
  false
44270
44256
  ) && !node.isTypeOnly) {
44271
44257
  const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node));
44272
- const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */;
44258
+ const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */;
44273
44259
  const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
44274
44260
  const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
44275
- const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
44261
+ const name = typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
44276
44262
  addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
44277
44263
  }
44278
44264
  }
@@ -44504,15 +44490,19 @@ function createTypeChecker(host) {
44504
44490
  return result;
44505
44491
  }
44506
44492
  function getExportOfModule(symbol, name, specifier, dontResolveAlias) {
44493
+ var _a2;
44507
44494
  if (symbol.flags & 1536 /* Module */) {
44508
44495
  const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);
44509
44496
  const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
44497
+ const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText);
44510
44498
  markSymbolOfAliasDeclarationIfTypeOnly(
44511
44499
  specifier,
44512
44500
  exportSymbol,
44513
44501
  resolved,
44514
44502
  /*overwriteEmpty*/
44515
- false
44503
+ false,
44504
+ exportStarDeclaration,
44505
+ name.escapedText
44516
44506
  );
44517
44507
  return resolved;
44518
44508
  }
@@ -44839,7 +44829,7 @@ function createTypeChecker(host) {
44839
44829
  }
44840
44830
  return flags;
44841
44831
  }
44842
- function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
44832
+ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) {
44843
44833
  if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration))
44844
44834
  return false;
44845
44835
  const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration);
@@ -44848,6 +44838,14 @@ function createTypeChecker(host) {
44848
44838
  links2.typeOnlyDeclaration = aliasDeclaration;
44849
44839
  return true;
44850
44840
  }
44841
+ if (exportStarDeclaration) {
44842
+ const links2 = getSymbolLinks(sourceSymbol);
44843
+ links2.typeOnlyDeclaration = exportStarDeclaration;
44844
+ if (sourceSymbol.escapedName !== exportStarName) {
44845
+ links2.typeOnlyExportStarName = exportStarName;
44846
+ }
44847
+ return true;
44848
+ }
44851
44849
  const links = getSymbolLinks(sourceSymbol);
44852
44850
  return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);
44853
44851
  }
@@ -44869,7 +44867,8 @@ function createTypeChecker(host) {
44869
44867
  return links.typeOnlyDeclaration || void 0;
44870
44868
  }
44871
44869
  if (links.typeOnlyDeclaration) {
44872
- return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0;
44870
+ const resolved = links.typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol);
44871
+ return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
44873
44872
  }
44874
44873
  return void 0;
44875
44874
  }
@@ -45527,7 +45526,12 @@ function createTypeChecker(host) {
45527
45526
  }
45528
45527
  function getExportsOfModule(moduleSymbol) {
45529
45528
  const links = getSymbolLinks(moduleSymbol);
45530
- return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol));
45529
+ if (!links.resolvedExports) {
45530
+ const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
45531
+ links.resolvedExports = exports;
45532
+ links.typeOnlyExportStarMap = typeOnlyExportStarMap;
45533
+ }
45534
+ return links.resolvedExports;
45531
45535
  }
45532
45536
  function extendExportSymbols(target, source, lookupTable, exportNode) {
45533
45537
  if (!source)
@@ -45555,9 +45559,21 @@ function createTypeChecker(host) {
45555
45559
  }
45556
45560
  function getExportsOfModuleWorker(moduleSymbol) {
45557
45561
  const visitedSymbols = [];
45562
+ let typeOnlyExportStarMap;
45563
+ const nonTypeOnlyNames = /* @__PURE__ */ new Set();
45558
45564
  moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
45559
- return visit(moduleSymbol) || emptySymbols;
45560
- function visit(symbol) {
45565
+ const exports = visit(moduleSymbol) || emptySymbols;
45566
+ if (typeOnlyExportStarMap) {
45567
+ nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name));
45568
+ }
45569
+ return {
45570
+ exports,
45571
+ typeOnlyExportStarMap
45572
+ };
45573
+ function visit(symbol, exportStar, isTypeOnly) {
45574
+ if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) {
45575
+ symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name));
45576
+ }
45561
45577
  if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) {
45562
45578
  return;
45563
45579
  }
@@ -45569,7 +45585,7 @@ function createTypeChecker(host) {
45569
45585
  if (exportStars.declarations) {
45570
45586
  for (const node of exportStars.declarations) {
45571
45587
  const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
45572
- const exportedSymbols = visit(resolvedModule);
45588
+ const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly);
45573
45589
  extendExportSymbols(
45574
45590
  nestedSymbols,
45575
45591
  exportedSymbols,
@@ -45593,6 +45609,13 @@ function createTypeChecker(host) {
45593
45609
  });
45594
45610
  extendExportSymbols(symbols, nestedSymbols);
45595
45611
  }
45612
+ if (exportStar == null ? void 0 : exportStar.isTypeOnly) {
45613
+ typeOnlyExportStarMap != null ? typeOnlyExportStarMap : typeOnlyExportStarMap = /* @__PURE__ */ new Map();
45614
+ symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set(
45615
+ escapedName,
45616
+ exportStar
45617
+ ));
45618
+ }
45596
45619
  return symbols;
45597
45620
  }
45598
45621
  }
@@ -48675,7 +48698,7 @@ function createTypeChecker(host) {
48675
48698
  /*modifiers*/
48676
48699
  void 0,
48677
48700
  /*isTypeOnly*/
48678
- false,
48701
+ node.isTypeOnly,
48679
48702
  /*exportClause*/
48680
48703
  void 0,
48681
48704
  factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context))
@@ -51819,7 +51842,7 @@ function createTypeChecker(host) {
51819
51842
  const links = getSymbolLinks(symbol);
51820
51843
  if (!links[resolutionKind]) {
51821
51844
  const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */;
51822
- const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) : symbol.exports;
51845
+ const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports;
51823
51846
  links[resolutionKind] = earlySymbols || emptySymbols;
51824
51847
  const lateSymbols = createSymbolTable();
51825
51848
  for (const decl of symbol.declarations || emptyArray) {
@@ -72277,7 +72300,14 @@ function createTypeChecker(host) {
72277
72300
  if (checkForDisallowedESSymbolOperand(operator)) {
72278
72301
  leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left));
72279
72302
  rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right));
72280
- reportOperatorErrorUnless((left2, right2) => isTypeComparableTo(left2, right2) || isTypeComparableTo(right2, left2) || isTypeAssignableTo(left2, numberOrBigIntType) && isTypeAssignableTo(right2, numberOrBigIntType));
72303
+ reportOperatorErrorUnless((left2, right2) => {
72304
+ if (isTypeAny(left2) || isTypeAny(right2)) {
72305
+ return true;
72306
+ }
72307
+ const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
72308
+ const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
72309
+ return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2);
72310
+ });
72281
72311
  }
72282
72312
  return booleanType;
72283
72313
  case 34 /* EqualsEqualsToken */:
@@ -78119,12 +78149,8 @@ function createTypeChecker(host) {
78119
78149
  }
78120
78150
  function checkGrammarExportDeclaration(node) {
78121
78151
  var _a2;
78122
- if (node.isTypeOnly) {
78123
- if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) {
78124
- return checkGrammarNamedImportsOrExports(node.exportClause);
78125
- } else {
78126
- return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type);
78127
- }
78152
+ if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) {
78153
+ return checkGrammarNamedImportsOrExports(node.exportClause);
78128
78154
  }
78129
78155
  return false;
78130
78156
  }
@@ -105682,7 +105708,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
105682
105708
  const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0;
105683
105709
  const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0;
105684
105710
  const emitterDiagnostics = createDiagnosticCollection();
105685
- const newLine = getNewLineCharacter(compilerOptions, () => host.getNewLine());
105711
+ const newLine = getNewLineCharacter(compilerOptions);
105686
105712
  const writer = createTextWriter(newLine);
105687
105713
  const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint");
105688
105714
  let bundleBuildInfo;
@@ -106182,7 +106208,6 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
106182
106208
  getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory),
106183
106209
  getCompilerOptions: () => config.options,
106184
106210
  getCurrentDirectory: () => host.getCurrentDirectory(),
106185
- getNewLine: () => host.getNewLine(),
106186
106211
  getSourceFile: returnUndefined,
106187
106212
  getSourceFileByPath: returnUndefined,
106188
106213
  getSourceFiles: () => sourceFilesForJsEmit,
@@ -111488,7 +111513,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys) {
111488
111513
  function getDefaultLibLocation() {
111489
111514
  return getDirectoryPath(normalizePath(system.getExecutingFilePath()));
111490
111515
  }
111491
- const newLine = getNewLineCharacter(options, () => system.newLine);
111516
+ const newLine = getNewLineCharacter(options);
111492
111517
  const realpath = system.realpath && ((path) => system.realpath(path));
111493
111518
  const compilerHost = {
111494
111519
  getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
@@ -112981,7 +113006,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
112981
113006
  getCommonSourceDirectory: program.getCommonSourceDirectory,
112982
113007
  getCompilerOptions: program.getCompilerOptions,
112983
113008
  getCurrentDirectory: () => currentDirectory,
112984
- getNewLine: () => host.getNewLine(),
112985
113009
  getSourceFile: program.getSourceFile,
112986
113010
  getSourceFileByPath: program.getSourceFileByPath,
112987
113011
  getSourceFiles: program.getSourceFiles,
@@ -113805,7 +113829,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
113805
113829
  if (filesByName.has(path)) {
113806
113830
  const file2 = filesByName.get(path);
113807
113831
  addFileIncludeReason(file2 || void 0, reason);
113808
- if (file2 && options.forceConsistentCasingInFileNames) {
113832
+ if (file2 && !(options.forceConsistentCasingInFileNames === false)) {
113809
113833
  const checkedName = file2.fileName;
113810
113834
  const isRedirect = toPath3(checkedName) !== toPath3(fileName);
113811
113835
  if (isRedirect) {
@@ -114555,16 +114579,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
114555
114579
  }
114556
114580
  }
114557
114581
  }
114558
- function verifyDeprecatedCompilerOptions() {
114582
+ function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) {
114559
114583
  const version2 = typeScriptVersion2 || versionMajorMinor;
114560
114584
  const ignoreDeprecations = options.ignoreDeprecations;
114561
114585
  if (ignoreDeprecations) {
114562
114586
  if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) {
114563
114587
  return;
114564
- } else {
114588
+ } else if (reportInvalidIgnoreDeprecations) {
114565
114589
  createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations);
114566
114590
  }
114567
114591
  }
114592
+ return version2;
114593
+ }
114594
+ function verifyDeprecatedCompilerOptions() {
114595
+ const version2 = getVersionForDeprecationDiagnostics(
114596
+ /*reportInvalidIgnoreDeprecations*/
114597
+ true
114598
+ );
114599
+ if (!version2)
114600
+ return;
114568
114601
  if (options.target === 0 /* ES3 */) {
114569
114602
  createDeprecatedDiagnosticForOption(version2, "target", "ES3");
114570
114603
  }
@@ -114608,65 +114641,64 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
114608
114641
  );
114609
114642
  }
114610
114643
  }
114611
- function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) {
114612
- if (version2 === "6.0" /* v6_0 */) {
114613
- if (useInstead) {
114614
- const details = chainDiagnosticMessages(
114615
- /*details*/
114616
- void 0,
114617
- Diagnostics.Use_0_instead,
114618
- useInstead
114619
- );
114620
- const chain = chainDiagnosticMessages(details, Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
114621
- createDiagnosticForOption(
114622
- /*onKey*/
114623
- !value,
114624
- name,
114625
- /*option2*/
114626
- void 0,
114627
- chain
114628
- );
114629
- } else {
114630
- createDiagnosticForOption(
114631
- /*onKey*/
114632
- !value,
114633
- name,
114634
- /*option2*/
114635
- void 0,
114636
- Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration,
114637
- value || name
114644
+ function verifyDeprecatedProjectReference(ref, parentFile, index) {
114645
+ if (ref.prepend) {
114646
+ const version2 = getVersionForDeprecationDiagnostics(
114647
+ /*reportInvalidIgnoreDeprecations*/
114648
+ false
114649
+ );
114650
+ if (version2) {
114651
+ createDeprecatedOptionForVersionDiagnostic(
114652
+ version2,
114653
+ (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2),
114654
+ "prepend"
114638
114655
  );
114639
114656
  }
114657
+ }
114658
+ }
114659
+ function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) {
114660
+ return createDeprecatedOptionForVersionDiagnostic(
114661
+ version2,
114662
+ (message, arg0, arg1, arg2) => {
114663
+ if (useInstead) {
114664
+ const details = chainDiagnosticMessages(
114665
+ /*details*/
114666
+ void 0,
114667
+ Diagnostics.Use_0_instead,
114668
+ useInstead
114669
+ );
114670
+ const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2);
114671
+ createDiagnosticForOption(
114672
+ /*onKey*/
114673
+ !value,
114674
+ name,
114675
+ /*option2*/
114676
+ void 0,
114677
+ chain
114678
+ );
114679
+ } else {
114680
+ createDiagnosticForOption(
114681
+ /*onKey*/
114682
+ !value,
114683
+ name,
114684
+ /*option2*/
114685
+ void 0,
114686
+ message,
114687
+ arg0,
114688
+ arg1,
114689
+ arg2
114690
+ );
114691
+ }
114692
+ },
114693
+ name,
114694
+ value
114695
+ );
114696
+ }
114697
+ function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) {
114698
+ if (version2 === "6.0" /* v6_0 */) {
114699
+ createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
114640
114700
  } else {
114641
- if (useInstead) {
114642
- const details = chainDiagnosticMessages(
114643
- /*details*/
114644
- void 0,
114645
- Diagnostics.Use_0_instead,
114646
- useInstead
114647
- );
114648
- const chain = chainDiagnosticMessages(details, Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */);
114649
- createDiagnosticForOption(
114650
- /*onKey*/
114651
- !value,
114652
- name,
114653
- /*option2*/
114654
- void 0,
114655
- chain
114656
- );
114657
- } else {
114658
- createDiagnosticForOption(
114659
- /*onKey*/
114660
- !value,
114661
- name,
114662
- /*option2*/
114663
- void 0,
114664
- Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error,
114665
- value || name,
114666
- "5.5" /* v5_5 */,
114667
- "5.0" /* v5_0 */
114668
- );
114669
- }
114701
+ createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */);
114670
114702
  }
114671
114703
  }
114672
114704
  function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
@@ -114812,6 +114844,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
114812
114844
  forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => {
114813
114845
  const ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index];
114814
114846
  const parentFile = parent && parent.sourceFile;
114847
+ verifyDeprecatedProjectReference(ref, parentFile, index);
114815
114848
  if (!resolvedRef) {
114816
114849
  createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path);
114817
114850
  return;
@@ -114919,15 +114952,15 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
114919
114952
  arg1
114920
114953
  );
114921
114954
  }
114922
- function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
114955
+ function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) {
114923
114956
  const referencesSyntax = firstDefined(
114924
114957
  getTsConfigPropArray(sourceFile || options.configFile, "references"),
114925
114958
  (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0
114926
114959
  );
114927
114960
  if (referencesSyntax && referencesSyntax.elements.length > index) {
114928
- programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1));
114961
+ programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2));
114929
114962
  } else {
114930
- programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1));
114963
+ programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2));
114931
114964
  }
114932
114965
  }
114933
114966
  function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) {
@@ -115236,9 +115269,8 @@ function createPrependNodes(projectReferences, getCommandLine, readFile, host) {
115236
115269
  }
115237
115270
  return nodes || emptyArray;
115238
115271
  }
115239
- function resolveProjectReferencePath(hostOrRef, ref) {
115240
- const passedInRef = ref ? ref : hostOrRef;
115241
- return resolveConfigFileProjectName(passedInRef.path);
115272
+ function resolveProjectReferencePath(ref) {
115273
+ return resolveConfigFileProjectName(ref.path);
115242
115274
  }
115243
115275
  function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) {
115244
115276
  switch (extension) {
@@ -118214,7 +118246,6 @@ function createWatchFactory(host, options) {
118214
118246
  }
118215
118247
  function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
118216
118248
  const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
118217
- const hostGetNewLine = memoize(() => host.getNewLine());
118218
118249
  const compilerHost = {
118219
118250
  getSourceFile: createGetSourceFile(
118220
118251
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
@@ -118232,7 +118263,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
118232
118263
  getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
118233
118264
  useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
118234
118265
  getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames),
118235
- getNewLine: () => getNewLineCharacter(getCompilerOptions(), hostGetNewLine),
118266
+ getNewLine: () => getNewLineCharacter(getCompilerOptions()),
118236
118267
  fileExists: (f) => host.fileExists(f),
118237
118268
  readFile: (f) => host.readFile(f),
118238
118269
  trace: maybeBind(host, host.trace),
@@ -118318,7 +118349,7 @@ function createWatchCompilerHost(system = sys, createProgram2, reportDiagnostic,
118318
118349
  copyProperties(result, createWatchHost(system, reportWatchStatus2));
118319
118350
  result.afterProgramCreate = (builderProgram) => {
118320
118351
  const compilerOptions = builderProgram.getCompilerOptions();
118321
- const newLine = getNewLineCharacter(compilerOptions, () => system.newLine);
118352
+ const newLine = getNewLineCharacter(compilerOptions);
118322
118353
  emitFilesAndReportErrors(
118323
118354
  builderProgram,
118324
118355
  reportDiagnostic,
@@ -118464,7 +118495,7 @@ function createWatchProgram(host) {
118464
118495
  }
118465
118496
  reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode);
118466
118497
  if (configFileName && !host.configFileParsingResult) {
118467
- newLine = getNewLineCharacter(optionsToExtendForConfigFile, () => host.getNewLine());
118498
+ newLine = getNewLineCharacter(optionsToExtendForConfigFile);
118468
118499
  Debug.assert(!rootFileNames);
118469
118500
  parseConfigFile2();
118470
118501
  newLine = updateNewLine();
@@ -118660,7 +118691,7 @@ function createWatchProgram(host) {
118660
118691
  scheduleProgramUpdate();
118661
118692
  }
118662
118693
  function updateNewLine() {
118663
- return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, () => host.getNewLine());
118694
+ return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile);
118664
118695
  }
118665
118696
  function toPath3(fileName) {
118666
118697
  return toPath(fileName, currentDirectory, getCanonicalFileName);