@typescript-deploys/pr-build 5.0.0-pr-52328-29 → 5.0.0-pr-52372-4

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-insiders.20230120`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230123`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -2676,7 +2676,7 @@ var nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerforma
2676
2676
  function tryGetNativePerformanceHooks() {
2677
2677
  return nativePerformanceHooks;
2678
2678
  }
2679
- var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +new Date();
2679
+ var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date();
2680
2680
 
2681
2681
  // src/compiler/perfLogger.ts
2682
2682
  var nullLogger = {
@@ -4028,7 +4028,7 @@ var PollingInterval = /* @__PURE__ */ ((PollingInterval3) => {
4028
4028
  PollingInterval3[PollingInterval3["Low"] = 250] = "Low";
4029
4029
  return PollingInterval3;
4030
4030
  })(PollingInterval || {});
4031
- var missingFileModifiedTime = new Date(0);
4031
+ var missingFileModifiedTime = /* @__PURE__ */ new Date(0);
4032
4032
  function getModifiedTime(host, fileName) {
4033
4033
  return host.getModifiedTime(fileName) || missingFileModifiedTime;
4034
4034
  }
@@ -5123,7 +5123,7 @@ var sys = (() => {
5123
5123
  if (!err) {
5124
5124
  try {
5125
5125
  if ((_a2 = statSync(profilePath)) == null ? void 0 : _a2.isDirectory()) {
5126
- profilePath = _path.join(profilePath, `${new Date().toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`);
5126
+ profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`);
5127
5127
  }
5128
5128
  } catch (e) {
5129
5129
  }
@@ -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
  }
@@ -27413,7 +27432,12 @@ var Parser;
27413
27432
  const name = parseIdentifier();
27414
27433
  let constraint;
27415
27434
  let expression;
27416
- if (parseOptional(94 /* ExtendsKeyword */)) {
27435
+ if (parseOptional(94 /* ExtendsKeyword */) || token() === 58 /* ColonToken */) {
27436
+ if (token() === 58 /* ColonToken */) {
27437
+ parseErrorAtCurrentToken(Diagnostics.Invalid_character);
27438
+ nextToken();
27439
+ constraint = parseType();
27440
+ }
27417
27441
  if (isStartOfType() || !isStartOfExpression()) {
27418
27442
  constraint = parseType();
27419
27443
  } else {
@@ -27700,6 +27724,10 @@ var Parser;
27700
27724
  function parseObjectTypeMembers() {
27701
27725
  let members;
27702
27726
  if (parseExpected(18 /* OpenBraceToken */)) {
27727
+ if (token() === 51 /* BarToken */) {
27728
+ parseErrorAtCurrentToken(Diagnostics.Invalid_character);
27729
+ nextToken();
27730
+ }
27703
27731
  members = parseList(ParsingContext.TypeMembers, parseTypeMember);
27704
27732
  parseExpected(19 /* CloseBraceToken */);
27705
27733
  } else {
@@ -33776,7 +33804,7 @@ var commandOptionsWithoutBuild = [
33776
33804
  paramType: Diagnostics.NEWLINE,
33777
33805
  category: Diagnostics.Emit,
33778
33806
  description: Diagnostics.Set_the_newline_character_for_emitting_files,
33779
- defaultValueDescription: Diagnostics.Platform_specific
33807
+ defaultValueDescription: "lf"
33780
33808
  },
33781
33809
  {
33782
33810
  name: "noErrorTruncation",
@@ -33952,7 +33980,7 @@ var commandOptionsWithoutBuild = [
33952
33980
  affectsModuleResolution: true,
33953
33981
  category: Diagnostics.Interop_Constraints,
33954
33982
  description: Diagnostics.Ensure_that_casing_is_correct_in_imports,
33955
- defaultValueDescription: false
33983
+ defaultValueDescription: true
33956
33984
  },
33957
33985
  {
33958
33986
  name: "maxNodeModuleJsDepth",
@@ -34076,14 +34104,6 @@ var buildOpts = [
34076
34104
  ...optionsForBuild
34077
34105
  ];
34078
34106
  var typeAcquisitionDeclarations = [
34079
- {
34080
- /* @deprecated typingOptions.enableAutoDiscovery
34081
- * Use typeAcquisition.enable instead.
34082
- */
34083
- name: "enableAutoDiscovery",
34084
- type: "boolean",
34085
- defaultValueDescription: false
34086
- },
34087
34107
  {
34088
34108
  name: "enable",
34089
34109
  type: "boolean",
@@ -34138,16 +34158,6 @@ var defaultInitCompilerOptions = {
34138
34158
  forceConsistentCasingInFileNames: true,
34139
34159
  skipLibCheck: true
34140
34160
  };
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
34161
  function createCompilerDiagnosticForInvalidCustomType(opt) {
34152
34162
  return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic);
34153
34163
  }
@@ -34518,12 +34528,6 @@ function getTsconfigRootOptionsMap() {
34518
34528
  elementOptions: getCommandLineWatchOptionsMap(),
34519
34529
  extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics
34520
34530
  },
34521
- {
34522
- name: "typingOptions",
34523
- type: "object",
34524
- elementOptions: getCommandLineTypeAcquisitionMap(),
34525
- extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
34526
- },
34527
34531
  {
34528
34532
  name: "typeAcquisition",
34529
34533
  type: "object",
@@ -35356,7 +35360,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
35356
35360
  errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
35357
35361
  }
35358
35362
  const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName);
35359
- const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName);
35363
+ const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName);
35360
35364
  const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors);
35361
35365
  json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
35362
35366
  let extendedConfigPath;
@@ -35383,7 +35387,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
35383
35387
  }
35384
35388
  function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) {
35385
35389
  const options = getDefaultCompilerOptions(configFileName);
35386
- let typeAcquisition, typingOptionstypeAcquisition;
35390
+ let typeAcquisition;
35387
35391
  let watchOptions;
35388
35392
  let extendedConfigPath;
35389
35393
  let rootCompilerOptions;
@@ -35400,9 +35404,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
35400
35404
  case "typeAcquisition":
35401
35405
  currentOption = typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName));
35402
35406
  break;
35403
- case "typingOptions":
35404
- currentOption = typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName));
35405
- break;
35406
35407
  default:
35407
35408
  Debug.fail("Unknown option");
35408
35409
  }
@@ -35455,15 +35456,7 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
35455
35456
  optionsIterator
35456
35457
  );
35457
35458
  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
- }
35459
+ typeAcquisition = getDefaultTypeAcquisition(configFileName);
35467
35460
  }
35468
35461
  if (rootCompilerOptions && json && json.compilerOptions === void 0) {
35469
35462
  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 +35552,7 @@ function getDefaultTypeAcquisition(configFileName) {
35559
35552
  }
35560
35553
  function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
35561
35554
  const options = getDefaultTypeAcquisition(configFileName);
35562
- const typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions);
35563
- convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors);
35555
+ convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors);
35564
35556
  return options;
35565
35557
  }
35566
35558
  function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) {
@@ -39912,6 +39904,9 @@ function createBinder() {
39912
39904
  function checkContextualIdentifier(node) {
39913
39905
  if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) {
39914
39906
  const originalKeywordKind = identifierToKeywordKind(node);
39907
+ if (originalKeywordKind === void 0) {
39908
+ return;
39909
+ }
39915
39910
  if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) {
39916
39911
  file.bindDiagnostics.push(createDiagnosticForNode2(
39917
39912
  node,
@@ -43870,7 +43865,7 @@ function createTypeChecker(host) {
43870
43865
  if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) {
43871
43866
  const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */);
43872
43867
  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;
43868
+ 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
43869
  const unescapedName = unescapeLeadingUnderscores(name);
43875
43870
  addTypeOnlyDeclarationRelatedInfo(
43876
43871
  error(errorLocation, message, unescapedName),
@@ -43890,7 +43885,7 @@ function createTypeChecker(host) {
43890
43885
  diagnostic,
43891
43886
  createDiagnosticForNode(
43892
43887
  typeOnlyDeclaration,
43893
- typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
43888
+ typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
43894
43889
  unescapedName
43895
43890
  )
43896
43891
  );
@@ -44269,10 +44264,10 @@ function createTypeChecker(host) {
44269
44264
  false
44270
44265
  ) && !node.isTypeOnly) {
44271
44266
  const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node));
44272
- const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */;
44267
+ const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */;
44273
44268
  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
44269
  const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
44275
- const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
44270
+ const name = typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
44276
44271
  addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
44277
44272
  }
44278
44273
  }
@@ -44504,15 +44499,19 @@ function createTypeChecker(host) {
44504
44499
  return result;
44505
44500
  }
44506
44501
  function getExportOfModule(symbol, name, specifier, dontResolveAlias) {
44502
+ var _a2;
44507
44503
  if (symbol.flags & 1536 /* Module */) {
44508
44504
  const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);
44509
44505
  const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
44506
+ const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText);
44510
44507
  markSymbolOfAliasDeclarationIfTypeOnly(
44511
44508
  specifier,
44512
44509
  exportSymbol,
44513
44510
  resolved,
44514
44511
  /*overwriteEmpty*/
44515
- false
44512
+ false,
44513
+ exportStarDeclaration,
44514
+ name.escapedText
44516
44515
  );
44517
44516
  return resolved;
44518
44517
  }
@@ -44839,7 +44838,7 @@ function createTypeChecker(host) {
44839
44838
  }
44840
44839
  return flags;
44841
44840
  }
44842
- function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
44841
+ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) {
44843
44842
  if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration))
44844
44843
  return false;
44845
44844
  const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration);
@@ -44848,6 +44847,14 @@ function createTypeChecker(host) {
44848
44847
  links2.typeOnlyDeclaration = aliasDeclaration;
44849
44848
  return true;
44850
44849
  }
44850
+ if (exportStarDeclaration) {
44851
+ const links2 = getSymbolLinks(sourceSymbol);
44852
+ links2.typeOnlyDeclaration = exportStarDeclaration;
44853
+ if (sourceSymbol.escapedName !== exportStarName) {
44854
+ links2.typeOnlyExportStarName = exportStarName;
44855
+ }
44856
+ return true;
44857
+ }
44851
44858
  const links = getSymbolLinks(sourceSymbol);
44852
44859
  return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);
44853
44860
  }
@@ -44869,7 +44876,8 @@ function createTypeChecker(host) {
44869
44876
  return links.typeOnlyDeclaration || void 0;
44870
44877
  }
44871
44878
  if (links.typeOnlyDeclaration) {
44872
- return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0;
44879
+ const resolved = links.typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol);
44880
+ return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
44873
44881
  }
44874
44882
  return void 0;
44875
44883
  }
@@ -45527,7 +45535,12 @@ function createTypeChecker(host) {
45527
45535
  }
45528
45536
  function getExportsOfModule(moduleSymbol) {
45529
45537
  const links = getSymbolLinks(moduleSymbol);
45530
- return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol));
45538
+ if (!links.resolvedExports) {
45539
+ const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
45540
+ links.resolvedExports = exports;
45541
+ links.typeOnlyExportStarMap = typeOnlyExportStarMap;
45542
+ }
45543
+ return links.resolvedExports;
45531
45544
  }
45532
45545
  function extendExportSymbols(target, source, lookupTable, exportNode) {
45533
45546
  if (!source)
@@ -45555,9 +45568,21 @@ function createTypeChecker(host) {
45555
45568
  }
45556
45569
  function getExportsOfModuleWorker(moduleSymbol) {
45557
45570
  const visitedSymbols = [];
45571
+ let typeOnlyExportStarMap;
45572
+ const nonTypeOnlyNames = /* @__PURE__ */ new Set();
45558
45573
  moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
45559
- return visit(moduleSymbol) || emptySymbols;
45560
- function visit(symbol) {
45574
+ const exports = visit(moduleSymbol) || emptySymbols;
45575
+ if (typeOnlyExportStarMap) {
45576
+ nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name));
45577
+ }
45578
+ return {
45579
+ exports,
45580
+ typeOnlyExportStarMap
45581
+ };
45582
+ function visit(symbol, exportStar, isTypeOnly) {
45583
+ if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) {
45584
+ symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name));
45585
+ }
45561
45586
  if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) {
45562
45587
  return;
45563
45588
  }
@@ -45569,7 +45594,7 @@ function createTypeChecker(host) {
45569
45594
  if (exportStars.declarations) {
45570
45595
  for (const node of exportStars.declarations) {
45571
45596
  const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
45572
- const exportedSymbols = visit(resolvedModule);
45597
+ const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly);
45573
45598
  extendExportSymbols(
45574
45599
  nestedSymbols,
45575
45600
  exportedSymbols,
@@ -45593,6 +45618,13 @@ function createTypeChecker(host) {
45593
45618
  });
45594
45619
  extendExportSymbols(symbols, nestedSymbols);
45595
45620
  }
45621
+ if (exportStar == null ? void 0 : exportStar.isTypeOnly) {
45622
+ typeOnlyExportStarMap != null ? typeOnlyExportStarMap : typeOnlyExportStarMap = /* @__PURE__ */ new Map();
45623
+ symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set(
45624
+ escapedName,
45625
+ exportStar
45626
+ ));
45627
+ }
45596
45628
  return symbols;
45597
45629
  }
45598
45630
  }
@@ -48675,7 +48707,7 @@ function createTypeChecker(host) {
48675
48707
  /*modifiers*/
48676
48708
  void 0,
48677
48709
  /*isTypeOnly*/
48678
- false,
48710
+ node.isTypeOnly,
48679
48711
  /*exportClause*/
48680
48712
  void 0,
48681
48713
  factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context))
@@ -51819,7 +51851,7 @@ function createTypeChecker(host) {
51819
51851
  const links = getSymbolLinks(symbol);
51820
51852
  if (!links[resolutionKind]) {
51821
51853
  const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */;
51822
- const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) : symbol.exports;
51854
+ const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports;
51823
51855
  links[resolutionKind] = earlySymbols || emptySymbols;
51824
51856
  const lateSymbols = createSymbolTable();
51825
51857
  for (const decl of symbol.declarations || emptyArray) {
@@ -72277,7 +72309,14 @@ function createTypeChecker(host) {
72277
72309
  if (checkForDisallowedESSymbolOperand(operator)) {
72278
72310
  leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left));
72279
72311
  rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right));
72280
- reportOperatorErrorUnless((left2, right2) => isTypeComparableTo(left2, right2) || isTypeComparableTo(right2, left2) || isTypeAssignableTo(left2, numberOrBigIntType) && isTypeAssignableTo(right2, numberOrBigIntType));
72312
+ reportOperatorErrorUnless((left2, right2) => {
72313
+ if (isTypeAny(left2) || isTypeAny(right2)) {
72314
+ return true;
72315
+ }
72316
+ const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
72317
+ const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
72318
+ return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2);
72319
+ });
72281
72320
  }
72282
72321
  return booleanType;
72283
72322
  case 34 /* EqualsEqualsToken */:
@@ -78119,12 +78158,8 @@ function createTypeChecker(host) {
78119
78158
  }
78120
78159
  function checkGrammarExportDeclaration(node) {
78121
78160
  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
- }
78161
+ if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) {
78162
+ return checkGrammarNamedImportsOrExports(node.exportClause);
78128
78163
  }
78129
78164
  return false;
78130
78165
  }
@@ -105682,7 +105717,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
105682
105717
  const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0;
105683
105718
  const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0;
105684
105719
  const emitterDiagnostics = createDiagnosticCollection();
105685
- const newLine = getNewLineCharacter(compilerOptions, () => host.getNewLine());
105720
+ const newLine = getNewLineCharacter(compilerOptions);
105686
105721
  const writer = createTextWriter(newLine);
105687
105722
  const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint");
105688
105723
  let bundleBuildInfo;
@@ -106182,7 +106217,6 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
106182
106217
  getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory),
106183
106218
  getCompilerOptions: () => config.options,
106184
106219
  getCurrentDirectory: () => host.getCurrentDirectory(),
106185
- getNewLine: () => host.getNewLine(),
106186
106220
  getSourceFile: returnUndefined,
106187
106221
  getSourceFileByPath: returnUndefined,
106188
106222
  getSourceFiles: () => sourceFilesForJsEmit,
@@ -111488,7 +111522,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys) {
111488
111522
  function getDefaultLibLocation() {
111489
111523
  return getDirectoryPath(normalizePath(system.getExecutingFilePath()));
111490
111524
  }
111491
- const newLine = getNewLineCharacter(options, () => system.newLine);
111525
+ const newLine = getNewLineCharacter(options);
111492
111526
  const realpath = system.realpath && ((path) => system.realpath(path));
111493
111527
  const compilerHost = {
111494
111528
  getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
@@ -112981,7 +113015,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
112981
113015
  getCommonSourceDirectory: program.getCommonSourceDirectory,
112982
113016
  getCompilerOptions: program.getCompilerOptions,
112983
113017
  getCurrentDirectory: () => currentDirectory,
112984
- getNewLine: () => host.getNewLine(),
112985
113018
  getSourceFile: program.getSourceFile,
112986
113019
  getSourceFileByPath: program.getSourceFileByPath,
112987
113020
  getSourceFiles: program.getSourceFiles,
@@ -113805,7 +113838,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
113805
113838
  if (filesByName.has(path)) {
113806
113839
  const file2 = filesByName.get(path);
113807
113840
  addFileIncludeReason(file2 || void 0, reason);
113808
- if (file2 && options.forceConsistentCasingInFileNames) {
113841
+ if (file2 && !(options.forceConsistentCasingInFileNames === false)) {
113809
113842
  const checkedName = file2.fileName;
113810
113843
  const isRedirect = toPath3(checkedName) !== toPath3(fileName);
113811
113844
  if (isRedirect) {
@@ -117782,7 +117815,7 @@ function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) {
117782
117815
  return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine;
117783
117816
  }
117784
117817
  function getLocaleTimeString(system) {
117785
- return !system.now ? new Date().toLocaleTimeString() : (
117818
+ return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : (
117786
117819
  // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM.
117787
117820
  // This branch is solely for testing, so just switch it to a normal space for baseline stability.
117788
117821
  // See:
@@ -118222,7 +118255,6 @@ function createWatchFactory(host, options) {
118222
118255
  }
118223
118256
  function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
118224
118257
  const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
118225
- const hostGetNewLine = memoize(() => host.getNewLine());
118226
118258
  const compilerHost = {
118227
118259
  getSourceFile: createGetSourceFile(
118228
118260
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
@@ -118240,7 +118272,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
118240
118272
  getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
118241
118273
  useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
118242
118274
  getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames),
118243
- getNewLine: () => getNewLineCharacter(getCompilerOptions(), hostGetNewLine),
118275
+ getNewLine: () => getNewLineCharacter(getCompilerOptions()),
118244
118276
  fileExists: (f) => host.fileExists(f),
118245
118277
  readFile: (f) => host.readFile(f),
118246
118278
  trace: maybeBind(host, host.trace),
@@ -118326,7 +118358,7 @@ function createWatchCompilerHost(system = sys, createProgram2, reportDiagnostic,
118326
118358
  copyProperties(result, createWatchHost(system, reportWatchStatus2));
118327
118359
  result.afterProgramCreate = (builderProgram) => {
118328
118360
  const compilerOptions = builderProgram.getCompilerOptions();
118329
- const newLine = getNewLineCharacter(compilerOptions, () => system.newLine);
118361
+ const newLine = getNewLineCharacter(compilerOptions);
118330
118362
  emitFilesAndReportErrors(
118331
118363
  builderProgram,
118332
118364
  reportDiagnostic,
@@ -118472,7 +118504,7 @@ function createWatchProgram(host) {
118472
118504
  }
118473
118505
  reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode);
118474
118506
  if (configFileName && !host.configFileParsingResult) {
118475
- newLine = getNewLineCharacter(optionsToExtendForConfigFile, () => host.getNewLine());
118507
+ newLine = getNewLineCharacter(optionsToExtendForConfigFile);
118476
118508
  Debug.assert(!rootFileNames);
118477
118509
  parseConfigFile2();
118478
118510
  newLine = updateNewLine();
@@ -118668,7 +118700,7 @@ function createWatchProgram(host) {
118668
118700
  scheduleProgramUpdate();
118669
118701
  }
118670
118702
  function updateNewLine() {
118671
- return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, () => host.getNewLine());
118703
+ return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile);
118672
118704
  }
118673
118705
  function toPath3(fileName) {
118674
118706
  return toPath(fileName, currentDirectory, getCanonicalFileName);
@@ -119110,8 +119142,8 @@ function resolveConfigFileProjectName(project) {
119110
119142
  }
119111
119143
 
119112
119144
  // src/compiler/tsbuildPublic.ts
119113
- var minimumDate = new Date(-864e13);
119114
- var maximumDate = new Date(864e13);
119145
+ var minimumDate = /* @__PURE__ */ new Date(-864e13);
119146
+ var maximumDate = /* @__PURE__ */ new Date(864e13);
119115
119147
  function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) {
119116
119148
  const existingValue = configFileMap.get(resolved);
119117
119149
  let newValue;
@@ -119125,7 +119157,7 @@ function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
119125
119157
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, () => /* @__PURE__ */ new Map());
119126
119158
  }
119127
119159
  function getCurrentTime(host) {
119128
- return host.now ? host.now() : new Date();
119160
+ return host.now ? host.now() : /* @__PURE__ */ new Date();
119129
119161
  }
119130
119162
  function isCircularBuildOrder(buildOrder) {
119131
119163
  return !!buildOrder && !!buildOrder.buildOrder;