@typescript-deploys/pr-build 4.7.0-pr-48080-37 → 4.7.0-pr-47657-5

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.
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-insiders.20220307";
297
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220311";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -2293,13 +2293,15 @@ var ts;
2293
2293
  for (var _i = 0; _i < arguments.length; _i++) {
2294
2294
  args[_i] = arguments[_i];
2295
2295
  }
2296
+ var lastResult;
2296
2297
  for (var _a = 0, fs_1 = fs; _a < fs_1.length; _a++) {
2297
2298
  var f = fs_1[_a];
2298
- if (f.apply(void 0, args)) {
2299
- return true;
2299
+ lastResult = f.apply(void 0, args);
2300
+ if (lastResult) {
2301
+ return lastResult;
2300
2302
  }
2301
2303
  }
2302
- return false;
2304
+ return lastResult;
2303
2305
  };
2304
2306
  }
2305
2307
  ts.or = or;
@@ -4358,6 +4360,7 @@ var ts;
4358
4360
  SyntaxKind[SyntaxKind["JSDocFunctionType"] = 316] = "JSDocFunctionType";
4359
4361
  SyntaxKind[SyntaxKind["JSDocVariadicType"] = 317] = "JSDocVariadicType";
4360
4362
  SyntaxKind[SyntaxKind["JSDocNamepathType"] = 318] = "JSDocNamepathType";
4363
+ /** @deprecated Use SyntaxKind.JSDoc */
4361
4364
  SyntaxKind[SyntaxKind["JSDocComment"] = 319] = "JSDocComment";
4362
4365
  SyntaxKind[SyntaxKind["JSDocText"] = 320] = "JSDocText";
4363
4366
  SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 321] = "JSDocTypeLiteral";
@@ -4431,6 +4434,7 @@ var ts;
4431
4434
  SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 346] = "LastJSDocTagNode";
4432
4435
  /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 126] = "FirstContextualKeyword";
4433
4436
  /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 159] = "LastContextualKeyword";
4437
+ SyntaxKind[SyntaxKind["JSDoc"] = 319] = "JSDoc";
4434
4438
  })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
4435
4439
  var NodeFlags;
4436
4440
  (function (NodeFlags) {
@@ -5088,57 +5092,58 @@ var ts;
5088
5092
  ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties";
5089
5093
  ObjectFlags[ObjectFlags["ReverseMapped"] = 1024] = "ReverseMapped";
5090
5094
  ObjectFlags[ObjectFlags["JsxAttributes"] = 2048] = "JsxAttributes";
5091
- ObjectFlags[ObjectFlags["JSLiteral"] = 4096] = "JSLiteral";
5092
- ObjectFlags[ObjectFlags["FreshLiteral"] = 8192] = "FreshLiteral";
5093
- ObjectFlags[ObjectFlags["ArrayLiteral"] = 16384] = "ArrayLiteral";
5095
+ ObjectFlags[ObjectFlags["MarkerType"] = 4096] = "MarkerType";
5096
+ ObjectFlags[ObjectFlags["JSLiteral"] = 8192] = "JSLiteral";
5097
+ ObjectFlags[ObjectFlags["FreshLiteral"] = 16384] = "FreshLiteral";
5098
+ ObjectFlags[ObjectFlags["ArrayLiteral"] = 32768] = "ArrayLiteral";
5094
5099
  /* @internal */
5095
- ObjectFlags[ObjectFlags["PrimitiveUnion"] = 32768] = "PrimitiveUnion";
5100
+ ObjectFlags[ObjectFlags["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
5096
5101
  /* @internal */
5097
- ObjectFlags[ObjectFlags["ContainsWideningType"] = 65536] = "ContainsWideningType";
5102
+ ObjectFlags[ObjectFlags["ContainsWideningType"] = 131072] = "ContainsWideningType";
5098
5103
  /* @internal */
5099
- ObjectFlags[ObjectFlags["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral";
5104
+ ObjectFlags[ObjectFlags["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
5100
5105
  /* @internal */
5101
- ObjectFlags[ObjectFlags["NonInferrableType"] = 262144] = "NonInferrableType";
5106
+ ObjectFlags[ObjectFlags["NonInferrableType"] = 524288] = "NonInferrableType";
5102
5107
  /* @internal */
5103
- ObjectFlags[ObjectFlags["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed";
5108
+ ObjectFlags[ObjectFlags["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
5104
5109
  /* @internal */
5105
- ObjectFlags[ObjectFlags["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables";
5110
+ ObjectFlags[ObjectFlags["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
5106
5111
  ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface";
5107
5112
  /* @internal */
5108
- ObjectFlags[ObjectFlags["RequiresWidening"] = 196608] = "RequiresWidening";
5113
+ ObjectFlags[ObjectFlags["RequiresWidening"] = 393216] = "RequiresWidening";
5109
5114
  /* @internal */
5110
- ObjectFlags[ObjectFlags["PropagatingFlags"] = 458752] = "PropagatingFlags";
5115
+ ObjectFlags[ObjectFlags["PropagatingFlags"] = 917504] = "PropagatingFlags";
5111
5116
  // Object flags that uniquely identify the kind of ObjectType
5112
5117
  /* @internal */
5113
5118
  ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
5114
5119
  // Flags that require TypeFlags.Object
5115
- ObjectFlags[ObjectFlags["ContainsSpread"] = 2097152] = "ContainsSpread";
5116
- ObjectFlags[ObjectFlags["ObjectRestType"] = 4194304] = "ObjectRestType";
5117
- ObjectFlags[ObjectFlags["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
5120
+ ObjectFlags[ObjectFlags["ContainsSpread"] = 4194304] = "ContainsSpread";
5121
+ ObjectFlags[ObjectFlags["ObjectRestType"] = 8388608] = "ObjectRestType";
5122
+ ObjectFlags[ObjectFlags["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
5118
5123
  /* @internal */
5119
- ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
5124
+ ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
5120
5125
  // Flags that require TypeFlags.Object and ObjectFlags.Reference
5121
5126
  /* @internal */
5122
- ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
5127
+ ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
5123
5128
  /* @internal */
5124
- ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
5129
+ ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
5125
5130
  // Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
5126
5131
  /* @internal */
5127
- ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed";
5132
+ ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
5128
5133
  /* @internal */
5129
- ObjectFlags[ObjectFlags["IsGenericObjectType"] = 4194304] = "IsGenericObjectType";
5134
+ ObjectFlags[ObjectFlags["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
5130
5135
  /* @internal */
5131
- ObjectFlags[ObjectFlags["IsGenericIndexType"] = 8388608] = "IsGenericIndexType";
5136
+ ObjectFlags[ObjectFlags["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
5132
5137
  /* @internal */
5133
- ObjectFlags[ObjectFlags["IsGenericType"] = 12582912] = "IsGenericType";
5138
+ ObjectFlags[ObjectFlags["IsGenericType"] = 25165824] = "IsGenericType";
5134
5139
  // Flags that require TypeFlags.Union
5135
5140
  /* @internal */
5136
- ObjectFlags[ObjectFlags["ContainsIntersections"] = 16777216] = "ContainsIntersections";
5141
+ ObjectFlags[ObjectFlags["ContainsIntersections"] = 33554432] = "ContainsIntersections";
5137
5142
  // Flags that require TypeFlags.Intersection
5138
5143
  /* @internal */
5139
- ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed";
5144
+ ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
5140
5145
  /* @internal */
5141
- ObjectFlags[ObjectFlags["IsNeverIntersection"] = 33554432] = "IsNeverIntersection";
5146
+ ObjectFlags[ObjectFlags["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
5142
5147
  })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {}));
5143
5148
  /* @internal */
5144
5149
  var VarianceFlags;
@@ -5316,6 +5321,21 @@ var ts;
5316
5321
  ModuleResolutionKind[ModuleResolutionKind["Node12"] = 3] = "Node12";
5317
5322
  ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
5318
5323
  })(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
5324
+ var ModuleDetectionKind;
5325
+ (function (ModuleDetectionKind) {
5326
+ /**
5327
+ * Files with imports, exports and/or import.meta are considered modules
5328
+ */
5329
+ ModuleDetectionKind[ModuleDetectionKind["Legacy"] = 1] = "Legacy";
5330
+ /**
5331
+ * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+
5332
+ */
5333
+ ModuleDetectionKind[ModuleDetectionKind["Auto"] = 2] = "Auto";
5334
+ /**
5335
+ * Consider all non-declaration files modules, regardless of present syntax
5336
+ */
5337
+ ModuleDetectionKind[ModuleDetectionKind["Force"] = 3] = "Force";
5338
+ })(ModuleDetectionKind = ts.ModuleDetectionKind || (ts.ModuleDetectionKind = {}));
5319
5339
  var WatchFileKind;
5320
5340
  (function (WatchFileKind) {
5321
5341
  WatchFileKind[WatchFileKind["FixedPollingInterval"] = 0] = "FixedPollingInterval";
@@ -8413,6 +8433,8 @@ var ts;
8413
8433
  catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
8414
8434
  An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
8415
8435
  An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
8436
+ Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
8437
+ auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node12+) as modules."),
8416
8438
  The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
8417
8439
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
8418
8440
  Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
@@ -9217,7 +9239,6 @@ var ts;
9217
9239
  Command_line_Options: diag(6171, ts.DiagnosticCategory.Message, "Command_line_Options_6171", "Command-line Options"),
9218
9240
  Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: diag(6179, ts.DiagnosticCategory.Message, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),
9219
9241
  Enable_all_strict_type_checking_options: diag(6180, ts.DiagnosticCategory.Message, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."),
9220
- List_of_language_service_plugins: diag(6181, ts.DiagnosticCategory.Message, "List_of_language_service_plugins_6181", "List of language service plugins."),
9221
9242
  Scoped_package_detected_looking_in_0: diag(6182, ts.DiagnosticCategory.Message, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"),
9222
9243
  Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6183, ts.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),
9223
9244
  Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6184, ts.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),
@@ -9324,7 +9345,7 @@ var ts;
9324
9345
  Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, ts.DiagnosticCategory.Message, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"),
9325
9346
  Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"),
9326
9347
  Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, ts.DiagnosticCategory.Message, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"),
9327
- Delete_the_outputs_of_all_projects: diag(6365, ts.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects"),
9348
+ Delete_the_outputs_of_all_projects: diag(6365, ts.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."),
9328
9349
  Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, ts.DiagnosticCategory.Message, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"),
9329
9350
  Option_build_must_be_the_first_command_line_argument: diag(6369, ts.DiagnosticCategory.Error, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."),
9330
9351
  Options_0_and_1_cannot_be_combined: diag(6370, ts.DiagnosticCategory.Error, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."),
@@ -9335,7 +9356,6 @@ var ts;
9335
9356
  A_non_dry_build_would_update_output_of_project_0: diag(6375, ts.DiagnosticCategory.Message, "A_non_dry_build_would_update_output_of_project_0_6375", "A non-dry build would update output of project '{0}'"),
9336
9357
  Cannot_update_output_of_project_0_because_there_was_error_reading_file_1: diag(6376, ts.DiagnosticCategory.Message, "Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376", "Cannot update output of project '{0}' because there was error reading file '{1}'"),
9337
9358
  Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, ts.DiagnosticCategory.Error, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),
9338
- Enable_incremental_compilation: diag(6378, ts.DiagnosticCategory.Message, "Enable_incremental_compilation_6378", "Enable incremental compilation"),
9339
9359
  Composite_projects_may_not_disable_incremental_compilation: diag(6379, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."),
9340
9360
  Specify_file_to_store_incremental_compilation_information: diag(6380, ts.DiagnosticCategory.Message, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"),
9341
9361
  Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),
@@ -9363,13 +9383,13 @@ var ts;
9363
9383
  File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),
9364
9384
  Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, ts.DiagnosticCategory.Message, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."),
9365
9385
  Consider_adding_a_declare_modifier_to_this_class: diag(6506, ts.DiagnosticCategory.Message, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."),
9366
- Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, ts.DiagnosticCategory.Message, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files."),
9386
+ Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, ts.DiagnosticCategory.Message, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),
9367
9387
  Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, ts.DiagnosticCategory.Message, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."),
9368
9388
  Allow_accessing_UMD_globals_from_modules: diag(6602, ts.DiagnosticCategory.Message, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."),
9369
9389
  Disable_error_reporting_for_unreachable_code: diag(6603, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."),
9370
9390
  Disable_error_reporting_for_unused_labels: diag(6604, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."),
9371
9391
  Ensure_use_strict_is_always_emitted: diag(6605, ts.DiagnosticCategory.Message, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."),
9372
- Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, ts.DiagnosticCategory.Message, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it."),
9392
+ Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, ts.DiagnosticCategory.Message, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),
9373
9393
  Specify_the_base_directory_to_resolve_non_relative_module_names: diag(6607, ts.DiagnosticCategory.Message, "Specify_the_base_directory_to_resolve_non_relative_module_names_6607", "Specify the base directory to resolve non-relative module names."),
9374
9394
  No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files: diag(6608, ts.DiagnosticCategory.Message, "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608", "No longer supported. In early versions, manually set the text encoding for reading files."),
9375
9395
  Enable_error_reporting_in_type_checked_JavaScript_files: diag(6609, ts.DiagnosticCategory.Message, "Enable_error_reporting_in_type_checked_JavaScript_files_6609", "Enable error reporting in type-checked JavaScript files."),
@@ -9382,13 +9402,13 @@ var ts;
9382
9402
  Reduce_the_number_of_projects_loaded_automatically_by_TypeScript: diag(6617, ts.DiagnosticCategory.Message, "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617", "Reduce the number of projects loaded automatically by TypeScript."),
9383
9403
  Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server: diag(6618, ts.DiagnosticCategory.Message, "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618", "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),
9384
9404
  Opt_a_project_out_of_multi_project_reference_checking_when_editing: diag(6619, ts.DiagnosticCategory.Message, "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619", "Opt a project out of multi-project reference checking when editing."),
9385
- Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, ts.DiagnosticCategory.Message, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects"),
9405
+ Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, ts.DiagnosticCategory.Message, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects."),
9386
9406
  Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration: diag(6621, ts.DiagnosticCategory.Message, "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621", "Emit more compliant, but verbose and less performant JavaScript for iteration."),
9387
9407
  Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6622, ts.DiagnosticCategory.Message, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),
9388
9408
  Only_output_d_ts_files_and_not_JavaScript_files: diag(6623, ts.DiagnosticCategory.Message, "Only_output_d_ts_files_and_not_JavaScript_files_6623", "Only output d.ts files and not JavaScript files."),
9389
9409
  Emit_design_type_metadata_for_decorated_declarations_in_source_files: diag(6624, ts.DiagnosticCategory.Message, "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624", "Emit design-type metadata for decorated declarations in source files."),
9390
9410
  Disable_the_type_acquisition_for_JavaScript_projects: diag(6625, ts.DiagnosticCategory.Message, "Disable_the_type_acquisition_for_JavaScript_projects_6625", "Disable the type acquisition for JavaScript projects"),
9391
- Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, ts.DiagnosticCategory.Message, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility."),
9411
+ Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, ts.DiagnosticCategory.Message, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),
9392
9412
  Filters_results_from_the_include_option: diag(6627, ts.DiagnosticCategory.Message, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."),
9393
9413
  Remove_a_list_of_directories_from_the_watch_process: diag(6628, ts.DiagnosticCategory.Message, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."),
9394
9414
  Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, ts.DiagnosticCategory.Message, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."),
@@ -9398,7 +9418,7 @@ var ts;
9398
9418
  Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, ts.DiagnosticCategory.Message, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."),
9399
9419
  Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers: diag(6634, ts.DiagnosticCategory.Message, "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634", "Specify what approach the watcher should use if the system runs out of native file watchers."),
9400
9420
  Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include: diag(6635, ts.DiagnosticCategory.Message, "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635", "Include a list of files. This does not support glob patterns, as opposed to `include`."),
9401
- Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, ts.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date"),
9421
+ Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, ts.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date."),
9402
9422
  Ensure_that_casing_is_correct_in_imports: diag(6637, ts.DiagnosticCategory.Message, "Ensure_that_casing_is_correct_in_imports_6637", "Ensure that casing is correct in imports."),
9403
9423
  Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging: diag(6638, ts.DiagnosticCategory.Message, "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638", "Emit a v8 CPU profile of the compiler run for debugging."),
9404
9424
  Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file: diag(6639, ts.DiagnosticCategory.Message, "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639", "Allow importing helper functions from tslib once per project, instead of including them per-file."),
@@ -9408,77 +9428,76 @@ var ts;
9408
9428
  Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript: diag(6644, ts.DiagnosticCategory.Message, "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644", "Include source code in the sourcemaps inside the emitted JavaScript."),
9409
9429
  Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports: diag(6645, ts.DiagnosticCategory.Message, "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645", "Ensure that each file can be safely transpiled without relying on other imports."),
9410
9430
  Specify_what_JSX_code_is_generated: diag(6646, ts.DiagnosticCategory.Message, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."),
9411
- Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, ts.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'"),
9431
+ Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, ts.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),
9412
9432
  Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment: diag(6648, ts.DiagnosticCategory.Message, "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648", "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),
9413
- Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, ts.DiagnosticCategory.Message, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`"),
9433
+ Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, ts.DiagnosticCategory.Message, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),
9414
9434
  Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option: diag(6650, ts.DiagnosticCategory.Message, "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650", "Make keyof only return strings instead of string, numbers or symbols. Legacy option."),
9415
9435
  Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment: diag(6651, ts.DiagnosticCategory.Message, "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651", "Specify a set of bundled library declaration files that describe the target runtime environment."),
9416
9436
  Print_the_names_of_emitted_files_after_a_compilation: diag(6652, ts.DiagnosticCategory.Message, "Print_the_names_of_emitted_files_after_a_compilation_6652", "Print the names of emitted files after a compilation."),
9417
9437
  Print_all_of_the_files_read_during_the_compilation: diag(6653, ts.DiagnosticCategory.Message, "Print_all_of_the_files_read_during_the_compilation_6653", "Print all of the files read during the compilation."),
9418
9438
  Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit: diag(6654, ts.DiagnosticCategory.Message, "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654", "Set the language of the messaging from TypeScript. This does not affect emit."),
9419
9439
  Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6655, ts.DiagnosticCategory.Message, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655", "Specify the location where debugger should locate map files instead of generated locations."),
9420
- Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, ts.DiagnosticCategory.Message, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`."),
9440
+ Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, ts.DiagnosticCategory.Message, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),
9421
9441
  Specify_what_module_code_is_generated: diag(6657, ts.DiagnosticCategory.Message, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."),
9422
9442
  Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier: diag(6658, ts.DiagnosticCategory.Message, "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658", "Specify how TypeScript looks up a file from a given module specifier."),
9423
9443
  Set_the_newline_character_for_emitting_files: diag(6659, ts.DiagnosticCategory.Message, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."),
9424
9444
  Disable_emitting_files_from_a_compilation: diag(6660, ts.DiagnosticCategory.Message, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."),
9425
- Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, ts.DiagnosticCategory.Message, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like `__extends` in compiled output."),
9445
+ Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, ts.DiagnosticCategory.Message, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like '__extends' in compiled output."),
9426
9446
  Disable_emitting_files_if_any_type_checking_errors_are_reported: diag(6662, ts.DiagnosticCategory.Message, "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662", "Disable emitting files if any type checking errors are reported."),
9427
9447
  Disable_truncating_types_in_error_messages: diag(6663, ts.DiagnosticCategory.Message, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."),
9428
9448
  Enable_error_reporting_for_fallthrough_cases_in_switch_statements: diag(6664, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664", "Enable error reporting for fallthrough cases in switch statements."),
9429
- Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied `any` type.."),
9449
+ Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied 'any' type."),
9430
9450
  Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier: diag(6666, ts.DiagnosticCategory.Message, "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666", "Ensure overriding members in derived classes are marked with an override modifier."),
9431
9451
  Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function: diag(6667, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667", "Enable error reporting for codepaths that do not explicitly return in a function."),
9432
- Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when `this` is given the type `any`."),
9452
+ Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when 'this' is given the type 'any'."),
9433
9453
  Disable_adding_use_strict_directives_in_emitted_JavaScript_files: diag(6669, ts.DiagnosticCategory.Message, "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669", "Disable adding 'use strict' directives in emitted JavaScript files."),
9434
9454
  Disable_including_any_library_files_including_the_default_lib_d_ts: diag(6670, ts.DiagnosticCategory.Message, "Disable_including_any_library_files_including_the_default_lib_d_ts_6670", "Disable including any library files, including the default lib.d.ts."),
9435
- Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, ts.DiagnosticCategory.Message, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type"),
9436
- Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, ts.DiagnosticCategory.Message, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project."),
9455
+ Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, ts.DiagnosticCategory.Message, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type."),
9456
+ Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, ts.DiagnosticCategory.Message, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project."),
9437
9457
  Disable_strict_checking_of_generic_signatures_in_function_types: diag(6673, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6673", "Disable strict checking of generic signatures in function types."),
9438
- Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, ts.DiagnosticCategory.Message, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add `undefined` to a type when accessed using an index."),
9439
- Enable_error_reporting_when_a_local_variables_aren_t_read: diag(6675, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_a_local_variables_aren_t_read_6675", "Enable error reporting when a local variables aren't read."),
9440
- Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, ts.DiagnosticCategory.Message, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read"),
9441
- Deprecated_setting_Use_outFile_instead: diag(6677, ts.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use `outFile` instead."),
9458
+ Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, ts.DiagnosticCategory.Message, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add 'undefined' to a type when accessed using an index."),
9459
+ Enable_error_reporting_when_local_variables_aren_t_read: diag(6675, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_local_variables_aren_t_read_6675", "Enable error reporting when local variables aren't read."),
9460
+ Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, ts.DiagnosticCategory.Message, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read."),
9461
+ Deprecated_setting_Use_outFile_instead: diag(6677, ts.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."),
9442
9462
  Specify_an_output_folder_for_all_emitted_files: diag(6678, ts.DiagnosticCategory.Message, "Specify_an_output_folder_for_all_emitted_files_6678", "Specify an output folder for all emitted files."),
9443
- Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, ts.DiagnosticCategory.Message, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output."),
9463
+ Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, ts.DiagnosticCategory.Message, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),
9444
9464
  Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations: diag(6680, ts.DiagnosticCategory.Message, "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680", "Specify a set of entries that re-map imports to additional lookup locations."),
9445
9465
  Specify_a_list_of_language_service_plugins_to_include: diag(6681, ts.DiagnosticCategory.Message, "Specify_a_list_of_language_service_plugins_to_include_6681", "Specify a list of language service plugins to include."),
9446
- Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, ts.DiagnosticCategory.Message, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing `const enum` declarations in generated code."),
9466
+ Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, ts.DiagnosticCategory.Message, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing 'const enum' declarations in generated code."),
9447
9467
  Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node: diag(6683, ts.DiagnosticCategory.Message, "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683", "Disable resolving symlinks to their realpath. This correlates to the same flag in node."),
9448
- Disable_wiping_the_console_in_watch_mode: diag(6684, ts.DiagnosticCategory.Message, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode"),
9449
- Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, ts.DiagnosticCategory.Message, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read"),
9450
- Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, ts.DiagnosticCategory.Message, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit."),
9468
+ Disable_wiping_the_console_in_watch_mode: diag(6684, ts.DiagnosticCategory.Message, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode."),
9469
+ Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, ts.DiagnosticCategory.Message, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read."),
9470
+ Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, ts.DiagnosticCategory.Message, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),
9451
9471
  Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references: diag(6687, ts.DiagnosticCategory.Message, "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687", "Specify an array of objects that specify paths for projects. Used in project references."),
9452
9472
  Disable_emitting_comments: diag(6688, ts.DiagnosticCategory.Message, "Disable_emitting_comments_6688", "Disable emitting comments."),
9453
- Enable_importing_json_files: diag(6689, ts.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files"),
9473
+ Enable_importing_json_files: diag(6689, ts.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files."),
9454
9474
  Specify_the_root_folder_within_your_source_files: diag(6690, ts.DiagnosticCategory.Message, "Specify_the_root_folder_within_your_source_files_6690", "Specify the root folder within your source files."),
9455
9475
  Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules: diag(6691, ts.DiagnosticCategory.Message, "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691", "Allow multiple folders to be treated as one when resolving modules."),
9456
9476
  Skip_type_checking_d_ts_files_that_are_included_with_TypeScript: diag(6692, ts.DiagnosticCategory.Message, "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692", "Skip type checking .d.ts files that are included with TypeScript."),
9457
9477
  Skip_type_checking_all_d_ts_files: diag(6693, ts.DiagnosticCategory.Message, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."),
9458
9478
  Create_source_map_files_for_emitted_JavaScript_files: diag(6694, ts.DiagnosticCategory.Message, "Create_source_map_files_for_emitted_JavaScript_files_6694", "Create source map files for emitted JavaScript files."),
9459
9479
  Specify_the_root_path_for_debuggers_to_find_the_reference_source_code: diag(6695, ts.DiagnosticCategory.Message, "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695", "Specify the root path for debuggers to find the reference source code."),
9460
- Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, ts.DiagnosticCategory.Message, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for `bind`, `call`, and `apply` methods match the original function."),
9480
+ Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, ts.DiagnosticCategory.Message, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),
9461
9481
  When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible: diag(6698, ts.DiagnosticCategory.Message, "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698", "When assigning functions, check to ensure parameters and the return values are subtype-compatible."),
9462
- When_type_checking_take_into_account_null_and_undefined: diag(6699, ts.DiagnosticCategory.Message, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account `null` and `undefined`."),
9482
+ When_type_checking_take_into_account_null_and_undefined: diag(6699, ts.DiagnosticCategory.Message, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account 'null' and 'undefined'."),
9463
9483
  Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor: diag(6700, ts.DiagnosticCategory.Message, "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700", "Check for class properties that are declared but not set in the constructor."),
9464
- Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, ts.DiagnosticCategory.Message, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have `@internal` in their JSDoc comments."),
9484
+ Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, ts.DiagnosticCategory.Message, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have '@internal' in their JSDoc comments."),
9465
9485
  Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals: diag(6702, ts.DiagnosticCategory.Message, "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702", "Disable reporting of excess property errors during the creation of object literals."),
9466
- Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, ts.DiagnosticCategory.Message, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress `noImplicitAny` errors when indexing objects that lack index signatures."),
9486
+ Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, ts.DiagnosticCategory.Message, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),
9467
9487
  Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6704, ts.DiagnosticCategory.Message, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704", "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),
9468
9488
  Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations: diag(6705, ts.DiagnosticCategory.Message, "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705", "Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),
9469
- Log_paths_used_during_the_moduleResolution_process: diag(6706, ts.DiagnosticCategory.Message, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the `moduleResolution` process."),
9489
+ Log_paths_used_during_the_moduleResolution_process: diag(6706, ts.DiagnosticCategory.Message, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the 'moduleResolution' process."),
9470
9490
  Specify_the_folder_for_tsbuildinfo_incremental_compilation_files: diag(6707, ts.DiagnosticCategory.Message, "Specify_the_folder_for_tsbuildinfo_incremental_compilation_files_6707", "Specify the folder for .tsbuildinfo incremental compilation files."),
9471
9491
  Specify_options_for_automatic_acquisition_of_declaration_files: diag(6709, ts.DiagnosticCategory.Message, "Specify_options_for_automatic_acquisition_of_declaration_files_6709", "Specify options for automatic acquisition of declaration files."),
9472
- Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, ts.DiagnosticCategory.Message, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like `./node_modules/@types`."),
9492
+ Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, ts.DiagnosticCategory.Message, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like './node_modules/@types'."),
9473
9493
  Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file: diag(6711, ts.DiagnosticCategory.Message, "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711", "Specify type package names to be included without being referenced in a source file."),
9474
9494
  Emit_ECMAScript_standard_compliant_class_fields: diag(6712, ts.DiagnosticCategory.Message, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."),
9475
- Enable_verbose_logging: diag(6713, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging"),
9495
+ Enable_verbose_logging: diag(6713, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging."),
9476
9496
  Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: diag(6714, ts.DiagnosticCategory.Message, "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714", "Specify how directories are watched on systems that lack recursive file-watching functionality."),
9477
9497
  Specify_how_the_TypeScript_watch_mode_works: diag(6715, ts.DiagnosticCategory.Message, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."),
9478
- Include_undefined_in_index_signature_results: diag(6716, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6716", "Include 'undefined' in index signature results"),
9479
9498
  Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, ts.DiagnosticCategory.Message, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
9480
- Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, ts.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types"),
9481
- Type_catch_clause_variables_as_unknown_instead_of_any: diag(6803, ts.DiagnosticCategory.Message, "Type_catch_clause_variables_as_unknown_instead_of_any_6803", "Type catch clause variables as 'unknown' instead of 'any'."),
9499
+ Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, ts.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
9500
+ Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, ts.DiagnosticCategory.Message, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
9482
9501
  one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
9483
9502
  one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
9484
9503
  type_Colon: diag(6902, ts.DiagnosticCategory.Message, "type_Colon_6902", "type:"),
@@ -13029,7 +13048,7 @@ var ts;
13029
13048
  return ts.emptyArray;
13030
13049
  }
13031
13050
  if (ts.isJSDocTypeAlias(node)) {
13032
- ts.Debug.assert(node.parent.kind === 319 /* JSDocComment */);
13051
+ ts.Debug.assert(node.parent.kind === 319 /* JSDoc */);
13033
13052
  return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
13034
13053
  }
13035
13054
  if (node.typeParameters) {
@@ -13976,7 +13995,7 @@ var ts;
13976
13995
  ts.isJSDocNode = isJSDocNode;
13977
13996
  /** True if node is of a kind that may contain comment text. */
13978
13997
  function isJSDocCommentContainingNode(node) {
13979
- return node.kind === 319 /* JSDocComment */
13998
+ return node.kind === 319 /* JSDoc */
13980
13999
  || node.kind === 318 /* JSDocNamepathType */
13981
14000
  || node.kind === 320 /* JSDocText */
13982
14001
  || isJSDocLinkLike(node)
@@ -15026,7 +15045,7 @@ var ts;
15026
15045
  return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
15027
15046
  }
15028
15047
  ts.isComputedNonLiteralName = isComputedNonLiteralName;
15029
- function getTextOfPropertyName(name) {
15048
+ function tryGetTextOfPropertyName(name) {
15030
15049
  switch (name.kind) {
15031
15050
  case 79 /* Identifier */:
15032
15051
  case 80 /* PrivateIdentifier */:
@@ -15038,11 +15057,15 @@ var ts;
15038
15057
  case 161 /* ComputedPropertyName */:
15039
15058
  if (isStringOrNumericLiteralLike(name.expression))
15040
15059
  return ts.escapeLeadingUnderscores(name.expression.text);
15041
- return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames");
15060
+ return undefined;
15042
15061
  default:
15043
15062
  return ts.Debug.assertNever(name);
15044
15063
  }
15045
15064
  }
15065
+ ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
15066
+ function getTextOfPropertyName(name) {
15067
+ return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
15068
+ }
15046
15069
  ts.getTextOfPropertyName = getTextOfPropertyName;
15047
15070
  function entityNameToString(name) {
15048
15071
  switch (name.kind) {
@@ -15537,10 +15560,23 @@ var ts;
15537
15560
  && node.parent.parent.kind === 236 /* VariableStatement */;
15538
15561
  }
15539
15562
  ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
15563
+ function isCommonJsExportedExpression(node) {
15564
+ if (!isInJSFile(node))
15565
+ return false;
15566
+ return (ts.isObjectLiteralExpression(node.parent) && ts.isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === 2 /* ModuleExports */) ||
15567
+ isCommonJsExportPropertyAssignment(node.parent);
15568
+ }
15569
+ ts.isCommonJsExportedExpression = isCommonJsExportedExpression;
15570
+ function isCommonJsExportPropertyAssignment(node) {
15571
+ if (!isInJSFile(node))
15572
+ return false;
15573
+ return (ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 1 /* ExportsProperty */);
15574
+ }
15575
+ ts.isCommonJsExportPropertyAssignment = isCommonJsExportPropertyAssignment;
15540
15576
  function isValidESSymbolDeclaration(node) {
15541
- return ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
15577
+ return (ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
15542
15578
  ts.isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) :
15543
- ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node);
15579
+ ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node)) || isCommonJsExportPropertyAssignment(node);
15544
15580
  }
15545
15581
  ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
15546
15582
  function introducesArgumentsExoticObject(node) {
@@ -15594,7 +15630,7 @@ var ts;
15594
15630
  function getPropertyAssignment(objectLiteral, key, key2) {
15595
15631
  return objectLiteral.properties.filter(function (property) {
15596
15632
  if (property.kind === 295 /* PropertyAssignment */) {
15597
- var propName = getTextOfPropertyName(property.name);
15633
+ var propName = tryGetTextOfPropertyName(property.name);
15598
15634
  return key === propName || (!!key2 && key2 === propName);
15599
15635
  }
15600
15636
  return false;
@@ -18434,7 +18470,7 @@ var ts;
18434
18470
  ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
18435
18471
  /** template tags are only available when a typedef isn't already using them */
18436
18472
  function isNonTypeAliasTemplate(tag) {
18437
- return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));
18473
+ return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
18438
18474
  }
18439
18475
  /**
18440
18476
  * Gets the effective type annotation of the value parameter of a set accessor. If the node
@@ -19908,6 +19944,61 @@ var ts;
19908
19944
  return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;
19909
19945
  }
19910
19946
  ts.getLanguageVariant = getLanguageVariant;
19947
+ /**
19948
+ * This is a somewhat unavoidable full tree walk to locate a JSX tag - `import.meta` requires the same,
19949
+ * but we avoid that walk (or parts of it) if at all possible using the `PossiblyContainsImportMeta` node flag.
19950
+ * Unfortunately, there's no `NodeFlag` space to do the same for JSX.
19951
+ */
19952
+ function walkTreeForJSXTags(node) {
19953
+ if (!(node.transformFlags & 2 /* ContainsJsx */))
19954
+ return undefined;
19955
+ return ts.isJsxOpeningLikeElement(node) || ts.isJsxFragment(node) ? node : ts.forEachChild(node, walkTreeForJSXTags);
19956
+ }
19957
+ function isFileModuleFromUsingJSXTag(file) {
19958
+ // Excludes declaration files - they still require an explicit `export {}` or the like
19959
+ // for back compat purposes. (not that declaration files should contain JSX tags!)
19960
+ return !file.isDeclarationFile ? walkTreeForJSXTags(file) : undefined;
19961
+ }
19962
+ /**
19963
+ * Note that this requires file.impliedNodeFormat be set already; meaning it must be set very early on
19964
+ * in SourceFile construction.
19965
+ */
19966
+ function isFileForcedToBeModuleByFormat(file) {
19967
+ // Excludes declaration files - they still require an explicit `export {}` or the like
19968
+ // for back compat purposes.
19969
+ return file.impliedNodeFormat === ts.ModuleKind.ESNext && !file.isDeclarationFile ? true : undefined;
19970
+ }
19971
+ function getSetExternalModuleIndicator(options) {
19972
+ // TODO: Should this callback be cached?
19973
+ switch (getEmitModuleDetectionKind(options)) {
19974
+ case ts.ModuleDetectionKind.Force:
19975
+ // All non-declaration files are modules, declaration files still do the usual isFileProbablyExternalModule
19976
+ return function (file) {
19977
+ file.externalModuleIndicator = !file.isDeclarationFile || ts.isFileProbablyExternalModule(file);
19978
+ };
19979
+ case ts.ModuleDetectionKind.Legacy:
19980
+ // Files are modules if they have imports, exports, or import.meta
19981
+ return function (file) {
19982
+ file.externalModuleIndicator = ts.isFileProbablyExternalModule(file);
19983
+ };
19984
+ case ts.ModuleDetectionKind.Auto:
19985
+ // If module is nodenext or node12, all esm format files are modules
19986
+ // If jsx is react-jsx or react-jsxdev then jsx tags force module-ness
19987
+ // otherwise, the presence of import or export statments (or import.meta) implies module-ness
19988
+ var checks = [ts.isFileProbablyExternalModule];
19989
+ if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) {
19990
+ checks.push(isFileModuleFromUsingJSXTag);
19991
+ }
19992
+ var moduleKind = getEmitModuleKind(options);
19993
+ if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
19994
+ checks.push(isFileForcedToBeModuleByFormat);
19995
+ }
19996
+ var combined_1 = ts.or.apply(void 0, checks);
19997
+ var callback = function (file) { return void (file.externalModuleIndicator = combined_1(file)); };
19998
+ return callback;
19999
+ }
20000
+ }
20001
+ ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
19911
20002
  function getEmitScriptTarget(compilerOptions) {
19912
20003
  return compilerOptions.target ||
19913
20004
  (compilerOptions.module === ts.ModuleKind.Node12 && 7 /* ES2020 */) ||
@@ -19942,6 +20033,10 @@ var ts;
19942
20033
  return moduleResolution;
19943
20034
  }
19944
20035
  ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
20036
+ function getEmitModuleDetectionKind(options) {
20037
+ return options.moduleDetection || ts.ModuleDetectionKind.Auto;
20038
+ }
20039
+ ts.getEmitModuleDetectionKind = getEmitModuleDetectionKind;
19945
20040
  function hasJsonModuleEmitEnabled(options) {
19946
20041
  switch (getEmitModuleKind(options)) {
19947
20042
  case ts.ModuleKind.CommonJS:
@@ -25411,7 +25506,7 @@ var ts;
25411
25506
  }
25412
25507
  // @api
25413
25508
  function createJSDocComment(comment, tags) {
25414
- var node = createBaseNode(319 /* JSDocComment */);
25509
+ var node = createBaseNode(319 /* JSDoc */);
25415
25510
  node.comment = comment;
25416
25511
  node.tags = asNodeArray(tags);
25417
25512
  return node;
@@ -28920,7 +29015,7 @@ var ts;
28920
29015
  }
28921
29016
  ts.isJSDocNamepathType = isJSDocNamepathType;
28922
29017
  function isJSDoc(node) {
28923
- return node.kind === 319 /* JSDocComment */;
29018
+ return node.kind === 319 /* JSDoc */;
28924
29019
  }
28925
29020
  ts.isJSDoc = isJSDoc;
28926
29021
  function isJSDocTypeLiteral(node) {
@@ -30112,6 +30207,36 @@ var ts;
30112
30207
  text.charCodeAt(start + 3) !== 47 /* slash */;
30113
30208
  }
30114
30209
  ts.isJSDocLikeText = isJSDocLikeText;
30210
+ /*@internal*/
30211
+ function isFileProbablyExternalModule(sourceFile) {
30212
+ // Try to use the first top-level import/export when available, then
30213
+ // fall back to looking for an 'import.meta' somewhere in the tree if necessary.
30214
+ return ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
30215
+ getImportMetaIfNecessary(sourceFile);
30216
+ }
30217
+ ts.isFileProbablyExternalModule = isFileProbablyExternalModule;
30218
+ function isAnExternalModuleIndicatorNode(node) {
30219
+ return hasModifierOfKind(node, 93 /* ExportKeyword */)
30220
+ || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
30221
+ || ts.isImportDeclaration(node)
30222
+ || ts.isExportAssignment(node)
30223
+ || ts.isExportDeclaration(node) ? node : undefined;
30224
+ }
30225
+ function getImportMetaIfNecessary(sourceFile) {
30226
+ return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ?
30227
+ walkTreeForImportMeta(sourceFile) :
30228
+ undefined;
30229
+ }
30230
+ function walkTreeForImportMeta(node) {
30231
+ return isImportMeta(node) ? node : forEachChild(node, walkTreeForImportMeta);
30232
+ }
30233
+ /** Do not use hasModifier inside the parser; it relies on parent pointers. Use this instead. */
30234
+ function hasModifierOfKind(node, kind) {
30235
+ return ts.some(node.modifiers, function (m) { return m.kind === kind; });
30236
+ }
30237
+ function isImportMeta(node) {
30238
+ return ts.isMetaProperty(node) && node.keywordToken === 100 /* ImportKeyword */ && node.name.escapedText === "meta";
30239
+ }
30115
30240
  /**
30116
30241
  * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
30117
30242
  * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
@@ -30545,7 +30670,7 @@ var ts;
30545
30670
  case 316 /* JSDocFunctionType */:
30546
30671
  return visitNodes(cbNode, cbNodes, node.parameters) ||
30547
30672
  visitNode(cbNode, node.type);
30548
- case 319 /* JSDocComment */:
30673
+ case 319 /* JSDoc */:
30549
30674
  return (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
30550
30675
  || visitNodes(cbNode, cbNodes, node.tags);
30551
30676
  case 345 /* JSDocSeeTag */:
@@ -30693,17 +30818,25 @@ var ts;
30693
30818
  children.unshift(n);
30694
30819
  }
30695
30820
  }
30696
- function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) {
30821
+ function setExternalModuleIndicator(sourceFile) {
30822
+ sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
30823
+ }
30824
+ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes, scriptKind) {
30697
30825
  if (setParentNodes === void 0) { setParentNodes = false; }
30698
30826
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("parse" /* Parse */, "createSourceFile", { path: fileName }, /*separateBeginAndEnd*/ true);
30699
30827
  ts.performance.mark("beforeParse");
30700
30828
  var result;
30701
30829
  ts.perfLogger.logStartParseSourceFile(fileName);
30830
+ var _a = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }, languageVersion = _a.languageVersion, overrideSetExternalModuleIndicator = _a.setExternalModuleIndicator, format = _a.impliedNodeFormat;
30702
30831
  if (languageVersion === 100 /* JSON */) {
30703
- result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, 6 /* JSON */);
30832
+ result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, 6 /* JSON */, ts.noop);
30704
30833
  }
30705
30834
  else {
30706
- result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind);
30835
+ var setIndicator = format === undefined ? overrideSetExternalModuleIndicator : function (file) {
30836
+ file.impliedNodeFormat = format;
30837
+ return (overrideSetExternalModuleIndicator || setExternalModuleIndicator)(file);
30838
+ };
30839
+ result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind, setIndicator);
30707
30840
  }
30708
30841
  ts.perfLogger.logStopParseSourceFile();
30709
30842
  ts.performance.mark("afterParse");
@@ -30889,7 +31022,7 @@ var ts;
30889
31022
  // Note: any errors at the end of the file that do not precede a regular node, should get
30890
31023
  // attached to the EOF token.
30891
31024
  var parseErrorBeforeNextFinishedNode = false;
30892
- function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
31025
+ function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind, setExternalModuleIndicatorOverride) {
30893
31026
  var _a;
30894
31027
  if (setParentNodes === void 0) { setParentNodes = false; }
30895
31028
  scriptKind = ts.ensureScriptKind(fileName, scriptKind);
@@ -30905,7 +31038,7 @@ var ts;
30905
31038
  return result_3;
30906
31039
  }
30907
31040
  initializeState(fileName, sourceText, languageVersion, syntaxCursor, scriptKind);
30908
- var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind);
31041
+ var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicatorOverride || setExternalModuleIndicator);
30909
31042
  clearState();
30910
31043
  return result;
30911
31044
  }
@@ -30989,7 +31122,7 @@ var ts;
30989
31122
  endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token);
30990
31123
  }
30991
31124
  // Set source file so that errors will be reported with this file name
30992
- var sourceFile = createSourceFile(fileName, 2 /* ES2015 */, 6 /* JSON */, /*isDeclaration*/ false, statements, endOfFileToken, sourceFlags);
31125
+ var sourceFile = createSourceFile(fileName, 2 /* ES2015 */, 6 /* JSON */, /*isDeclaration*/ false, statements, endOfFileToken, sourceFlags, ts.noop);
30993
31126
  if (setParentNodes) {
30994
31127
  fixupParentReferences(sourceFile);
30995
31128
  }
@@ -31063,7 +31196,7 @@ var ts;
31063
31196
  notParenthesizedArrow = undefined;
31064
31197
  topLevel = true;
31065
31198
  }
31066
- function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind) {
31199
+ function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicator) {
31067
31200
  var isDeclarationFile = isDeclarationFileName(fileName);
31068
31201
  if (isDeclarationFile) {
31069
31202
  contextFlags |= 8388608 /* Ambient */;
@@ -31074,7 +31207,7 @@ var ts;
31074
31207
  var statements = parseList(0 /* SourceElements */, parseStatement);
31075
31208
  ts.Debug.assert(token() === 1 /* EndOfFileToken */);
31076
31209
  var endOfFileToken = addJSDocComment(parseTokenNode());
31077
- var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags);
31210
+ var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator);
31078
31211
  // A member of ReadonlyArray<T> isn't assignable to a member of T[] (and prevents a direct cast) - but this is where we set up those members so they can be readonly in the future
31079
31212
  processCommentPragmas(sourceFile, sourceText);
31080
31213
  processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
@@ -31211,25 +31344,30 @@ var ts;
31211
31344
  ts.setParentRecursive(rootNode, /*incremental*/ true);
31212
31345
  }
31213
31346
  Parser.fixupParentReferences = fixupParentReferences;
31214
- function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags) {
31347
+ function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator) {
31215
31348
  // code from createNode is inlined here so createNode won't have to deal with special case of creating source files
31216
31349
  // this is quite rare comparing to other nodes and createNode should be as fast as possible
31217
31350
  var sourceFile = factory.createSourceFile(statements, endOfFileToken, flags);
31218
31351
  ts.setTextRangePosWidth(sourceFile, 0, sourceText.length);
31219
- setExternalModuleIndicator(sourceFile);
31352
+ setFields(sourceFile);
31220
31353
  // If we parsed this as an external module, it may contain top-level await
31221
31354
  if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 16777216 /* ContainsPossibleTopLevelAwait */) {
31222
31355
  sourceFile = reparseTopLevelAwait(sourceFile);
31356
+ setFields(sourceFile);
31223
31357
  }
31224
- sourceFile.text = sourceText;
31225
- sourceFile.bindDiagnostics = [];
31226
- sourceFile.bindSuggestionDiagnostics = undefined;
31227
- sourceFile.languageVersion = languageVersion;
31228
- sourceFile.fileName = fileName;
31229
- sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
31230
- sourceFile.isDeclarationFile = isDeclarationFile;
31231
- sourceFile.scriptKind = scriptKind;
31232
31358
  return sourceFile;
31359
+ function setFields(sourceFile) {
31360
+ sourceFile.text = sourceText;
31361
+ sourceFile.bindDiagnostics = [];
31362
+ sourceFile.bindSuggestionDiagnostics = undefined;
31363
+ sourceFile.languageVersion = languageVersion;
31364
+ sourceFile.fileName = fileName;
31365
+ sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
31366
+ sourceFile.isDeclarationFile = isDeclarationFile;
31367
+ sourceFile.scriptKind = scriptKind;
31368
+ setExternalModuleIndicator(sourceFile);
31369
+ sourceFile.setExternalModuleIndicator = setExternalModuleIndicator;
31370
+ }
31233
31371
  }
31234
31372
  function setContextFlag(val, flag) {
31235
31373
  if (val) {
@@ -36712,35 +36850,6 @@ var ts;
36712
36850
  var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
36713
36851
  return withJSDoc(finishNode(node, pos), hasJSDoc);
36714
36852
  }
36715
- function setExternalModuleIndicator(sourceFile) {
36716
- // Try to use the first top-level import/export when available, then
36717
- // fall back to looking for an 'import.meta' somewhere in the tree if necessary.
36718
- sourceFile.externalModuleIndicator =
36719
- ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
36720
- getImportMetaIfNecessary(sourceFile);
36721
- }
36722
- function isAnExternalModuleIndicatorNode(node) {
36723
- return hasModifierOfKind(node, 93 /* ExportKeyword */)
36724
- || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
36725
- || ts.isImportDeclaration(node)
36726
- || ts.isExportAssignment(node)
36727
- || ts.isExportDeclaration(node) ? node : undefined;
36728
- }
36729
- function getImportMetaIfNecessary(sourceFile) {
36730
- return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ?
36731
- walkTreeForExternalModuleIndicators(sourceFile) :
36732
- undefined;
36733
- }
36734
- function walkTreeForExternalModuleIndicators(node) {
36735
- return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators);
36736
- }
36737
- /** Do not use hasModifier inside the parser; it relies on parent pointers. Use this instead. */
36738
- function hasModifierOfKind(node, kind) {
36739
- return ts.some(node.modifiers, function (m) { return m.kind === kind; });
36740
- }
36741
- function isImportMeta(node) {
36742
- return ts.isMetaProperty(node) && node.keywordToken === 100 /* ImportKeyword */ && node.name.escapedText === "meta";
36743
- }
36744
36853
  var ParsingContext;
36745
36854
  (function (ParsingContext) {
36746
36855
  ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements";
@@ -36783,7 +36892,7 @@ var ts;
36783
36892
  scanner.setText(content, start, length);
36784
36893
  currentToken = scanner.scan();
36785
36894
  var jsDocTypeExpression = parseJSDocTypeExpression();
36786
- var sourceFile = createSourceFile("file.js", 99 /* Latest */, 1 /* JS */, /*isDeclarationFile*/ false, [], factory.createToken(1 /* EndOfFileToken */), 0 /* None */);
36895
+ var sourceFile = createSourceFile("file.js", 99 /* Latest */, 1 /* JS */, /*isDeclarationFile*/ false, [], factory.createToken(1 /* EndOfFileToken */), 0 /* None */, ts.noop);
36787
36896
  var diagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);
36788
36897
  if (jsDocDiagnostics) {
36789
36898
  sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
@@ -37744,7 +37853,7 @@ var ts;
37744
37853
  if (sourceFile.statements.length === 0) {
37745
37854
  // If we don't have any statements in the current source file, then there's no real
37746
37855
  // way to incrementally parse. So just do a full parse instead.
37747
- return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true, sourceFile.scriptKind);
37856
+ return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
37748
37857
  }
37749
37858
  // Make sure we're not trying to incrementally update a source file more than once. Once
37750
37859
  // we do an update the original source file is considered unusable from that point onwards.
@@ -37801,7 +37910,7 @@ var ts;
37801
37910
  // inconsistent tree. Setting the parents on the new tree should be very fast. We
37802
37911
  // will immediately bail out of walking any subtrees when we can see that their parents
37803
37912
  // are already correct.
37804
- var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true, sourceFile.scriptKind);
37913
+ var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
37805
37914
  result.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result.commentDirectives, changeRange.span.start, ts.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks);
37806
37915
  result.impliedNodeFormat = sourceFile.impliedNodeFormat;
37807
37916
  return result;
@@ -38779,7 +38888,7 @@ var ts;
38779
38888
  shortName: "i",
38780
38889
  type: "boolean",
38781
38890
  category: ts.Diagnostics.Projects,
38782
- description: ts.Diagnostics.Enable_incremental_compilation,
38891
+ description: ts.Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,
38783
38892
  transpileOptionValue: undefined,
38784
38893
  defaultValueDescription: ts.Diagnostics.false_unless_composite_is_set
38785
38894
  },
@@ -39179,7 +39288,7 @@ var ts;
39179
39288
  affectsSemanticDiagnostics: true,
39180
39289
  strictFlag: true,
39181
39290
  category: ts.Diagnostics.Type_Checking,
39182
- description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
39291
+ description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
39183
39292
  defaultValueDescription: false,
39184
39293
  },
39185
39294
  {
@@ -39197,7 +39306,7 @@ var ts;
39197
39306
  type: "boolean",
39198
39307
  affectsSemanticDiagnostics: true,
39199
39308
  category: ts.Diagnostics.Type_Checking,
39200
- description: ts.Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,
39309
+ description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39201
39310
  defaultValueDescription: false,
39202
39311
  },
39203
39312
  {
@@ -39238,7 +39347,7 @@ var ts;
39238
39347
  type: "boolean",
39239
39348
  affectsSemanticDiagnostics: true,
39240
39349
  category: ts.Diagnostics.Type_Checking,
39241
- description: ts.Diagnostics.Include_undefined_in_index_signature_results,
39350
+ description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39242
39351
  defaultValueDescription: false,
39243
39352
  },
39244
39353
  {
@@ -39714,9 +39823,21 @@ var ts;
39714
39823
  name: "plugin",
39715
39824
  type: "object"
39716
39825
  },
39717
- description: ts.Diagnostics.List_of_language_service_plugins,
39826
+ description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
39718
39827
  category: ts.Diagnostics.Editor_Support,
39719
39828
  },
39829
+ {
39830
+ name: "moduleDetection",
39831
+ type: new ts.Map(ts.getEntries({
39832
+ auto: ts.ModuleDetectionKind.Auto,
39833
+ legacy: ts.ModuleDetectionKind.Legacy,
39834
+ force: ts.ModuleDetectionKind.Force,
39835
+ })),
39836
+ affectsModuleResolution: true,
39837
+ description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
39838
+ category: ts.Diagnostics.Language_and_Environment,
39839
+ defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules,
39840
+ }
39720
39841
  ];
39721
39842
  /* @internal */
39722
39843
  ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
@@ -47434,7 +47555,7 @@ var ts;
47434
47555
  var noImplicitThis = ts.getStrictOptionValue(compilerOptions, "noImplicitThis");
47435
47556
  var useUnknownInCatchVariables = ts.getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
47436
47557
  var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
47437
- var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
47558
+ var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
47438
47559
  var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
47439
47560
  var checkBinaryExpression = createCheckBinaryExpression();
47440
47561
  var emitResolver = createResolver();
@@ -47818,16 +47939,16 @@ var ts;
47818
47939
  var wildcardType = createIntrinsicType(1 /* Any */, "any");
47819
47940
  var errorType = createIntrinsicType(1 /* Any */, "error");
47820
47941
  var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
47821
- var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */);
47942
+ var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */);
47822
47943
  var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
47823
47944
  var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
47824
47945
  var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
47825
47946
  var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
47826
- var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */);
47947
+ var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */);
47827
47948
  var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
47828
47949
  var missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768 /* Undefined */, "undefined") : undefinedType;
47829
47950
  var nullType = createIntrinsicType(65536 /* Null */, "null");
47830
- var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */);
47951
+ var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */);
47831
47952
  var stringType = createIntrinsicType(4 /* String */, "string");
47832
47953
  var numberType = createIntrinsicType(8 /* Number */, "number");
47833
47954
  var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
@@ -47848,7 +47969,7 @@ var ts;
47848
47969
  var voidType = createIntrinsicType(16384 /* Void */, "void");
47849
47970
  var neverType = createIntrinsicType(131072 /* Never */, "never");
47850
47971
  var silentNeverType = createIntrinsicType(131072 /* Never */, "never");
47851
- var nonInferrableType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */);
47972
+ var nonInferrableType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */);
47852
47973
  var implicitNeverType = createIntrinsicType(131072 /* Never */, "never");
47853
47974
  var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never");
47854
47975
  var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object");
@@ -47859,6 +47980,8 @@ var ts;
47859
47980
  var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
47860
47981
  var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; });
47861
47982
  var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; });
47983
+ var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); // `uniqueLiteralType` is a special `never` flagged by union reduction to behave as a literal
47984
+ var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t; }); // replace all type parameters with the unique literal type (disregarding constraints)
47862
47985
  var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47863
47986
  var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47864
47987
  emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
@@ -47870,7 +47993,7 @@ var ts;
47870
47993
  var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47871
47994
  // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated
47872
47995
  // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes.
47873
- anyFunctionType.objectFlags |= 262144 /* NonInferrableType */;
47996
+ anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
47874
47997
  var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47875
47998
  var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47876
47999
  var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
@@ -48797,7 +48920,7 @@ var ts;
48797
48920
  // - parameters are only in the scope of function body
48798
48921
  // This restriction does not apply to JSDoc comment types because they are parented
48799
48922
  // at a higher level than type parameters would normally be
48800
- if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDocComment */) {
48923
+ if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDoc */) {
48801
48924
  useResult = result.flags & 262144 /* TypeParameter */
48802
48925
  // type parameters are visible in parameter list, return type and type parameter list
48803
48926
  ? lastLocation === location.type ||
@@ -51416,7 +51539,7 @@ var ts;
51416
51539
  return flags & 814775659 /* NodeBuilderFlagsMask */;
51417
51540
  }
51418
51541
  function isClassInstanceSide(type) {
51419
- return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) & 16777216 /* IsClassInstanceClone */)));
51542
+ return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) & 33554432 /* IsClassInstanceClone */)));
51420
51543
  }
51421
51544
  function createNodeBuilder() {
51422
51545
  return {
@@ -51763,10 +51886,16 @@ var ts;
51763
51886
  var readonlyToken = type.declaration.readonlyToken ? ts.factory.createToken(type.declaration.readonlyToken.kind) : undefined;
51764
51887
  var questionToken = type.declaration.questionToken ? ts.factory.createToken(type.declaration.questionToken.kind) : undefined;
51765
51888
  var appropriateConstraintTypeNode;
51889
+ var newTypeVariable;
51766
51890
  if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
51767
51891
  // We have a { [P in keyof T]: X }
51768
51892
  // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType`
51769
- appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(140 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
51893
+ if (!(getModifiersTypeFromMappedType(type).flags & 262144 /* TypeParameter */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
51894
+ var newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T"));
51895
+ var name = typeParameterToName(newParam, context);
51896
+ newTypeVariable = ts.factory.createTypeReferenceNode(name);
51897
+ }
51898
+ appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(140 /* KeyOfKeyword */, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
51770
51899
  }
51771
51900
  else {
51772
51901
  appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context);
@@ -51776,7 +51905,14 @@ var ts;
51776
51905
  var templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), context);
51777
51906
  var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode, /*members*/ undefined);
51778
51907
  context.approximateLength += 10;
51779
- return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */);
51908
+ var result = ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */);
51909
+ if (isMappedTypeWithKeyofConstraintDeclaration(type) && !(getModifiersTypeFromMappedType(type).flags & 262144 /* TypeParameter */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
51910
+ // homomorphic mapped type with a non-homomorphic naive inlining
51911
+ // wrap it with a conditional like `SomeModifiersType extends infer U ? {..the mapped type...} : never` to ensure the resulting
51912
+ // type stays homomorphic
51913
+ return ts.factory.createConditionalTypeNode(typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context), ts.factory.createInferTypeNode(ts.factory.createTypeParameterDeclaration(ts.factory.cloneNode(newTypeVariable.typeName))), result, ts.factory.createKeywordTypeNode(143 /* NeverKeyword */));
51914
+ }
51915
+ return result;
51780
51916
  }
51781
51917
  function createAnonymousTypeNode(type) {
51782
51918
  var _a;
@@ -53397,7 +53533,7 @@ var ts;
53397
53533
  // If it's a class/interface/function: emit a class/interface/function with a `default` modifier
53398
53534
  // These forms can merge, eg (`export default 12; export default interface A {}`)
53399
53535
  function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
53400
- var _a, _b;
53536
+ var _a, _b, _c, _d;
53401
53537
  var symbolName = ts.unescapeLeadingUnderscores(symbol.escapedName);
53402
53538
  var isDefault = symbol.escapedName === "default" /* Default */;
53403
53539
  if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && ts.isStringANonContextualKeyword(symbolName) && !isDefault) {
@@ -53448,17 +53584,21 @@ var ts;
53448
53584
  else {
53449
53585
  // A Class + Property merge is made for a `module.exports.Member = class {}`, and it doesn't serialize well as either a class _or_ a property symbol - in fact, _it behaves like an alias!_
53450
53586
  // `var` is `FunctionScopedVariable`, `const` and `let` are `BlockScopedVariable`, and `module.exports.thing =` is `Property`
53451
- var flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? undefined
53452
- : isConstVariable(symbol) ? 2 /* Const */
53587
+ var flags = !(symbol.flags & 2 /* BlockScopedVariable */)
53588
+ ? ((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && ts.isSourceFile((_b = symbol.parent) === null || _b === void 0 ? void 0 : _b.valueDeclaration)
53589
+ ? 2 /* Const */
53590
+ : undefined
53591
+ : isConstVariable(symbol)
53592
+ ? 2 /* Const */
53453
53593
  : 1 /* Let */;
53454
53594
  var name = (needsPostExportDefault || !(symbol.flags & 4 /* Property */)) ? localName : getUnusedName(localName, symbol);
53455
53595
  var textRange = symbol.declarations && ts.find(symbol.declarations, function (d) { return ts.isVariableDeclaration(d); });
53456
53596
  if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
53457
53597
  textRange = textRange.parent.parent;
53458
53598
  }
53459
- var propertyAccessRequire = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isPropertyAccessExpression);
53599
+ var propertyAccessRequire = (_c = symbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isPropertyAccessExpression);
53460
53600
  if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
53461
- && ((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
53601
+ && ((_d = type.symbol) === null || _d === void 0 ? void 0 : _d.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
53462
53602
  var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
53463
53603
  addResult(ts.factory.createExportDeclaration(
53464
53604
  /*decorators*/ undefined,
@@ -53538,8 +53678,8 @@ var ts;
53538
53678
  // synthesize export * from "moduleReference"
53539
53679
  // Straightforward - only one thing to do - make an export declaration
53540
53680
  if (symbol.declarations) {
53541
- for (var _i = 0, _c = symbol.declarations; _i < _c.length; _i++) {
53542
- var node = _c[_i];
53681
+ for (var _i = 0, _e = symbol.declarations; _i < _e.length; _i++) {
53682
+ var node = _e[_i];
53543
53683
  var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
53544
53684
  if (!resolvedModule)
53545
53685
  continue;
@@ -54817,7 +54957,7 @@ var ts;
54817
54957
  members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
54818
54958
  }
54819
54959
  var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
54820
- result.objectFlags |= 4194304 /* ObjectRestType */;
54960
+ result.objectFlags |= 8388608 /* ObjectRestType */;
54821
54961
  return result;
54822
54962
  }
54823
54963
  function isGenericTypeWithUndefinedConstraint(type) {
@@ -55289,7 +55429,7 @@ var ts;
55289
55429
  mergeSymbolTable(exports, s.exports);
55290
55430
  }
55291
55431
  var type = createAnonymousType(symbol, exports, ts.emptyArray, ts.emptyArray, ts.emptyArray);
55292
- type.objectFlags |= 4096 /* JSLiteral */;
55432
+ type.objectFlags |= 8192 /* JSLiteral */;
55293
55433
  return type;
55294
55434
  }
55295
55435
  function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
@@ -55345,7 +55485,10 @@ var ts;
55345
55485
  if (containsSameNamedThisProperty(expression.left, expression.right)) {
55346
55486
  return anyType;
55347
55487
  }
55348
- var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : getWidenedLiteralType(checkExpressionCached(expression.right));
55488
+ var isDirectExport = kind === 1 /* ExportsProperty */ && (ts.isPropertyAccessExpression(expression.left) || ts.isElementAccessExpression(expression.left)) && (ts.isModuleExportsAccessExpression(expression.left.expression) || (ts.isIdentifier(expression.left.expression) && ts.isExportsIdentifier(expression.left.expression)));
55489
+ var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol)
55490
+ : isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right))
55491
+ : getWidenedLiteralType(checkExpressionCached(expression.right));
55349
55492
  if (type.flags & 524288 /* Object */ &&
55350
55493
  kind === 2 /* ModuleExports */ &&
55351
55494
  symbol.escapedName === "export=" /* ExportEquals */) {
@@ -55393,9 +55536,9 @@ var ts;
55393
55536
  });
55394
55537
  var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type
55395
55538
  members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
55396
- result.objectFlags |= (ts.getObjectFlags(type) & 4096 /* JSLiteral */); // Propagate JSLiteral flag
55539
+ result.objectFlags |= (ts.getObjectFlags(type) & 8192 /* JSLiteral */); // Propagate JSLiteral flag
55397
55540
  if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
55398
- result.objectFlags |= 16777216 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
55541
+ result.objectFlags |= 33554432 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
55399
55542
  }
55400
55543
  return result;
55401
55544
  }
@@ -55454,7 +55597,7 @@ var ts;
55454
55597
  function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {
55455
55598
  var members = ts.createSymbolTable();
55456
55599
  var stringIndexInfo;
55457
- var objectFlags = 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
55600
+ var objectFlags = 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
55458
55601
  ts.forEach(pattern.elements, function (e) {
55459
55602
  var name = e.propertyName || e.name;
55460
55603
  if (e.dotDotDotToken) {
@@ -55478,7 +55621,7 @@ var ts;
55478
55621
  result.objectFlags |= objectFlags;
55479
55622
  if (includePatternInType) {
55480
55623
  result.pattern = pattern;
55481
- result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
55624
+ result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
55482
55625
  }
55483
55626
  return result;
55484
55627
  }
@@ -55497,7 +55640,7 @@ var ts;
55497
55640
  if (includePatternInType) {
55498
55641
  result = cloneTypeReference(result);
55499
55642
  result.pattern = pattern;
55500
- result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
55643
+ result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
55501
55644
  }
55502
55645
  return result;
55503
55646
  }
@@ -56089,7 +56232,7 @@ var ts;
56089
56232
  node = paramSymbol.valueDeclaration;
56090
56233
  }
56091
56234
  break;
56092
- case 319 /* JSDocComment */: {
56235
+ case 319 /* JSDoc */: {
56093
56236
  var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
56094
56237
  return node.tags
56095
56238
  ? appendTypeParameters(outerTypeParameters, ts.flatMap(node.tags, function (t) { return ts.isJSDocTemplateTag(t) ? t.typeParameters : undefined; }))
@@ -58291,7 +58434,7 @@ var ts;
58291
58434
  checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
58292
58435
  indexTypes = ts.append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
58293
58436
  }
58294
- else if (isObjectLiteralType(type) && !(ts.getObjectFlags(type) & 2097152 /* ContainsSpread */)) {
58437
+ else if (isObjectLiteralType(type) && !(ts.getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
58295
58438
  checkFlags |= 32 /* WritePartial */;
58296
58439
  indexTypes = ts.append(indexTypes, undefinedType);
58297
58440
  }
@@ -58350,10 +58493,10 @@ var ts;
58350
58493
  else if (type !== firstType) {
58351
58494
  checkFlags |= 64 /* HasNonUniformType */;
58352
58495
  }
58353
- if (isLiteralType(type) || isPatternLiteralType(type)) {
58496
+ if (isLiteralType(type) || isPatternLiteralType(type) || type === uniqueLiteralType) {
58354
58497
  checkFlags |= 128 /* HasLiteralType */;
58355
58498
  }
58356
- if (type.flags & 131072 /* Never */) {
58499
+ if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
58357
58500
  checkFlags |= 131072 /* HasNeverType */;
58358
58501
  }
58359
58502
  propTypes.push(type);
@@ -58415,15 +58558,15 @@ var ts;
58415
58558
  * no constituent property has type 'never', but the intersection of the constituent property types is 'never'.
58416
58559
  */
58417
58560
  function getReducedType(type) {
58418
- if (type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */) {
58561
+ if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
58419
58562
  return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
58420
58563
  }
58421
58564
  else if (type.flags & 2097152 /* Intersection */) {
58422
- if (!(type.objectFlags & 16777216 /* IsNeverIntersectionComputed */)) {
58423
- type.objectFlags |= 16777216 /* IsNeverIntersectionComputed */ |
58424
- (ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 33554432 /* IsNeverIntersection */ : 0);
58565
+ if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
58566
+ type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ |
58567
+ (ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
58425
58568
  }
58426
- return type.objectFlags & 33554432 /* IsNeverIntersection */ ? neverType : type;
58569
+ return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
58427
58570
  }
58428
58571
  return type;
58429
58572
  }
@@ -58453,7 +58596,7 @@ var ts;
58453
58596
  return !prop.valueDeclaration && !!(ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */);
58454
58597
  }
58455
58598
  function elaborateNeverIntersection(errorInfo, type) {
58456
- if (type.flags & 2097152 /* Intersection */ && ts.getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
58599
+ if (type.flags & 2097152 /* Intersection */ && ts.getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
58457
58600
  var neverProp = ts.find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
58458
58601
  if (neverProp) {
58459
58602
  return ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(type, /*enclosingDeclaration*/ undefined, 536870912 /* NoTypeReduction */), symbolToString(neverProp));
@@ -59260,7 +59403,7 @@ var ts;
59260
59403
  result |= ts.getObjectFlags(type);
59261
59404
  }
59262
59405
  }
59263
- return result & 458752 /* PropagatingFlags */;
59406
+ return result & 917504 /* PropagatingFlags */;
59264
59407
  }
59265
59408
  function createTypeReference(target, typeArguments) {
59266
59409
  var id = getTypeListId(typeArguments);
@@ -59538,7 +59681,7 @@ var ts;
59538
59681
  function getConditionalFlowTypeOfType(type, node) {
59539
59682
  var constraints;
59540
59683
  var covariant = true;
59541
- while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDocComment */) {
59684
+ while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDoc */) {
59542
59685
  var parent = node.parent;
59543
59686
  // only consider variance flipped by parameter locations - `keyof` types would usually be considered variance inverting, but
59544
59687
  // often get used in indexed accesses where they behave sortof invariantly, but our checking is lax
@@ -60182,7 +60325,7 @@ var ts;
60182
60325
  if (type === wildcardType)
60183
60326
  includes |= 8388608 /* IncludesWildcard */;
60184
60327
  if (!strictNullChecks && flags & 98304 /* Nullable */) {
60185
- if (!(ts.getObjectFlags(type) & 65536 /* ContainsWideningType */))
60328
+ if (!(ts.getObjectFlags(type) & 131072 /* ContainsWideningType */))
60186
60329
  includes |= 4194304 /* IncludesNonWideningType */;
60187
60330
  }
60188
60331
  else {
@@ -60205,6 +60348,10 @@ var ts;
60205
60348
  return includes;
60206
60349
  }
60207
60350
  function removeSubtypes(types, hasObjectTypes) {
60351
+ // [] and [T] immediately reduce to [] and [T] respectively
60352
+ if (types.length < 2) {
60353
+ return types;
60354
+ }
60208
60355
  var id = getTypeListId(types);
60209
60356
  var match = subtypeReductionCache.get(id);
60210
60357
  if (match) {
@@ -60392,8 +60539,8 @@ var ts;
60392
60539
  origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
60393
60540
  }
60394
60541
  }
60395
- var objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) |
60396
- (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
60542
+ var objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) |
60543
+ (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
60397
60544
  return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
60398
60545
  }
60399
60546
  function getUnionOrIntersectionTypePredicate(signatures, kind) {
@@ -60582,7 +60729,7 @@ var ts;
60582
60729
  // other unions and return true. Otherwise, do nothing and return false.
60583
60730
  function intersectUnionsOfPrimitiveTypes(types) {
60584
60731
  var unionTypes;
60585
- var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 32768 /* PrimitiveUnion */); });
60732
+ var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 65536 /* PrimitiveUnion */); });
60586
60733
  if (index < 0) {
60587
60734
  return false;
60588
60735
  }
@@ -60591,7 +60738,7 @@ var ts;
60591
60738
  // the unionTypes array.
60592
60739
  while (i < types.length) {
60593
60740
  var t = types[i];
60594
- if (ts.getObjectFlags(t) & 32768 /* PrimitiveUnion */) {
60741
+ if (ts.getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
60595
60742
  (unionTypes || (unionTypes = [types[index]])).push(t);
60596
60743
  ts.orderedRemoveItemAt(types, i);
60597
60744
  }
@@ -60620,7 +60767,7 @@ var ts;
60620
60767
  }
60621
60768
  }
60622
60769
  // Finally replace the first union with the result
60623
- types[index] = getUnionTypeFromSortedList(result, 32768 /* PrimitiveUnion */);
60770
+ types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
60624
60771
  return true;
60625
60772
  }
60626
60773
  function createIntersectionType(types, aliasSymbol, aliasTypeArguments) {
@@ -60890,10 +61037,24 @@ var ts;
60890
61037
  return getUnionType(ts.concatenate(propertyTypes, indexKeyTypes), 1 /* Literal */,
60891
61038
  /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, origin);
60892
61039
  }
61040
+ /**
61041
+ * A union type which is reducible upon instantiation (meaning some members are removed under certain instantiations)
61042
+ * must be kept generic, as that instantiation information needs to flow through the type system. By replacing all
61043
+ * type parameters in the union with a special never type that is treated as a literal in `getReducedType`, we can cause the `getReducedType` logic
61044
+ * to reduce the resulting type if possible (since only intersections with conflicting literal-typed properties are reducible).
61045
+ */
61046
+ function isPossiblyReducibleByInstantiation(type) {
61047
+ return ts.some(type.types, function (t) {
61048
+ var uniqueFilled = getUniqueLiteralFilledInstantiation(t);
61049
+ return getReducedType(uniqueFilled) !== uniqueFilled;
61050
+ });
61051
+ }
60893
61052
  function getIndexType(type, stringsOnly, noIndexSignatures) {
60894
61053
  if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
60895
61054
  type = getReducedType(type);
60896
- return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
61055
+ return type.flags & 1048576 /* Union */ ? isPossiblyReducibleByInstantiation(type)
61056
+ ? getIndexTypeForGenericType(type, stringsOnly)
61057
+ : getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
60897
61058
  type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
60898
61059
  type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
60899
61060
  ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
@@ -61059,7 +61220,7 @@ var ts;
61059
61220
  if (noImplicitAny) {
61060
61221
  return false; // Flag is meaningless under `noImplicitAny` mode
61061
61222
  }
61062
- if (ts.getObjectFlags(type) & 4096 /* JSLiteral */) {
61223
+ if (ts.getObjectFlags(type) & 8192 /* JSLiteral */) {
61063
61224
  return true;
61064
61225
  }
61065
61226
  if (type.flags & 1048576 /* Union */) {
@@ -61273,28 +61434,28 @@ var ts;
61273
61434
  return !!getGenericObjectFlags(type);
61274
61435
  }
61275
61436
  function isGenericObjectType(type) {
61276
- return !!(getGenericObjectFlags(type) & 4194304 /* IsGenericObjectType */);
61437
+ return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
61277
61438
  }
61278
61439
  function isGenericIndexType(type) {
61279
- return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
61440
+ return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
61280
61441
  }
61281
61442
  function getGenericObjectFlags(type) {
61282
61443
  if (type.flags & 3145728 /* UnionOrIntersection */) {
61283
- if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
61284
- type.objectFlags |= 2097152 /* IsGenericTypeComputed */ |
61444
+ if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
61445
+ type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
61285
61446
  ts.reduceLeft(type.types, function (flags, t) { return flags | getGenericObjectFlags(t); }, 0);
61286
61447
  }
61287
- return type.objectFlags & 12582912 /* IsGenericType */;
61448
+ return type.objectFlags & 25165824 /* IsGenericType */;
61288
61449
  }
61289
61450
  if (type.flags & 33554432 /* Substitution */) {
61290
- if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
61291
- type.objectFlags |= 2097152 /* IsGenericTypeComputed */ |
61451
+ if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
61452
+ type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
61292
61453
  getGenericObjectFlags(type.substitute) | getGenericObjectFlags(type.baseType);
61293
61454
  }
61294
- return type.objectFlags & 12582912 /* IsGenericType */;
61455
+ return type.objectFlags & 25165824 /* IsGenericType */;
61295
61456
  }
61296
- return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) |
61297
- (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
61457
+ return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) |
61458
+ (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
61298
61459
  }
61299
61460
  function getSimplifiedType(type, writing) {
61300
61461
  return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) :
@@ -61521,6 +61682,10 @@ var ts;
61521
61682
  }
61522
61683
  return type;
61523
61684
  }
61685
+ function maybeCloneTypeParameter(p) {
61686
+ var constraint = getConstraintOfTypeParameter(p);
61687
+ return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
61688
+ }
61524
61689
  function isTypicalNondistributiveConditional(root) {
61525
61690
  return !root.isDistributive && isSingletonTupleType(root.node.checkType) && isSingletonTupleType(root.node.extendsType);
61526
61691
  }
@@ -61539,37 +61704,65 @@ var ts;
61539
61704
  var result;
61540
61705
  var extraTypes;
61541
61706
  var tailCount = 0;
61542
- // We loop here for an immediately nested conditional type in the false position, effectively treating
61543
- // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for
61544
- // purposes of resolution. We also loop here when resolution of a conditional type ends in resolution of
61545
- // another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
61546
- // cases we increment the tail recursion counter and stop after 1000 iterations.
61547
- while (true) {
61707
+ var _loop_18 = function () {
61548
61708
  if (tailCount === 1000) {
61549
61709
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
61550
61710
  result = errorType;
61551
- break;
61711
+ return "break";
61552
61712
  }
61553
61713
  var isUnwrapped = isTypicalNondistributiveConditional(root);
61554
61714
  var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
61555
61715
  var checkTypeInstantiable = isGenericType(checkType);
61556
61716
  var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
61557
61717
  if (checkType === wildcardType || extendsType === wildcardType) {
61558
- return wildcardType;
61718
+ return { value: wildcardType };
61559
61719
  }
61560
61720
  var combinedMapper = void 0;
61561
61721
  if (root.inferTypeParameters) {
61562
- var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
61563
- if (!checkTypeInstantiable) {
61722
+ // When we're looking at making an inference for an infer type, when we get its constraint, it'll automagically be
61723
+ // instantiated with the context, so it doesn't need the mapper for the inference contex - however the constraint
61724
+ // may refer to another _root_, _uncloned_ `infer` type parameter [1], or to something mapped by `mapper` [2].
61725
+ // [1] Eg, if we have `Foo<T, U extends T>` and `Foo<number, infer B>` - `B` is constrained to `T`, which, in turn, has been instantiated
61726
+ // as `number`
61727
+ // Conversely, if we have `Foo<infer A, infer B>`, `B` is still constrained to `T` and `T` is instantiated as `A`
61728
+ // [2] Eg, if we have `Foo<T, U extends T>` and `Foo<Q, infer B>` where `Q` is mapped by `mapper` into `number` - `B` is constrained to `T`
61729
+ // which is in turn instantiated as `Q`, which is in turn instantiated as `number`.
61730
+ // So we need to:
61731
+ // * Clone the type parameters so their constraints can be instantiated in the context of `mapper` (otherwise theyd only get inference context information)
61732
+ // * Set the clones to both map the conditional's enclosing `mapper` and the original params
61733
+ // * instantiate the extends type with the clones
61734
+ // * incorporate all of the component mappers into the combined mapper for the true and false members
61735
+ // This means we have three mappers that need applying:
61736
+ // * The original `mapper` used to create this conditional
61737
+ // * The mapper that maps the old root type parameter to the clone (`freshMapper`)
61738
+ // * The mapper that maps the clone to its inference result (`context.mapper`)
61739
+ var freshParams = ts.sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
61740
+ var freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : undefined;
61741
+ var context = createInferenceContext(freshParams, /*signature*/ undefined, 0 /* None */);
61742
+ if (freshMapper) {
61743
+ var freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
61744
+ for (var _i = 0, freshParams_1 = freshParams; _i < freshParams_1.length; _i++) {
61745
+ var p = freshParams_1[_i];
61746
+ if (root.inferTypeParameters.indexOf(p) === -1) {
61747
+ p.mapper = freshCombinedMapper;
61748
+ }
61749
+ }
61750
+ }
61751
+ // We skip inference of the possible `infer` types unles the `extendsType` _is_ an infer type
61752
+ // if it was, it's trivial to say that extendsType = checkType, however such a pattern is used to
61753
+ // "reset" the type being build up during constraint calculation and avoid making an apparently "infinite" constraint
61754
+ // so in those cases we refain from performing inference and retain the uninfered type parameter
61755
+ if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) {
61564
61756
  // We don't want inferences from constraints as they may cause us to eagerly resolve the
61565
61757
  // conditional type instead of deferring resolution. Also, we always want strict function
61566
61758
  // types rules (i.e. proper contravariance) for inferences.
61567
- inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
61759
+ inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
61568
61760
  }
61761
+ var innerMapper = combineTypeMappers(freshMapper, context.mapper);
61569
61762
  // It's possible for 'infer T' type paramteters to be given uninstantiated constraints when the
61570
61763
  // those type parameters are used in type references (see getInferredTypeParameterConstraint). For
61571
61764
  // that reason we need context.mapper to be first in the combined mapper. See #42636 for examples.
61572
- combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
61765
+ combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
61573
61766
  }
61574
61767
  // Instantiate the extends type including inferences for 'infer T' type parameters
61575
61768
  var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), combinedMapper) : extendsType;
@@ -61591,14 +61784,14 @@ var ts;
61591
61784
  var newRoot = falseType_1.root;
61592
61785
  if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
61593
61786
  root = newRoot;
61594
- continue;
61787
+ return "continue";
61595
61788
  }
61596
61789
  if (canTailRecurse(falseType_1, mapper)) {
61597
- continue;
61790
+ return "continue";
61598
61791
  }
61599
61792
  }
61600
61793
  result = instantiateType(falseType_1, mapper);
61601
- break;
61794
+ return "break";
61602
61795
  }
61603
61796
  // Return trueType for a definitely true extends check. We check instantiations of the two
61604
61797
  // types with type parameters mapped to their restrictive form, i.e. a form of the type parameter
@@ -61609,10 +61802,10 @@ var ts;
61609
61802
  var trueType_1 = getTypeFromTypeNode(root.node.trueType);
61610
61803
  var trueMapper = combinedMapper || mapper;
61611
61804
  if (canTailRecurse(trueType_1, trueMapper)) {
61612
- continue;
61805
+ return "continue";
61613
61806
  }
61614
61807
  result = instantiateType(trueType_1, trueMapper);
61615
- break;
61808
+ return "break";
61616
61809
  }
61617
61810
  }
61618
61811
  // Return a deferred type for a check that is neither definitely true nor definitely false
@@ -61624,7 +61817,19 @@ var ts;
61624
61817
  result.combinedMapper = combinedMapper;
61625
61818
  result.aliasSymbol = aliasSymbol || root.aliasSymbol;
61626
61819
  result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper); // TODO: GH#18217
61627
- break;
61820
+ return "break";
61821
+ };
61822
+ // We loop here for an immediately nested conditional type in the false position, effectively treating
61823
+ // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for
61824
+ // purposes of resolution. We also loop here when resolution of a conditional type ends in resolution of
61825
+ // another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
61826
+ // cases we increment the tail recursion counter and stop after 1000 iterations.
61827
+ while (true) {
61828
+ var state_5 = _loop_18();
61829
+ if (typeof state_5 === "object")
61830
+ return state_5.value;
61831
+ if (state_5 === "break")
61832
+ break;
61628
61833
  }
61629
61834
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
61630
61835
  // We tail-recurse for generic conditional types that (a) have not already been evaluated and cached, and
@@ -61862,7 +62067,7 @@ var ts;
61862
62067
  }
61863
62068
  }
61864
62069
  var spread = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(type));
61865
- spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
62070
+ spread.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
61866
62071
  return spread;
61867
62072
  }
61868
62073
  }
@@ -61952,7 +62157,7 @@ var ts;
61952
62157
  }
61953
62158
  }
61954
62159
  var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, ts.sameMap(indexInfos, function (info) { return getIndexInfoWithReadonly(info, readonly); }));
61955
- spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */ | 2097152 /* ContainsSpread */ | objectFlags;
62160
+ spread.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
61956
62161
  return spread;
61957
62162
  }
61958
62163
  /** We approximate own properties as non-methods plus methods that are inside the object literal */
@@ -62046,9 +62251,11 @@ var ts;
62046
62251
  }
62047
62252
  function getESSymbolLikeTypeForNode(node) {
62048
62253
  if (ts.isValidESSymbolDeclaration(node)) {
62049
- var symbol = getSymbolOfNode(node);
62050
- var links = getSymbolLinks(symbol);
62051
- return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
62254
+ var symbol = ts.isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
62255
+ if (symbol) {
62256
+ var links = getSymbolLinks(symbol);
62257
+ return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
62258
+ }
62052
62259
  }
62053
62260
  return esSymbolType;
62054
62261
  }
@@ -62366,7 +62573,7 @@ var ts;
62366
62573
  }
62367
62574
  function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
62368
62575
  var declaration = type.objectFlags & 4 /* Reference */ ? type.node :
62369
- type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node :
62576
+ type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node :
62370
62577
  type.symbol.declarations[0];
62371
62578
  var links = getNodeLinks(declaration);
62372
62579
  var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType :
@@ -62383,8 +62590,8 @@ var ts;
62383
62590
  outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
62384
62591
  }
62385
62592
  typeParameters = outerTypeParameters || ts.emptyArray;
62386
- var allDeclarations_1 = type.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
62387
- typeParameters = (target.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
62593
+ var allDeclarations_1 = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
62594
+ typeParameters = (target.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
62388
62595
  ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
62389
62596
  typeParameters;
62390
62597
  links.outerTypeParameters = typeParameters;
@@ -62419,16 +62626,15 @@ var ts;
62419
62626
  node.parent.kind === 199 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
62420
62627
  }
62421
62628
  function isTypeParameterPossiblyReferenced(tp, node) {
62422
- // If there are intervening statement blocks between the node and the type parameter declaration, if the node
62423
- // contains actual references to the type parameter, or if the node contains type queries, we consider the
62424
- // type parameter possibly referenced.
62425
- if (tp.symbol && tp.symbol.declarations) {
62426
- var n_1 = node;
62427
- while (!ts.some(tp.symbol.declarations, function (d) { return n_1 === d.parent; })) {
62428
- if (!n_1 || n_1.kind === 234 /* Block */ || n_1.kind === 188 /* ConditionalType */ && ts.forEachChild(n_1.extendsType, containsReference)) {
62629
+ // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks
62630
+ // between the node and the type parameter declaration, if the node contains actual references to the
62631
+ // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced.
62632
+ if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
62633
+ var container = tp.symbol.declarations[0].parent;
62634
+ for (var n = node; n !== container; n = n.parent) {
62635
+ if (!n || n.kind === 234 /* Block */ || n.kind === 188 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) {
62429
62636
  return true;
62430
62637
  }
62431
- n_1 = n_1.parent;
62432
62638
  }
62433
62639
  return containsReference(node);
62434
62640
  }
@@ -62557,7 +62763,7 @@ var ts;
62557
62763
  mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
62558
62764
  freshTypeParameter.mapper = mapper;
62559
62765
  }
62560
- if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
62766
+ if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
62561
62767
  result.node = type.node;
62562
62768
  }
62563
62769
  result.target = type;
@@ -62693,6 +62899,10 @@ var ts;
62693
62899
  }
62694
62900
  return type; // Nested invocation of `inferTypeForHomomorphicMappedType` or the `source` instantiated into something unmappable
62695
62901
  }
62902
+ function getUniqueLiteralFilledInstantiation(type) {
62903
+ return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :
62904
+ type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
62905
+ }
62696
62906
  function getPermissiveInstantiation(type) {
62697
62907
  return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :
62698
62908
  type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
@@ -63581,7 +63791,8 @@ var ts;
63581
63791
  return true;
63582
63792
  }
63583
63793
  }
63584
- else {
63794
+ else if (!((source.flags | target.flags) & (3145728 /* UnionOrIntersection */ | 8388608 /* IndexedAccess */ | 16777216 /* Conditional */ | 33554432 /* Substitution */))) {
63795
+ // We have excluded types that may simplify to other forms, so types must have identical flags
63585
63796
  if (source.flags !== target.flags)
63586
63797
  return false;
63587
63798
  if (source.flags & 67358815 /* Singleton */)
@@ -63589,7 +63800,7 @@ var ts;
63589
63800
  }
63590
63801
  if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
63591
63802
  var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false));
63592
- if (related !== undefined && !(related & 24 /* ReportsMask */)) {
63803
+ if (related !== undefined) {
63593
63804
  return !!(related & 1 /* Succeeded */);
63594
63805
  }
63595
63806
  }
@@ -63993,7 +64204,7 @@ var ts;
63993
64204
  isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
63994
64205
  return -1 /* True */;
63995
64206
  if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
63996
- var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 8192 /* FreshLiteral */);
64207
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
63997
64208
  if (isPerformingExcessPropertyChecks) {
63998
64209
  if (hasExcessProperties(source, target, reportErrors)) {
63999
64210
  if (reportErrors) {
@@ -64045,7 +64256,7 @@ var ts;
64045
64256
  // We suppress recursive intersection property checks because they can generate lots of work when relating
64046
64257
  // recursive intersections that are structurally similar but not exactly identical. See #37854.
64047
64258
  if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
64048
- isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144 /* NonInferrableType */); }))) {
64259
+ isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
64049
64260
  inPropertyCheck = true;
64050
64261
  result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
64051
64262
  inPropertyCheck = false;
@@ -64108,7 +64319,7 @@ var ts;
64108
64319
  if ((source.flags & 3145728 /* UnionOrIntersection */) && (target.flags & 3145728 /* UnionOrIntersection */)) {
64109
64320
  var sourceUnionOrIntersection = source;
64110
64321
  var targetUnionOrIntersection = target;
64111
- if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768 /* PrimitiveUnion */) {
64322
+ if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
64112
64323
  // There's a fast path for comparing primitive unions
64113
64324
  return;
64114
64325
  }
@@ -64138,7 +64349,7 @@ var ts;
64138
64349
  }
64139
64350
  function hasExcessProperties(source, target, reportErrors) {
64140
64351
  var _a;
64141
- if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 4096 /* JSLiteral */) {
64352
+ if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 8192 /* JSLiteral */) {
64142
64353
  return false; // Disable excess property checks on JS literals to simulate having an implicit "index signature" - but only outside of noImplicitAny
64143
64354
  }
64144
64355
  var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
@@ -64152,7 +64363,7 @@ var ts;
64152
64363
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
64153
64364
  checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
64154
64365
  }
64155
- var _loop_18 = function (prop) {
64366
+ var _loop_19 = function (prop) {
64156
64367
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
64157
64368
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
64158
64369
  if (reportErrors) {
@@ -64215,9 +64426,9 @@ var ts;
64215
64426
  };
64216
64427
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
64217
64428
  var prop = _b[_i];
64218
- var state_5 = _loop_18(prop);
64219
- if (typeof state_5 === "object")
64220
- return state_5.value;
64429
+ var state_6 = _loop_19(prop);
64430
+ if (typeof state_6 === "object")
64431
+ return state_6.value;
64221
64432
  }
64222
64433
  return false;
64223
64434
  }
@@ -64640,17 +64851,17 @@ var ts;
64640
64851
  // We limit alias variance probing to only object and conditional types since their alias behavior
64641
64852
  // is more predictable than other, interned types, which may or may not have an alias depending on
64642
64853
  // the order in which things were checked.
64643
- if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
64854
+ if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
64855
+ source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
64856
+ !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
64644
64857
  var variances = getAliasVariances(source.aliasSymbol);
64645
- if (variances !== ts.emptyArray) {
64646
- var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);
64647
- if (varianceResult !== undefined) {
64648
- return varianceResult;
64649
- }
64650
- }
64651
- else if (!someContainsMarkerType(source.aliasTypeArguments) && !someContainsMarkerType(target.aliasTypeArguments)) {
64858
+ if (variances === ts.emptyArray) {
64652
64859
  return 1 /* Unknown */;
64653
64860
  }
64861
+ var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);
64862
+ if (varianceResult !== undefined) {
64863
+ return varianceResult;
64864
+ }
64654
64865
  }
64655
64866
  // For a generic type T and a type U that is assignable to T, [...U] is assignable to T, U is assignable to readonly [...T],
64656
64867
  // and U is assignable to [...T] when U is constrained to a mutable array or tuple type.
@@ -65008,26 +65219,27 @@ var ts;
65008
65219
  else if (isGenericMappedType(source)) {
65009
65220
  return 0 /* False */;
65010
65221
  }
65011
- if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && !isTupleType(source)) {
65222
+ if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target &&
65223
+ !isTupleType(source) && !(ts.getObjectFlags(source) & 4096 /* MarkerType */ || ts.getObjectFlags(target) & 4096 /* MarkerType */)) {
65012
65224
  // When strictNullChecks is disabled, the element type of the empty array literal is undefinedWideningType,
65013
65225
  // and an empty array literal wouldn't be assignable to a `never[]` without this check.
65014
65226
  if (isEmptyArrayLiteralType(source)) {
65015
65227
  return -1 /* True */;
65016
65228
  }
65017
- // We have type references to the same generic type. Obtain the variance information for the type
65018
- // parameters and relate the type arguments accordingly. If variance information for the type is in
65019
- // the process of being computed, structurally relate references that contain marker types in their
65020
- // type arguments, but otherwise return Ternary.Unknown (the non-cached version of Ternary.Maybe).
65229
+ // We have type references to the same generic type, and the type references are not marker
65230
+ // type references (which are intended by be compared structurally). Obtain the variance
65231
+ // information for the type parameters and relate the type arguments accordingly.
65021
65232
  var variances = getVariances(source.target);
65022
- if (variances !== ts.emptyArray) {
65023
- var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState);
65024
- if (varianceResult !== undefined) {
65025
- return varianceResult;
65026
- }
65027
- }
65028
- else if (!someContainsMarkerType(getTypeArguments(source)) && !someContainsMarkerType(getTypeArguments(target))) {
65233
+ // We return Ternary.Maybe for a recursive invocation of getVariances (signalled by emptyArray). This
65234
+ // effectively means we measure variance only from type parameter occurrences that aren't nested in
65235
+ // recursive instantiations of the generic type.
65236
+ if (variances === ts.emptyArray) {
65029
65237
  return 1 /* Unknown */;
65030
65238
  }
65239
+ var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState);
65240
+ if (varianceResult !== undefined) {
65241
+ return varianceResult;
65242
+ }
65031
65243
  }
65032
65244
  else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
65033
65245
  if (relation !== identityRelation) {
@@ -65041,7 +65253,7 @@ var ts;
65041
65253
  }
65042
65254
  // Consider a fresh empty object literal type "closed" under the subtype relationship - this way `{} <- {[idx: string]: any} <- fresh({})`
65043
65255
  // and not `{} <- fresh({}) <- {[idx: string]: any}`
65044
- else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 8192 /* FreshLiteral */ && !isEmptyObjectType(source)) {
65256
+ else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source)) {
65045
65257
  return 0 /* False */;
65046
65258
  }
65047
65259
  // Even if relationship doesn't hold for unions, intersections, or generic type references,
@@ -65206,11 +65418,11 @@ var ts;
65206
65418
  // constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
65207
65419
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
65208
65420
  var matchingTypes = [];
65209
- var _loop_19 = function (combination) {
65421
+ var _loop_20 = function (combination) {
65210
65422
  var hasMatch = false;
65211
65423
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
65212
65424
  var type = _d[_c];
65213
- var _loop_20 = function (i) {
65425
+ var _loop_21 = function (i) {
65214
65426
  var sourceProperty = sourcePropertiesFiltered[i];
65215
65427
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
65216
65428
  if (!targetProperty)
@@ -65226,8 +65438,8 @@ var ts;
65226
65438
  }
65227
65439
  };
65228
65440
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
65229
- var state_7 = _loop_20(i);
65230
- switch (state_7) {
65441
+ var state_8 = _loop_21(i);
65442
+ switch (state_8) {
65231
65443
  case "continue-outer": continue outer;
65232
65444
  }
65233
65445
  }
@@ -65240,9 +65452,9 @@ var ts;
65240
65452
  };
65241
65453
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
65242
65454
  var combination = discriminantCombinations_1[_a];
65243
- var state_6 = _loop_19(combination);
65244
- if (typeof state_6 === "object")
65245
- return state_6.value;
65455
+ var state_7 = _loop_20(combination);
65456
+ if (typeof state_7 === "object")
65457
+ return state_7.value;
65246
65458
  }
65247
65459
  // Compare the remaining non-discriminant properties of each match.
65248
65460
  var result = -1 /* True */;
@@ -65926,28 +66138,36 @@ var ts;
65926
66138
  }
65927
66139
  return false;
65928
66140
  }
65929
- function getVariances(type) {
65930
- // Arrays and tuples are known to be covariant, no need to spend time computing this.
65931
- return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */ ?
65932
- arrayVariances :
65933
- getVariancesWorker(type.symbol, type.typeParameters);
66141
+ // Return a type reference where the source type parameter is replaced with the target marker
66142
+ // type, and flag the result as a marker type reference.
66143
+ function getMarkerTypeReference(type, source, target) {
66144
+ var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; }));
66145
+ result.objectFlags |= 4096 /* MarkerType */;
66146
+ return result;
65934
66147
  }
65935
66148
  function getAliasVariances(symbol) {
65936
- return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
66149
+ var links = getSymbolLinks(symbol);
66150
+ return getVariancesWorker(links.typeParameters, links, function (_links, param, marker) {
66151
+ var type = getTypeAliasInstantiation(symbol, instantiateTypes(links.typeParameters, makeUnaryTypeMapper(param, marker)));
66152
+ type.aliasTypeArgumentsContainsMarker = true;
66153
+ return type;
66154
+ });
65937
66155
  }
65938
66156
  // Return an array containing the variance of each type parameter. The variance is effectively
65939
66157
  // a digest of the type comparisons that occur for each type argument when instantiations of the
65940
66158
  // generic type are structurally compared. We infer the variance information by comparing
65941
66159
  // instantiations of the generic type for type arguments with known relations. The function
65942
66160
  // returns the emptyArray singleton when invoked recursively for the given generic type.
65943
- function getVariancesWorker(symbol, typeParameters) {
66161
+ function getVariancesWorker(typeParameters, cache, createMarkerType) {
66162
+ var _a, _b, _c;
65944
66163
  if (typeParameters === void 0) { typeParameters = ts.emptyArray; }
65945
- var links = getSymbolLinks(symbol);
65946
- if (!links.variances) {
65947
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
65948
- links.variances = ts.emptyArray;
65949
- var variances = [];
65950
- var _loop_21 = function (tp) {
66164
+ var variances = cache.variances;
66165
+ if (!variances) {
66166
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 });
66167
+ // The emptyArray singleton is used to signal a recursive invocation.
66168
+ cache.variances = ts.emptyArray;
66169
+ variances = [];
66170
+ var _loop_22 = function (tp) {
65951
66171
  var unmeasurable = false;
65952
66172
  var unreliable = false;
65953
66173
  var oldHandler = outofbandVarianceMarkerHandler;
@@ -65955,15 +66175,15 @@ var ts;
65955
66175
  // We first compare instantiations where the type parameter is replaced with
65956
66176
  // marker types that have a known subtype relationship. From this we can infer
65957
66177
  // invariance, covariance, contravariance or bivariance.
65958
- var typeWithSuper = createMarkerType(symbol, tp, markerSuperType);
65959
- var typeWithSub = createMarkerType(symbol, tp, markerSubType);
66178
+ var typeWithSuper = createMarkerType(cache, tp, markerSuperType);
66179
+ var typeWithSub = createMarkerType(cache, tp, markerSubType);
65960
66180
  var variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 /* Covariant */ : 0) |
65961
66181
  (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 /* Contravariant */ : 0);
65962
66182
  // If the instantiations appear to be related bivariantly it may be because the
65963
66183
  // type parameter is independent (i.e. it isn't witnessed anywhere in the generic
65964
66184
  // type). To determine this we compare instantiations where the type parameter is
65965
66185
  // replaced with marker types that are known to be unrelated.
65966
- if (variance === 3 /* Bivariant */ && isTypeAssignableTo(createMarkerType(symbol, tp, markerOtherType), typeWithSuper)) {
66186
+ if (variance === 3 /* Bivariant */ && isTypeAssignableTo(createMarkerType(cache, tp, markerOtherType), typeWithSuper)) {
65967
66187
  variance = 4 /* Independent */;
65968
66188
  }
65969
66189
  outofbandVarianceMarkerHandler = oldHandler;
@@ -65979,59 +66199,19 @@ var ts;
65979
66199
  };
65980
66200
  for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
65981
66201
  var tp = typeParameters_1[_i];
65982
- _loop_21(tp);
66202
+ _loop_22(tp);
65983
66203
  }
65984
- links.variances = variances;
66204
+ cache.variances = variances;
65985
66205
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
65986
66206
  }
65987
- return links.variances;
66207
+ return variances;
65988
66208
  }
65989
- function createMarkerType(symbol, source, target) {
65990
- var mapper = makeUnaryTypeMapper(source, target);
65991
- if (symbol.flags & 524288 /* TypeAlias */) {
65992
- return getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters, mapper));
65993
- }
65994
- var type = getDeclaredTypeOfSymbol(symbol);
65995
- return createTypeReference(type, instantiateTypes(type.typeParameters, mapper));
65996
- }
65997
- // Check if any of the given types contain marker types. We visit type arguments of generic classes, interfaces, and
65998
- // type aliases, members of anonymous type literals and mapped types, constituents of union, intersection, and
65999
- // template literal types, and targets of index types and string mapping types. This is by design a limited set of
66000
- // types to avoid excessive fan out. In deferred (and thus possibly circular) locations we limit the traversal to
66001
- // four levels of depth.
66002
- function someContainsMarkerType(types, maxDepth) {
66003
- if (maxDepth === void 0) { maxDepth = 4; }
66004
- return ts.some(types, function (t) { return containsMarkerType(t, maxDepth); });
66005
- }
66006
- function containsMarkerType(type, maxDepth) {
66007
- return maxDepth > 0 && (type.flags & 262144 /* TypeParameter */ ? type === markerSubType || type === markerSubType || type === markerOtherType :
66008
- type.aliasSymbol ? someContainsMarkerType(type.aliasTypeArguments, maxDepth) :
66009
- type.flags & 524288 /* Object */ ? objectTypeContainsMarkerType(type, maxDepth) :
66010
- type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) ? someContainsMarkerType(type.types, maxDepth) :
66011
- type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) ? containsMarkerType(type.type, maxDepth) :
66012
- false);
66013
- }
66014
- function objectTypeContainsMarkerType(type, maxDepth) {
66015
- var objectFlags = ts.getObjectFlags(type);
66016
- if (objectFlags & 4 /* Reference */) {
66017
- return someContainsMarkerType(getTypeArguments(type), maxDepth - (type.node ? 1 : 0));
66018
- }
66019
- if (objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) {
66020
- var resolved = resolveStructuredTypeMembers(type);
66021
- return ts.some(resolved.properties, function (prop) { return containsMarkerType(getTypeOfSymbol(prop), maxDepth - 1); }) ||
66022
- ts.some(resolved.callSignatures, function (sig) { return signatureContainsMarkerType(sig, maxDepth); }) ||
66023
- ts.some(resolved.constructSignatures, function (sig) { return signatureContainsMarkerType(sig, maxDepth); }) ||
66024
- ts.some(resolved.indexInfos, function (info) { return containsMarkerType(info.type, maxDepth - 1); });
66025
- }
66026
- if (objectFlags & 32 /* Mapped */) {
66027
- return containsMarkerType(getConstraintTypeFromMappedType(type), maxDepth - 1) ||
66028
- containsMarkerType(getTemplateTypeFromMappedType(type), maxDepth - 1);
66209
+ function getVariances(type) {
66210
+ // Arrays and tuples are known to be covariant, no need to spend time computing this.
66211
+ if (type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */) {
66212
+ return arrayVariances;
66029
66213
  }
66030
- return false;
66031
- }
66032
- function signatureContainsMarkerType(sig, maxDepth) {
66033
- return ts.some(sig.parameters, function (param) { return containsMarkerType(getTypeOfSymbol(param), maxDepth - 1); }) ||
66034
- containsMarkerType(getReturnTypeOfSignature(sig), maxDepth - 1);
66214
+ return getVariancesWorker(type.typeParameters, type, getMarkerTypeReference);
66035
66215
  }
66036
66216
  // Return true if the given type reference has a 'void' type argument for a covariant type parameter.
66037
66217
  // See comment at call in recursiveTypeRelatedTo for when this case matters.
@@ -66402,10 +66582,10 @@ var ts;
66402
66582
  if (!(ts.getObjectFlags(type) & 4 /* Reference */) || !(ts.getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
66403
66583
  return undefined;
66404
66584
  }
66405
- if (ts.getObjectFlags(type) & 33554432 /* IdenticalBaseTypeCalculated */) {
66406
- return ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
66585
+ if (ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
66586
+ return ts.getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
66407
66587
  }
66408
- type.objectFlags |= 33554432 /* IdenticalBaseTypeCalculated */;
66588
+ type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
66409
66589
  var target = type.target;
66410
66590
  if (ts.getObjectFlags(target) & 1 /* Class */) {
66411
66591
  var baseTypeNode = getBaseTypeNodeOfClass(target);
@@ -66426,7 +66606,7 @@ var ts;
66426
66606
  if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
66427
66607
  instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
66428
66608
  }
66429
- type.objectFlags |= 67108864 /* IdenticalBaseTypeExists */;
66609
+ type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
66430
66610
  return type.cachedEquivalentBaseType = instantiatedBase;
66431
66611
  }
66432
66612
  function isEmptyLiteralType(type) {
@@ -66721,7 +66901,7 @@ var ts;
66721
66901
  * Leave signatures alone since they are not subject to the check.
66722
66902
  */
66723
66903
  function getRegularTypeOfObjectLiteral(type) {
66724
- if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 8192 /* FreshLiteral */)) {
66904
+ if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 16384 /* FreshLiteral */)) {
66725
66905
  return type;
66726
66906
  }
66727
66907
  var regularType = type.regularType;
@@ -66732,7 +66912,7 @@ var ts;
66732
66912
  var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
66733
66913
  var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
66734
66914
  regularNew.flags = resolved.flags;
66735
- regularNew.objectFlags |= resolved.objectFlags & ~8192 /* FreshLiteral */;
66915
+ regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
66736
66916
  type.regularType = regularNew;
66737
66917
  return regularNew;
66738
66918
  }
@@ -66762,7 +66942,7 @@ var ts;
66762
66942
  var names = new ts.Map();
66763
66943
  for (var _i = 0, _a = getSiblingsOfContext(context); _i < _a.length; _i++) {
66764
66944
  var t = _a[_i];
66765
- if (isObjectLiteralType(t) && !(ts.getObjectFlags(t) & 2097152 /* ContainsSpread */)) {
66945
+ if (isObjectLiteralType(t) && !(ts.getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
66766
66946
  for (var _b = 0, _c = getPropertiesOfType(t); _b < _c.length; _b++) {
66767
66947
  var prop = _c[_b];
66768
66948
  names.set(prop.escapedName, prop);
@@ -66809,14 +66989,14 @@ var ts;
66809
66989
  }
66810
66990
  }
66811
66991
  var result = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, ts.sameMap(getIndexInfosOfType(type), function (info) { return createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly); }));
66812
- result.objectFlags |= (ts.getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */)); // Retain js literal flag through widening
66992
+ result.objectFlags |= (ts.getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */)); // Retain js literal flag through widening
66813
66993
  return result;
66814
66994
  }
66815
66995
  function getWidenedType(type) {
66816
66996
  return getWidenedTypeWithContext(type, /*context*/ undefined);
66817
66997
  }
66818
66998
  function getWidenedTypeWithContext(type, context) {
66819
- if (ts.getObjectFlags(type) & 196608 /* RequiresWidening */) {
66999
+ if (ts.getObjectFlags(type) & 393216 /* RequiresWidening */) {
66820
67000
  if (context === undefined && type.widened) {
66821
67001
  return type.widened;
66822
67002
  }
@@ -66861,7 +67041,7 @@ var ts;
66861
67041
  */
66862
67042
  function reportWideningErrorsInType(type) {
66863
67043
  var errorReported = false;
66864
- if (ts.getObjectFlags(type) & 65536 /* ContainsWideningType */) {
67044
+ if (ts.getObjectFlags(type) & 131072 /* ContainsWideningType */) {
66865
67045
  if (type.flags & 1048576 /* Union */) {
66866
67046
  if (ts.some(type.types, isEmptyObjectType)) {
66867
67047
  errorReported = true;
@@ -66887,7 +67067,7 @@ var ts;
66887
67067
  for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) {
66888
67068
  var p = _e[_d];
66889
67069
  var t = getTypeOfSymbol(p);
66890
- if (ts.getObjectFlags(t) & 65536 /* ContainsWideningType */) {
67070
+ if (ts.getObjectFlags(t) & 131072 /* ContainsWideningType */) {
66891
67071
  if (!reportWideningErrorsInType(t)) {
66892
67072
  error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
66893
67073
  }
@@ -66968,7 +67148,7 @@ var ts;
66968
67148
  errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
66969
67149
  }
66970
67150
  function reportErrorsFromWidening(declaration, type, wideningKind) {
66971
- if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 65536 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
67151
+ if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
66972
67152
  // Report implicit any error within type if possible, otherwise report error on declaration
66973
67153
  if (!reportWideningErrorsInType(type)) {
66974
67154
  reportImplicitAny(declaration, type, wideningKind);
@@ -67084,16 +67264,16 @@ var ts;
67084
67264
  // results for union and intersection types for performance reasons.
67085
67265
  function couldContainTypeVariables(type) {
67086
67266
  var objectFlags = ts.getObjectFlags(type);
67087
- if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
67088
- return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
67267
+ if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
67268
+ return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
67089
67269
  }
67090
67270
  var result = !!(type.flags & 465829888 /* Instantiable */ ||
67091
67271
  type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
67092
67272
  objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ||
67093
- objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) ||
67273
+ objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */)) ||
67094
67274
  type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
67095
67275
  if (type.flags & 3899393 /* ObjectFlagsType */) {
67096
- type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
67276
+ type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
67097
67277
  }
67098
67278
  return result;
67099
67279
  }
@@ -67153,7 +67333,7 @@ var ts;
67153
67333
  // literal { a: 123, b: x => true } is marked non-inferable because it contains a context sensitive
67154
67334
  // arrow function, but is considered partially inferable because property 'a' has an inferable type.
67155
67335
  function isPartiallyInferableType(type) {
67156
- return !(ts.getObjectFlags(type) & 262144 /* NonInferrableType */) ||
67336
+ return !(ts.getObjectFlags(type) & 524288 /* NonInferrableType */) ||
67157
67337
  isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) ||
67158
67338
  isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType);
67159
67339
  }
@@ -67493,7 +67673,7 @@ var ts;
67493
67673
  }
67494
67674
  var inference = getInferenceInfoForType(target);
67495
67675
  if (inference) {
67496
- if (ts.getObjectFlags(source) & 262144 /* NonInferrableType */) {
67676
+ if (ts.getObjectFlags(source) & 524288 /* NonInferrableType */) {
67497
67677
  return;
67498
67678
  }
67499
67679
  if (!inference.isFixed) {
@@ -67818,7 +67998,7 @@ var ts;
67818
67998
  // We assign a lower priority to inferences made from types containing non-inferrable
67819
67999
  // types because we may only have a partial result (i.e. we may have failed to make
67820
68000
  // reverse inferences for some properties).
67821
- inferWithPriority(inferredType, inference.typeParameter, ts.getObjectFlags(source) & 262144 /* NonInferrableType */ ?
68001
+ inferWithPriority(inferredType, inference.typeParameter, ts.getObjectFlags(source) & 524288 /* NonInferrableType */ ?
67822
68002
  16 /* PartialHomomorphicMappedType */ :
67823
68003
  8 /* HomomorphicMappedType */);
67824
68004
  }
@@ -67986,7 +68166,7 @@ var ts;
67986
68166
  var sourceLen = sourceSignatures.length;
67987
68167
  var targetLen = targetSignatures.length;
67988
68168
  var len = sourceLen < targetLen ? sourceLen : targetLen;
67989
- var skipParameters = !!(ts.getObjectFlags(source) & 262144 /* NonInferrableType */);
68169
+ var skipParameters = !!(ts.getObjectFlags(source) & 524288 /* NonInferrableType */);
67990
68170
  for (var i = 0; i < len; i++) {
67991
68171
  inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters);
67992
68172
  }
@@ -68053,7 +68233,7 @@ var ts;
68053
68233
  return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */);
68054
68234
  }
68055
68235
  function isObjectOrArrayLiteralType(type) {
68056
- return !!(ts.getObjectFlags(type) & (128 /* ObjectLiteral */ | 16384 /* ArrayLiteral */));
68236
+ return !!(ts.getObjectFlags(type) & (128 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
68057
68237
  }
68058
68238
  function unionObjectAndArrayLiteralCandidates(candidates) {
68059
68239
  if (candidates.length > 1) {
@@ -68390,7 +68570,7 @@ var ts;
68390
68570
  function mapTypesByKeyProperty(types, name) {
68391
68571
  var map = new ts.Map();
68392
68572
  var count = 0;
68393
- var _loop_22 = function (type) {
68573
+ var _loop_23 = function (type) {
68394
68574
  if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
68395
68575
  var discriminant = getTypeOfPropertyOfType(type, name);
68396
68576
  if (discriminant) {
@@ -68416,9 +68596,9 @@ var ts;
68416
68596
  };
68417
68597
  for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
68418
68598
  var type = types_16[_i];
68419
- var state_8 = _loop_22(type);
68420
- if (typeof state_8 === "object")
68421
- return state_8.value;
68599
+ var state_9 = _loop_23(type);
68600
+ if (typeof state_9 === "object")
68601
+ return state_9.value;
68422
68602
  }
68423
68603
  return count >= 10 && count * 2 >= types.length ? map : undefined;
68424
68604
  }
@@ -68427,7 +68607,7 @@ var ts;
68427
68607
  function getKeyPropertyName(unionType) {
68428
68608
  var types = unionType.types;
68429
68609
  // We only construct maps for unions with many non-primitive constituents.
68430
- if (types.length < 10 || ts.getObjectFlags(unionType) & 32768 /* PrimitiveUnion */ ||
68610
+ if (types.length < 10 || ts.getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ ||
68431
68611
  ts.countWhere(types, function (t) { return !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */)); }) < 10) {
68432
68612
  return undefined;
68433
68613
  }
@@ -69688,7 +69868,7 @@ var ts;
69688
69868
  return result;
69689
69869
  }
69690
69870
  function getCandidateDiscriminantPropertyAccess(expr) {
69691
- if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
69871
+ if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference) || ts.isObjectLiteralMethod(reference)) {
69692
69872
  // When the reference is a binding pattern or function or arrow expression, we are narrowing a pesudo-reference in
69693
69873
  // getNarrowedTypeOfSymbol. An identifier for a destructuring variable declared in the same binding pattern or
69694
69874
  // parameter declared in the same parameter list is a candidate.
@@ -72363,7 +72543,7 @@ var ts;
72363
72543
  var literalType = type.literalType;
72364
72544
  if (!literalType) {
72365
72545
  literalType = type.literalType = cloneTypeReference(type);
72366
- literalType.objectFlags |= 16384 /* ArrayLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
72546
+ literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
72367
72547
  }
72368
72548
  return literalType;
72369
72549
  }
@@ -72508,7 +72688,7 @@ var ts;
72508
72688
  checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
72509
72689
  }
72510
72690
  }
72511
- objectFlags |= ts.getObjectFlags(type) & 458752 /* PropagatingFlags */;
72691
+ objectFlags |= ts.getObjectFlags(type) & 917504 /* PropagatingFlags */;
72512
72692
  var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined;
72513
72693
  var prop = nameType ?
72514
72694
  createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) :
@@ -72646,9 +72826,9 @@ var ts;
72646
72826
  if (hasComputedSymbolProperty)
72647
72827
  indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
72648
72828
  var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, indexInfos);
72649
- result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
72829
+ result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
72650
72830
  if (isJSObjectLiteral) {
72651
- result.objectFlags |= 4096 /* JSLiteral */;
72831
+ result.objectFlags |= 8192 /* JSLiteral */;
72652
72832
  }
72653
72833
  if (patternWithComputedProperties) {
72654
72834
  result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;
@@ -72739,7 +72919,7 @@ var ts;
72739
72919
  var member = attributeDecl.symbol;
72740
72920
  if (ts.isJsxAttribute(attributeDecl)) {
72741
72921
  var exprType = checkJsxAttribute(attributeDecl, checkMode);
72742
- objectFlags |= ts.getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
72922
+ objectFlags |= ts.getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
72743
72923
  var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
72744
72924
  attributeSymbol.declarations = member.declarations;
72745
72925
  attributeSymbol.parent = member.parent;
@@ -72823,7 +73003,7 @@ var ts;
72823
73003
  function createJsxAttributesType() {
72824
73004
  objectFlags |= freshObjectLiteralFlag;
72825
73005
  var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
72826
- result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
73006
+ result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
72827
73007
  return result;
72828
73008
  }
72829
73009
  }
@@ -74749,7 +74929,7 @@ var ts;
74749
74929
  if (spreadIndex >= 0) {
74750
74930
  // Create synthetic arguments from spreads of tuple types.
74751
74931
  var effectiveArgs_1 = args.slice(0, spreadIndex);
74752
- var _loop_23 = function (i) {
74932
+ var _loop_24 = function (i) {
74753
74933
  var arg = args[i];
74754
74934
  // We can call checkExpressionCached because spread expressions never have a contextual type.
74755
74935
  var spreadType = arg.kind === 224 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
@@ -74766,7 +74946,7 @@ var ts;
74766
74946
  }
74767
74947
  };
74768
74948
  for (var i = spreadIndex; i < args.length; i++) {
74769
- _loop_23(i);
74949
+ _loop_24(i);
74770
74950
  }
74771
74951
  return effectiveArgs_1;
74772
74952
  }
@@ -75079,7 +75259,7 @@ var ts;
75079
75259
  var min_3 = Number.MAX_VALUE;
75080
75260
  var minIndex = 0;
75081
75261
  var i_1 = 0;
75082
- var _loop_24 = function (c) {
75262
+ var _loop_25 = function (c) {
75083
75263
  var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
75084
75264
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2);
75085
75265
  if (diags_2) {
@@ -75097,7 +75277,7 @@ var ts;
75097
75277
  };
75098
75278
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
75099
75279
  var c = candidatesForArgumentError_1[_a];
75100
- _loop_24(c);
75280
+ _loop_25(c);
75101
75281
  }
75102
75282
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
75103
75283
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -75255,7 +75435,7 @@ var ts;
75255
75435
  }
75256
75436
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
75257
75437
  var parameters = [];
75258
- var _loop_25 = function (i) {
75438
+ var _loop_26 = function (i) {
75259
75439
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
75260
75440
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
75261
75441
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -75263,7 +75443,7 @@ var ts;
75263
75443
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
75264
75444
  };
75265
75445
  for (var i = 0; i < maxNonRestParam; i++) {
75266
- _loop_25(i);
75446
+ _loop_26(i);
75267
75447
  }
75268
75448
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
75269
75449
  var flags = 0 /* None */;
@@ -76030,7 +76210,7 @@ var ts;
76030
76210
  var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false);
76031
76211
  if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) {
76032
76212
  var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, ts.emptyArray);
76033
- jsAssignmentType.objectFlags |= 4096 /* JSLiteral */;
76213
+ jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
76034
76214
  return getIntersectionType([returnType, jsAssignmentType]);
76035
76215
  }
76036
76216
  }
@@ -76297,7 +76477,7 @@ var ts;
76297
76477
  hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
76298
76478
  if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
76299
76479
  var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
76300
- result_11.objectFlags |= 8388608 /* InstantiationExpressionType */;
76480
+ result_11.objectFlags |= 16777216 /* InstantiationExpressionType */;
76301
76481
  result_11.node = node;
76302
76482
  return result_11;
76303
76483
  }
@@ -76660,6 +76840,9 @@ var ts;
76660
76840
  assignBindingElementTypes(declaration.name, links.type);
76661
76841
  }
76662
76842
  }
76843
+ else if (type) {
76844
+ ts.Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type");
76845
+ }
76663
76846
  }
76664
76847
  // When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
76665
76848
  // the destructured type into the contained binding elements.
@@ -77065,7 +77248,7 @@ var ts;
77065
77248
  var returnType = getReturnTypeFromBody(node, checkMode);
77066
77249
  var returnOnlySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, returnType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);
77067
77250
  var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts.emptyArray, ts.emptyArray);
77068
- returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
77251
+ returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
77069
77252
  return links.contextFreeType = returnOnlyType;
77070
77253
  }
77071
77254
  }
@@ -78490,7 +78673,7 @@ var ts;
78490
78673
  }
78491
78674
  function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {
78492
78675
  var type = checkExpression(node, checkMode, forceTuple);
78493
- return isConstContext(node) ? getRegularTypeOfLiteralType(type) :
78676
+ return isConstContext(node) || ts.isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) :
78494
78677
  isTypeAssertion(node) ? type :
78495
78678
  getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node));
78496
78679
  }
@@ -79259,7 +79442,7 @@ var ts;
79259
79442
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
79260
79443
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
79261
79444
  var indexSignatureMap_1 = new ts.Map();
79262
- var _loop_26 = function (declaration) {
79445
+ var _loop_27 = function (declaration) {
79263
79446
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
79264
79447
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
79265
79448
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -79274,7 +79457,7 @@ var ts;
79274
79457
  };
79275
79458
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
79276
79459
  var declaration = _a[_i];
79277
- _loop_26(declaration);
79460
+ _loop_27(declaration);
79278
79461
  }
79279
79462
  indexSignatureMap_1.forEach(function (entry) {
79280
79463
  if (entry.declarations.length > 1) {
@@ -82653,7 +82836,7 @@ var ts;
82653
82836
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
82654
82837
  var localPropDeclaration = declaration && declaration.kind === 220 /* BinaryExpression */ ||
82655
82838
  name && name.kind === 161 /* ComputedPropertyName */ || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
82656
- var _loop_27 = function (info) {
82839
+ var _loop_28 = function (info) {
82657
82840
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
82658
82841
  // We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
82659
82842
  // in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
@@ -82666,7 +82849,7 @@ var ts;
82666
82849
  };
82667
82850
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
82668
82851
  var info = indexInfos_9[_i];
82669
- _loop_27(info);
82852
+ _loop_28(info);
82670
82853
  }
82671
82854
  }
82672
82855
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -82674,7 +82857,7 @@ var ts;
82674
82857
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
82675
82858
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
82676
82859
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
82677
- var _loop_28 = function (info) {
82860
+ var _loop_29 = function (info) {
82678
82861
  if (info === checkInfo)
82679
82862
  return "continue";
82680
82863
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -82689,7 +82872,7 @@ var ts;
82689
82872
  };
82690
82873
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
82691
82874
  var info = indexInfos_10[_i];
82692
- _loop_28(info);
82875
+ _loop_29(info);
82693
82876
  }
82694
82877
  }
82695
82878
  function checkTypeNameIsReserved(name, message) {
@@ -83000,7 +83183,7 @@ var ts;
83000
83183
  var baseTypes = baseTypeNode && getBaseTypes(type);
83001
83184
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
83002
83185
  var baseStaticType = getBaseConstructorTypeOfClass(type);
83003
- var _loop_29 = function (member) {
83186
+ var _loop_30 = function (member) {
83004
83187
  if (ts.hasAmbientModifier(member)) {
83005
83188
  return "continue";
83006
83189
  }
@@ -83017,7 +83200,7 @@ var ts;
83017
83200
  };
83018
83201
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
83019
83202
  var member = _a[_i];
83020
- _loop_29(member);
83203
+ _loop_30(member);
83021
83204
  }
83022
83205
  }
83023
83206
  /**
@@ -83105,7 +83288,7 @@ var ts;
83105
83288
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
83106
83289
  // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
83107
83290
  var issuedMemberError = false;
83108
- var _loop_30 = function (member) {
83291
+ var _loop_31 = function (member) {
83109
83292
  if (ts.isStatic(member)) {
83110
83293
  return "continue";
83111
83294
  }
@@ -83124,7 +83307,7 @@ var ts;
83124
83307
  };
83125
83308
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
83126
83309
  var member = _a[_i];
83127
- _loop_30(member);
83310
+ _loop_31(member);
83128
83311
  }
83129
83312
  if (!issuedMemberError) {
83130
83313
  // check again with diagnostics to generate a less-specific error
@@ -110089,7 +110272,7 @@ var ts;
110089
110272
  return emitRestOrJSDocVariadicType(node);
110090
110273
  case 318 /* JSDocNamepathType */:
110091
110274
  return;
110092
- case 319 /* JSDocComment */:
110275
+ case 319 /* JSDoc */:
110093
110276
  return emitJSDoc(node);
110094
110277
  case 321 /* JSDocTypeLiteral */:
110095
110278
  return emitJSDocTypeLiteral(node);
@@ -114465,7 +114648,7 @@ var ts;
114465
114648
  var existingDirectories = new ts.Map();
114466
114649
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
114467
114650
  var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
114468
- function getSourceFile(fileName, languageVersion, onError) {
114651
+ function getSourceFile(fileName, languageVersionOrOptions, onError) {
114469
114652
  var text;
114470
114653
  try {
114471
114654
  ts.performance.mark("beforeIORead");
@@ -114479,7 +114662,7 @@ var ts;
114479
114662
  }
114480
114663
  text = "";
114481
114664
  }
114482
- return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined;
114665
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : undefined;
114483
114666
  }
114484
114667
  function directoryExists(directoryPath) {
114485
114668
  if (existingDirectories.has(directoryPath)) {
@@ -115885,8 +116068,8 @@ var ts;
115885
116068
  for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {
115886
116069
  var oldSourceFile = oldSourceFiles_2[_i];
115887
116070
  var newSourceFile = host.getSourceFileByPath
115888
- ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, ts.getEmitScriptTarget(options), /*onError*/ undefined, shouldCreateNewSourceFile)
115889
- : host.getSourceFile(oldSourceFile.fileName, ts.getEmitScriptTarget(options), /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
116071
+ ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), /*onError*/ undefined, shouldCreateNewSourceFile)
116072
+ : host.getSourceFile(oldSourceFile.fileName, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
115890
116073
  if (!newSourceFile) {
115891
116074
  return 0 /* Not */;
115892
116075
  }
@@ -115917,7 +116100,6 @@ var ts;
115917
116100
  newSourceFile.originalFileName = oldSourceFile.originalFileName;
115918
116101
  newSourceFile.resolvedPath = oldSourceFile.resolvedPath;
115919
116102
  newSourceFile.fileName = oldSourceFile.fileName;
115920
- newSourceFile.impliedNodeFormat = oldSourceFile.impliedNodeFormat;
115921
116103
  var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path);
115922
116104
  if (packageName !== undefined) {
115923
116105
  // If there are 2 different source files for the same package name and at least one of them changes,
@@ -116836,6 +117018,17 @@ var ts;
116836
117018
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
116837
117019
  return result;
116838
117020
  }
117021
+ function getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options) {
117022
+ // It's a _little odd_ that we can't set `impliedNodeFormat` until the program step - but it's the first and only time we have a resolution cache
117023
+ // and a freshly made source file node on hand at the same time, and we need both to set the field. Persisting the resolution cache all the way
117024
+ // to the check and emit steps would be bad - so we much prefer detecting and storing the format information on the source file node upfront.
117025
+ var impliedNodeFormat = getImpliedNodeFormatForFile(toPath(fileName), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
117026
+ return {
117027
+ languageVersion: ts.getEmitScriptTarget(options),
117028
+ impliedNodeFormat: impliedNodeFormat,
117029
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(options)
117030
+ };
117031
+ }
116839
117032
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
116840
117033
  var path = toPath(fileName);
116841
117034
  if (useSourceOfProjectReferenceRedirect) {
@@ -116923,7 +117116,7 @@ var ts;
116923
117116
  }
116924
117117
  }
116925
117118
  // We haven't looked for this file, do so now and cache result
116926
- var file = host.getSourceFile(fileName, ts.getEmitScriptTarget(options), function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
117119
+ var file = host.getSourceFile(fileName, getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options), function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
116927
117120
  if (packageId) {
116928
117121
  var packageIdKey = ts.packageIdToString(packageId);
116929
117122
  var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
@@ -116951,10 +117144,6 @@ var ts;
116951
117144
  file.path = path;
116952
117145
  file.resolvedPath = toPath(fileName);
116953
117146
  file.originalFileName = originalFileName;
116954
- // It's a _little odd_ that we can't set `impliedNodeFormat` until the program step - but it's the first and only time we have a resolution cache
116955
- // and a freshly made source file node on hand at the same time, and we need both to set the field. Persisting the resolution cache all the way
116956
- // to the check and emit steps would be bad - so we much prefer detecting and storing the format information on the source file node upfront.
116957
- file.impliedNodeFormat = getImpliedNodeFormatForFile(file.resolvedPath, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
116958
117147
  addFileIncludeReason(file, reason);
116959
117148
  if (host.useCaseSensitiveFileNames()) {
116960
117149
  var pathLowerCase = ts.toFileNameLowerCase(path);
@@ -117456,7 +117645,7 @@ var ts;
117456
117645
  }
117457
117646
  else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) {
117458
117647
  // We cannot use createDiagnosticFromNode because nodes do not have parents yet
117459
- var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117648
+ var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117460
117649
  programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
117461
117650
  }
117462
117651
  // Cannot specify module gen that isn't amd or system with --out
@@ -117465,7 +117654,7 @@ var ts;
117465
117654
  createDiagnosticForOptionName(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module");
117466
117655
  }
117467
117656
  else if (options.module === undefined && firstNonAmbientExternalModuleSourceFile) {
117468
- var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117657
+ var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117469
117658
  programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
117470
117659
  }
117471
117660
  }
@@ -120911,7 +121100,7 @@ var ts;
120911
121100
  });
120912
121101
  // Sort by paths closest to importing file Name directory
120913
121102
  var sortedPaths = [];
120914
- var _loop_31 = function (directory) {
121103
+ var _loop_32 = function (directory) {
120915
121104
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
120916
121105
  var pathsInDirectory;
120917
121106
  allFileNames.forEach(function (_a, fileName) {
@@ -120935,9 +121124,9 @@ var ts;
120935
121124
  };
120936
121125
  var out_directory_1;
120937
121126
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
120938
- var state_9 = _loop_31(directory);
121127
+ var state_10 = _loop_32(directory);
120939
121128
  directory = out_directory_1;
120940
- if (state_9 === "break")
121129
+ if (state_10 === "break")
120941
121130
  break;
120942
121131
  }
120943
121132
  if (allFileNames.size) {
@@ -121727,7 +121916,7 @@ var ts;
121727
121916
  var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
121728
121917
  var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
121729
121918
  return {
121730
- getSourceFile: function (fileName, languageVersion, onError) {
121919
+ getSourceFile: function (fileName, languageVersionOrOptions, onError) {
121731
121920
  var text;
121732
121921
  try {
121733
121922
  ts.performance.mark("beforeIORead");
@@ -121741,7 +121930,7 @@ var ts;
121741
121930
  }
121742
121931
  text = "";
121743
121932
  }
121744
- return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined;
121933
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions) : undefined;
121745
121934
  },
121746
121935
  getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation),
121747
121936
  getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
@@ -122209,7 +122398,7 @@ var ts;
122209
122398
  }
122210
122399
  return directoryStructureHost.fileExists(fileName);
122211
122400
  }
122212
- function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) {
122401
+ function getVersionedSourceFileByPath(fileName, path, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
122213
122402
  var hostSourceFile = sourceFilesCache.get(path);
122214
122403
  // No source file on the host
122215
122404
  if (isFileMissingOnHost(hostSourceFile)) {
@@ -122217,7 +122406,7 @@ var ts;
122217
122406
  }
122218
122407
  // Create new source file if requested or the versions dont match
122219
122408
  if (hostSourceFile === undefined || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) {
122220
- var sourceFile = getNewSourceFile(fileName, languageVersion, onError);
122409
+ var sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError);
122221
122410
  if (hostSourceFile) {
122222
122411
  if (sourceFile) {
122223
122412
  // Set the source file and create file watcher now that file was present on the disk
@@ -134322,9 +134511,15 @@ var ts;
134322
134511
  });
134323
134512
  return JSON.stringify(bucketInfoArray, undefined, 2);
134324
134513
  }
134514
+ function getCompilationSettings(settingsOrHost) {
134515
+ if (typeof settingsOrHost.getCompilationSettings === "function") {
134516
+ return settingsOrHost.getCompilationSettings();
134517
+ }
134518
+ return settingsOrHost;
134519
+ }
134325
134520
  function acquireDocument(fileName, compilationSettings, scriptSnapshot, version, scriptKind) {
134326
134521
  var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);
134327
- var key = getKeyForCompilationSettings(compilationSettings);
134522
+ var key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
134328
134523
  return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
134329
134524
  }
134330
134525
  function acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind) {
@@ -134332,20 +134527,28 @@ var ts;
134332
134527
  }
134333
134528
  function updateDocument(fileName, compilationSettings, scriptSnapshot, version, scriptKind) {
134334
134529
  var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);
134335
- var key = getKeyForCompilationSettings(compilationSettings);
134530
+ var key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
134336
134531
  return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
134337
134532
  }
134338
134533
  function updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind) {
134339
- return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ false, scriptKind);
134534
+ return acquireOrUpdateDocument(fileName, path, getCompilationSettings(compilationSettings), key, scriptSnapshot, version, /*acquiring*/ false, scriptKind);
134340
134535
  }
134341
134536
  function getDocumentRegistryEntry(bucketEntry, scriptKind) {
134342
134537
  var entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(ts.Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided"));
134343
134538
  ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:" + scriptKind + " and sourceFile.scriptKind: " + (entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind) + ", !entry: " + !entry);
134344
134539
  return entry;
134345
134540
  }
134346
- function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
134541
+ function acquireOrUpdateDocument(fileName, path, compilationSettingsOrHost, key, scriptSnapshot, version, acquiring, scriptKind) {
134542
+ var _a, _b, _c, _d;
134347
134543
  scriptKind = ts.ensureScriptKind(fileName, scriptKind);
134544
+ var compilationSettings = getCompilationSettings(compilationSettingsOrHost);
134545
+ var host = compilationSettingsOrHost === compilationSettings ? undefined : compilationSettingsOrHost;
134348
134546
  var scriptTarget = scriptKind === 6 /* JSON */ ? 100 /* JSON */ : ts.getEmitScriptTarget(compilationSettings);
134547
+ var sourceFileOptions = {
134548
+ languageVersion: scriptTarget,
134549
+ impliedNodeFormat: host && ts.getImpliedNodeFormatForFile(path, (_d = (_c = (_b = (_a = host.getCompilerHost) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getModuleResolutionCache) === null || _c === void 0 ? void 0 : _c.call(_b)) === null || _d === void 0 ? void 0 : _d.getPackageJsonInfoCache(), host, compilationSettings),
134550
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(compilationSettings)
134551
+ };
134349
134552
  var oldBucketCount = buckets.size;
134350
134553
  var bucket = ts.getOrUpdate(buckets, key, function () { return new ts.Map(); });
134351
134554
  if (ts.tracing) {
@@ -134379,7 +134582,7 @@ var ts;
134379
134582
  }
134380
134583
  if (!entry) {
134381
134584
  // Have never seen this file with these settings. Create a new source file for it.
134382
- var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, /*setNodeParents*/ false, scriptKind);
134585
+ var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, sourceFileOptions, version, /*setNodeParents*/ false, scriptKind);
134383
134586
  if (externalCache) {
134384
134587
  externalCache.setDocument(key, path, sourceFile);
134385
134588
  }
@@ -141313,6 +141516,41 @@ var ts;
141313
141516
  if (ts.scanner.getToken() === 1 /* EndOfFileToken */) {
141314
141517
  break;
141315
141518
  }
141519
+ if (ts.scanner.getToken() === 15 /* TemplateHead */) {
141520
+ var stack = [ts.scanner.getToken()];
141521
+ var token = ts.scanner.scan();
141522
+ loop: while (ts.length(stack)) {
141523
+ switch (token) {
141524
+ case 1 /* EndOfFileToken */:
141525
+ break loop;
141526
+ case 100 /* ImportKeyword */:
141527
+ tryConsumeImport();
141528
+ break;
141529
+ case 15 /* TemplateHead */:
141530
+ stack.push(token);
141531
+ break;
141532
+ case 18 /* OpenBraceToken */:
141533
+ if (ts.length(stack)) {
141534
+ stack.push(token);
141535
+ }
141536
+ break;
141537
+ case 19 /* CloseBraceToken */:
141538
+ if (ts.length(stack)) {
141539
+ if (ts.lastOrUndefined(stack) === 15 /* TemplateHead */) {
141540
+ if (ts.scanner.reScanTemplateToken(/* isTaggedTemplate */ false) === 17 /* TemplateTail */) {
141541
+ stack.pop();
141542
+ }
141543
+ }
141544
+ else {
141545
+ stack.pop();
141546
+ }
141547
+ }
141548
+ break;
141549
+ }
141550
+ token = ts.scanner.scan();
141551
+ }
141552
+ nextToken();
141553
+ }
141316
141554
  // check if at least one of alternative have moved scanner forward
141317
141555
  if (tryConsumeDeclare() ||
141318
141556
  tryConsumeImport() ||
@@ -142823,7 +143061,7 @@ var ts;
142823
143061
  continue;
142824
143062
  var module_1 = ts.getResolvedModule(sourceFile, moduleSpecifier.text, ts.getModeForUsageLocation(sourceFile, moduleSpecifier));
142825
143063
  var resolvedFile = module_1 && program.getSourceFile(module_1.resolvedFileName);
142826
- if (resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
143064
+ if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
142827
143065
  diags.push(ts.createDiagnosticForNode(name, ts.Diagnostics.Import_may_be_converted_to_a_default_import));
142828
143066
  }
142829
143067
  }
@@ -143739,19 +143977,7 @@ var ts;
143739
143977
  options.suppressOutputPathCheck = true;
143740
143978
  // Filename can be non-ts file.
143741
143979
  options.allowNonTsExtensions = true;
143742
- // if jsx is specified then treat file as .tsx
143743
- var inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts");
143744
- var sourceFile = ts.createSourceFile(inputFileName, input, ts.getEmitScriptTarget(options));
143745
- if (transpileOptions.moduleName) {
143746
- sourceFile.moduleName = transpileOptions.moduleName;
143747
- }
143748
- if (transpileOptions.renamedDependencies) {
143749
- sourceFile.renamedDependencies = new ts.Map(ts.getEntries(transpileOptions.renamedDependencies));
143750
- }
143751
143980
  var newLine = ts.getNewLineCharacter(options);
143752
- // Output
143753
- var outputText;
143754
- var sourceMapText;
143755
143981
  // Create a compilerHost object to allow the compiler to read and write files
143756
143982
  var compilerHost = {
143757
143983
  getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; },
@@ -143775,6 +144001,22 @@ var ts;
143775
144001
  directoryExists: function () { return true; },
143776
144002
  getDirectories: function () { return []; }
143777
144003
  };
144004
+ // if jsx is specified then treat file as .tsx
144005
+ var inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts");
144006
+ var sourceFile = ts.createSourceFile(inputFileName, input, {
144007
+ languageVersion: ts.getEmitScriptTarget(options),
144008
+ impliedNodeFormat: ts.getImpliedNodeFormatForFile(ts.toPath(inputFileName, "", compilerHost.getCanonicalFileName), /*cache*/ undefined, compilerHost, options),
144009
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(options)
144010
+ });
144011
+ if (transpileOptions.moduleName) {
144012
+ sourceFile.moduleName = transpileOptions.moduleName;
144013
+ }
144014
+ if (transpileOptions.renamedDependencies) {
144015
+ sourceFile.renamedDependencies = new ts.Map(ts.getEntries(transpileOptions.renamedDependencies));
144016
+ }
144017
+ // Output
144018
+ var outputText;
144019
+ var sourceMapText;
143778
144020
  var program = ts.createProgram([inputFileName], options, compilerHost);
143779
144021
  if (transpileOptions.reportDiagnostics) {
143780
144022
  ts.addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile));
@@ -160287,7 +160529,7 @@ var ts;
160287
160529
  for (var i = 1;; i++) {
160288
160530
  var name = ts.combinePaths(inDirectory, newModuleName + extension);
160289
160531
  if (!host.fileExists(name))
160290
- return newModuleName; // TODO: GH#18217
160532
+ return newModuleName;
160291
160533
  newModuleName = moduleName + "." + i;
160292
160534
  }
160293
160535
  }
@@ -162647,6 +162889,7 @@ var ts;
162647
162889
  this.host = host;
162648
162890
  }
162649
162891
  SyntaxTreeCache.prototype.getCurrentSourceFile = function (fileName) {
162892
+ var _a, _b, _c, _d, _e, _f, _g, _h;
162650
162893
  var scriptSnapshot = this.host.getScriptSnapshot(fileName);
162651
162894
  if (!scriptSnapshot) {
162652
162895
  // The host does not know about this file.
@@ -162657,7 +162900,12 @@ var ts;
162657
162900
  var sourceFile;
162658
162901
  if (this.currentFileName !== fileName) {
162659
162902
  // This is a new file, just parse it
162660
- sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 99 /* Latest */, version, /*setNodeParents*/ true, scriptKind);
162903
+ var options = {
162904
+ languageVersion: 99 /* Latest */,
162905
+ impliedNodeFormat: ts.getImpliedNodeFormatForFile(ts.toPath(fileName, this.host.getCurrentDirectory(), ((_c = (_b = (_a = this.host).getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.getCanonicalFileName) || ts.hostGetCanonicalFileName(this.host)), (_h = (_g = (_f = (_e = (_d = this.host).getCompilerHost) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.getModuleResolutionCache) === null || _g === void 0 ? void 0 : _g.call(_f)) === null || _h === void 0 ? void 0 : _h.getPackageJsonInfoCache(), this.host, this.host.getCompilationSettings()),
162906
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(this.host.getCompilationSettings())
162907
+ };
162908
+ sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, options, version, /*setNodeParents*/ true, scriptKind);
162661
162909
  }
162662
162910
  else if (this.currentFileVersion !== version) {
162663
162911
  // This is the same file, just a newer version. Incrementally parse the file.
@@ -162679,8 +162927,8 @@ var ts;
162679
162927
  sourceFile.version = version;
162680
162928
  sourceFile.scriptSnapshot = scriptSnapshot;
162681
162929
  }
162682
- function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents, scriptKind) {
162683
- var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTarget, setNodeParents, scriptKind);
162930
+ function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version, setNodeParents, scriptKind) {
162931
+ var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind);
162684
162932
  setSourceFileFields(sourceFile, scriptSnapshot, version);
162685
162933
  return sourceFile;
162686
162934
  }
@@ -162728,8 +162976,13 @@ var ts;
162728
162976
  return newSourceFile;
162729
162977
  }
162730
162978
  }
162979
+ var options = {
162980
+ languageVersion: sourceFile.languageVersion,
162981
+ impliedNodeFormat: sourceFile.impliedNodeFormat,
162982
+ setExternalModuleIndicator: sourceFile.setExternalModuleIndicator,
162983
+ };
162731
162984
  // Otherwise, just create a new source file.
162732
- return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true, sourceFile.scriptKind);
162985
+ return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, options, version, /*setNodeParents*/ true, sourceFile.scriptKind);
162733
162986
  }
162734
162987
  ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile;
162735
162988
  var NoopCancellationToken = {
@@ -163073,7 +163326,7 @@ var ts;
163073
163326
  // file's script kind, i.e. in one project some file is treated as ".ts"
163074
163327
  // and in another as ".js"
163075
163328
  if (hostFileInformation.scriptKind === oldSourceFile.scriptKind) {
163076
- return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
163329
+ return documentRegistry.updateDocumentWithKey(fileName, path, host, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
163077
163330
  }
163078
163331
  else {
163079
163332
  // Release old source file and fall through to aquire new file with new script kind
@@ -163083,7 +163336,7 @@ var ts;
163083
163336
  // We didn't already have the file. Fall through and acquire it from the registry.
163084
163337
  }
163085
163338
  // Could not find this file in the old program, create a new SourceFile for it.
163086
- return documentRegistry.acquireDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
163339
+ return documentRegistry.acquireDocumentWithKey(fileName, path, host, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
163087
163340
  }
163088
163341
  }
163089
163342
  // TODO: GH#18217 frequently asserted as defined
@@ -168213,6 +168466,10 @@ var ts;
168213
168466
  this.packageJsonsForAutoImport = new ts.Set(packageJsons.map(function (p) { return p.fileName; }));
168214
168467
  return packageJsons;
168215
168468
  };
168469
+ /* @internal */
168470
+ Project.prototype.getPackageJsonCache = function () {
168471
+ return this.projectService.packageJsonCache;
168472
+ };
168216
168473
  /*@internal*/
168217
168474
  Project.prototype.getCachedExportInfoMap = function () {
168218
168475
  return this.exportMapCache || (this.exportMapCache = ts.createCacheableExportInfoMap(this));