@typescript-deploys/pr-build 4.6.0-pr-47000-3 → 4.6.0-pr-47050-2

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/lib.es5.d.ts CHANGED
@@ -1515,7 +1515,7 @@ interface Promise<T> {
1515
1515
  type Awaited<T> =
1516
1516
  T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
1517
1517
  T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1518
- F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument
1518
+ F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
1519
1519
  Awaited<V> : // recursively unwrap the value
1520
1520
  never : // the argument to `then` was not callable
1521
1521
  T; // non-object or non-thenable
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20211206";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20211208";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -6103,6 +6103,7 @@ var ts;
6103
6103
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
6104
6104
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
6105
6105
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
6106
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
6106
6107
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
6107
6108
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
6108
6109
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -6296,6 +6297,9 @@ var ts;
6296
6297
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
6297
6298
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
6298
6299
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
6300
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
6301
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
6302
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
6299
6303
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
6300
6304
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
6301
6305
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -27083,7 +27087,11 @@ var ts;
27083
27087
  if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
27084
27088
  return undefined;
27085
27089
  }
27086
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
27090
+ var unwrappedType = type;
27091
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190) {
27092
+ unwrappedType = unwrappedType.type;
27093
+ }
27094
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
27087
27095
  if (!allowAmbiguity && token() !== 38 && (hasJSDocFunctionType || token() !== 18)) {
27088
27096
  return undefined;
27089
27097
  }
@@ -47433,7 +47441,7 @@ var ts;
47433
47441
  }
47434
47442
  if (t.flags & 268435456) {
47435
47443
  var constraint = getBaseConstraint(t.type);
47436
- return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
47444
+ return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
47437
47445
  }
47438
47446
  if (t.flags & 8388608) {
47439
47447
  var baseObjectType = getBaseConstraint(t.objectType);
@@ -49982,9 +49990,11 @@ var ts;
49982
49990
  }
49983
49991
  function getStringMappingType(symbol, type) {
49984
49992
  return type.flags & (1048576 | 131072) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
49985
- isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
49986
- type.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
49987
- type;
49993
+ type.flags & 268435456 && symbol === type.symbol ? type :
49994
+ isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456) ? getTemplateLiteralType(["", ""], [type]) : type) :
49995
+ type.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
49996
+ type.flags & 134217728 ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
49997
+ type;
49988
49998
  }
49989
49999
  function applyStringMapping(symbol, str) {
49990
50000
  switch (intrinsicTypeKinds.get(symbol.escapedName)) {
@@ -49995,6 +50005,15 @@ var ts;
49995
50005
  }
49996
50006
  return str;
49997
50007
  }
50008
+ function applyTemplateStringMapping(symbol, texts, types) {
50009
+ switch (intrinsicTypeKinds.get(symbol.escapedName)) {
50010
+ case 0: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
50011
+ case 1: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
50012
+ case 2: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
50013
+ case 3: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
50014
+ }
50015
+ return [texts, types];
50016
+ }
49998
50017
  function getStringMappingTypeForGenericType(symbol, type) {
49999
50018
  var id = getSymbolId(symbol) + "," + getTypeId(type);
50000
50019
  var result = stringMappingTypes.get(id);
@@ -50224,7 +50243,7 @@ var ts;
50224
50243
  accessNode;
50225
50244
  }
50226
50245
  function isPatternLiteralPlaceholderType(type) {
50227
- return !!(type.flags & (1 | 4 | 8 | 64));
50246
+ return !!(type.flags & (1 | 4 | 8 | 64)) || !!(type.flags & 268435456 && isPatternLiteralPlaceholderType(type.type));
50228
50247
  }
50229
50248
  function isPatternLiteralType(type) {
50230
50249
  return !!(type.flags & 134217728) && ts.every(type.types, isPatternLiteralPlaceholderType);
@@ -53350,6 +53369,13 @@ var ts;
53350
53369
  return -1;
53351
53370
  }
53352
53371
  }
53372
+ else if (target.flags & 268435456) {
53373
+ if (!(source.flags & 268435456)) {
53374
+ if (isUnchangedByStringMapping(target.symbol, source)) {
53375
+ return -1;
53376
+ }
53377
+ }
53378
+ }
53353
53379
  if (source.flags & 8650752) {
53354
53380
  if (!(source.flags & 8388608 && target.flags & 8388608)) {
53355
53381
  var constraint = getConstraintOfType(source);
@@ -53385,7 +53411,10 @@ var ts;
53385
53411
  }
53386
53412
  }
53387
53413
  else if (source.flags & 268435456) {
53388
- if (target.flags & 268435456 && source.symbol === target.symbol) {
53414
+ if (target.flags & 268435456) {
53415
+ if (source.symbol !== target.symbol) {
53416
+ return 0;
53417
+ }
53389
53418
  if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
53390
53419
  resetErrorInfo(saveErrorInfo);
53391
53420
  return result;
@@ -54159,7 +54188,7 @@ var ts;
54159
54188
  return typeCouldHaveTopLevelSingletonTypes(constraint);
54160
54189
  }
54161
54190
  }
54162
- return isUnitType(type) || !!(type.flags & 134217728);
54191
+ return isUnitType(type) || !!(type.flags & 134217728) || !!(type.flags & 268435456);
54163
54192
  }
54164
54193
  function getExactOptionalUnassignableProperties(source, target) {
54165
54194
  if (isTupleType(source) && isTupleType(target))
@@ -55386,6 +55415,9 @@ var ts;
55386
55415
  var flags = scanner.getTokenFlags();
55387
55416
  return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512);
55388
55417
  }
55418
+ function isUnchangedByStringMapping(symbol, value) {
55419
+ return value === getStringMappingType(symbol, value);
55420
+ }
55389
55421
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
55390
55422
  if (source === target || target.flags & (1 | 4)) {
55391
55423
  return true;
@@ -55394,7 +55426,8 @@ var ts;
55394
55426
  var value = source.value;
55395
55427
  return !!(target.flags & 8 && value !== "" && isFinite(+value) ||
55396
55428
  target.flags & 64 && value !== "" && isValidBigIntString(value) ||
55397
- target.flags & (512 | 98304) && value === target.intrinsicName);
55429
+ target.flags & (512 | 98304) && value === target.intrinsicName ||
55430
+ target.flags & 268435456 && isUnchangedByStringMapping(target.symbol, getStringLiteralType(value)));
55398
55431
  }
55399
55432
  if (source.flags & 134217728) {
55400
55433
  var texts = source.texts;
@@ -99009,19 +99042,74 @@ var ts;
99009
99042
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
99010
99043
  }
99011
99044
  ts.getErrorCountForSummary = getErrorCountForSummary;
99045
+ function getFilesInErrorForSummary(diagnostics) {
99046
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
99047
+ .map(function (errorDiagnostic) {
99048
+ if (errorDiagnostic.file === undefined)
99049
+ return;
99050
+ return "" + errorDiagnostic.file.fileName;
99051
+ });
99052
+ return filesInError.map(function (fileName) {
99053
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
99054
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
99055
+ });
99056
+ if (diagnosticForFileName !== undefined) {
99057
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
99058
+ return {
99059
+ fileName: fileName,
99060
+ line: line + 1,
99061
+ };
99062
+ }
99063
+ });
99064
+ }
99065
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
99012
99066
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
99013
99067
  return errorCount === 1 ?
99014
99068
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
99015
99069
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
99016
99070
  }
99017
99071
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
99018
- function getErrorSummaryText(errorCount, newLine) {
99072
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
99019
99073
  if (errorCount === 0)
99020
99074
  return "";
99021
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
99022
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
99075
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
99076
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
99077
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
99078
+ var d = errorCount === 1 ?
99079
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
99080
+ ts.Diagnostics.Found_1_error_in_1 :
99081
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
99082
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
99083
+ ts.Diagnostics.Found_0_errors :
99084
+ distinctFileNamesWithLines.length === 1 ?
99085
+ ts.Diagnostics.Found_0_errors_in_1_file :
99086
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
99087
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
99023
99088
  }
99024
99089
  ts.getErrorSummaryText = getErrorSummaryText;
99090
+ function createTabularErrorsDisplay(filesInError) {
99091
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
99092
+ if (distinctFiles.length === 0)
99093
+ return "";
99094
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
99095
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
99096
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
99097
+ var headerRow = ts.Diagnostics.Errors_Files.message;
99098
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
99099
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
99100
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
99101
+ var tabularData = "";
99102
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
99103
+ fileToErrorCount.forEach(function (row) {
99104
+ var file = row[0], errorCount = row[1];
99105
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
99106
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
99107
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
99108
+ : "";
99109
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
99110
+ });
99111
+ return tabularData;
99112
+ }
99025
99113
  function isBuilderProgram(program) {
99026
99114
  return !!program.getState;
99027
99115
  }
@@ -99210,7 +99298,7 @@ var ts;
99210
99298
  listFiles(program, write);
99211
99299
  }
99212
99300
  if (reportSummary) {
99213
- reportSummary(getErrorCountForSummary(diagnostics));
99301
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
99214
99302
  }
99215
99303
  return {
99216
99304
  emitResult: emitResult,
@@ -99400,7 +99488,7 @@ var ts;
99400
99488
  var system = input.system || ts.sys;
99401
99489
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
99402
99490
  var builderProgram = ts.createIncrementalProgram(input);
99403
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
99491
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
99404
99492
  if (input.afterProgramEmitAndDiagnostics)
99405
99493
  input.afterProgramEmitAndDiagnostics(builderProgram);
99406
99494
  return exitStatus;
@@ -101458,11 +101546,14 @@ var ts;
101458
101546
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
101459
101547
  var diagnostics = state.diagnostics;
101460
101548
  var totalErrors = 0;
101549
+ var filesInError = [];
101461
101550
  if (isCircularBuildOrder(buildOrder)) {
101462
101551
  reportBuildQueue(state, buildOrder.buildOrder);
101463
101552
  reportErrors(state, buildOrder.circularDiagnostics);
101464
101553
  if (canReportSummary)
101465
101554
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
101555
+ if (canReportSummary)
101556
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
101466
101557
  }
101467
101558
  else {
101468
101559
  buildOrder.forEach(function (project) {
@@ -101473,12 +101564,14 @@ var ts;
101473
101564
  });
101474
101565
  if (canReportSummary)
101475
101566
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
101567
+ if (canReportSummary)
101568
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
101476
101569
  }
101477
101570
  if (state.watch) {
101478
101571
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
101479
101572
  }
101480
101573
  else if (state.host.reportErrorSummary) {
101481
- state.host.reportErrorSummary(totalErrors);
101574
+ state.host.reportErrorSummary(totalErrors, filesInError);
101482
101575
  }
101483
101576
  }
101484
101577
  function reportBuildQueue(state, buildQueue) {
@@ -102105,7 +102198,7 @@ var ts;
102105
102198
  }
102106
102199
  function createReportErrorSummary(sys, options) {
102107
102200
  return shouldBePretty(sys, options) ?
102108
- function (errorCount) { return sys.write(ts.getErrorSummaryText(errorCount, sys.newLine)); } :
102201
+ function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
102109
102202
  undefined;
102110
102203
  }
102111
102204
  function performCompilation(sys, cb, reportDiagnostic, config) {
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-insiders.20211206";
103
+ ts.version = ts.versionMajorMinor + ".0-insiders.20211208";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -8889,6 +8889,7 @@ var ts;
8889
8889
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
8890
8890
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
8891
8891
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
8892
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
8892
8893
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
8893
8894
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
8894
8895
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -9082,6 +9083,9 @@ var ts;
9082
9083
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9083
9084
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9084
9085
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
9086
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9087
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9088
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9085
9089
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
9086
9090
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
9087
9091
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -33620,10 +33624,14 @@ var ts;
33620
33624
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33621
33625
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33622
33626
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33623
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33627
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33624
33628
  //
33625
33629
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33626
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33630
+ var unwrappedType = type;
33631
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33632
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33633
+ }
33634
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33627
33635
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33628
33636
  // Returning undefined here will cause our caller to rewind to where we started from.
33629
33637
  return undefined;
@@ -57324,7 +57332,7 @@ var ts;
57324
57332
  }
57325
57333
  if (t.flags & 268435456 /* StringMapping */) {
57326
57334
  var constraint = getBaseConstraint(t.type);
57327
- return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
57335
+ return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
57328
57336
  }
57329
57337
  if (t.flags & 8388608 /* IndexedAccess */) {
57330
57338
  var baseObjectType = getBaseConstraint(t.objectType);
@@ -60195,9 +60203,12 @@ var ts;
60195
60203
  }
60196
60204
  function getStringMappingType(symbol, type) {
60197
60205
  return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
60198
- isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
60199
- type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60200
- type;
60206
+ // Mapping<Mapping<T>> === Mapping<T>
60207
+ type.flags & 268435456 /* StringMapping */ && symbol === type.symbol ? type :
60208
+ isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456 /* StringMapping */) ? getTemplateLiteralType(["", ""], [type]) : type) :
60209
+ type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60210
+ type.flags & 134217728 /* TemplateLiteral */ ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
60211
+ type;
60201
60212
  }
60202
60213
  function applyStringMapping(symbol, str) {
60203
60214
  switch (intrinsicTypeKinds.get(symbol.escapedName)) {
@@ -60208,6 +60219,15 @@ var ts;
60208
60219
  }
60209
60220
  return str;
60210
60221
  }
60222
+ function applyTemplateStringMapping(symbol, texts, types) {
60223
+ switch (intrinsicTypeKinds.get(symbol.escapedName)) {
60224
+ case 0 /* Uppercase */: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60225
+ case 1 /* Lowercase */: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60226
+ case 2 /* Capitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60227
+ case 3 /* Uncapitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60228
+ }
60229
+ return [texts, types];
60230
+ }
60211
60231
  function getStringMappingTypeForGenericType(symbol, type) {
60212
60232
  var id = getSymbolId(symbol) + "," + getTypeId(type);
60213
60233
  var result = stringMappingTypes.get(id);
@@ -60449,7 +60469,7 @@ var ts;
60449
60469
  accessNode;
60450
60470
  }
60451
60471
  function isPatternLiteralPlaceholderType(type) {
60452
- return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */));
60472
+ return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || !!(type.flags & 268435456 /* StringMapping */ && isPatternLiteralPlaceholderType(type.type));
60453
60473
  }
60454
60474
  function isPatternLiteralType(type) {
60455
60475
  return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
@@ -64048,6 +64068,13 @@ var ts;
64048
64068
  return -1 /* True */;
64049
64069
  }
64050
64070
  }
64071
+ else if (target.flags & 268435456 /* StringMapping */) {
64072
+ if (!(source.flags & 268435456 /* StringMapping */)) {
64073
+ if (isUnchangedByStringMapping(target.symbol, source)) {
64074
+ return -1 /* True */;
64075
+ }
64076
+ }
64077
+ }
64051
64078
  if (source.flags & 8650752 /* TypeVariable */) {
64052
64079
  // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
64053
64080
  if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
@@ -64087,7 +64114,10 @@ var ts;
64087
64114
  }
64088
64115
  }
64089
64116
  else if (source.flags & 268435456 /* StringMapping */) {
64090
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
64117
+ if (target.flags & 268435456 /* StringMapping */) {
64118
+ if (source.symbol !== target.symbol) {
64119
+ return 0 /* False */;
64120
+ }
64091
64121
  if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
64092
64122
  resetErrorInfo(saveErrorInfo);
64093
64123
  return result;
@@ -64982,7 +65012,7 @@ var ts;
64982
65012
  return typeCouldHaveTopLevelSingletonTypes(constraint);
64983
65013
  }
64984
65014
  }
64985
- return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);
65015
+ return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */) || !!(type.flags & 268435456 /* StringMapping */);
64986
65016
  }
64987
65017
  function getExactOptionalUnassignableProperties(source, target) {
64988
65018
  if (isTupleType(source) && isTupleType(target))
@@ -66395,6 +66425,9 @@ var ts;
66395
66425
  // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)
66396
66426
  return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */);
66397
66427
  }
66428
+ function isUnchangedByStringMapping(symbol, value) {
66429
+ return value === getStringMappingType(symbol, value);
66430
+ }
66398
66431
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
66399
66432
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
66400
66433
  return true;
@@ -66403,7 +66436,8 @@ var ts;
66403
66436
  var value = source.value;
66404
66437
  return !!(target.flags & 8 /* Number */ && value !== "" && isFinite(+value) ||
66405
66438
  target.flags & 64 /* BigInt */ && value !== "" && isValidBigIntString(value) ||
66406
- target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName);
66439
+ target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName ||
66440
+ target.flags & 268435456 /* StringMapping */ && isUnchangedByStringMapping(target.symbol, getStringLiteralType(value)));
66407
66441
  }
66408
66442
  if (source.flags & 134217728 /* TemplateLiteral */) {
66409
66443
  var texts = source.texts;
@@ -119721,7 +119755,7 @@ var ts;
119721
119755
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119722
119756
  } : undefined;
119723
119757
  /**
119724
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119758
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119725
119759
  */
119726
119760
  function createDiagnosticReporter(system, pretty) {
119727
119761
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -119807,19 +119841,74 @@ var ts;
119807
119841
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
119808
119842
  }
119809
119843
  ts.getErrorCountForSummary = getErrorCountForSummary;
119844
+ function getFilesInErrorForSummary(diagnostics) {
119845
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
119846
+ .map(function (errorDiagnostic) {
119847
+ if (errorDiagnostic.file === undefined)
119848
+ return;
119849
+ return "" + errorDiagnostic.file.fileName;
119850
+ });
119851
+ return filesInError.map(function (fileName) {
119852
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
119853
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
119854
+ });
119855
+ if (diagnosticForFileName !== undefined) {
119856
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
119857
+ return {
119858
+ fileName: fileName,
119859
+ line: line + 1,
119860
+ };
119861
+ }
119862
+ });
119863
+ }
119864
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
119810
119865
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
119811
119866
  return errorCount === 1 ?
119812
119867
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
119813
119868
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
119814
119869
  }
119815
119870
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
119816
- function getErrorSummaryText(errorCount, newLine) {
119871
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
119817
119872
  if (errorCount === 0)
119818
119873
  return "";
119819
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
119820
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
119874
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
119875
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
119876
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
119877
+ var d = errorCount === 1 ?
119878
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
119879
+ ts.Diagnostics.Found_1_error_in_1 :
119880
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
119881
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
119882
+ ts.Diagnostics.Found_0_errors :
119883
+ distinctFileNamesWithLines.length === 1 ?
119884
+ ts.Diagnostics.Found_0_errors_in_1_file :
119885
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
119886
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
119821
119887
  }
119822
119888
  ts.getErrorSummaryText = getErrorSummaryText;
119889
+ function createTabularErrorsDisplay(filesInError) {
119890
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
119891
+ if (distinctFiles.length === 0)
119892
+ return "";
119893
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
119894
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
119895
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
119896
+ var headerRow = ts.Diagnostics.Errors_Files.message;
119897
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
119898
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
119899
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
119900
+ var tabularData = "";
119901
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
119902
+ fileToErrorCount.forEach(function (row) {
119903
+ var file = row[0], errorCount = row[1];
119904
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
119905
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
119906
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
119907
+ : "";
119908
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
119909
+ });
119910
+ return tabularData;
119911
+ }
119823
119912
  function isBuilderProgram(program) {
119824
119913
  return !!program.getState;
119825
119914
  }
@@ -120023,7 +120112,7 @@ var ts;
120023
120112
  listFiles(program, write);
120024
120113
  }
120025
120114
  if (reportSummary) {
120026
- reportSummary(getErrorCountForSummary(diagnostics));
120115
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120027
120116
  }
120028
120117
  return {
120029
120118
  emitResult: emitResult,
@@ -120234,7 +120323,7 @@ var ts;
120234
120323
  var system = input.system || ts.sys;
120235
120324
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120236
120325
  var builderProgram = ts.createIncrementalProgram(input);
120237
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
120326
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
120238
120327
  if (input.afterProgramEmitAndDiagnostics)
120239
120328
  input.afterProgramEmitAndDiagnostics(builderProgram);
120240
120329
  return exitStatus;
@@ -122453,11 +122542,14 @@ var ts;
122453
122542
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122454
122543
  var diagnostics = state.diagnostics;
122455
122544
  var totalErrors = 0;
122545
+ var filesInError = [];
122456
122546
  if (isCircularBuildOrder(buildOrder)) {
122457
122547
  reportBuildQueue(state, buildOrder.buildOrder);
122458
122548
  reportErrors(state, buildOrder.circularDiagnostics);
122459
122549
  if (canReportSummary)
122460
122550
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122551
+ if (canReportSummary)
122552
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122461
122553
  }
122462
122554
  else {
122463
122555
  // Report errors from the other projects
@@ -122469,12 +122561,14 @@ var ts;
122469
122561
  });
122470
122562
  if (canReportSummary)
122471
122563
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122564
+ if (canReportSummary)
122565
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122472
122566
  }
122473
122567
  if (state.watch) {
122474
122568
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122475
122569
  }
122476
122570
  else if (state.host.reportErrorSummary) {
122477
- state.host.reportErrorSummary(totalErrors);
122571
+ state.host.reportErrorSummary(totalErrors, filesInError);
122478
122572
  }
122479
122573
  }
122480
122574
  /**
@@ -127331,6 +127425,9 @@ var ts;
127331
127425
  }
127332
127426
  return;
127333
127427
  }
127428
+ if (ts.isConstTypeReference(token.parent)) {
127429
+ return 3 /* keyword */;
127430
+ }
127334
127431
  }
127335
127432
  return 2 /* identifier */;
127336
127433
  }
@@ -131151,8 +131248,10 @@ var ts;
131151
131248
  }
131152
131249
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131153
131250
  function getJsDocTagAtPosition(node, position) {
131154
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131155
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131251
+ return ts.findAncestor(node, function (n) {
131252
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131253
+ ts.isJSDoc(n) ? "quit" : false;
131254
+ });
131156
131255
  }
131157
131256
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131158
131257
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -5352,7 +5352,11 @@ declare namespace ts {
5352
5352
  traceResolution?: boolean;
5353
5353
  [option: string]: CompilerOptionsValue | undefined;
5354
5354
  }
5355
- type ReportEmitErrorSummary = (errorCount: number) => void;
5355
+ type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5356
+ interface ReportFileInError {
5357
+ fileName: string;
5358
+ line: number;
5359
+ }
5356
5360
  interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5357
5361
  createDirectory?(path: string): void;
5358
5362
  /**