@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.
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-insiders.20220307";
103
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220311";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -2099,13 +2099,15 @@ var ts;
2099
2099
  for (var _i = 0; _i < arguments.length; _i++) {
2100
2100
  args[_i] = arguments[_i];
2101
2101
  }
2102
+ var lastResult;
2102
2103
  for (var _a = 0, fs_1 = fs; _a < fs_1.length; _a++) {
2103
2104
  var f = fs_1[_a];
2104
- if (f.apply(void 0, args)) {
2105
- return true;
2105
+ lastResult = f.apply(void 0, args);
2106
+ if (lastResult) {
2107
+ return lastResult;
2106
2108
  }
2107
2109
  }
2108
- return false;
2110
+ return lastResult;
2109
2111
  };
2110
2112
  }
2111
2113
  ts.or = or;
@@ -4164,6 +4166,7 @@ var ts;
4164
4166
  SyntaxKind[SyntaxKind["JSDocFunctionType"] = 316] = "JSDocFunctionType";
4165
4167
  SyntaxKind[SyntaxKind["JSDocVariadicType"] = 317] = "JSDocVariadicType";
4166
4168
  SyntaxKind[SyntaxKind["JSDocNamepathType"] = 318] = "JSDocNamepathType";
4169
+ /** @deprecated Use SyntaxKind.JSDoc */
4167
4170
  SyntaxKind[SyntaxKind["JSDocComment"] = 319] = "JSDocComment";
4168
4171
  SyntaxKind[SyntaxKind["JSDocText"] = 320] = "JSDocText";
4169
4172
  SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 321] = "JSDocTypeLiteral";
@@ -4237,6 +4240,7 @@ var ts;
4237
4240
  SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 346] = "LastJSDocTagNode";
4238
4241
  /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 126] = "FirstContextualKeyword";
4239
4242
  /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 159] = "LastContextualKeyword";
4243
+ SyntaxKind[SyntaxKind["JSDoc"] = 319] = "JSDoc";
4240
4244
  })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
4241
4245
  var NodeFlags;
4242
4246
  (function (NodeFlags) {
@@ -4894,57 +4898,58 @@ var ts;
4894
4898
  ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties";
4895
4899
  ObjectFlags[ObjectFlags["ReverseMapped"] = 1024] = "ReverseMapped";
4896
4900
  ObjectFlags[ObjectFlags["JsxAttributes"] = 2048] = "JsxAttributes";
4897
- ObjectFlags[ObjectFlags["JSLiteral"] = 4096] = "JSLiteral";
4898
- ObjectFlags[ObjectFlags["FreshLiteral"] = 8192] = "FreshLiteral";
4899
- ObjectFlags[ObjectFlags["ArrayLiteral"] = 16384] = "ArrayLiteral";
4901
+ ObjectFlags[ObjectFlags["MarkerType"] = 4096] = "MarkerType";
4902
+ ObjectFlags[ObjectFlags["JSLiteral"] = 8192] = "JSLiteral";
4903
+ ObjectFlags[ObjectFlags["FreshLiteral"] = 16384] = "FreshLiteral";
4904
+ ObjectFlags[ObjectFlags["ArrayLiteral"] = 32768] = "ArrayLiteral";
4900
4905
  /* @internal */
4901
- ObjectFlags[ObjectFlags["PrimitiveUnion"] = 32768] = "PrimitiveUnion";
4906
+ ObjectFlags[ObjectFlags["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
4902
4907
  /* @internal */
4903
- ObjectFlags[ObjectFlags["ContainsWideningType"] = 65536] = "ContainsWideningType";
4908
+ ObjectFlags[ObjectFlags["ContainsWideningType"] = 131072] = "ContainsWideningType";
4904
4909
  /* @internal */
4905
- ObjectFlags[ObjectFlags["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral";
4910
+ ObjectFlags[ObjectFlags["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
4906
4911
  /* @internal */
4907
- ObjectFlags[ObjectFlags["NonInferrableType"] = 262144] = "NonInferrableType";
4912
+ ObjectFlags[ObjectFlags["NonInferrableType"] = 524288] = "NonInferrableType";
4908
4913
  /* @internal */
4909
- ObjectFlags[ObjectFlags["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed";
4914
+ ObjectFlags[ObjectFlags["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
4910
4915
  /* @internal */
4911
- ObjectFlags[ObjectFlags["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables";
4916
+ ObjectFlags[ObjectFlags["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
4912
4917
  ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface";
4913
4918
  /* @internal */
4914
- ObjectFlags[ObjectFlags["RequiresWidening"] = 196608] = "RequiresWidening";
4919
+ ObjectFlags[ObjectFlags["RequiresWidening"] = 393216] = "RequiresWidening";
4915
4920
  /* @internal */
4916
- ObjectFlags[ObjectFlags["PropagatingFlags"] = 458752] = "PropagatingFlags";
4921
+ ObjectFlags[ObjectFlags["PropagatingFlags"] = 917504] = "PropagatingFlags";
4917
4922
  // Object flags that uniquely identify the kind of ObjectType
4918
4923
  /* @internal */
4919
4924
  ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
4920
4925
  // Flags that require TypeFlags.Object
4921
- ObjectFlags[ObjectFlags["ContainsSpread"] = 2097152] = "ContainsSpread";
4922
- ObjectFlags[ObjectFlags["ObjectRestType"] = 4194304] = "ObjectRestType";
4923
- ObjectFlags[ObjectFlags["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
4926
+ ObjectFlags[ObjectFlags["ContainsSpread"] = 4194304] = "ContainsSpread";
4927
+ ObjectFlags[ObjectFlags["ObjectRestType"] = 8388608] = "ObjectRestType";
4928
+ ObjectFlags[ObjectFlags["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
4924
4929
  /* @internal */
4925
- ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
4930
+ ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
4926
4931
  // Flags that require TypeFlags.Object and ObjectFlags.Reference
4927
4932
  /* @internal */
4928
- ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
4933
+ ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
4929
4934
  /* @internal */
4930
- ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
4935
+ ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
4931
4936
  // Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
4932
4937
  /* @internal */
4933
- ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed";
4938
+ ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
4934
4939
  /* @internal */
4935
- ObjectFlags[ObjectFlags["IsGenericObjectType"] = 4194304] = "IsGenericObjectType";
4940
+ ObjectFlags[ObjectFlags["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
4936
4941
  /* @internal */
4937
- ObjectFlags[ObjectFlags["IsGenericIndexType"] = 8388608] = "IsGenericIndexType";
4942
+ ObjectFlags[ObjectFlags["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
4938
4943
  /* @internal */
4939
- ObjectFlags[ObjectFlags["IsGenericType"] = 12582912] = "IsGenericType";
4944
+ ObjectFlags[ObjectFlags["IsGenericType"] = 25165824] = "IsGenericType";
4940
4945
  // Flags that require TypeFlags.Union
4941
4946
  /* @internal */
4942
- ObjectFlags[ObjectFlags["ContainsIntersections"] = 16777216] = "ContainsIntersections";
4947
+ ObjectFlags[ObjectFlags["ContainsIntersections"] = 33554432] = "ContainsIntersections";
4943
4948
  // Flags that require TypeFlags.Intersection
4944
4949
  /* @internal */
4945
- ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed";
4950
+ ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
4946
4951
  /* @internal */
4947
- ObjectFlags[ObjectFlags["IsNeverIntersection"] = 33554432] = "IsNeverIntersection";
4952
+ ObjectFlags[ObjectFlags["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
4948
4953
  })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {}));
4949
4954
  /* @internal */
4950
4955
  var VarianceFlags;
@@ -5122,6 +5127,21 @@ var ts;
5122
5127
  ModuleResolutionKind[ModuleResolutionKind["Node12"] = 3] = "Node12";
5123
5128
  ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
5124
5129
  })(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
5130
+ var ModuleDetectionKind;
5131
+ (function (ModuleDetectionKind) {
5132
+ /**
5133
+ * Files with imports, exports and/or import.meta are considered modules
5134
+ */
5135
+ ModuleDetectionKind[ModuleDetectionKind["Legacy"] = 1] = "Legacy";
5136
+ /**
5137
+ * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+
5138
+ */
5139
+ ModuleDetectionKind[ModuleDetectionKind["Auto"] = 2] = "Auto";
5140
+ /**
5141
+ * Consider all non-declaration files modules, regardless of present syntax
5142
+ */
5143
+ ModuleDetectionKind[ModuleDetectionKind["Force"] = 3] = "Force";
5144
+ })(ModuleDetectionKind = ts.ModuleDetectionKind || (ts.ModuleDetectionKind = {}));
5125
5145
  var WatchFileKind;
5126
5146
  (function (WatchFileKind) {
5127
5147
  WatchFileKind[WatchFileKind["FixedPollingInterval"] = 0] = "FixedPollingInterval";
@@ -8219,6 +8239,8 @@ var ts;
8219
8239
  catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
8220
8240
  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."),
8221
8241
  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."),
8242
+ 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."),
8243
+ 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."),
8222
8244
  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."),
8223
8245
  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."),
8224
8246
  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),
@@ -9023,7 +9045,6 @@ var ts;
9023
9045
  Command_line_Options: diag(6171, ts.DiagnosticCategory.Message, "Command_line_Options_6171", "Command-line Options"),
9024
9046
  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'."),
9025
9047
  Enable_all_strict_type_checking_options: diag(6180, ts.DiagnosticCategory.Message, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."),
9026
- List_of_language_service_plugins: diag(6181, ts.DiagnosticCategory.Message, "List_of_language_service_plugins_6181", "List of language service plugins."),
9027
9048
  Scoped_package_detected_looking_in_0: diag(6182, ts.DiagnosticCategory.Message, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"),
9028
9049
  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}'."),
9029
9050
  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}'."),
@@ -9130,7 +9151,7 @@ var ts;
9130
9151
  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"),
9131
9152
  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"),
9132
9153
  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"),
9133
- Delete_the_outputs_of_all_projects: diag(6365, ts.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects"),
9154
+ Delete_the_outputs_of_all_projects: diag(6365, ts.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."),
9134
9155
  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')"),
9135
9156
  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."),
9136
9157
  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."),
@@ -9141,7 +9162,6 @@ var ts;
9141
9162
  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}'"),
9142
9163
  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}'"),
9143
9164
  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}'"),
9144
- Enable_incremental_compilation: diag(6378, ts.DiagnosticCategory.Message, "Enable_incremental_compilation_6378", "Enable incremental compilation"),
9145
9165
  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."),
9146
9166
  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"),
9147
9167
  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}'"),
@@ -9169,13 +9189,13 @@ var ts;
9169
9189
  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?"),
9170
9190
  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."),
9171
9191
  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."),
9172
- 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."),
9192
+ 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."),
9173
9193
  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."),
9174
9194
  Allow_accessing_UMD_globals_from_modules: diag(6602, ts.DiagnosticCategory.Message, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."),
9175
9195
  Disable_error_reporting_for_unreachable_code: diag(6603, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."),
9176
9196
  Disable_error_reporting_for_unused_labels: diag(6604, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."),
9177
9197
  Ensure_use_strict_is_always_emitted: diag(6605, ts.DiagnosticCategory.Message, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."),
9178
- 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."),
9198
+ 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."),
9179
9199
  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."),
9180
9200
  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."),
9181
9201
  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."),
@@ -9188,13 +9208,13 @@ var ts;
9188
9208
  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."),
9189
9209
  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."),
9190
9210
  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."),
9191
- 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"),
9211
+ 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."),
9192
9212
  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."),
9193
9213
  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."),
9194
9214
  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."),
9195
9215
  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."),
9196
9216
  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"),
9197
- 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."),
9217
+ 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."),
9198
9218
  Filters_results_from_the_include_option: diag(6627, ts.DiagnosticCategory.Message, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."),
9199
9219
  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."),
9200
9220
  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."),
@@ -9204,7 +9224,7 @@ var ts;
9204
9224
  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."),
9205
9225
  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."),
9206
9226
  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`."),
9207
- 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"),
9227
+ 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."),
9208
9228
  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."),
9209
9229
  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."),
9210
9230
  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."),
@@ -9214,77 +9234,76 @@ var ts;
9214
9234
  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."),
9215
9235
  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."),
9216
9236
  Specify_what_JSX_code_is_generated: diag(6646, ts.DiagnosticCategory.Message, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."),
9217
- 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'"),
9237
+ 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'."),
9218
9238
  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'."),
9219
- 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*`.`"),
9239
+ 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*'."),
9220
9240
  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."),
9221
9241
  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."),
9222
9242
  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."),
9223
9243
  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."),
9224
9244
  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."),
9225
9245
  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."),
9226
- 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`."),
9246
+ 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'."),
9227
9247
  Specify_what_module_code_is_generated: diag(6657, ts.DiagnosticCategory.Message, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."),
9228
9248
  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."),
9229
9249
  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."),
9230
9250
  Disable_emitting_files_from_a_compilation: diag(6660, ts.DiagnosticCategory.Message, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."),
9231
- 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."),
9251
+ 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."),
9232
9252
  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."),
9233
9253
  Disable_truncating_types_in_error_messages: diag(6663, ts.DiagnosticCategory.Message, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."),
9234
9254
  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."),
9235
- 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.."),
9255
+ 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."),
9236
9256
  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."),
9237
9257
  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."),
9238
- 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`."),
9258
+ 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'."),
9239
9259
  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."),
9240
9260
  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."),
9241
- 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"),
9242
- 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."),
9261
+ 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."),
9262
+ 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."),
9243
9263
  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."),
9244
- 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."),
9245
- 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."),
9246
- 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"),
9247
- Deprecated_setting_Use_outFile_instead: diag(6677, ts.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use `outFile` instead."),
9264
+ 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."),
9265
+ 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."),
9266
+ 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."),
9267
+ Deprecated_setting_Use_outFile_instead: diag(6677, ts.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."),
9248
9268
  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."),
9249
- 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."),
9269
+ 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."),
9250
9270
  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."),
9251
9271
  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."),
9252
- 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."),
9272
+ 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."),
9253
9273
  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."),
9254
- 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"),
9255
- 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"),
9256
- 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."),
9274
+ 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."),
9275
+ 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."),
9276
+ 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."),
9257
9277
  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."),
9258
9278
  Disable_emitting_comments: diag(6688, ts.DiagnosticCategory.Message, "Disable_emitting_comments_6688", "Disable emitting comments."),
9259
- Enable_importing_json_files: diag(6689, ts.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files"),
9279
+ Enable_importing_json_files: diag(6689, ts.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files."),
9260
9280
  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."),
9261
9281
  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."),
9262
9282
  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."),
9263
9283
  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."),
9264
9284
  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."),
9265
9285
  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."),
9266
- 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."),
9286
+ 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."),
9267
9287
  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."),
9268
- 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`."),
9288
+ 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'."),
9269
9289
  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."),
9270
- 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."),
9290
+ 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."),
9271
9291
  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."),
9272
- 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."),
9292
+ 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."),
9273
9293
  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."),
9274
9294
  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."),
9275
- 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."),
9295
+ 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."),
9276
9296
  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."),
9277
9297
  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."),
9278
- 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`."),
9298
+ 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'."),
9279
9299
  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."),
9280
9300
  Emit_ECMAScript_standard_compliant_class_fields: diag(6712, ts.DiagnosticCategory.Message, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."),
9281
- Enable_verbose_logging: diag(6713, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging"),
9301
+ Enable_verbose_logging: diag(6713, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging."),
9282
9302
  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."),
9283
9303
  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."),
9284
- Include_undefined_in_index_signature_results: diag(6716, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6716", "Include 'undefined' in index signature results"),
9285
9304
  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."),
9286
- 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"),
9287
- 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'."),
9305
+ 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."),
9306
+ 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'."),
9288
9307
  one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
9289
9308
  one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
9290
9309
  type_Colon: diag(6902, ts.DiagnosticCategory.Message, "type_Colon_6902", "type:"),
@@ -12835,7 +12854,7 @@ var ts;
12835
12854
  return ts.emptyArray;
12836
12855
  }
12837
12856
  if (ts.isJSDocTypeAlias(node)) {
12838
- ts.Debug.assert(node.parent.kind === 319 /* JSDocComment */);
12857
+ ts.Debug.assert(node.parent.kind === 319 /* JSDoc */);
12839
12858
  return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
12840
12859
  }
12841
12860
  if (node.typeParameters) {
@@ -13782,7 +13801,7 @@ var ts;
13782
13801
  ts.isJSDocNode = isJSDocNode;
13783
13802
  /** True if node is of a kind that may contain comment text. */
13784
13803
  function isJSDocCommentContainingNode(node) {
13785
- return node.kind === 319 /* JSDocComment */
13804
+ return node.kind === 319 /* JSDoc */
13786
13805
  || node.kind === 318 /* JSDocNamepathType */
13787
13806
  || node.kind === 320 /* JSDocText */
13788
13807
  || isJSDocLinkLike(node)
@@ -14832,7 +14851,7 @@ var ts;
14832
14851
  return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
14833
14852
  }
14834
14853
  ts.isComputedNonLiteralName = isComputedNonLiteralName;
14835
- function getTextOfPropertyName(name) {
14854
+ function tryGetTextOfPropertyName(name) {
14836
14855
  switch (name.kind) {
14837
14856
  case 79 /* Identifier */:
14838
14857
  case 80 /* PrivateIdentifier */:
@@ -14844,11 +14863,15 @@ var ts;
14844
14863
  case 161 /* ComputedPropertyName */:
14845
14864
  if (isStringOrNumericLiteralLike(name.expression))
14846
14865
  return ts.escapeLeadingUnderscores(name.expression.text);
14847
- return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames");
14866
+ return undefined;
14848
14867
  default:
14849
14868
  return ts.Debug.assertNever(name);
14850
14869
  }
14851
14870
  }
14871
+ ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
14872
+ function getTextOfPropertyName(name) {
14873
+ return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
14874
+ }
14852
14875
  ts.getTextOfPropertyName = getTextOfPropertyName;
14853
14876
  function entityNameToString(name) {
14854
14877
  switch (name.kind) {
@@ -15343,10 +15366,23 @@ var ts;
15343
15366
  && node.parent.parent.kind === 236 /* VariableStatement */;
15344
15367
  }
15345
15368
  ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
15369
+ function isCommonJsExportedExpression(node) {
15370
+ if (!isInJSFile(node))
15371
+ return false;
15372
+ return (ts.isObjectLiteralExpression(node.parent) && ts.isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === 2 /* ModuleExports */) ||
15373
+ isCommonJsExportPropertyAssignment(node.parent);
15374
+ }
15375
+ ts.isCommonJsExportedExpression = isCommonJsExportedExpression;
15376
+ function isCommonJsExportPropertyAssignment(node) {
15377
+ if (!isInJSFile(node))
15378
+ return false;
15379
+ return (ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 1 /* ExportsProperty */);
15380
+ }
15381
+ ts.isCommonJsExportPropertyAssignment = isCommonJsExportPropertyAssignment;
15346
15382
  function isValidESSymbolDeclaration(node) {
15347
- return ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
15383
+ return (ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
15348
15384
  ts.isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) :
15349
- ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node);
15385
+ ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node)) || isCommonJsExportPropertyAssignment(node);
15350
15386
  }
15351
15387
  ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
15352
15388
  function introducesArgumentsExoticObject(node) {
@@ -15400,7 +15436,7 @@ var ts;
15400
15436
  function getPropertyAssignment(objectLiteral, key, key2) {
15401
15437
  return objectLiteral.properties.filter(function (property) {
15402
15438
  if (property.kind === 295 /* PropertyAssignment */) {
15403
- var propName = getTextOfPropertyName(property.name);
15439
+ var propName = tryGetTextOfPropertyName(property.name);
15404
15440
  return key === propName || (!!key2 && key2 === propName);
15405
15441
  }
15406
15442
  return false;
@@ -18240,7 +18276,7 @@ var ts;
18240
18276
  ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
18241
18277
  /** template tags are only available when a typedef isn't already using them */
18242
18278
  function isNonTypeAliasTemplate(tag) {
18243
- return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));
18279
+ return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
18244
18280
  }
18245
18281
  /**
18246
18282
  * Gets the effective type annotation of the value parameter of a set accessor. If the node
@@ -19714,6 +19750,61 @@ var ts;
19714
19750
  return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;
19715
19751
  }
19716
19752
  ts.getLanguageVariant = getLanguageVariant;
19753
+ /**
19754
+ * This is a somewhat unavoidable full tree walk to locate a JSX tag - `import.meta` requires the same,
19755
+ * but we avoid that walk (or parts of it) if at all possible using the `PossiblyContainsImportMeta` node flag.
19756
+ * Unfortunately, there's no `NodeFlag` space to do the same for JSX.
19757
+ */
19758
+ function walkTreeForJSXTags(node) {
19759
+ if (!(node.transformFlags & 2 /* ContainsJsx */))
19760
+ return undefined;
19761
+ return ts.isJsxOpeningLikeElement(node) || ts.isJsxFragment(node) ? node : ts.forEachChild(node, walkTreeForJSXTags);
19762
+ }
19763
+ function isFileModuleFromUsingJSXTag(file) {
19764
+ // Excludes declaration files - they still require an explicit `export {}` or the like
19765
+ // for back compat purposes. (not that declaration files should contain JSX tags!)
19766
+ return !file.isDeclarationFile ? walkTreeForJSXTags(file) : undefined;
19767
+ }
19768
+ /**
19769
+ * Note that this requires file.impliedNodeFormat be set already; meaning it must be set very early on
19770
+ * in SourceFile construction.
19771
+ */
19772
+ function isFileForcedToBeModuleByFormat(file) {
19773
+ // Excludes declaration files - they still require an explicit `export {}` or the like
19774
+ // for back compat purposes.
19775
+ return file.impliedNodeFormat === ts.ModuleKind.ESNext && !file.isDeclarationFile ? true : undefined;
19776
+ }
19777
+ function getSetExternalModuleIndicator(options) {
19778
+ // TODO: Should this callback be cached?
19779
+ switch (getEmitModuleDetectionKind(options)) {
19780
+ case ts.ModuleDetectionKind.Force:
19781
+ // All non-declaration files are modules, declaration files still do the usual isFileProbablyExternalModule
19782
+ return function (file) {
19783
+ file.externalModuleIndicator = !file.isDeclarationFile || ts.isFileProbablyExternalModule(file);
19784
+ };
19785
+ case ts.ModuleDetectionKind.Legacy:
19786
+ // Files are modules if they have imports, exports, or import.meta
19787
+ return function (file) {
19788
+ file.externalModuleIndicator = ts.isFileProbablyExternalModule(file);
19789
+ };
19790
+ case ts.ModuleDetectionKind.Auto:
19791
+ // If module is nodenext or node12, all esm format files are modules
19792
+ // If jsx is react-jsx or react-jsxdev then jsx tags force module-ness
19793
+ // otherwise, the presence of import or export statments (or import.meta) implies module-ness
19794
+ var checks = [ts.isFileProbablyExternalModule];
19795
+ if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) {
19796
+ checks.push(isFileModuleFromUsingJSXTag);
19797
+ }
19798
+ var moduleKind = getEmitModuleKind(options);
19799
+ if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
19800
+ checks.push(isFileForcedToBeModuleByFormat);
19801
+ }
19802
+ var combined_1 = ts.or.apply(void 0, checks);
19803
+ var callback = function (file) { return void (file.externalModuleIndicator = combined_1(file)); };
19804
+ return callback;
19805
+ }
19806
+ }
19807
+ ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
19717
19808
  function getEmitScriptTarget(compilerOptions) {
19718
19809
  return compilerOptions.target ||
19719
19810
  (compilerOptions.module === ts.ModuleKind.Node12 && 7 /* ES2020 */) ||
@@ -19748,6 +19839,10 @@ var ts;
19748
19839
  return moduleResolution;
19749
19840
  }
19750
19841
  ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
19842
+ function getEmitModuleDetectionKind(options) {
19843
+ return options.moduleDetection || ts.ModuleDetectionKind.Auto;
19844
+ }
19845
+ ts.getEmitModuleDetectionKind = getEmitModuleDetectionKind;
19751
19846
  function hasJsonModuleEmitEnabled(options) {
19752
19847
  switch (getEmitModuleKind(options)) {
19753
19848
  case ts.ModuleKind.CommonJS:
@@ -25217,7 +25312,7 @@ var ts;
25217
25312
  }
25218
25313
  // @api
25219
25314
  function createJSDocComment(comment, tags) {
25220
- var node = createBaseNode(319 /* JSDocComment */);
25315
+ var node = createBaseNode(319 /* JSDoc */);
25221
25316
  node.comment = comment;
25222
25317
  node.tags = asNodeArray(tags);
25223
25318
  return node;
@@ -28726,7 +28821,7 @@ var ts;
28726
28821
  }
28727
28822
  ts.isJSDocNamepathType = isJSDocNamepathType;
28728
28823
  function isJSDoc(node) {
28729
- return node.kind === 319 /* JSDocComment */;
28824
+ return node.kind === 319 /* JSDoc */;
28730
28825
  }
28731
28826
  ts.isJSDoc = isJSDoc;
28732
28827
  function isJSDocTypeLiteral(node) {
@@ -29918,6 +30013,36 @@ var ts;
29918
30013
  text.charCodeAt(start + 3) !== 47 /* slash */;
29919
30014
  }
29920
30015
  ts.isJSDocLikeText = isJSDocLikeText;
30016
+ /*@internal*/
30017
+ function isFileProbablyExternalModule(sourceFile) {
30018
+ // Try to use the first top-level import/export when available, then
30019
+ // fall back to looking for an 'import.meta' somewhere in the tree if necessary.
30020
+ return ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
30021
+ getImportMetaIfNecessary(sourceFile);
30022
+ }
30023
+ ts.isFileProbablyExternalModule = isFileProbablyExternalModule;
30024
+ function isAnExternalModuleIndicatorNode(node) {
30025
+ return hasModifierOfKind(node, 93 /* ExportKeyword */)
30026
+ || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
30027
+ || ts.isImportDeclaration(node)
30028
+ || ts.isExportAssignment(node)
30029
+ || ts.isExportDeclaration(node) ? node : undefined;
30030
+ }
30031
+ function getImportMetaIfNecessary(sourceFile) {
30032
+ return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ?
30033
+ walkTreeForImportMeta(sourceFile) :
30034
+ undefined;
30035
+ }
30036
+ function walkTreeForImportMeta(node) {
30037
+ return isImportMeta(node) ? node : forEachChild(node, walkTreeForImportMeta);
30038
+ }
30039
+ /** Do not use hasModifier inside the parser; it relies on parent pointers. Use this instead. */
30040
+ function hasModifierOfKind(node, kind) {
30041
+ return ts.some(node.modifiers, function (m) { return m.kind === kind; });
30042
+ }
30043
+ function isImportMeta(node) {
30044
+ return ts.isMetaProperty(node) && node.keywordToken === 100 /* ImportKeyword */ && node.name.escapedText === "meta";
30045
+ }
29921
30046
  /**
29922
30047
  * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
29923
30048
  * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
@@ -30351,7 +30476,7 @@ var ts;
30351
30476
  case 316 /* JSDocFunctionType */:
30352
30477
  return visitNodes(cbNode, cbNodes, node.parameters) ||
30353
30478
  visitNode(cbNode, node.type);
30354
- case 319 /* JSDocComment */:
30479
+ case 319 /* JSDoc */:
30355
30480
  return (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
30356
30481
  || visitNodes(cbNode, cbNodes, node.tags);
30357
30482
  case 345 /* JSDocSeeTag */:
@@ -30499,17 +30624,25 @@ var ts;
30499
30624
  children.unshift(n);
30500
30625
  }
30501
30626
  }
30502
- function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) {
30627
+ function setExternalModuleIndicator(sourceFile) {
30628
+ sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
30629
+ }
30630
+ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes, scriptKind) {
30503
30631
  if (setParentNodes === void 0) { setParentNodes = false; }
30504
30632
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("parse" /* Parse */, "createSourceFile", { path: fileName }, /*separateBeginAndEnd*/ true);
30505
30633
  ts.performance.mark("beforeParse");
30506
30634
  var result;
30507
30635
  ts.perfLogger.logStartParseSourceFile(fileName);
30636
+ var _a = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }, languageVersion = _a.languageVersion, overrideSetExternalModuleIndicator = _a.setExternalModuleIndicator, format = _a.impliedNodeFormat;
30508
30637
  if (languageVersion === 100 /* JSON */) {
30509
- result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, 6 /* JSON */);
30638
+ result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, 6 /* JSON */, ts.noop);
30510
30639
  }
30511
30640
  else {
30512
- result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind);
30641
+ var setIndicator = format === undefined ? overrideSetExternalModuleIndicator : function (file) {
30642
+ file.impliedNodeFormat = format;
30643
+ return (overrideSetExternalModuleIndicator || setExternalModuleIndicator)(file);
30644
+ };
30645
+ result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind, setIndicator);
30513
30646
  }
30514
30647
  ts.perfLogger.logStopParseSourceFile();
30515
30648
  ts.performance.mark("afterParse");
@@ -30695,7 +30828,7 @@ var ts;
30695
30828
  // Note: any errors at the end of the file that do not precede a regular node, should get
30696
30829
  // attached to the EOF token.
30697
30830
  var parseErrorBeforeNextFinishedNode = false;
30698
- function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
30831
+ function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind, setExternalModuleIndicatorOverride) {
30699
30832
  var _a;
30700
30833
  if (setParentNodes === void 0) { setParentNodes = false; }
30701
30834
  scriptKind = ts.ensureScriptKind(fileName, scriptKind);
@@ -30711,7 +30844,7 @@ var ts;
30711
30844
  return result_3;
30712
30845
  }
30713
30846
  initializeState(fileName, sourceText, languageVersion, syntaxCursor, scriptKind);
30714
- var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind);
30847
+ var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicatorOverride || setExternalModuleIndicator);
30715
30848
  clearState();
30716
30849
  return result;
30717
30850
  }
@@ -30795,7 +30928,7 @@ var ts;
30795
30928
  endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token);
30796
30929
  }
30797
30930
  // Set source file so that errors will be reported with this file name
30798
- var sourceFile = createSourceFile(fileName, 2 /* ES2015 */, 6 /* JSON */, /*isDeclaration*/ false, statements, endOfFileToken, sourceFlags);
30931
+ var sourceFile = createSourceFile(fileName, 2 /* ES2015 */, 6 /* JSON */, /*isDeclaration*/ false, statements, endOfFileToken, sourceFlags, ts.noop);
30799
30932
  if (setParentNodes) {
30800
30933
  fixupParentReferences(sourceFile);
30801
30934
  }
@@ -30869,7 +31002,7 @@ var ts;
30869
31002
  notParenthesizedArrow = undefined;
30870
31003
  topLevel = true;
30871
31004
  }
30872
- function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind) {
31005
+ function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicator) {
30873
31006
  var isDeclarationFile = isDeclarationFileName(fileName);
30874
31007
  if (isDeclarationFile) {
30875
31008
  contextFlags |= 8388608 /* Ambient */;
@@ -30880,7 +31013,7 @@ var ts;
30880
31013
  var statements = parseList(0 /* SourceElements */, parseStatement);
30881
31014
  ts.Debug.assert(token() === 1 /* EndOfFileToken */);
30882
31015
  var endOfFileToken = addJSDocComment(parseTokenNode());
30883
- var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags);
31016
+ var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator);
30884
31017
  // 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
30885
31018
  processCommentPragmas(sourceFile, sourceText);
30886
31019
  processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
@@ -31017,25 +31150,30 @@ var ts;
31017
31150
  ts.setParentRecursive(rootNode, /*incremental*/ true);
31018
31151
  }
31019
31152
  Parser.fixupParentReferences = fixupParentReferences;
31020
- function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags) {
31153
+ function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator) {
31021
31154
  // code from createNode is inlined here so createNode won't have to deal with special case of creating source files
31022
31155
  // this is quite rare comparing to other nodes and createNode should be as fast as possible
31023
31156
  var sourceFile = factory.createSourceFile(statements, endOfFileToken, flags);
31024
31157
  ts.setTextRangePosWidth(sourceFile, 0, sourceText.length);
31025
- setExternalModuleIndicator(sourceFile);
31158
+ setFields(sourceFile);
31026
31159
  // If we parsed this as an external module, it may contain top-level await
31027
31160
  if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 16777216 /* ContainsPossibleTopLevelAwait */) {
31028
31161
  sourceFile = reparseTopLevelAwait(sourceFile);
31162
+ setFields(sourceFile);
31029
31163
  }
31030
- sourceFile.text = sourceText;
31031
- sourceFile.bindDiagnostics = [];
31032
- sourceFile.bindSuggestionDiagnostics = undefined;
31033
- sourceFile.languageVersion = languageVersion;
31034
- sourceFile.fileName = fileName;
31035
- sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
31036
- sourceFile.isDeclarationFile = isDeclarationFile;
31037
- sourceFile.scriptKind = scriptKind;
31038
31164
  return sourceFile;
31165
+ function setFields(sourceFile) {
31166
+ sourceFile.text = sourceText;
31167
+ sourceFile.bindDiagnostics = [];
31168
+ sourceFile.bindSuggestionDiagnostics = undefined;
31169
+ sourceFile.languageVersion = languageVersion;
31170
+ sourceFile.fileName = fileName;
31171
+ sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
31172
+ sourceFile.isDeclarationFile = isDeclarationFile;
31173
+ sourceFile.scriptKind = scriptKind;
31174
+ setExternalModuleIndicator(sourceFile);
31175
+ sourceFile.setExternalModuleIndicator = setExternalModuleIndicator;
31176
+ }
31039
31177
  }
31040
31178
  function setContextFlag(val, flag) {
31041
31179
  if (val) {
@@ -36518,35 +36656,6 @@ var ts;
36518
36656
  var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
36519
36657
  return withJSDoc(finishNode(node, pos), hasJSDoc);
36520
36658
  }
36521
- function setExternalModuleIndicator(sourceFile) {
36522
- // Try to use the first top-level import/export when available, then
36523
- // fall back to looking for an 'import.meta' somewhere in the tree if necessary.
36524
- sourceFile.externalModuleIndicator =
36525
- ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
36526
- getImportMetaIfNecessary(sourceFile);
36527
- }
36528
- function isAnExternalModuleIndicatorNode(node) {
36529
- return hasModifierOfKind(node, 93 /* ExportKeyword */)
36530
- || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
36531
- || ts.isImportDeclaration(node)
36532
- || ts.isExportAssignment(node)
36533
- || ts.isExportDeclaration(node) ? node : undefined;
36534
- }
36535
- function getImportMetaIfNecessary(sourceFile) {
36536
- return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ?
36537
- walkTreeForExternalModuleIndicators(sourceFile) :
36538
- undefined;
36539
- }
36540
- function walkTreeForExternalModuleIndicators(node) {
36541
- return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators);
36542
- }
36543
- /** Do not use hasModifier inside the parser; it relies on parent pointers. Use this instead. */
36544
- function hasModifierOfKind(node, kind) {
36545
- return ts.some(node.modifiers, function (m) { return m.kind === kind; });
36546
- }
36547
- function isImportMeta(node) {
36548
- return ts.isMetaProperty(node) && node.keywordToken === 100 /* ImportKeyword */ && node.name.escapedText === "meta";
36549
- }
36550
36659
  var ParsingContext;
36551
36660
  (function (ParsingContext) {
36552
36661
  ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements";
@@ -36589,7 +36698,7 @@ var ts;
36589
36698
  scanner.setText(content, start, length);
36590
36699
  currentToken = scanner.scan();
36591
36700
  var jsDocTypeExpression = parseJSDocTypeExpression();
36592
- var sourceFile = createSourceFile("file.js", 99 /* Latest */, 1 /* JS */, /*isDeclarationFile*/ false, [], factory.createToken(1 /* EndOfFileToken */), 0 /* None */);
36701
+ var sourceFile = createSourceFile("file.js", 99 /* Latest */, 1 /* JS */, /*isDeclarationFile*/ false, [], factory.createToken(1 /* EndOfFileToken */), 0 /* None */, ts.noop);
36593
36702
  var diagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);
36594
36703
  if (jsDocDiagnostics) {
36595
36704
  sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
@@ -37550,7 +37659,7 @@ var ts;
37550
37659
  if (sourceFile.statements.length === 0) {
37551
37660
  // If we don't have any statements in the current source file, then there's no real
37552
37661
  // way to incrementally parse. So just do a full parse instead.
37553
- return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true, sourceFile.scriptKind);
37662
+ return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
37554
37663
  }
37555
37664
  // Make sure we're not trying to incrementally update a source file more than once. Once
37556
37665
  // we do an update the original source file is considered unusable from that point onwards.
@@ -37607,7 +37716,7 @@ var ts;
37607
37716
  // inconsistent tree. Setting the parents on the new tree should be very fast. We
37608
37717
  // will immediately bail out of walking any subtrees when we can see that their parents
37609
37718
  // are already correct.
37610
- var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true, sourceFile.scriptKind);
37719
+ var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
37611
37720
  result.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result.commentDirectives, changeRange.span.start, ts.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks);
37612
37721
  result.impliedNodeFormat = sourceFile.impliedNodeFormat;
37613
37722
  return result;
@@ -38585,7 +38694,7 @@ var ts;
38585
38694
  shortName: "i",
38586
38695
  type: "boolean",
38587
38696
  category: ts.Diagnostics.Projects,
38588
- description: ts.Diagnostics.Enable_incremental_compilation,
38697
+ description: ts.Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,
38589
38698
  transpileOptionValue: undefined,
38590
38699
  defaultValueDescription: ts.Diagnostics.false_unless_composite_is_set
38591
38700
  },
@@ -38985,7 +39094,7 @@ var ts;
38985
39094
  affectsSemanticDiagnostics: true,
38986
39095
  strictFlag: true,
38987
39096
  category: ts.Diagnostics.Type_Checking,
38988
- description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
39097
+ description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
38989
39098
  defaultValueDescription: false,
38990
39099
  },
38991
39100
  {
@@ -39003,7 +39112,7 @@ var ts;
39003
39112
  type: "boolean",
39004
39113
  affectsSemanticDiagnostics: true,
39005
39114
  category: ts.Diagnostics.Type_Checking,
39006
- description: ts.Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,
39115
+ description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39007
39116
  defaultValueDescription: false,
39008
39117
  },
39009
39118
  {
@@ -39044,7 +39153,7 @@ var ts;
39044
39153
  type: "boolean",
39045
39154
  affectsSemanticDiagnostics: true,
39046
39155
  category: ts.Diagnostics.Type_Checking,
39047
- description: ts.Diagnostics.Include_undefined_in_index_signature_results,
39156
+ description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39048
39157
  defaultValueDescription: false,
39049
39158
  },
39050
39159
  {
@@ -39520,9 +39629,21 @@ var ts;
39520
39629
  name: "plugin",
39521
39630
  type: "object"
39522
39631
  },
39523
- description: ts.Diagnostics.List_of_language_service_plugins,
39632
+ description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
39524
39633
  category: ts.Diagnostics.Editor_Support,
39525
39634
  },
39635
+ {
39636
+ name: "moduleDetection",
39637
+ type: new ts.Map(ts.getEntries({
39638
+ auto: ts.ModuleDetectionKind.Auto,
39639
+ legacy: ts.ModuleDetectionKind.Legacy,
39640
+ force: ts.ModuleDetectionKind.Force,
39641
+ })),
39642
+ affectsModuleResolution: true,
39643
+ description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
39644
+ category: ts.Diagnostics.Language_and_Environment,
39645
+ 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,
39646
+ }
39526
39647
  ];
39527
39648
  /* @internal */
39528
39649
  ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
@@ -47240,7 +47361,7 @@ var ts;
47240
47361
  var noImplicitThis = ts.getStrictOptionValue(compilerOptions, "noImplicitThis");
47241
47362
  var useUnknownInCatchVariables = ts.getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
47242
47363
  var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
47243
- var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
47364
+ var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
47244
47365
  var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
47245
47366
  var checkBinaryExpression = createCheckBinaryExpression();
47246
47367
  var emitResolver = createResolver();
@@ -47624,16 +47745,16 @@ var ts;
47624
47745
  var wildcardType = createIntrinsicType(1 /* Any */, "any");
47625
47746
  var errorType = createIntrinsicType(1 /* Any */, "error");
47626
47747
  var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
47627
- var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */);
47748
+ var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */);
47628
47749
  var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
47629
47750
  var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
47630
47751
  var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
47631
47752
  var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
47632
- var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */);
47753
+ var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */);
47633
47754
  var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
47634
47755
  var missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768 /* Undefined */, "undefined") : undefinedType;
47635
47756
  var nullType = createIntrinsicType(65536 /* Null */, "null");
47636
- var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */);
47757
+ var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */);
47637
47758
  var stringType = createIntrinsicType(4 /* String */, "string");
47638
47759
  var numberType = createIntrinsicType(8 /* Number */, "number");
47639
47760
  var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
@@ -47654,7 +47775,7 @@ var ts;
47654
47775
  var voidType = createIntrinsicType(16384 /* Void */, "void");
47655
47776
  var neverType = createIntrinsicType(131072 /* Never */, "never");
47656
47777
  var silentNeverType = createIntrinsicType(131072 /* Never */, "never");
47657
- var nonInferrableType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */);
47778
+ var nonInferrableType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */);
47658
47779
  var implicitNeverType = createIntrinsicType(131072 /* Never */, "never");
47659
47780
  var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never");
47660
47781
  var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object");
@@ -47665,6 +47786,8 @@ var ts;
47665
47786
  var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
47666
47787
  var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; });
47667
47788
  var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; });
47789
+ var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); // `uniqueLiteralType` is a special `never` flagged by union reduction to behave as a literal
47790
+ var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t; }); // replace all type parameters with the unique literal type (disregarding constraints)
47668
47791
  var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47669
47792
  var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47670
47793
  emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
@@ -47676,7 +47799,7 @@ var ts;
47676
47799
  var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47677
47800
  // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated
47678
47801
  // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes.
47679
- anyFunctionType.objectFlags |= 262144 /* NonInferrableType */;
47802
+ anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
47680
47803
  var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47681
47804
  var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
47682
47805
  var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
@@ -48603,7 +48726,7 @@ var ts;
48603
48726
  // - parameters are only in the scope of function body
48604
48727
  // This restriction does not apply to JSDoc comment types because they are parented
48605
48728
  // at a higher level than type parameters would normally be
48606
- if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDocComment */) {
48729
+ if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDoc */) {
48607
48730
  useResult = result.flags & 262144 /* TypeParameter */
48608
48731
  // type parameters are visible in parameter list, return type and type parameter list
48609
48732
  ? lastLocation === location.type ||
@@ -51222,7 +51345,7 @@ var ts;
51222
51345
  return flags & 814775659 /* NodeBuilderFlagsMask */;
51223
51346
  }
51224
51347
  function isClassInstanceSide(type) {
51225
- return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) & 16777216 /* IsClassInstanceClone */)));
51348
+ return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) & 33554432 /* IsClassInstanceClone */)));
51226
51349
  }
51227
51350
  function createNodeBuilder() {
51228
51351
  return {
@@ -51569,10 +51692,16 @@ var ts;
51569
51692
  var readonlyToken = type.declaration.readonlyToken ? ts.factory.createToken(type.declaration.readonlyToken.kind) : undefined;
51570
51693
  var questionToken = type.declaration.questionToken ? ts.factory.createToken(type.declaration.questionToken.kind) : undefined;
51571
51694
  var appropriateConstraintTypeNode;
51695
+ var newTypeVariable;
51572
51696
  if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
51573
51697
  // We have a { [P in keyof T]: X }
51574
51698
  // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType`
51575
- appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(140 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
51699
+ if (!(getModifiersTypeFromMappedType(type).flags & 262144 /* TypeParameter */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
51700
+ var newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T"));
51701
+ var name = typeParameterToName(newParam, context);
51702
+ newTypeVariable = ts.factory.createTypeReferenceNode(name);
51703
+ }
51704
+ appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(140 /* KeyOfKeyword */, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
51576
51705
  }
51577
51706
  else {
51578
51707
  appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context);
@@ -51582,7 +51711,14 @@ var ts;
51582
51711
  var templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), context);
51583
51712
  var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode, /*members*/ undefined);
51584
51713
  context.approximateLength += 10;
51585
- return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */);
51714
+ var result = ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */);
51715
+ if (isMappedTypeWithKeyofConstraintDeclaration(type) && !(getModifiersTypeFromMappedType(type).flags & 262144 /* TypeParameter */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
51716
+ // homomorphic mapped type with a non-homomorphic naive inlining
51717
+ // wrap it with a conditional like `SomeModifiersType extends infer U ? {..the mapped type...} : never` to ensure the resulting
51718
+ // type stays homomorphic
51719
+ 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 */));
51720
+ }
51721
+ return result;
51586
51722
  }
51587
51723
  function createAnonymousTypeNode(type) {
51588
51724
  var _a;
@@ -53203,7 +53339,7 @@ var ts;
53203
53339
  // If it's a class/interface/function: emit a class/interface/function with a `default` modifier
53204
53340
  // These forms can merge, eg (`export default 12; export default interface A {}`)
53205
53341
  function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
53206
- var _a, _b;
53342
+ var _a, _b, _c, _d;
53207
53343
  var symbolName = ts.unescapeLeadingUnderscores(symbol.escapedName);
53208
53344
  var isDefault = symbol.escapedName === "default" /* Default */;
53209
53345
  if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && ts.isStringANonContextualKeyword(symbolName) && !isDefault) {
@@ -53254,17 +53390,21 @@ var ts;
53254
53390
  else {
53255
53391
  // 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!_
53256
53392
  // `var` is `FunctionScopedVariable`, `const` and `let` are `BlockScopedVariable`, and `module.exports.thing =` is `Property`
53257
- var flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? undefined
53258
- : isConstVariable(symbol) ? 2 /* Const */
53393
+ var flags = !(symbol.flags & 2 /* BlockScopedVariable */)
53394
+ ? ((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && ts.isSourceFile((_b = symbol.parent) === null || _b === void 0 ? void 0 : _b.valueDeclaration)
53395
+ ? 2 /* Const */
53396
+ : undefined
53397
+ : isConstVariable(symbol)
53398
+ ? 2 /* Const */
53259
53399
  : 1 /* Let */;
53260
53400
  var name = (needsPostExportDefault || !(symbol.flags & 4 /* Property */)) ? localName : getUnusedName(localName, symbol);
53261
53401
  var textRange = symbol.declarations && ts.find(symbol.declarations, function (d) { return ts.isVariableDeclaration(d); });
53262
53402
  if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
53263
53403
  textRange = textRange.parent.parent;
53264
53404
  }
53265
- var propertyAccessRequire = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isPropertyAccessExpression);
53405
+ var propertyAccessRequire = (_c = symbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isPropertyAccessExpression);
53266
53406
  if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
53267
- && ((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
53407
+ && ((_d = type.symbol) === null || _d === void 0 ? void 0 : _d.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
53268
53408
  var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
53269
53409
  addResult(ts.factory.createExportDeclaration(
53270
53410
  /*decorators*/ undefined,
@@ -53344,8 +53484,8 @@ var ts;
53344
53484
  // synthesize export * from "moduleReference"
53345
53485
  // Straightforward - only one thing to do - make an export declaration
53346
53486
  if (symbol.declarations) {
53347
- for (var _i = 0, _c = symbol.declarations; _i < _c.length; _i++) {
53348
- var node = _c[_i];
53487
+ for (var _i = 0, _e = symbol.declarations; _i < _e.length; _i++) {
53488
+ var node = _e[_i];
53349
53489
  var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
53350
53490
  if (!resolvedModule)
53351
53491
  continue;
@@ -54623,7 +54763,7 @@ var ts;
54623
54763
  members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
54624
54764
  }
54625
54765
  var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
54626
- result.objectFlags |= 4194304 /* ObjectRestType */;
54766
+ result.objectFlags |= 8388608 /* ObjectRestType */;
54627
54767
  return result;
54628
54768
  }
54629
54769
  function isGenericTypeWithUndefinedConstraint(type) {
@@ -55095,7 +55235,7 @@ var ts;
55095
55235
  mergeSymbolTable(exports, s.exports);
55096
55236
  }
55097
55237
  var type = createAnonymousType(symbol, exports, ts.emptyArray, ts.emptyArray, ts.emptyArray);
55098
- type.objectFlags |= 4096 /* JSLiteral */;
55238
+ type.objectFlags |= 8192 /* JSLiteral */;
55099
55239
  return type;
55100
55240
  }
55101
55241
  function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
@@ -55151,7 +55291,10 @@ var ts;
55151
55291
  if (containsSameNamedThisProperty(expression.left, expression.right)) {
55152
55292
  return anyType;
55153
55293
  }
55154
- var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : getWidenedLiteralType(checkExpressionCached(expression.right));
55294
+ 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)));
55295
+ var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol)
55296
+ : isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right))
55297
+ : getWidenedLiteralType(checkExpressionCached(expression.right));
55155
55298
  if (type.flags & 524288 /* Object */ &&
55156
55299
  kind === 2 /* ModuleExports */ &&
55157
55300
  symbol.escapedName === "export=" /* ExportEquals */) {
@@ -55199,9 +55342,9 @@ var ts;
55199
55342
  });
55200
55343
  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
55201
55344
  members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
55202
- result.objectFlags |= (ts.getObjectFlags(type) & 4096 /* JSLiteral */); // Propagate JSLiteral flag
55345
+ result.objectFlags |= (ts.getObjectFlags(type) & 8192 /* JSLiteral */); // Propagate JSLiteral flag
55203
55346
  if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
55204
- result.objectFlags |= 16777216 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
55347
+ result.objectFlags |= 33554432 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
55205
55348
  }
55206
55349
  return result;
55207
55350
  }
@@ -55260,7 +55403,7 @@ var ts;
55260
55403
  function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {
55261
55404
  var members = ts.createSymbolTable();
55262
55405
  var stringIndexInfo;
55263
- var objectFlags = 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
55406
+ var objectFlags = 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
55264
55407
  ts.forEach(pattern.elements, function (e) {
55265
55408
  var name = e.propertyName || e.name;
55266
55409
  if (e.dotDotDotToken) {
@@ -55284,7 +55427,7 @@ var ts;
55284
55427
  result.objectFlags |= objectFlags;
55285
55428
  if (includePatternInType) {
55286
55429
  result.pattern = pattern;
55287
- result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
55430
+ result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
55288
55431
  }
55289
55432
  return result;
55290
55433
  }
@@ -55303,7 +55446,7 @@ var ts;
55303
55446
  if (includePatternInType) {
55304
55447
  result = cloneTypeReference(result);
55305
55448
  result.pattern = pattern;
55306
- result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
55449
+ result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
55307
55450
  }
55308
55451
  return result;
55309
55452
  }
@@ -55895,7 +56038,7 @@ var ts;
55895
56038
  node = paramSymbol.valueDeclaration;
55896
56039
  }
55897
56040
  break;
55898
- case 319 /* JSDocComment */: {
56041
+ case 319 /* JSDoc */: {
55899
56042
  var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
55900
56043
  return node.tags
55901
56044
  ? appendTypeParameters(outerTypeParameters, ts.flatMap(node.tags, function (t) { return ts.isJSDocTemplateTag(t) ? t.typeParameters : undefined; }))
@@ -58097,7 +58240,7 @@ var ts;
58097
58240
  checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
58098
58241
  indexTypes = ts.append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
58099
58242
  }
58100
- else if (isObjectLiteralType(type) && !(ts.getObjectFlags(type) & 2097152 /* ContainsSpread */)) {
58243
+ else if (isObjectLiteralType(type) && !(ts.getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
58101
58244
  checkFlags |= 32 /* WritePartial */;
58102
58245
  indexTypes = ts.append(indexTypes, undefinedType);
58103
58246
  }
@@ -58156,10 +58299,10 @@ var ts;
58156
58299
  else if (type !== firstType) {
58157
58300
  checkFlags |= 64 /* HasNonUniformType */;
58158
58301
  }
58159
- if (isLiteralType(type) || isPatternLiteralType(type)) {
58302
+ if (isLiteralType(type) || isPatternLiteralType(type) || type === uniqueLiteralType) {
58160
58303
  checkFlags |= 128 /* HasLiteralType */;
58161
58304
  }
58162
- if (type.flags & 131072 /* Never */) {
58305
+ if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
58163
58306
  checkFlags |= 131072 /* HasNeverType */;
58164
58307
  }
58165
58308
  propTypes.push(type);
@@ -58221,15 +58364,15 @@ var ts;
58221
58364
  * no constituent property has type 'never', but the intersection of the constituent property types is 'never'.
58222
58365
  */
58223
58366
  function getReducedType(type) {
58224
- if (type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */) {
58367
+ if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
58225
58368
  return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
58226
58369
  }
58227
58370
  else if (type.flags & 2097152 /* Intersection */) {
58228
- if (!(type.objectFlags & 16777216 /* IsNeverIntersectionComputed */)) {
58229
- type.objectFlags |= 16777216 /* IsNeverIntersectionComputed */ |
58230
- (ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 33554432 /* IsNeverIntersection */ : 0);
58371
+ if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
58372
+ type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ |
58373
+ (ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
58231
58374
  }
58232
- return type.objectFlags & 33554432 /* IsNeverIntersection */ ? neverType : type;
58375
+ return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
58233
58376
  }
58234
58377
  return type;
58235
58378
  }
@@ -58259,7 +58402,7 @@ var ts;
58259
58402
  return !prop.valueDeclaration && !!(ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */);
58260
58403
  }
58261
58404
  function elaborateNeverIntersection(errorInfo, type) {
58262
- if (type.flags & 2097152 /* Intersection */ && ts.getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
58405
+ if (type.flags & 2097152 /* Intersection */ && ts.getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
58263
58406
  var neverProp = ts.find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
58264
58407
  if (neverProp) {
58265
58408
  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));
@@ -59066,7 +59209,7 @@ var ts;
59066
59209
  result |= ts.getObjectFlags(type);
59067
59210
  }
59068
59211
  }
59069
- return result & 458752 /* PropagatingFlags */;
59212
+ return result & 917504 /* PropagatingFlags */;
59070
59213
  }
59071
59214
  function createTypeReference(target, typeArguments) {
59072
59215
  var id = getTypeListId(typeArguments);
@@ -59344,7 +59487,7 @@ var ts;
59344
59487
  function getConditionalFlowTypeOfType(type, node) {
59345
59488
  var constraints;
59346
59489
  var covariant = true;
59347
- while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDocComment */) {
59490
+ while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDoc */) {
59348
59491
  var parent = node.parent;
59349
59492
  // only consider variance flipped by parameter locations - `keyof` types would usually be considered variance inverting, but
59350
59493
  // often get used in indexed accesses where they behave sortof invariantly, but our checking is lax
@@ -59988,7 +60131,7 @@ var ts;
59988
60131
  if (type === wildcardType)
59989
60132
  includes |= 8388608 /* IncludesWildcard */;
59990
60133
  if (!strictNullChecks && flags & 98304 /* Nullable */) {
59991
- if (!(ts.getObjectFlags(type) & 65536 /* ContainsWideningType */))
60134
+ if (!(ts.getObjectFlags(type) & 131072 /* ContainsWideningType */))
59992
60135
  includes |= 4194304 /* IncludesNonWideningType */;
59993
60136
  }
59994
60137
  else {
@@ -60011,6 +60154,10 @@ var ts;
60011
60154
  return includes;
60012
60155
  }
60013
60156
  function removeSubtypes(types, hasObjectTypes) {
60157
+ // [] and [T] immediately reduce to [] and [T] respectively
60158
+ if (types.length < 2) {
60159
+ return types;
60160
+ }
60014
60161
  var id = getTypeListId(types);
60015
60162
  var match = subtypeReductionCache.get(id);
60016
60163
  if (match) {
@@ -60198,8 +60345,8 @@ var ts;
60198
60345
  origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
60199
60346
  }
60200
60347
  }
60201
- var objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) |
60202
- (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
60348
+ var objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) |
60349
+ (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
60203
60350
  return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
60204
60351
  }
60205
60352
  function getUnionOrIntersectionTypePredicate(signatures, kind) {
@@ -60388,7 +60535,7 @@ var ts;
60388
60535
  // other unions and return true. Otherwise, do nothing and return false.
60389
60536
  function intersectUnionsOfPrimitiveTypes(types) {
60390
60537
  var unionTypes;
60391
- var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 32768 /* PrimitiveUnion */); });
60538
+ var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 65536 /* PrimitiveUnion */); });
60392
60539
  if (index < 0) {
60393
60540
  return false;
60394
60541
  }
@@ -60397,7 +60544,7 @@ var ts;
60397
60544
  // the unionTypes array.
60398
60545
  while (i < types.length) {
60399
60546
  var t = types[i];
60400
- if (ts.getObjectFlags(t) & 32768 /* PrimitiveUnion */) {
60547
+ if (ts.getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
60401
60548
  (unionTypes || (unionTypes = [types[index]])).push(t);
60402
60549
  ts.orderedRemoveItemAt(types, i);
60403
60550
  }
@@ -60426,7 +60573,7 @@ var ts;
60426
60573
  }
60427
60574
  }
60428
60575
  // Finally replace the first union with the result
60429
- types[index] = getUnionTypeFromSortedList(result, 32768 /* PrimitiveUnion */);
60576
+ types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
60430
60577
  return true;
60431
60578
  }
60432
60579
  function createIntersectionType(types, aliasSymbol, aliasTypeArguments) {
@@ -60696,10 +60843,24 @@ var ts;
60696
60843
  return getUnionType(ts.concatenate(propertyTypes, indexKeyTypes), 1 /* Literal */,
60697
60844
  /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, origin);
60698
60845
  }
60846
+ /**
60847
+ * A union type which is reducible upon instantiation (meaning some members are removed under certain instantiations)
60848
+ * must be kept generic, as that instantiation information needs to flow through the type system. By replacing all
60849
+ * type parameters in the union with a special never type that is treated as a literal in `getReducedType`, we can cause the `getReducedType` logic
60850
+ * to reduce the resulting type if possible (since only intersections with conflicting literal-typed properties are reducible).
60851
+ */
60852
+ function isPossiblyReducibleByInstantiation(type) {
60853
+ return ts.some(type.types, function (t) {
60854
+ var uniqueFilled = getUniqueLiteralFilledInstantiation(t);
60855
+ return getReducedType(uniqueFilled) !== uniqueFilled;
60856
+ });
60857
+ }
60699
60858
  function getIndexType(type, stringsOnly, noIndexSignatures) {
60700
60859
  if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
60701
60860
  type = getReducedType(type);
60702
- return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
60861
+ return type.flags & 1048576 /* Union */ ? isPossiblyReducibleByInstantiation(type)
60862
+ ? getIndexTypeForGenericType(type, stringsOnly)
60863
+ : getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
60703
60864
  type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
60704
60865
  type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
60705
60866
  ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
@@ -60865,7 +61026,7 @@ var ts;
60865
61026
  if (noImplicitAny) {
60866
61027
  return false; // Flag is meaningless under `noImplicitAny` mode
60867
61028
  }
60868
- if (ts.getObjectFlags(type) & 4096 /* JSLiteral */) {
61029
+ if (ts.getObjectFlags(type) & 8192 /* JSLiteral */) {
60869
61030
  return true;
60870
61031
  }
60871
61032
  if (type.flags & 1048576 /* Union */) {
@@ -61079,28 +61240,28 @@ var ts;
61079
61240
  return !!getGenericObjectFlags(type);
61080
61241
  }
61081
61242
  function isGenericObjectType(type) {
61082
- return !!(getGenericObjectFlags(type) & 4194304 /* IsGenericObjectType */);
61243
+ return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
61083
61244
  }
61084
61245
  function isGenericIndexType(type) {
61085
- return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
61246
+ return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
61086
61247
  }
61087
61248
  function getGenericObjectFlags(type) {
61088
61249
  if (type.flags & 3145728 /* UnionOrIntersection */) {
61089
- if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
61090
- type.objectFlags |= 2097152 /* IsGenericTypeComputed */ |
61250
+ if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
61251
+ type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
61091
61252
  ts.reduceLeft(type.types, function (flags, t) { return flags | getGenericObjectFlags(t); }, 0);
61092
61253
  }
61093
- return type.objectFlags & 12582912 /* IsGenericType */;
61254
+ return type.objectFlags & 25165824 /* IsGenericType */;
61094
61255
  }
61095
61256
  if (type.flags & 33554432 /* Substitution */) {
61096
- if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
61097
- type.objectFlags |= 2097152 /* IsGenericTypeComputed */ |
61257
+ if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
61258
+ type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
61098
61259
  getGenericObjectFlags(type.substitute) | getGenericObjectFlags(type.baseType);
61099
61260
  }
61100
- return type.objectFlags & 12582912 /* IsGenericType */;
61261
+ return type.objectFlags & 25165824 /* IsGenericType */;
61101
61262
  }
61102
- return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) |
61103
- (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
61263
+ return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) |
61264
+ (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
61104
61265
  }
61105
61266
  function getSimplifiedType(type, writing) {
61106
61267
  return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) :
@@ -61327,6 +61488,10 @@ var ts;
61327
61488
  }
61328
61489
  return type;
61329
61490
  }
61491
+ function maybeCloneTypeParameter(p) {
61492
+ var constraint = getConstraintOfTypeParameter(p);
61493
+ return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
61494
+ }
61330
61495
  function isTypicalNondistributiveConditional(root) {
61331
61496
  return !root.isDistributive && isSingletonTupleType(root.node.checkType) && isSingletonTupleType(root.node.extendsType);
61332
61497
  }
@@ -61345,37 +61510,65 @@ var ts;
61345
61510
  var result;
61346
61511
  var extraTypes;
61347
61512
  var tailCount = 0;
61348
- // We loop here for an immediately nested conditional type in the false position, effectively treating
61349
- // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for
61350
- // purposes of resolution. We also loop here when resolution of a conditional type ends in resolution of
61351
- // another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
61352
- // cases we increment the tail recursion counter and stop after 1000 iterations.
61353
- while (true) {
61513
+ var _loop_18 = function () {
61354
61514
  if (tailCount === 1000) {
61355
61515
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
61356
61516
  result = errorType;
61357
- break;
61517
+ return "break";
61358
61518
  }
61359
61519
  var isUnwrapped = isTypicalNondistributiveConditional(root);
61360
61520
  var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
61361
61521
  var checkTypeInstantiable = isGenericType(checkType);
61362
61522
  var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
61363
61523
  if (checkType === wildcardType || extendsType === wildcardType) {
61364
- return wildcardType;
61524
+ return { value: wildcardType };
61365
61525
  }
61366
61526
  var combinedMapper = void 0;
61367
61527
  if (root.inferTypeParameters) {
61368
- var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
61369
- if (!checkTypeInstantiable) {
61528
+ // When we're looking at making an inference for an infer type, when we get its constraint, it'll automagically be
61529
+ // instantiated with the context, so it doesn't need the mapper for the inference contex - however the constraint
61530
+ // may refer to another _root_, _uncloned_ `infer` type parameter [1], or to something mapped by `mapper` [2].
61531
+ // [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
61532
+ // as `number`
61533
+ // Conversely, if we have `Foo<infer A, infer B>`, `B` is still constrained to `T` and `T` is instantiated as `A`
61534
+ // [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`
61535
+ // which is in turn instantiated as `Q`, which is in turn instantiated as `number`.
61536
+ // So we need to:
61537
+ // * Clone the type parameters so their constraints can be instantiated in the context of `mapper` (otherwise theyd only get inference context information)
61538
+ // * Set the clones to both map the conditional's enclosing `mapper` and the original params
61539
+ // * instantiate the extends type with the clones
61540
+ // * incorporate all of the component mappers into the combined mapper for the true and false members
61541
+ // This means we have three mappers that need applying:
61542
+ // * The original `mapper` used to create this conditional
61543
+ // * The mapper that maps the old root type parameter to the clone (`freshMapper`)
61544
+ // * The mapper that maps the clone to its inference result (`context.mapper`)
61545
+ var freshParams = ts.sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
61546
+ var freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : undefined;
61547
+ var context = createInferenceContext(freshParams, /*signature*/ undefined, 0 /* None */);
61548
+ if (freshMapper) {
61549
+ var freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
61550
+ for (var _i = 0, freshParams_1 = freshParams; _i < freshParams_1.length; _i++) {
61551
+ var p = freshParams_1[_i];
61552
+ if (root.inferTypeParameters.indexOf(p) === -1) {
61553
+ p.mapper = freshCombinedMapper;
61554
+ }
61555
+ }
61556
+ }
61557
+ // We skip inference of the possible `infer` types unles the `extendsType` _is_ an infer type
61558
+ // if it was, it's trivial to say that extendsType = checkType, however such a pattern is used to
61559
+ // "reset" the type being build up during constraint calculation and avoid making an apparently "infinite" constraint
61560
+ // so in those cases we refain from performing inference and retain the uninfered type parameter
61561
+ if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) {
61370
61562
  // We don't want inferences from constraints as they may cause us to eagerly resolve the
61371
61563
  // conditional type instead of deferring resolution. Also, we always want strict function
61372
61564
  // types rules (i.e. proper contravariance) for inferences.
61373
- inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
61565
+ inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
61374
61566
  }
61567
+ var innerMapper = combineTypeMappers(freshMapper, context.mapper);
61375
61568
  // It's possible for 'infer T' type paramteters to be given uninstantiated constraints when the
61376
61569
  // those type parameters are used in type references (see getInferredTypeParameterConstraint). For
61377
61570
  // that reason we need context.mapper to be first in the combined mapper. See #42636 for examples.
61378
- combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
61571
+ combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
61379
61572
  }
61380
61573
  // Instantiate the extends type including inferences for 'infer T' type parameters
61381
61574
  var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), combinedMapper) : extendsType;
@@ -61397,14 +61590,14 @@ var ts;
61397
61590
  var newRoot = falseType_1.root;
61398
61591
  if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
61399
61592
  root = newRoot;
61400
- continue;
61593
+ return "continue";
61401
61594
  }
61402
61595
  if (canTailRecurse(falseType_1, mapper)) {
61403
- continue;
61596
+ return "continue";
61404
61597
  }
61405
61598
  }
61406
61599
  result = instantiateType(falseType_1, mapper);
61407
- break;
61600
+ return "break";
61408
61601
  }
61409
61602
  // Return trueType for a definitely true extends check. We check instantiations of the two
61410
61603
  // types with type parameters mapped to their restrictive form, i.e. a form of the type parameter
@@ -61415,10 +61608,10 @@ var ts;
61415
61608
  var trueType_1 = getTypeFromTypeNode(root.node.trueType);
61416
61609
  var trueMapper = combinedMapper || mapper;
61417
61610
  if (canTailRecurse(trueType_1, trueMapper)) {
61418
- continue;
61611
+ return "continue";
61419
61612
  }
61420
61613
  result = instantiateType(trueType_1, trueMapper);
61421
- break;
61614
+ return "break";
61422
61615
  }
61423
61616
  }
61424
61617
  // Return a deferred type for a check that is neither definitely true nor definitely false
@@ -61430,7 +61623,19 @@ var ts;
61430
61623
  result.combinedMapper = combinedMapper;
61431
61624
  result.aliasSymbol = aliasSymbol || root.aliasSymbol;
61432
61625
  result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper); // TODO: GH#18217
61433
- break;
61626
+ return "break";
61627
+ };
61628
+ // We loop here for an immediately nested conditional type in the false position, effectively treating
61629
+ // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for
61630
+ // purposes of resolution. We also loop here when resolution of a conditional type ends in resolution of
61631
+ // another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
61632
+ // cases we increment the tail recursion counter and stop after 1000 iterations.
61633
+ while (true) {
61634
+ var state_5 = _loop_18();
61635
+ if (typeof state_5 === "object")
61636
+ return state_5.value;
61637
+ if (state_5 === "break")
61638
+ break;
61434
61639
  }
61435
61640
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
61436
61641
  // We tail-recurse for generic conditional types that (a) have not already been evaluated and cached, and
@@ -61668,7 +61873,7 @@ var ts;
61668
61873
  }
61669
61874
  }
61670
61875
  var spread = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(type));
61671
- spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
61876
+ spread.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
61672
61877
  return spread;
61673
61878
  }
61674
61879
  }
@@ -61758,7 +61963,7 @@ var ts;
61758
61963
  }
61759
61964
  }
61760
61965
  var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, ts.sameMap(indexInfos, function (info) { return getIndexInfoWithReadonly(info, readonly); }));
61761
- spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */ | 2097152 /* ContainsSpread */ | objectFlags;
61966
+ spread.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
61762
61967
  return spread;
61763
61968
  }
61764
61969
  /** We approximate own properties as non-methods plus methods that are inside the object literal */
@@ -61852,9 +62057,11 @@ var ts;
61852
62057
  }
61853
62058
  function getESSymbolLikeTypeForNode(node) {
61854
62059
  if (ts.isValidESSymbolDeclaration(node)) {
61855
- var symbol = getSymbolOfNode(node);
61856
- var links = getSymbolLinks(symbol);
61857
- return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
62060
+ var symbol = ts.isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
62061
+ if (symbol) {
62062
+ var links = getSymbolLinks(symbol);
62063
+ return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
62064
+ }
61858
62065
  }
61859
62066
  return esSymbolType;
61860
62067
  }
@@ -62172,7 +62379,7 @@ var ts;
62172
62379
  }
62173
62380
  function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
62174
62381
  var declaration = type.objectFlags & 4 /* Reference */ ? type.node :
62175
- type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node :
62382
+ type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node :
62176
62383
  type.symbol.declarations[0];
62177
62384
  var links = getNodeLinks(declaration);
62178
62385
  var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType :
@@ -62189,8 +62396,8 @@ var ts;
62189
62396
  outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
62190
62397
  }
62191
62398
  typeParameters = outerTypeParameters || ts.emptyArray;
62192
- var allDeclarations_1 = type.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
62193
- typeParameters = (target.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
62399
+ var allDeclarations_1 = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
62400
+ typeParameters = (target.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
62194
62401
  ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
62195
62402
  typeParameters;
62196
62403
  links.outerTypeParameters = typeParameters;
@@ -62225,16 +62432,15 @@ var ts;
62225
62432
  node.parent.kind === 199 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
62226
62433
  }
62227
62434
  function isTypeParameterPossiblyReferenced(tp, node) {
62228
- // If there are intervening statement blocks between the node and the type parameter declaration, if the node
62229
- // contains actual references to the type parameter, or if the node contains type queries, we consider the
62230
- // type parameter possibly referenced.
62231
- if (tp.symbol && tp.symbol.declarations) {
62232
- var n_1 = node;
62233
- while (!ts.some(tp.symbol.declarations, function (d) { return n_1 === d.parent; })) {
62234
- if (!n_1 || n_1.kind === 234 /* Block */ || n_1.kind === 188 /* ConditionalType */ && ts.forEachChild(n_1.extendsType, containsReference)) {
62435
+ // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks
62436
+ // between the node and the type parameter declaration, if the node contains actual references to the
62437
+ // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced.
62438
+ if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
62439
+ var container = tp.symbol.declarations[0].parent;
62440
+ for (var n = node; n !== container; n = n.parent) {
62441
+ if (!n || n.kind === 234 /* Block */ || n.kind === 188 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) {
62235
62442
  return true;
62236
62443
  }
62237
- n_1 = n_1.parent;
62238
62444
  }
62239
62445
  return containsReference(node);
62240
62446
  }
@@ -62363,7 +62569,7 @@ var ts;
62363
62569
  mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
62364
62570
  freshTypeParameter.mapper = mapper;
62365
62571
  }
62366
- if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
62572
+ if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
62367
62573
  result.node = type.node;
62368
62574
  }
62369
62575
  result.target = type;
@@ -62499,6 +62705,10 @@ var ts;
62499
62705
  }
62500
62706
  return type; // Nested invocation of `inferTypeForHomomorphicMappedType` or the `source` instantiated into something unmappable
62501
62707
  }
62708
+ function getUniqueLiteralFilledInstantiation(type) {
62709
+ return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :
62710
+ type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
62711
+ }
62502
62712
  function getPermissiveInstantiation(type) {
62503
62713
  return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :
62504
62714
  type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
@@ -63387,7 +63597,8 @@ var ts;
63387
63597
  return true;
63388
63598
  }
63389
63599
  }
63390
- else {
63600
+ else if (!((source.flags | target.flags) & (3145728 /* UnionOrIntersection */ | 8388608 /* IndexedAccess */ | 16777216 /* Conditional */ | 33554432 /* Substitution */))) {
63601
+ // We have excluded types that may simplify to other forms, so types must have identical flags
63391
63602
  if (source.flags !== target.flags)
63392
63603
  return false;
63393
63604
  if (source.flags & 67358815 /* Singleton */)
@@ -63395,7 +63606,7 @@ var ts;
63395
63606
  }
63396
63607
  if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
63397
63608
  var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false));
63398
- if (related !== undefined && !(related & 24 /* ReportsMask */)) {
63609
+ if (related !== undefined) {
63399
63610
  return !!(related & 1 /* Succeeded */);
63400
63611
  }
63401
63612
  }
@@ -63799,7 +64010,7 @@ var ts;
63799
64010
  isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
63800
64011
  return -1 /* True */;
63801
64012
  if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
63802
- var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 8192 /* FreshLiteral */);
64013
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
63803
64014
  if (isPerformingExcessPropertyChecks) {
63804
64015
  if (hasExcessProperties(source, target, reportErrors)) {
63805
64016
  if (reportErrors) {
@@ -63851,7 +64062,7 @@ var ts;
63851
64062
  // We suppress recursive intersection property checks because they can generate lots of work when relating
63852
64063
  // recursive intersections that are structurally similar but not exactly identical. See #37854.
63853
64064
  if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
63854
- 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 */); }))) {
64065
+ 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 */); }))) {
63855
64066
  inPropertyCheck = true;
63856
64067
  result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
63857
64068
  inPropertyCheck = false;
@@ -63914,7 +64125,7 @@ var ts;
63914
64125
  if ((source.flags & 3145728 /* UnionOrIntersection */) && (target.flags & 3145728 /* UnionOrIntersection */)) {
63915
64126
  var sourceUnionOrIntersection = source;
63916
64127
  var targetUnionOrIntersection = target;
63917
- if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768 /* PrimitiveUnion */) {
64128
+ if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
63918
64129
  // There's a fast path for comparing primitive unions
63919
64130
  return;
63920
64131
  }
@@ -63944,7 +64155,7 @@ var ts;
63944
64155
  }
63945
64156
  function hasExcessProperties(source, target, reportErrors) {
63946
64157
  var _a;
63947
- if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 4096 /* JSLiteral */) {
64158
+ if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 8192 /* JSLiteral */) {
63948
64159
  return false; // Disable excess property checks on JS literals to simulate having an implicit "index signature" - but only outside of noImplicitAny
63949
64160
  }
63950
64161
  var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
@@ -63958,7 +64169,7 @@ var ts;
63958
64169
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
63959
64170
  checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
63960
64171
  }
63961
- var _loop_18 = function (prop) {
64172
+ var _loop_19 = function (prop) {
63962
64173
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
63963
64174
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
63964
64175
  if (reportErrors) {
@@ -64021,9 +64232,9 @@ var ts;
64021
64232
  };
64022
64233
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
64023
64234
  var prop = _b[_i];
64024
- var state_5 = _loop_18(prop);
64025
- if (typeof state_5 === "object")
64026
- return state_5.value;
64235
+ var state_6 = _loop_19(prop);
64236
+ if (typeof state_6 === "object")
64237
+ return state_6.value;
64027
64238
  }
64028
64239
  return false;
64029
64240
  }
@@ -64446,17 +64657,17 @@ var ts;
64446
64657
  // We limit alias variance probing to only object and conditional types since their alias behavior
64447
64658
  // is more predictable than other, interned types, which may or may not have an alias depending on
64448
64659
  // the order in which things were checked.
64449
- if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
64660
+ if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
64661
+ source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
64662
+ !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
64450
64663
  var variances = getAliasVariances(source.aliasSymbol);
64451
- if (variances !== ts.emptyArray) {
64452
- var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);
64453
- if (varianceResult !== undefined) {
64454
- return varianceResult;
64455
- }
64456
- }
64457
- else if (!someContainsMarkerType(source.aliasTypeArguments) && !someContainsMarkerType(target.aliasTypeArguments)) {
64664
+ if (variances === ts.emptyArray) {
64458
64665
  return 1 /* Unknown */;
64459
64666
  }
64667
+ var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);
64668
+ if (varianceResult !== undefined) {
64669
+ return varianceResult;
64670
+ }
64460
64671
  }
64461
64672
  // 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],
64462
64673
  // and U is assignable to [...T] when U is constrained to a mutable array or tuple type.
@@ -64814,26 +65025,27 @@ var ts;
64814
65025
  else if (isGenericMappedType(source)) {
64815
65026
  return 0 /* False */;
64816
65027
  }
64817
- if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && !isTupleType(source)) {
65028
+ if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target &&
65029
+ !isTupleType(source) && !(ts.getObjectFlags(source) & 4096 /* MarkerType */ || ts.getObjectFlags(target) & 4096 /* MarkerType */)) {
64818
65030
  // When strictNullChecks is disabled, the element type of the empty array literal is undefinedWideningType,
64819
65031
  // and an empty array literal wouldn't be assignable to a `never[]` without this check.
64820
65032
  if (isEmptyArrayLiteralType(source)) {
64821
65033
  return -1 /* True */;
64822
65034
  }
64823
- // We have type references to the same generic type. Obtain the variance information for the type
64824
- // parameters and relate the type arguments accordingly. If variance information for the type is in
64825
- // the process of being computed, structurally relate references that contain marker types in their
64826
- // type arguments, but otherwise return Ternary.Unknown (the non-cached version of Ternary.Maybe).
65035
+ // We have type references to the same generic type, and the type references are not marker
65036
+ // type references (which are intended by be compared structurally). Obtain the variance
65037
+ // information for the type parameters and relate the type arguments accordingly.
64827
65038
  var variances = getVariances(source.target);
64828
- if (variances !== ts.emptyArray) {
64829
- var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState);
64830
- if (varianceResult !== undefined) {
64831
- return varianceResult;
64832
- }
64833
- }
64834
- else if (!someContainsMarkerType(getTypeArguments(source)) && !someContainsMarkerType(getTypeArguments(target))) {
65039
+ // We return Ternary.Maybe for a recursive invocation of getVariances (signalled by emptyArray). This
65040
+ // effectively means we measure variance only from type parameter occurrences that aren't nested in
65041
+ // recursive instantiations of the generic type.
65042
+ if (variances === ts.emptyArray) {
64835
65043
  return 1 /* Unknown */;
64836
65044
  }
65045
+ var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState);
65046
+ if (varianceResult !== undefined) {
65047
+ return varianceResult;
65048
+ }
64837
65049
  }
64838
65050
  else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
64839
65051
  if (relation !== identityRelation) {
@@ -64847,7 +65059,7 @@ var ts;
64847
65059
  }
64848
65060
  // Consider a fresh empty object literal type "closed" under the subtype relationship - this way `{} <- {[idx: string]: any} <- fresh({})`
64849
65061
  // and not `{} <- fresh({}) <- {[idx: string]: any}`
64850
- else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 8192 /* FreshLiteral */ && !isEmptyObjectType(source)) {
65062
+ else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source)) {
64851
65063
  return 0 /* False */;
64852
65064
  }
64853
65065
  // Even if relationship doesn't hold for unions, intersections, or generic type references,
@@ -65012,11 +65224,11 @@ var ts;
65012
65224
  // constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
65013
65225
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
65014
65226
  var matchingTypes = [];
65015
- var _loop_19 = function (combination) {
65227
+ var _loop_20 = function (combination) {
65016
65228
  var hasMatch = false;
65017
65229
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
65018
65230
  var type = _d[_c];
65019
- var _loop_20 = function (i) {
65231
+ var _loop_21 = function (i) {
65020
65232
  var sourceProperty = sourcePropertiesFiltered[i];
65021
65233
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
65022
65234
  if (!targetProperty)
@@ -65032,8 +65244,8 @@ var ts;
65032
65244
  }
65033
65245
  };
65034
65246
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
65035
- var state_7 = _loop_20(i);
65036
- switch (state_7) {
65247
+ var state_8 = _loop_21(i);
65248
+ switch (state_8) {
65037
65249
  case "continue-outer": continue outer;
65038
65250
  }
65039
65251
  }
@@ -65046,9 +65258,9 @@ var ts;
65046
65258
  };
65047
65259
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
65048
65260
  var combination = discriminantCombinations_1[_a];
65049
- var state_6 = _loop_19(combination);
65050
- if (typeof state_6 === "object")
65051
- return state_6.value;
65261
+ var state_7 = _loop_20(combination);
65262
+ if (typeof state_7 === "object")
65263
+ return state_7.value;
65052
65264
  }
65053
65265
  // Compare the remaining non-discriminant properties of each match.
65054
65266
  var result = -1 /* True */;
@@ -65732,28 +65944,36 @@ var ts;
65732
65944
  }
65733
65945
  return false;
65734
65946
  }
65735
- function getVariances(type) {
65736
- // Arrays and tuples are known to be covariant, no need to spend time computing this.
65737
- return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */ ?
65738
- arrayVariances :
65739
- getVariancesWorker(type.symbol, type.typeParameters);
65947
+ // Return a type reference where the source type parameter is replaced with the target marker
65948
+ // type, and flag the result as a marker type reference.
65949
+ function getMarkerTypeReference(type, source, target) {
65950
+ var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; }));
65951
+ result.objectFlags |= 4096 /* MarkerType */;
65952
+ return result;
65740
65953
  }
65741
65954
  function getAliasVariances(symbol) {
65742
- return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
65955
+ var links = getSymbolLinks(symbol);
65956
+ return getVariancesWorker(links.typeParameters, links, function (_links, param, marker) {
65957
+ var type = getTypeAliasInstantiation(symbol, instantiateTypes(links.typeParameters, makeUnaryTypeMapper(param, marker)));
65958
+ type.aliasTypeArgumentsContainsMarker = true;
65959
+ return type;
65960
+ });
65743
65961
  }
65744
65962
  // Return an array containing the variance of each type parameter. The variance is effectively
65745
65963
  // a digest of the type comparisons that occur for each type argument when instantiations of the
65746
65964
  // generic type are structurally compared. We infer the variance information by comparing
65747
65965
  // instantiations of the generic type for type arguments with known relations. The function
65748
65966
  // returns the emptyArray singleton when invoked recursively for the given generic type.
65749
- function getVariancesWorker(symbol, typeParameters) {
65967
+ function getVariancesWorker(typeParameters, cache, createMarkerType) {
65968
+ var _a, _b, _c;
65750
65969
  if (typeParameters === void 0) { typeParameters = ts.emptyArray; }
65751
- var links = getSymbolLinks(symbol);
65752
- if (!links.variances) {
65753
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
65754
- links.variances = ts.emptyArray;
65755
- var variances = [];
65756
- var _loop_21 = function (tp) {
65970
+ var variances = cache.variances;
65971
+ if (!variances) {
65972
+ 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 });
65973
+ // The emptyArray singleton is used to signal a recursive invocation.
65974
+ cache.variances = ts.emptyArray;
65975
+ variances = [];
65976
+ var _loop_22 = function (tp) {
65757
65977
  var unmeasurable = false;
65758
65978
  var unreliable = false;
65759
65979
  var oldHandler = outofbandVarianceMarkerHandler;
@@ -65761,15 +65981,15 @@ var ts;
65761
65981
  // We first compare instantiations where the type parameter is replaced with
65762
65982
  // marker types that have a known subtype relationship. From this we can infer
65763
65983
  // invariance, covariance, contravariance or bivariance.
65764
- var typeWithSuper = createMarkerType(symbol, tp, markerSuperType);
65765
- var typeWithSub = createMarkerType(symbol, tp, markerSubType);
65984
+ var typeWithSuper = createMarkerType(cache, tp, markerSuperType);
65985
+ var typeWithSub = createMarkerType(cache, tp, markerSubType);
65766
65986
  var variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 /* Covariant */ : 0) |
65767
65987
  (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 /* Contravariant */ : 0);
65768
65988
  // If the instantiations appear to be related bivariantly it may be because the
65769
65989
  // type parameter is independent (i.e. it isn't witnessed anywhere in the generic
65770
65990
  // type). To determine this we compare instantiations where the type parameter is
65771
65991
  // replaced with marker types that are known to be unrelated.
65772
- if (variance === 3 /* Bivariant */ && isTypeAssignableTo(createMarkerType(symbol, tp, markerOtherType), typeWithSuper)) {
65992
+ if (variance === 3 /* Bivariant */ && isTypeAssignableTo(createMarkerType(cache, tp, markerOtherType), typeWithSuper)) {
65773
65993
  variance = 4 /* Independent */;
65774
65994
  }
65775
65995
  outofbandVarianceMarkerHandler = oldHandler;
@@ -65785,59 +66005,19 @@ var ts;
65785
66005
  };
65786
66006
  for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
65787
66007
  var tp = typeParameters_1[_i];
65788
- _loop_21(tp);
66008
+ _loop_22(tp);
65789
66009
  }
65790
- links.variances = variances;
66010
+ cache.variances = variances;
65791
66011
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
65792
66012
  }
65793
- return links.variances;
66013
+ return variances;
65794
66014
  }
65795
- function createMarkerType(symbol, source, target) {
65796
- var mapper = makeUnaryTypeMapper(source, target);
65797
- if (symbol.flags & 524288 /* TypeAlias */) {
65798
- return getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters, mapper));
65799
- }
65800
- var type = getDeclaredTypeOfSymbol(symbol);
65801
- return createTypeReference(type, instantiateTypes(type.typeParameters, mapper));
65802
- }
65803
- // Check if any of the given types contain marker types. We visit type arguments of generic classes, interfaces, and
65804
- // type aliases, members of anonymous type literals and mapped types, constituents of union, intersection, and
65805
- // template literal types, and targets of index types and string mapping types. This is by design a limited set of
65806
- // types to avoid excessive fan out. In deferred (and thus possibly circular) locations we limit the traversal to
65807
- // four levels of depth.
65808
- function someContainsMarkerType(types, maxDepth) {
65809
- if (maxDepth === void 0) { maxDepth = 4; }
65810
- return ts.some(types, function (t) { return containsMarkerType(t, maxDepth); });
65811
- }
65812
- function containsMarkerType(type, maxDepth) {
65813
- return maxDepth > 0 && (type.flags & 262144 /* TypeParameter */ ? type === markerSubType || type === markerSubType || type === markerOtherType :
65814
- type.aliasSymbol ? someContainsMarkerType(type.aliasTypeArguments, maxDepth) :
65815
- type.flags & 524288 /* Object */ ? objectTypeContainsMarkerType(type, maxDepth) :
65816
- type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) ? someContainsMarkerType(type.types, maxDepth) :
65817
- type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) ? containsMarkerType(type.type, maxDepth) :
65818
- false);
65819
- }
65820
- function objectTypeContainsMarkerType(type, maxDepth) {
65821
- var objectFlags = ts.getObjectFlags(type);
65822
- if (objectFlags & 4 /* Reference */) {
65823
- return someContainsMarkerType(getTypeArguments(type), maxDepth - (type.node ? 1 : 0));
65824
- }
65825
- if (objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) {
65826
- var resolved = resolveStructuredTypeMembers(type);
65827
- return ts.some(resolved.properties, function (prop) { return containsMarkerType(getTypeOfSymbol(prop), maxDepth - 1); }) ||
65828
- ts.some(resolved.callSignatures, function (sig) { return signatureContainsMarkerType(sig, maxDepth); }) ||
65829
- ts.some(resolved.constructSignatures, function (sig) { return signatureContainsMarkerType(sig, maxDepth); }) ||
65830
- ts.some(resolved.indexInfos, function (info) { return containsMarkerType(info.type, maxDepth - 1); });
65831
- }
65832
- if (objectFlags & 32 /* Mapped */) {
65833
- return containsMarkerType(getConstraintTypeFromMappedType(type), maxDepth - 1) ||
65834
- containsMarkerType(getTemplateTypeFromMappedType(type), maxDepth - 1);
66015
+ function getVariances(type) {
66016
+ // Arrays and tuples are known to be covariant, no need to spend time computing this.
66017
+ if (type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */) {
66018
+ return arrayVariances;
65835
66019
  }
65836
- return false;
65837
- }
65838
- function signatureContainsMarkerType(sig, maxDepth) {
65839
- return ts.some(sig.parameters, function (param) { return containsMarkerType(getTypeOfSymbol(param), maxDepth - 1); }) ||
65840
- containsMarkerType(getReturnTypeOfSignature(sig), maxDepth - 1);
66020
+ return getVariancesWorker(type.typeParameters, type, getMarkerTypeReference);
65841
66021
  }
65842
66022
  // Return true if the given type reference has a 'void' type argument for a covariant type parameter.
65843
66023
  // See comment at call in recursiveTypeRelatedTo for when this case matters.
@@ -66208,10 +66388,10 @@ var ts;
66208
66388
  if (!(ts.getObjectFlags(type) & 4 /* Reference */) || !(ts.getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
66209
66389
  return undefined;
66210
66390
  }
66211
- if (ts.getObjectFlags(type) & 33554432 /* IdenticalBaseTypeCalculated */) {
66212
- return ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
66391
+ if (ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
66392
+ return ts.getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
66213
66393
  }
66214
- type.objectFlags |= 33554432 /* IdenticalBaseTypeCalculated */;
66394
+ type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
66215
66395
  var target = type.target;
66216
66396
  if (ts.getObjectFlags(target) & 1 /* Class */) {
66217
66397
  var baseTypeNode = getBaseTypeNodeOfClass(target);
@@ -66232,7 +66412,7 @@ var ts;
66232
66412
  if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
66233
66413
  instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
66234
66414
  }
66235
- type.objectFlags |= 67108864 /* IdenticalBaseTypeExists */;
66415
+ type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
66236
66416
  return type.cachedEquivalentBaseType = instantiatedBase;
66237
66417
  }
66238
66418
  function isEmptyLiteralType(type) {
@@ -66527,7 +66707,7 @@ var ts;
66527
66707
  * Leave signatures alone since they are not subject to the check.
66528
66708
  */
66529
66709
  function getRegularTypeOfObjectLiteral(type) {
66530
- if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 8192 /* FreshLiteral */)) {
66710
+ if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 16384 /* FreshLiteral */)) {
66531
66711
  return type;
66532
66712
  }
66533
66713
  var regularType = type.regularType;
@@ -66538,7 +66718,7 @@ var ts;
66538
66718
  var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
66539
66719
  var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
66540
66720
  regularNew.flags = resolved.flags;
66541
- regularNew.objectFlags |= resolved.objectFlags & ~8192 /* FreshLiteral */;
66721
+ regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
66542
66722
  type.regularType = regularNew;
66543
66723
  return regularNew;
66544
66724
  }
@@ -66568,7 +66748,7 @@ var ts;
66568
66748
  var names = new ts.Map();
66569
66749
  for (var _i = 0, _a = getSiblingsOfContext(context); _i < _a.length; _i++) {
66570
66750
  var t = _a[_i];
66571
- if (isObjectLiteralType(t) && !(ts.getObjectFlags(t) & 2097152 /* ContainsSpread */)) {
66751
+ if (isObjectLiteralType(t) && !(ts.getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
66572
66752
  for (var _b = 0, _c = getPropertiesOfType(t); _b < _c.length; _b++) {
66573
66753
  var prop = _c[_b];
66574
66754
  names.set(prop.escapedName, prop);
@@ -66615,14 +66795,14 @@ var ts;
66615
66795
  }
66616
66796
  }
66617
66797
  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); }));
66618
- result.objectFlags |= (ts.getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */)); // Retain js literal flag through widening
66798
+ result.objectFlags |= (ts.getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */)); // Retain js literal flag through widening
66619
66799
  return result;
66620
66800
  }
66621
66801
  function getWidenedType(type) {
66622
66802
  return getWidenedTypeWithContext(type, /*context*/ undefined);
66623
66803
  }
66624
66804
  function getWidenedTypeWithContext(type, context) {
66625
- if (ts.getObjectFlags(type) & 196608 /* RequiresWidening */) {
66805
+ if (ts.getObjectFlags(type) & 393216 /* RequiresWidening */) {
66626
66806
  if (context === undefined && type.widened) {
66627
66807
  return type.widened;
66628
66808
  }
@@ -66667,7 +66847,7 @@ var ts;
66667
66847
  */
66668
66848
  function reportWideningErrorsInType(type) {
66669
66849
  var errorReported = false;
66670
- if (ts.getObjectFlags(type) & 65536 /* ContainsWideningType */) {
66850
+ if (ts.getObjectFlags(type) & 131072 /* ContainsWideningType */) {
66671
66851
  if (type.flags & 1048576 /* Union */) {
66672
66852
  if (ts.some(type.types, isEmptyObjectType)) {
66673
66853
  errorReported = true;
@@ -66693,7 +66873,7 @@ var ts;
66693
66873
  for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) {
66694
66874
  var p = _e[_d];
66695
66875
  var t = getTypeOfSymbol(p);
66696
- if (ts.getObjectFlags(t) & 65536 /* ContainsWideningType */) {
66876
+ if (ts.getObjectFlags(t) & 131072 /* ContainsWideningType */) {
66697
66877
  if (!reportWideningErrorsInType(t)) {
66698
66878
  error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
66699
66879
  }
@@ -66774,7 +66954,7 @@ var ts;
66774
66954
  errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
66775
66955
  }
66776
66956
  function reportErrorsFromWidening(declaration, type, wideningKind) {
66777
- if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 65536 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
66957
+ if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
66778
66958
  // Report implicit any error within type if possible, otherwise report error on declaration
66779
66959
  if (!reportWideningErrorsInType(type)) {
66780
66960
  reportImplicitAny(declaration, type, wideningKind);
@@ -66890,16 +67070,16 @@ var ts;
66890
67070
  // results for union and intersection types for performance reasons.
66891
67071
  function couldContainTypeVariables(type) {
66892
67072
  var objectFlags = ts.getObjectFlags(type);
66893
- if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
66894
- return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
67073
+ if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
67074
+ return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
66895
67075
  }
66896
67076
  var result = !!(type.flags & 465829888 /* Instantiable */ ||
66897
67077
  type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
66898
67078
  objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ||
66899
- objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) ||
67079
+ objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */)) ||
66900
67080
  type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
66901
67081
  if (type.flags & 3899393 /* ObjectFlagsType */) {
66902
- type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
67082
+ type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
66903
67083
  }
66904
67084
  return result;
66905
67085
  }
@@ -66959,7 +67139,7 @@ var ts;
66959
67139
  // literal { a: 123, b: x => true } is marked non-inferable because it contains a context sensitive
66960
67140
  // arrow function, but is considered partially inferable because property 'a' has an inferable type.
66961
67141
  function isPartiallyInferableType(type) {
66962
- return !(ts.getObjectFlags(type) & 262144 /* NonInferrableType */) ||
67142
+ return !(ts.getObjectFlags(type) & 524288 /* NonInferrableType */) ||
66963
67143
  isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) ||
66964
67144
  isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType);
66965
67145
  }
@@ -67299,7 +67479,7 @@ var ts;
67299
67479
  }
67300
67480
  var inference = getInferenceInfoForType(target);
67301
67481
  if (inference) {
67302
- if (ts.getObjectFlags(source) & 262144 /* NonInferrableType */) {
67482
+ if (ts.getObjectFlags(source) & 524288 /* NonInferrableType */) {
67303
67483
  return;
67304
67484
  }
67305
67485
  if (!inference.isFixed) {
@@ -67624,7 +67804,7 @@ var ts;
67624
67804
  // We assign a lower priority to inferences made from types containing non-inferrable
67625
67805
  // types because we may only have a partial result (i.e. we may have failed to make
67626
67806
  // reverse inferences for some properties).
67627
- inferWithPriority(inferredType, inference.typeParameter, ts.getObjectFlags(source) & 262144 /* NonInferrableType */ ?
67807
+ inferWithPriority(inferredType, inference.typeParameter, ts.getObjectFlags(source) & 524288 /* NonInferrableType */ ?
67628
67808
  16 /* PartialHomomorphicMappedType */ :
67629
67809
  8 /* HomomorphicMappedType */);
67630
67810
  }
@@ -67792,7 +67972,7 @@ var ts;
67792
67972
  var sourceLen = sourceSignatures.length;
67793
67973
  var targetLen = targetSignatures.length;
67794
67974
  var len = sourceLen < targetLen ? sourceLen : targetLen;
67795
- var skipParameters = !!(ts.getObjectFlags(source) & 262144 /* NonInferrableType */);
67975
+ var skipParameters = !!(ts.getObjectFlags(source) & 524288 /* NonInferrableType */);
67796
67976
  for (var i = 0; i < len; i++) {
67797
67977
  inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters);
67798
67978
  }
@@ -67859,7 +68039,7 @@ var ts;
67859
68039
  return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */);
67860
68040
  }
67861
68041
  function isObjectOrArrayLiteralType(type) {
67862
- return !!(ts.getObjectFlags(type) & (128 /* ObjectLiteral */ | 16384 /* ArrayLiteral */));
68042
+ return !!(ts.getObjectFlags(type) & (128 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
67863
68043
  }
67864
68044
  function unionObjectAndArrayLiteralCandidates(candidates) {
67865
68045
  if (candidates.length > 1) {
@@ -68196,7 +68376,7 @@ var ts;
68196
68376
  function mapTypesByKeyProperty(types, name) {
68197
68377
  var map = new ts.Map();
68198
68378
  var count = 0;
68199
- var _loop_22 = function (type) {
68379
+ var _loop_23 = function (type) {
68200
68380
  if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
68201
68381
  var discriminant = getTypeOfPropertyOfType(type, name);
68202
68382
  if (discriminant) {
@@ -68222,9 +68402,9 @@ var ts;
68222
68402
  };
68223
68403
  for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
68224
68404
  var type = types_16[_i];
68225
- var state_8 = _loop_22(type);
68226
- if (typeof state_8 === "object")
68227
- return state_8.value;
68405
+ var state_9 = _loop_23(type);
68406
+ if (typeof state_9 === "object")
68407
+ return state_9.value;
68228
68408
  }
68229
68409
  return count >= 10 && count * 2 >= types.length ? map : undefined;
68230
68410
  }
@@ -68233,7 +68413,7 @@ var ts;
68233
68413
  function getKeyPropertyName(unionType) {
68234
68414
  var types = unionType.types;
68235
68415
  // We only construct maps for unions with many non-primitive constituents.
68236
- if (types.length < 10 || ts.getObjectFlags(unionType) & 32768 /* PrimitiveUnion */ ||
68416
+ if (types.length < 10 || ts.getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ ||
68237
68417
  ts.countWhere(types, function (t) { return !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */)); }) < 10) {
68238
68418
  return undefined;
68239
68419
  }
@@ -69494,7 +69674,7 @@ var ts;
69494
69674
  return result;
69495
69675
  }
69496
69676
  function getCandidateDiscriminantPropertyAccess(expr) {
69497
- if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
69677
+ if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference) || ts.isObjectLiteralMethod(reference)) {
69498
69678
  // When the reference is a binding pattern or function or arrow expression, we are narrowing a pesudo-reference in
69499
69679
  // getNarrowedTypeOfSymbol. An identifier for a destructuring variable declared in the same binding pattern or
69500
69680
  // parameter declared in the same parameter list is a candidate.
@@ -72169,7 +72349,7 @@ var ts;
72169
72349
  var literalType = type.literalType;
72170
72350
  if (!literalType) {
72171
72351
  literalType = type.literalType = cloneTypeReference(type);
72172
- literalType.objectFlags |= 16384 /* ArrayLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
72352
+ literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
72173
72353
  }
72174
72354
  return literalType;
72175
72355
  }
@@ -72314,7 +72494,7 @@ var ts;
72314
72494
  checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
72315
72495
  }
72316
72496
  }
72317
- objectFlags |= ts.getObjectFlags(type) & 458752 /* PropagatingFlags */;
72497
+ objectFlags |= ts.getObjectFlags(type) & 917504 /* PropagatingFlags */;
72318
72498
  var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined;
72319
72499
  var prop = nameType ?
72320
72500
  createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) :
@@ -72452,9 +72632,9 @@ var ts;
72452
72632
  if (hasComputedSymbolProperty)
72453
72633
  indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
72454
72634
  var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, indexInfos);
72455
- result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
72635
+ result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
72456
72636
  if (isJSObjectLiteral) {
72457
- result.objectFlags |= 4096 /* JSLiteral */;
72637
+ result.objectFlags |= 8192 /* JSLiteral */;
72458
72638
  }
72459
72639
  if (patternWithComputedProperties) {
72460
72640
  result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;
@@ -72545,7 +72725,7 @@ var ts;
72545
72725
  var member = attributeDecl.symbol;
72546
72726
  if (ts.isJsxAttribute(attributeDecl)) {
72547
72727
  var exprType = checkJsxAttribute(attributeDecl, checkMode);
72548
- objectFlags |= ts.getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
72728
+ objectFlags |= ts.getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
72549
72729
  var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
72550
72730
  attributeSymbol.declarations = member.declarations;
72551
72731
  attributeSymbol.parent = member.parent;
@@ -72629,7 +72809,7 @@ var ts;
72629
72809
  function createJsxAttributesType() {
72630
72810
  objectFlags |= freshObjectLiteralFlag;
72631
72811
  var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
72632
- result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
72812
+ result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
72633
72813
  return result;
72634
72814
  }
72635
72815
  }
@@ -74555,7 +74735,7 @@ var ts;
74555
74735
  if (spreadIndex >= 0) {
74556
74736
  // Create synthetic arguments from spreads of tuple types.
74557
74737
  var effectiveArgs_1 = args.slice(0, spreadIndex);
74558
- var _loop_23 = function (i) {
74738
+ var _loop_24 = function (i) {
74559
74739
  var arg = args[i];
74560
74740
  // We can call checkExpressionCached because spread expressions never have a contextual type.
74561
74741
  var spreadType = arg.kind === 224 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
@@ -74572,7 +74752,7 @@ var ts;
74572
74752
  }
74573
74753
  };
74574
74754
  for (var i = spreadIndex; i < args.length; i++) {
74575
- _loop_23(i);
74755
+ _loop_24(i);
74576
74756
  }
74577
74757
  return effectiveArgs_1;
74578
74758
  }
@@ -74885,7 +75065,7 @@ var ts;
74885
75065
  var min_3 = Number.MAX_VALUE;
74886
75066
  var minIndex = 0;
74887
75067
  var i_1 = 0;
74888
- var _loop_24 = function (c) {
75068
+ var _loop_25 = function (c) {
74889
75069
  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)); };
74890
75070
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2);
74891
75071
  if (diags_2) {
@@ -74903,7 +75083,7 @@ var ts;
74903
75083
  };
74904
75084
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
74905
75085
  var c = candidatesForArgumentError_1[_a];
74906
- _loop_24(c);
75086
+ _loop_25(c);
74907
75087
  }
74908
75088
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
74909
75089
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -75061,7 +75241,7 @@ var ts;
75061
75241
  }
75062
75242
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
75063
75243
  var parameters = [];
75064
- var _loop_25 = function (i) {
75244
+ var _loop_26 = function (i) {
75065
75245
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
75066
75246
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
75067
75247
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -75069,7 +75249,7 @@ var ts;
75069
75249
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
75070
75250
  };
75071
75251
  for (var i = 0; i < maxNonRestParam; i++) {
75072
- _loop_25(i);
75252
+ _loop_26(i);
75073
75253
  }
75074
75254
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
75075
75255
  var flags = 0 /* None */;
@@ -75836,7 +76016,7 @@ var ts;
75836
76016
  var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false);
75837
76017
  if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) {
75838
76018
  var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, ts.emptyArray);
75839
- jsAssignmentType.objectFlags |= 4096 /* JSLiteral */;
76019
+ jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
75840
76020
  return getIntersectionType([returnType, jsAssignmentType]);
75841
76021
  }
75842
76022
  }
@@ -76103,7 +76283,7 @@ var ts;
76103
76283
  hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
76104
76284
  if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
76105
76285
  var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
76106
- result_11.objectFlags |= 8388608 /* InstantiationExpressionType */;
76286
+ result_11.objectFlags |= 16777216 /* InstantiationExpressionType */;
76107
76287
  result_11.node = node;
76108
76288
  return result_11;
76109
76289
  }
@@ -76466,6 +76646,9 @@ var ts;
76466
76646
  assignBindingElementTypes(declaration.name, links.type);
76467
76647
  }
76468
76648
  }
76649
+ else if (type) {
76650
+ ts.Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type");
76651
+ }
76469
76652
  }
76470
76653
  // When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
76471
76654
  // the destructured type into the contained binding elements.
@@ -76871,7 +77054,7 @@ var ts;
76871
77054
  var returnType = getReturnTypeFromBody(node, checkMode);
76872
77055
  var returnOnlySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, returnType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);
76873
77056
  var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts.emptyArray, ts.emptyArray);
76874
- returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
77057
+ returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
76875
77058
  return links.contextFreeType = returnOnlyType;
76876
77059
  }
76877
77060
  }
@@ -78296,7 +78479,7 @@ var ts;
78296
78479
  }
78297
78480
  function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {
78298
78481
  var type = checkExpression(node, checkMode, forceTuple);
78299
- return isConstContext(node) ? getRegularTypeOfLiteralType(type) :
78482
+ return isConstContext(node) || ts.isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) :
78300
78483
  isTypeAssertion(node) ? type :
78301
78484
  getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node));
78302
78485
  }
@@ -79065,7 +79248,7 @@ var ts;
79065
79248
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
79066
79249
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
79067
79250
  var indexSignatureMap_1 = new ts.Map();
79068
- var _loop_26 = function (declaration) {
79251
+ var _loop_27 = function (declaration) {
79069
79252
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
79070
79253
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
79071
79254
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -79080,7 +79263,7 @@ var ts;
79080
79263
  };
79081
79264
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
79082
79265
  var declaration = _a[_i];
79083
- _loop_26(declaration);
79266
+ _loop_27(declaration);
79084
79267
  }
79085
79268
  indexSignatureMap_1.forEach(function (entry) {
79086
79269
  if (entry.declarations.length > 1) {
@@ -82459,7 +82642,7 @@ var ts;
82459
82642
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
82460
82643
  var localPropDeclaration = declaration && declaration.kind === 220 /* BinaryExpression */ ||
82461
82644
  name && name.kind === 161 /* ComputedPropertyName */ || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
82462
- var _loop_27 = function (info) {
82645
+ var _loop_28 = function (info) {
82463
82646
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
82464
82647
  // We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
82465
82648
  // in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
@@ -82472,7 +82655,7 @@ var ts;
82472
82655
  };
82473
82656
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
82474
82657
  var info = indexInfos_9[_i];
82475
- _loop_27(info);
82658
+ _loop_28(info);
82476
82659
  }
82477
82660
  }
82478
82661
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -82480,7 +82663,7 @@ var ts;
82480
82663
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
82481
82664
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
82482
82665
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
82483
- var _loop_28 = function (info) {
82666
+ var _loop_29 = function (info) {
82484
82667
  if (info === checkInfo)
82485
82668
  return "continue";
82486
82669
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -82495,7 +82678,7 @@ var ts;
82495
82678
  };
82496
82679
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
82497
82680
  var info = indexInfos_10[_i];
82498
- _loop_28(info);
82681
+ _loop_29(info);
82499
82682
  }
82500
82683
  }
82501
82684
  function checkTypeNameIsReserved(name, message) {
@@ -82806,7 +82989,7 @@ var ts;
82806
82989
  var baseTypes = baseTypeNode && getBaseTypes(type);
82807
82990
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
82808
82991
  var baseStaticType = getBaseConstructorTypeOfClass(type);
82809
- var _loop_29 = function (member) {
82992
+ var _loop_30 = function (member) {
82810
82993
  if (ts.hasAmbientModifier(member)) {
82811
82994
  return "continue";
82812
82995
  }
@@ -82823,7 +83006,7 @@ var ts;
82823
83006
  };
82824
83007
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
82825
83008
  var member = _a[_i];
82826
- _loop_29(member);
83009
+ _loop_30(member);
82827
83010
  }
82828
83011
  }
82829
83012
  /**
@@ -82911,7 +83094,7 @@ var ts;
82911
83094
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
82912
83095
  // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
82913
83096
  var issuedMemberError = false;
82914
- var _loop_30 = function (member) {
83097
+ var _loop_31 = function (member) {
82915
83098
  if (ts.isStatic(member)) {
82916
83099
  return "continue";
82917
83100
  }
@@ -82930,7 +83113,7 @@ var ts;
82930
83113
  };
82931
83114
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
82932
83115
  var member = _a[_i];
82933
- _loop_30(member);
83116
+ _loop_31(member);
82934
83117
  }
82935
83118
  if (!issuedMemberError) {
82936
83119
  // check again with diagnostics to generate a less-specific error
@@ -109895,7 +110078,7 @@ var ts;
109895
110078
  return emitRestOrJSDocVariadicType(node);
109896
110079
  case 318 /* JSDocNamepathType */:
109897
110080
  return;
109898
- case 319 /* JSDocComment */:
110081
+ case 319 /* JSDoc */:
109899
110082
  return emitJSDoc(node);
109900
110083
  case 321 /* JSDocTypeLiteral */:
109901
110084
  return emitJSDocTypeLiteral(node);
@@ -114271,7 +114454,7 @@ var ts;
114271
114454
  var existingDirectories = new ts.Map();
114272
114455
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
114273
114456
  var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
114274
- function getSourceFile(fileName, languageVersion, onError) {
114457
+ function getSourceFile(fileName, languageVersionOrOptions, onError) {
114275
114458
  var text;
114276
114459
  try {
114277
114460
  ts.performance.mark("beforeIORead");
@@ -114285,7 +114468,7 @@ var ts;
114285
114468
  }
114286
114469
  text = "";
114287
114470
  }
114288
- return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined;
114471
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : undefined;
114289
114472
  }
114290
114473
  function directoryExists(directoryPath) {
114291
114474
  if (existingDirectories.has(directoryPath)) {
@@ -115691,8 +115874,8 @@ var ts;
115691
115874
  for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {
115692
115875
  var oldSourceFile = oldSourceFiles_2[_i];
115693
115876
  var newSourceFile = host.getSourceFileByPath
115694
- ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, ts.getEmitScriptTarget(options), /*onError*/ undefined, shouldCreateNewSourceFile)
115695
- : host.getSourceFile(oldSourceFile.fileName, ts.getEmitScriptTarget(options), /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
115877
+ ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), /*onError*/ undefined, shouldCreateNewSourceFile)
115878
+ : host.getSourceFile(oldSourceFile.fileName, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
115696
115879
  if (!newSourceFile) {
115697
115880
  return 0 /* Not */;
115698
115881
  }
@@ -115723,7 +115906,6 @@ var ts;
115723
115906
  newSourceFile.originalFileName = oldSourceFile.originalFileName;
115724
115907
  newSourceFile.resolvedPath = oldSourceFile.resolvedPath;
115725
115908
  newSourceFile.fileName = oldSourceFile.fileName;
115726
- newSourceFile.impliedNodeFormat = oldSourceFile.impliedNodeFormat;
115727
115909
  var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path);
115728
115910
  if (packageName !== undefined) {
115729
115911
  // If there are 2 different source files for the same package name and at least one of them changes,
@@ -116642,6 +116824,17 @@ var ts;
116642
116824
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
116643
116825
  return result;
116644
116826
  }
116827
+ function getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options) {
116828
+ // 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
116829
+ // 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
116830
+ // 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.
116831
+ var impliedNodeFormat = getImpliedNodeFormatForFile(toPath(fileName), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
116832
+ return {
116833
+ languageVersion: ts.getEmitScriptTarget(options),
116834
+ impliedNodeFormat: impliedNodeFormat,
116835
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(options)
116836
+ };
116837
+ }
116645
116838
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
116646
116839
  var path = toPath(fileName);
116647
116840
  if (useSourceOfProjectReferenceRedirect) {
@@ -116729,7 +116922,7 @@ var ts;
116729
116922
  }
116730
116923
  }
116731
116924
  // We haven't looked for this file, do so now and cache result
116732
- 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);
116925
+ 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);
116733
116926
  if (packageId) {
116734
116927
  var packageIdKey = ts.packageIdToString(packageId);
116735
116928
  var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
@@ -116757,10 +116950,6 @@ var ts;
116757
116950
  file.path = path;
116758
116951
  file.resolvedPath = toPath(fileName);
116759
116952
  file.originalFileName = originalFileName;
116760
- // 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
116761
- // 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
116762
- // 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.
116763
- file.impliedNodeFormat = getImpliedNodeFormatForFile(file.resolvedPath, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
116764
116953
  addFileIncludeReason(file, reason);
116765
116954
  if (host.useCaseSensitiveFileNames()) {
116766
116955
  var pathLowerCase = ts.toFileNameLowerCase(path);
@@ -117262,7 +117451,7 @@ var ts;
117262
117451
  }
117263
117452
  else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) {
117264
117453
  // We cannot use createDiagnosticFromNode because nodes do not have parents yet
117265
- var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117454
+ var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117266
117455
  programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
117267
117456
  }
117268
117457
  // Cannot specify module gen that isn't amd or system with --out
@@ -117271,7 +117460,7 @@ var ts;
117271
117460
  createDiagnosticForOptionName(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module");
117272
117461
  }
117273
117462
  else if (options.module === undefined && firstNonAmbientExternalModuleSourceFile) {
117274
- var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117463
+ var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
117275
117464
  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"));
117276
117465
  }
117277
117466
  }
@@ -120717,7 +120906,7 @@ var ts;
120717
120906
  });
120718
120907
  // Sort by paths closest to importing file Name directory
120719
120908
  var sortedPaths = [];
120720
- var _loop_31 = function (directory) {
120909
+ var _loop_32 = function (directory) {
120721
120910
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
120722
120911
  var pathsInDirectory;
120723
120912
  allFileNames.forEach(function (_a, fileName) {
@@ -120741,9 +120930,9 @@ var ts;
120741
120930
  };
120742
120931
  var out_directory_1;
120743
120932
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
120744
- var state_9 = _loop_31(directory);
120933
+ var state_10 = _loop_32(directory);
120745
120934
  directory = out_directory_1;
120746
- if (state_9 === "break")
120935
+ if (state_10 === "break")
120747
120936
  break;
120748
120937
  }
120749
120938
  if (allFileNames.size) {
@@ -121533,7 +121722,7 @@ var ts;
121533
121722
  var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
121534
121723
  var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
121535
121724
  return {
121536
- getSourceFile: function (fileName, languageVersion, onError) {
121725
+ getSourceFile: function (fileName, languageVersionOrOptions, onError) {
121537
121726
  var text;
121538
121727
  try {
121539
121728
  ts.performance.mark("beforeIORead");
@@ -121547,7 +121736,7 @@ var ts;
121547
121736
  }
121548
121737
  text = "";
121549
121738
  }
121550
- return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined;
121739
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions) : undefined;
121551
121740
  },
121552
121741
  getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation),
121553
121742
  getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
@@ -122015,7 +122204,7 @@ var ts;
122015
122204
  }
122016
122205
  return directoryStructureHost.fileExists(fileName);
122017
122206
  }
122018
- function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) {
122207
+ function getVersionedSourceFileByPath(fileName, path, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
122019
122208
  var hostSourceFile = sourceFilesCache.get(path);
122020
122209
  // No source file on the host
122021
122210
  if (isFileMissingOnHost(hostSourceFile)) {
@@ -122023,7 +122212,7 @@ var ts;
122023
122212
  }
122024
122213
  // Create new source file if requested or the versions dont match
122025
122214
  if (hostSourceFile === undefined || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) {
122026
- var sourceFile = getNewSourceFile(fileName, languageVersion, onError);
122215
+ var sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError);
122027
122216
  if (hostSourceFile) {
122028
122217
  if (sourceFile) {
122029
122218
  // Set the source file and create file watcher now that file was present on the disk
@@ -133711,9 +133900,15 @@ var ts;
133711
133900
  });
133712
133901
  return JSON.stringify(bucketInfoArray, undefined, 2);
133713
133902
  }
133903
+ function getCompilationSettings(settingsOrHost) {
133904
+ if (typeof settingsOrHost.getCompilationSettings === "function") {
133905
+ return settingsOrHost.getCompilationSettings();
133906
+ }
133907
+ return settingsOrHost;
133908
+ }
133714
133909
  function acquireDocument(fileName, compilationSettings, scriptSnapshot, version, scriptKind) {
133715
133910
  var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);
133716
- var key = getKeyForCompilationSettings(compilationSettings);
133911
+ var key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
133717
133912
  return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
133718
133913
  }
133719
133914
  function acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind) {
@@ -133721,20 +133916,28 @@ var ts;
133721
133916
  }
133722
133917
  function updateDocument(fileName, compilationSettings, scriptSnapshot, version, scriptKind) {
133723
133918
  var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);
133724
- var key = getKeyForCompilationSettings(compilationSettings);
133919
+ var key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
133725
133920
  return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
133726
133921
  }
133727
133922
  function updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind) {
133728
- return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ false, scriptKind);
133923
+ return acquireOrUpdateDocument(fileName, path, getCompilationSettings(compilationSettings), key, scriptSnapshot, version, /*acquiring*/ false, scriptKind);
133729
133924
  }
133730
133925
  function getDocumentRegistryEntry(bucketEntry, scriptKind) {
133731
133926
  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"));
133732
133927
  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);
133733
133928
  return entry;
133734
133929
  }
133735
- function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
133930
+ function acquireOrUpdateDocument(fileName, path, compilationSettingsOrHost, key, scriptSnapshot, version, acquiring, scriptKind) {
133931
+ var _a, _b, _c, _d;
133736
133932
  scriptKind = ts.ensureScriptKind(fileName, scriptKind);
133933
+ var compilationSettings = getCompilationSettings(compilationSettingsOrHost);
133934
+ var host = compilationSettingsOrHost === compilationSettings ? undefined : compilationSettingsOrHost;
133737
133935
  var scriptTarget = scriptKind === 6 /* JSON */ ? 100 /* JSON */ : ts.getEmitScriptTarget(compilationSettings);
133936
+ var sourceFileOptions = {
133937
+ languageVersion: scriptTarget,
133938
+ 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),
133939
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(compilationSettings)
133940
+ };
133738
133941
  var oldBucketCount = buckets.size;
133739
133942
  var bucket = ts.getOrUpdate(buckets, key, function () { return new ts.Map(); });
133740
133943
  if (ts.tracing) {
@@ -133768,7 +133971,7 @@ var ts;
133768
133971
  }
133769
133972
  if (!entry) {
133770
133973
  // Have never seen this file with these settings. Create a new source file for it.
133771
- var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, /*setNodeParents*/ false, scriptKind);
133974
+ var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, sourceFileOptions, version, /*setNodeParents*/ false, scriptKind);
133772
133975
  if (externalCache) {
133773
133976
  externalCache.setDocument(key, path, sourceFile);
133774
133977
  }
@@ -140702,6 +140905,41 @@ var ts;
140702
140905
  if (ts.scanner.getToken() === 1 /* EndOfFileToken */) {
140703
140906
  break;
140704
140907
  }
140908
+ if (ts.scanner.getToken() === 15 /* TemplateHead */) {
140909
+ var stack = [ts.scanner.getToken()];
140910
+ var token = ts.scanner.scan();
140911
+ loop: while (ts.length(stack)) {
140912
+ switch (token) {
140913
+ case 1 /* EndOfFileToken */:
140914
+ break loop;
140915
+ case 100 /* ImportKeyword */:
140916
+ tryConsumeImport();
140917
+ break;
140918
+ case 15 /* TemplateHead */:
140919
+ stack.push(token);
140920
+ break;
140921
+ case 18 /* OpenBraceToken */:
140922
+ if (ts.length(stack)) {
140923
+ stack.push(token);
140924
+ }
140925
+ break;
140926
+ case 19 /* CloseBraceToken */:
140927
+ if (ts.length(stack)) {
140928
+ if (ts.lastOrUndefined(stack) === 15 /* TemplateHead */) {
140929
+ if (ts.scanner.reScanTemplateToken(/* isTaggedTemplate */ false) === 17 /* TemplateTail */) {
140930
+ stack.pop();
140931
+ }
140932
+ }
140933
+ else {
140934
+ stack.pop();
140935
+ }
140936
+ }
140937
+ break;
140938
+ }
140939
+ token = ts.scanner.scan();
140940
+ }
140941
+ nextToken();
140942
+ }
140705
140943
  // check if at least one of alternative have moved scanner forward
140706
140944
  if (tryConsumeDeclare() ||
140707
140945
  tryConsumeImport() ||
@@ -142212,7 +142450,7 @@ var ts;
142212
142450
  continue;
142213
142451
  var module_1 = ts.getResolvedModule(sourceFile, moduleSpecifier.text, ts.getModeForUsageLocation(sourceFile, moduleSpecifier));
142214
142452
  var resolvedFile = module_1 && program.getSourceFile(module_1.resolvedFileName);
142215
- if (resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
142453
+ if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
142216
142454
  diags.push(ts.createDiagnosticForNode(name, ts.Diagnostics.Import_may_be_converted_to_a_default_import));
142217
142455
  }
142218
142456
  }
@@ -143128,19 +143366,7 @@ var ts;
143128
143366
  options.suppressOutputPathCheck = true;
143129
143367
  // Filename can be non-ts file.
143130
143368
  options.allowNonTsExtensions = true;
143131
- // if jsx is specified then treat file as .tsx
143132
- var inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts");
143133
- var sourceFile = ts.createSourceFile(inputFileName, input, ts.getEmitScriptTarget(options));
143134
- if (transpileOptions.moduleName) {
143135
- sourceFile.moduleName = transpileOptions.moduleName;
143136
- }
143137
- if (transpileOptions.renamedDependencies) {
143138
- sourceFile.renamedDependencies = new ts.Map(ts.getEntries(transpileOptions.renamedDependencies));
143139
- }
143140
143369
  var newLine = ts.getNewLineCharacter(options);
143141
- // Output
143142
- var outputText;
143143
- var sourceMapText;
143144
143370
  // Create a compilerHost object to allow the compiler to read and write files
143145
143371
  var compilerHost = {
143146
143372
  getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; },
@@ -143164,6 +143390,22 @@ var ts;
143164
143390
  directoryExists: function () { return true; },
143165
143391
  getDirectories: function () { return []; }
143166
143392
  };
143393
+ // if jsx is specified then treat file as .tsx
143394
+ var inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts");
143395
+ var sourceFile = ts.createSourceFile(inputFileName, input, {
143396
+ languageVersion: ts.getEmitScriptTarget(options),
143397
+ impliedNodeFormat: ts.getImpliedNodeFormatForFile(ts.toPath(inputFileName, "", compilerHost.getCanonicalFileName), /*cache*/ undefined, compilerHost, options),
143398
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(options)
143399
+ });
143400
+ if (transpileOptions.moduleName) {
143401
+ sourceFile.moduleName = transpileOptions.moduleName;
143402
+ }
143403
+ if (transpileOptions.renamedDependencies) {
143404
+ sourceFile.renamedDependencies = new ts.Map(ts.getEntries(transpileOptions.renamedDependencies));
143405
+ }
143406
+ // Output
143407
+ var outputText;
143408
+ var sourceMapText;
143167
143409
  var program = ts.createProgram([inputFileName], options, compilerHost);
143168
143410
  if (transpileOptions.reportDiagnostics) {
143169
143411
  ts.addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile));
@@ -159676,7 +159918,7 @@ var ts;
159676
159918
  for (var i = 1;; i++) {
159677
159919
  var name = ts.combinePaths(inDirectory, newModuleName + extension);
159678
159920
  if (!host.fileExists(name))
159679
- return newModuleName; // TODO: GH#18217
159921
+ return newModuleName;
159680
159922
  newModuleName = moduleName + "." + i;
159681
159923
  }
159682
159924
  }
@@ -162036,6 +162278,7 @@ var ts;
162036
162278
  this.host = host;
162037
162279
  }
162038
162280
  SyntaxTreeCache.prototype.getCurrentSourceFile = function (fileName) {
162281
+ var _a, _b, _c, _d, _e, _f, _g, _h;
162039
162282
  var scriptSnapshot = this.host.getScriptSnapshot(fileName);
162040
162283
  if (!scriptSnapshot) {
162041
162284
  // The host does not know about this file.
@@ -162046,7 +162289,12 @@ var ts;
162046
162289
  var sourceFile;
162047
162290
  if (this.currentFileName !== fileName) {
162048
162291
  // This is a new file, just parse it
162049
- sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 99 /* Latest */, version, /*setNodeParents*/ true, scriptKind);
162292
+ var options = {
162293
+ languageVersion: 99 /* Latest */,
162294
+ 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()),
162295
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(this.host.getCompilationSettings())
162296
+ };
162297
+ sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, options, version, /*setNodeParents*/ true, scriptKind);
162050
162298
  }
162051
162299
  else if (this.currentFileVersion !== version) {
162052
162300
  // This is the same file, just a newer version. Incrementally parse the file.
@@ -162068,8 +162316,8 @@ var ts;
162068
162316
  sourceFile.version = version;
162069
162317
  sourceFile.scriptSnapshot = scriptSnapshot;
162070
162318
  }
162071
- function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents, scriptKind) {
162072
- var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTarget, setNodeParents, scriptKind);
162319
+ function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version, setNodeParents, scriptKind) {
162320
+ var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind);
162073
162321
  setSourceFileFields(sourceFile, scriptSnapshot, version);
162074
162322
  return sourceFile;
162075
162323
  }
@@ -162117,8 +162365,13 @@ var ts;
162117
162365
  return newSourceFile;
162118
162366
  }
162119
162367
  }
162368
+ var options = {
162369
+ languageVersion: sourceFile.languageVersion,
162370
+ impliedNodeFormat: sourceFile.impliedNodeFormat,
162371
+ setExternalModuleIndicator: sourceFile.setExternalModuleIndicator,
162372
+ };
162120
162373
  // Otherwise, just create a new source file.
162121
- return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true, sourceFile.scriptKind);
162374
+ return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, options, version, /*setNodeParents*/ true, sourceFile.scriptKind);
162122
162375
  }
162123
162376
  ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile;
162124
162377
  var NoopCancellationToken = {
@@ -162462,7 +162715,7 @@ var ts;
162462
162715
  // file's script kind, i.e. in one project some file is treated as ".ts"
162463
162716
  // and in another as ".js"
162464
162717
  if (hostFileInformation.scriptKind === oldSourceFile.scriptKind) {
162465
- return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
162718
+ return documentRegistry.updateDocumentWithKey(fileName, path, host, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
162466
162719
  }
162467
162720
  else {
162468
162721
  // Release old source file and fall through to aquire new file with new script kind
@@ -162472,7 +162725,7 @@ var ts;
162472
162725
  // We didn't already have the file. Fall through and acquire it from the registry.
162473
162726
  }
162474
162727
  // Could not find this file in the old program, create a new SourceFile for it.
162475
- return documentRegistry.acquireDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
162728
+ return documentRegistry.acquireDocumentWithKey(fileName, path, host, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);
162476
162729
  }
162477
162730
  }
162478
162731
  // TODO: GH#18217 frequently asserted as defined
@@ -168019,6 +168272,10 @@ var ts;
168019
168272
  this.packageJsonsForAutoImport = new ts.Set(packageJsons.map(function (p) { return p.fileName; }));
168020
168273
  return packageJsons;
168021
168274
  };
168275
+ /* @internal */
168276
+ Project.prototype.getPackageJsonCache = function () {
168277
+ return this.projectService.packageJsonCache;
168278
+ };
168022
168279
  /*@internal*/
168023
168280
  Project.prototype.getCachedExportInfoMap = function () {
168024
168281
  return this.exportMapCache || (this.exportMapCache = ts.createCacheableExportInfoMap(this));