typescript 4.7.0-dev.20220503 → 4.7.0-dev.20220504

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.7";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220503";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220504";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -3405,7 +3405,7 @@ var ts;
3405
3405
  (function (ModuleResolutionKind) {
3406
3406
  ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
3407
3407
  ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
3408
- ModuleResolutionKind[ModuleResolutionKind["Node12"] = 3] = "Node12";
3408
+ ModuleResolutionKind[ModuleResolutionKind["Node16"] = 3] = "Node16";
3409
3409
  ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
3410
3410
  })(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
3411
3411
  var ModuleDetectionKind;
@@ -3448,7 +3448,7 @@ var ts;
3448
3448
  ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
3449
3449
  ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
3450
3450
  ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
3451
- ModuleKind[ModuleKind["Node12"] = 100] = "Node12";
3451
+ ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
3452
3452
  ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
3453
3453
  })(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
3454
3454
  ts.commentPragmas = {
@@ -5442,6 +5442,7 @@ var ts;
5442
5442
  _0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, ts.DiagnosticCategory.Error, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
5443
5443
  with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
5444
5444
  await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
5445
+ The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, ts.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
5445
5446
  Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
5446
5447
  The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, ts.DiagnosticCategory.Error, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."),
5447
5448
  Global_module_exports_may_only_appear_in_module_files: diag(1314, ts.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."),
@@ -5453,8 +5454,8 @@ var ts;
5453
5454
  Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
5454
5455
  Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts.DiagnosticCategory.Error, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
5455
5456
  Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, ts.DiagnosticCategory.Error, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
5456
- Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),
5457
- Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'."),
5457
+ Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),
5458
+ Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),
5458
5459
  Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
5459
5460
  This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
5460
5461
  String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
@@ -5471,7 +5472,7 @@ var ts;
5471
5472
  Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
5472
5473
  Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
5473
5474
  Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
5474
- The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'."),
5475
+ The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
5475
5476
  A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
5476
5477
  An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
5477
5478
  This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
@@ -5502,7 +5503,7 @@ var ts;
5502
5503
  await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
5503
5504
  _0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
5504
5505
  _0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
5505
- Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5506
+ Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5506
5507
  An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
5507
5508
  An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
5508
5509
  Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
@@ -5554,7 +5555,7 @@ var ts;
5554
5555
  File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
5555
5556
  The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
5556
5557
  for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, ts.DiagnosticCategory.Error, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
5557
- Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5558
+ Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5558
5559
  Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."),
5559
5560
  Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
5560
5561
  Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts.DiagnosticCategory.Error, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
@@ -5572,7 +5573,7 @@ var ts;
5572
5573
  Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.Message, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
5573
5574
  Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
5574
5575
  Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
5575
- Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`."),
5576
+ Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`."),
5576
5577
  resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
5577
5578
  resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
5578
5579
  resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
@@ -5583,7 +5584,7 @@ var ts;
5583
5584
  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."),
5584
5585
  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."),
5585
5586
  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."),
5586
- 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."),
5587
+ auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_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: node16+) as modules."),
5587
5588
  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."),
5588
5589
  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."),
5589
5590
  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.", undefined, true),
@@ -6069,8 +6070,8 @@ var ts;
6069
6070
  Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
6070
6071
  Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
6071
6072
  Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
6072
- Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),
6073
- Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
6073
+ Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
6074
+ Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
6074
6075
  Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
6075
6076
  Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
6076
6077
  All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
@@ -6736,7 +6737,6 @@ var ts;
6736
6737
  This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
6737
6738
  This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
6738
6739
  A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
6739
- JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
6740
6740
  You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
6741
6741
  You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
6742
6742
  import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
@@ -11334,7 +11334,7 @@ var ts;
11334
11334
  }
11335
11335
  ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;
11336
11336
  function isCommonJSContainingModuleKind(kind) {
11337
- return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node12 || kind === ts.ModuleKind.NodeNext;
11337
+ return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node16 || kind === ts.ModuleKind.NodeNext;
11338
11338
  }
11339
11339
  function isEffectiveExternalModule(node, compilerOptions) {
11340
11340
  return ts.isExternalModule(node) || compilerOptions.isolatedModules || (isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator);
@@ -15847,7 +15847,7 @@ var ts;
15847
15847
  checks.push(isFileModuleFromUsingJSXTag);
15848
15848
  }
15849
15849
  var moduleKind = getEmitModuleKind(options);
15850
- if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
15850
+ if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
15851
15851
  checks.push(isFileForcedToBeModuleByFormat);
15852
15852
  }
15853
15853
  var combined_1 = ts.or.apply(void 0, checks);
@@ -15858,7 +15858,7 @@ var ts;
15858
15858
  ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
15859
15859
  function getEmitScriptTarget(compilerOptions) {
15860
15860
  return compilerOptions.target ||
15861
- (compilerOptions.module === ts.ModuleKind.Node12 && 7) ||
15861
+ (compilerOptions.module === ts.ModuleKind.Node16 && 9) ||
15862
15862
  (compilerOptions.module === ts.ModuleKind.NodeNext && 99) ||
15863
15863
  0;
15864
15864
  }
@@ -15876,8 +15876,8 @@ var ts;
15876
15876
  case ts.ModuleKind.CommonJS:
15877
15877
  moduleResolution = ts.ModuleResolutionKind.NodeJs;
15878
15878
  break;
15879
- case ts.ModuleKind.Node12:
15880
- moduleResolution = ts.ModuleResolutionKind.Node12;
15879
+ case ts.ModuleKind.Node16:
15880
+ moduleResolution = ts.ModuleResolutionKind.Node16;
15881
15881
  break;
15882
15882
  case ts.ModuleKind.NodeNext:
15883
15883
  moduleResolution = ts.ModuleResolutionKind.NodeNext;
@@ -15902,7 +15902,7 @@ var ts;
15902
15902
  case ts.ModuleKind.ES2020:
15903
15903
  case ts.ModuleKind.ES2022:
15904
15904
  case ts.ModuleKind.ESNext:
15905
- case ts.ModuleKind.Node12:
15905
+ case ts.ModuleKind.Node16:
15906
15906
  case ts.ModuleKind.NodeNext:
15907
15907
  return true;
15908
15908
  default:
@@ -15927,7 +15927,7 @@ var ts;
15927
15927
  return compilerOptions.esModuleInterop;
15928
15928
  }
15929
15929
  switch (getEmitModuleKind(compilerOptions)) {
15930
- case ts.ModuleKind.Node12:
15930
+ case ts.ModuleKind.Node16:
15931
15931
  case ts.ModuleKind.NodeNext:
15932
15932
  return true;
15933
15933
  }
@@ -31786,7 +31786,7 @@ var ts;
31786
31786
  es2020: ts.ModuleKind.ES2020,
31787
31787
  es2022: ts.ModuleKind.ES2022,
31788
31788
  esnext: ts.ModuleKind.ESNext,
31789
- node12: ts.ModuleKind.Node12,
31789
+ node16: ts.ModuleKind.Node16,
31790
31790
  nodenext: ts.ModuleKind.NodeNext,
31791
31791
  })),
31792
31792
  affectsModuleResolution: true,
@@ -32135,7 +32135,7 @@ var ts;
32135
32135
  type: new ts.Map(ts.getEntries({
32136
32136
  node: ts.ModuleResolutionKind.NodeJs,
32137
32137
  classic: ts.ModuleResolutionKind.Classic,
32138
- node12: ts.ModuleResolutionKind.Node12,
32138
+ node16: ts.ModuleResolutionKind.Node16,
32139
32139
  nodenext: ts.ModuleResolutionKind.NodeNext,
32140
32140
  })),
32141
32141
  affectsModuleResolution: true,
@@ -32598,7 +32598,7 @@ var ts;
32598
32598
  affectsModuleResolution: true,
32599
32599
  description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
32600
32600
  category: ts.Diagnostics.Language_and_Environment,
32601
- 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,
32601
+ defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
32602
32602
  }
32603
32603
  ];
32604
32604
  ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
@@ -34544,7 +34544,7 @@ var ts;
34544
34544
  }
34545
34545
  var failedLookupLocations = [];
34546
34546
  var features = getDefaultNodeResolutionFeatures(options);
34547
- if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
34547
+ if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
34548
34548
  features |= NodeResolutionFeatures.EsmMode;
34549
34549
  }
34550
34550
  var conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
@@ -34631,7 +34631,7 @@ var ts;
34631
34631
  }
34632
34632
  ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
34633
34633
  function getDefaultNodeResolutionFeatures(options) {
34634
- return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
34634
+ return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default :
34635
34635
  ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
34636
34636
  NodeResolutionFeatures.None;
34637
34637
  }
@@ -34944,8 +34944,8 @@ var ts;
34944
34944
  case ts.ModuleKind.CommonJS:
34945
34945
  moduleResolution = ts.ModuleResolutionKind.NodeJs;
34946
34946
  break;
34947
- case ts.ModuleKind.Node12:
34948
- moduleResolution = ts.ModuleResolutionKind.Node12;
34947
+ case ts.ModuleKind.Node16:
34948
+ moduleResolution = ts.ModuleResolutionKind.Node16;
34949
34949
  break;
34950
34950
  case ts.ModuleKind.NodeNext:
34951
34951
  moduleResolution = ts.ModuleResolutionKind.NodeNext;
@@ -34965,8 +34965,8 @@ var ts;
34965
34965
  }
34966
34966
  ts.perfLogger.logStartResolveModule(moduleName);
34967
34967
  switch (moduleResolution) {
34968
- case ts.ModuleResolutionKind.Node12:
34969
- result = node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
34968
+ case ts.ModuleResolutionKind.Node16:
34969
+ result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
34970
34970
  break;
34971
34971
  case ts.ModuleResolutionKind.NodeNext:
34972
34972
  result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
@@ -35124,12 +35124,12 @@ var ts;
35124
35124
  NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
35125
35125
  NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
35126
35126
  NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
35127
- NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
35127
+ NodeResolutionFeatures[NodeResolutionFeatures["Node16Default"] = 30] = "Node16Default";
35128
35128
  NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
35129
35129
  NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
35130
35130
  })(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
35131
- function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35132
- return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
35131
+ function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35132
+ return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node16Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
35133
35133
  }
35134
35134
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35135
35135
  return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
@@ -41700,16 +41700,13 @@ var ts;
41700
41700
  if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
41701
41701
  errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference);
41702
41702
  }
41703
- if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
41703
+ if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
41704
41704
  var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
41705
41705
  var overrideClauseHost = ts.findAncestor(location, function (l) { return ts.isImportTypeNode(l) || ts.isExportDeclaration(l) || ts.isImportDeclaration(l); });
41706
41706
  var overrideClause = overrideClauseHost && ts.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause;
41707
41707
  if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext && !ts.getResolutionModeOverrideForClause(overrideClause)) {
41708
41708
  error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
41709
41709
  }
41710
- if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json") {
41711
- error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
41712
- }
41713
41710
  }
41714
41711
  return getMergedSymbol(sourceFile.symbol);
41715
41712
  }
@@ -41753,7 +41750,7 @@ var ts;
41753
41750
  var tsExtension = ts.tryExtractTSExtension(moduleReference);
41754
41751
  var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
41755
41752
  var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
41756
- var resolutionIsNode12OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node12 ||
41753
+ var resolutionIsNode16OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node16 ||
41757
41754
  moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
41758
41755
  if (tsExtension) {
41759
41756
  var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
@@ -41770,17 +41767,17 @@ var ts;
41770
41767
  ts.hasJsonModuleEmitEnabled(compilerOptions)) {
41771
41768
  error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
41772
41769
  }
41773
- else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
41770
+ else if (mode === ts.ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
41774
41771
  var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
41775
41772
  var suggestedExt = (_h = suggestedExtensions.find(function (_a) {
41776
41773
  var actualExt = _a[0], _importExt = _a[1];
41777
41774
  return host.fileExists(absoluteRef_1 + actualExt);
41778
41775
  })) === null || _h === void 0 ? void 0 : _h[1];
41779
41776
  if (suggestedExt) {
41780
- error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
41777
+ error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
41781
41778
  }
41782
41779
  else {
41783
- error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);
41780
+ error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
41784
41781
  }
41785
41782
  }
41786
41783
  else {
@@ -43877,7 +43874,7 @@ var ts;
43877
43874
  var targetFile = ts.getSourceFileOfModule(chain[0]);
43878
43875
  var specifier = void 0;
43879
43876
  var assertion = void 0;
43880
- if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
43877
+ if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
43881
43878
  if ((targetFile === null || targetFile === void 0 ? void 0 : targetFile.impliedNodeFormat) === ts.ModuleKind.ESNext && targetFile.impliedNodeFormat !== (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat)) {
43882
43879
  specifier = getSpecifierForModuleSymbol(chain[0], context, ts.ModuleKind.ESNext);
43883
43880
  assertion = ts.factory.createImportTypeAssertionContainer(ts.factory.createAssertClause(ts.factory.createNodeArray([
@@ -43890,7 +43887,7 @@ var ts;
43890
43887
  }
43891
43888
  if (!(context.flags & 67108864) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
43892
43889
  var oldSpecifier = specifier;
43893
- if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
43890
+ if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
43894
43891
  var swappedMode = (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat) === ts.ModuleKind.ESNext ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
43895
43892
  specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
43896
43893
  if (specifier.indexOf("/node_modules/") >= 0) {
@@ -59440,7 +59437,7 @@ var ts;
59440
59437
  if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
59441
59438
  var parent = declaration.parent.parent;
59442
59439
  if (parent.kind === 254 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 164) {
59443
- var links = getNodeLinks(location);
59440
+ var links = getNodeLinks(parent);
59444
59441
  if (!(links.flags & 268435456)) {
59445
59442
  links.flags |= 268435456;
59446
59443
  var parentType = getTypeForBindingElementParent(parent, 0);
@@ -64409,13 +64406,13 @@ var ts;
64409
64406
  }
64410
64407
  }
64411
64408
  function checkImportMetaProperty(node) {
64412
- if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
64409
+ if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
64413
64410
  if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
64414
64411
  error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
64415
64412
  }
64416
64413
  }
64417
64414
  else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
64418
- error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);
64415
+ error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
64419
64416
  }
64420
64417
  var file = ts.getSourceFileOfNode(node);
64421
64418
  ts.Debug.assert(!!(file.flags & 4194304), "Containing file is missing import meta node flag.");
@@ -65247,15 +65244,28 @@ var ts;
65247
65244
  if (!hasParseDiagnostics(sourceFile)) {
65248
65245
  var span = void 0;
65249
65246
  if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
65250
- if (!span)
65251
- span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
65247
+ span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
65252
65248
  var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module);
65253
65249
  diagnostics.add(diagnostic);
65254
65250
  }
65255
- if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
65256
- span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
65257
- var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher);
65258
- diagnostics.add(diagnostic);
65251
+ switch (moduleKind) {
65252
+ case ts.ModuleKind.Node16:
65253
+ case ts.ModuleKind.NodeNext:
65254
+ if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
65255
+ span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
65256
+ diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
65257
+ break;
65258
+ }
65259
+ case ts.ModuleKind.ES2022:
65260
+ case ts.ModuleKind.ESNext:
65261
+ case ts.ModuleKind.System:
65262
+ if (languageVersion >= 4) {
65263
+ break;
65264
+ }
65265
+ default:
65266
+ span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
65267
+ diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
65268
+ break;
65259
65269
  }
65260
65270
  }
65261
65271
  }
@@ -67456,8 +67466,8 @@ var ts;
67456
67466
  if (node.assertions) {
67457
67467
  var override = ts.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
67458
67468
  if (override) {
67459
- if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
67460
- grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext);
67469
+ if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
67470
+ grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
67461
67471
  }
67462
67472
  }
67463
67473
  }
@@ -68626,7 +68636,7 @@ var ts;
68626
68636
  });
68627
68637
  }
68628
68638
  function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
68629
- if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node12 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
68639
+ if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
68630
68640
  return;
68631
68641
  }
68632
68642
  if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
@@ -71076,8 +71086,8 @@ var ts;
71076
71086
  var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
71077
71087
  var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
71078
71088
  if (validForTypeAssertions && override) {
71079
- if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
71080
- return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext);
71089
+ if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
71090
+ return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
71081
71091
  }
71082
71092
  return;
71083
71093
  }
@@ -73969,8 +73979,22 @@ var ts;
73969
73979
  if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
73970
73980
  diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module));
73971
73981
  }
73972
- if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
73973
- diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
73982
+ switch (moduleKind) {
73983
+ case ts.ModuleKind.Node16:
73984
+ case ts.ModuleKind.NodeNext:
73985
+ if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
73986
+ diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
73987
+ break;
73988
+ }
73989
+ case ts.ModuleKind.ES2022:
73990
+ case ts.ModuleKind.ESNext:
73991
+ case ts.ModuleKind.System:
73992
+ if (languageVersion >= 4) {
73993
+ break;
73994
+ }
73995
+ default:
73996
+ diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
73997
+ break;
73974
73998
  }
73975
73999
  }
73976
74000
  }
@@ -74602,7 +74626,7 @@ var ts;
74602
74626
  }
74603
74627
  function checkGrammarImportCallExpression(node) {
74604
74628
  if (moduleKind === ts.ModuleKind.ES2015) {
74605
- return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);
74629
+ return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
74606
74630
  }
74607
74631
  if (node.typeArguments) {
74608
74632
  return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
@@ -74612,7 +74636,7 @@ var ts;
74612
74636
  checkGrammarForDisallowedTrailingComma(nodeArguments);
74613
74637
  if (nodeArguments.length > 1) {
74614
74638
  var assertionArgument = nodeArguments[1];
74615
- return grammarErrorOnNode(assertionArgument, ts.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext);
74639
+ return grammarErrorOnNode(assertionArgument, ts.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
74616
74640
  }
74617
74641
  }
74618
74642
  if (nodeArguments.length === 0 || nodeArguments.length > 2) {
@@ -89386,7 +89410,7 @@ var ts;
89386
89410
  return ts.transformECMAScriptModule;
89387
89411
  case ts.ModuleKind.System:
89388
89412
  return ts.transformSystemModule;
89389
- case ts.ModuleKind.Node12:
89413
+ case ts.ModuleKind.Node16:
89390
89414
  case ts.ModuleKind.NodeNext:
89391
89415
  return ts.transformNodeModule;
89392
89416
  default:
@@ -95709,7 +95733,7 @@ var ts;
95709
95733
  ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
95710
95734
  function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) {
95711
95735
  switch (ts.getEmitModuleResolutionKind(options)) {
95712
- case ts.ModuleResolutionKind.Node12:
95736
+ case ts.ModuleResolutionKind.Node16:
95713
95737
  case ts.ModuleResolutionKind.NodeNext:
95714
95738
  return ts.fileExtensionIsOneOf(fileName, [".d.mts", ".mts", ".mjs"]) ? ts.ModuleKind.ESNext :
95715
95739
  ts.fileExtensionIsOneOf(fileName, [".d.cts", ".cts", ".cjs"]) ? ts.ModuleKind.CommonJS :
@@ -97398,8 +97422,8 @@ var ts;
97398
97422
  var fileName = ts.toFileNameLowerCase(ref.fileName);
97399
97423
  ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
97400
97424
  var mode = ref.resolutionMode || file.impliedNodeFormat;
97401
- if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
97402
- programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext));
97425
+ if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
97426
+ programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext));
97403
97427
  }
97404
97428
  processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
97405
97429
  }
@@ -97732,7 +97756,7 @@ var ts;
97732
97756
  }
97733
97757
  if (options.resolveJsonModule) {
97734
97758
  if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
97735
- ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 &&
97759
+ ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 &&
97736
97760
  ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
97737
97761
  createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
97738
97762
  }
@@ -100405,7 +100429,7 @@ var ts;
100405
100429
  }
100406
100430
  function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
100407
100431
  var _a;
100408
- if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
100432
+ if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16
100409
100433
  && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
100410
100434
  return false;
100411
100435
  }
@@ -100901,7 +100925,7 @@ var ts;
100901
100925
  var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
100902
100926
  if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
100903
100927
  var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
100904
- if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
100928
+ if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
100905
100929
  var conditions = ["node", overrideMode || importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
100906
100930
  var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
100907
100931
  ? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)