typescript 5.3.0-dev.20230925 → 5.3.0-dev.20230927
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es5.d.ts +9 -1
- package/lib/tsc.js +377 -300
- package/lib/tsserver.js +431 -338
- package/lib/typescript.d.ts +51 -29
- package/lib/typescript.js +425 -335
- package/lib/typingsInstaller.js +165 -109
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230927`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3802,8 +3802,10 @@ ${lanes.join("\n")}
|
|
|
3802
3802
|
SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause";
|
|
3803
3803
|
SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause";
|
|
3804
3804
|
SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause";
|
|
3805
|
-
SyntaxKind5[SyntaxKind5["
|
|
3806
|
-
SyntaxKind5[SyntaxKind5["
|
|
3805
|
+
SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes";
|
|
3806
|
+
SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute";
|
|
3807
|
+
SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
3808
|
+
SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
3807
3809
|
SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
|
|
3808
3810
|
SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
3809
3811
|
SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
@@ -5102,7 +5104,8 @@ ${lanes.join("\n")}
|
|
|
5102
5104
|
ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
|
|
5103
5105
|
ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
|
|
5104
5106
|
ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
|
|
5105
|
-
ListFormat2[ListFormat2["
|
|
5107
|
+
ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes";
|
|
5108
|
+
ListFormat2[ListFormat2["ImportClauseEntries"] = 526226 /* ImportAttributes */] = "ImportClauseEntries";
|
|
5106
5109
|
ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
|
|
5107
5110
|
ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements";
|
|
5108
5111
|
ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
|
|
@@ -7363,9 +7366,8 @@ ${lanes.join("\n")}
|
|
|
7363
7366
|
_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),
|
|
7364
7367
|
_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),
|
|
7365
7368
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* 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."),
|
|
7366
|
-
|
|
7369
|
+
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),
|
|
7367
7370
|
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, 1 /* 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"),
|
|
7368
|
-
resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
7369
7371
|
resolution_mode_should_be_either_require_or_import: diag(1453, 1 /* Error */, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
7370
7372
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, 1 /* Error */, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
7371
7373
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -7375,6 +7377,8 @@ ${lanes.join("\n")}
|
|
|
7375
7377
|
File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3 /* Message */, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`),
|
|
7376
7378
|
File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3 /* Message */, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`),
|
|
7377
7379
|
File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, 3 /* Message */, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"),
|
|
7380
|
+
resolution_mode_is_the_only_valid_key_for_type_import_attributes: diag(1463, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463", "'resolution-mode' is the only valid key for type import attributes."),
|
|
7381
|
+
Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1 /* Error */, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),
|
|
7378
7382
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* Error */, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
7379
7383
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, 1 /* Error */, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),
|
|
7380
7384
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -7401,6 +7405,7 @@ ${lanes.join("\n")}
|
|
|
7401
7405
|
The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
|
|
7402
7406
|
The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
|
|
7403
7407
|
_0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
|
|
7408
|
+
Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."),
|
|
7404
7409
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
7405
7410
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
7406
7411
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -7930,15 +7935,15 @@ ${lanes.join("\n")}
|
|
|
7930
7935
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
7931
7936
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* 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'."),
|
|
7932
7937
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
7938
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
7933
7939
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
7934
7940
|
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, 1 /* 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."),
|
|
7935
7941
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* 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}'?"),
|
|
7936
|
-
|
|
7942
|
+
Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2836, 1 /* Error */, "Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836", "Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
7937
7943
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1 /* Error */, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
7938
7944
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
7939
7945
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
7940
7946
|
An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
|
|
7941
|
-
The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
7942
7947
|
_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
|
|
7943
7948
|
We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
|
|
7944
7949
|
Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
@@ -7952,6 +7957,10 @@ ${lanes.join("\n")}
|
|
|
7952
7957
|
await_using_statements_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(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements 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."),
|
|
7953
7958
|
Top_level_await_using_statements_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(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements 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."),
|
|
7954
7959
|
Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
|
|
7960
|
+
Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
7961
|
+
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
|
|
7962
|
+
Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
|
|
7963
|
+
Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
|
|
7955
7964
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
7956
7965
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
7957
7966
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -8060,7 +8069,6 @@ ${lanes.join("\n")}
|
|
|
8060
8069
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
8061
8070
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8062
8071
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
8063
|
-
resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, 1 /* Error */, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
8064
8072
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
8065
8073
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
8066
8074
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -12142,12 +12150,12 @@ ${lanes.join("\n")}
|
|
|
12142
12150
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
12143
12151
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
12144
12152
|
}
|
|
12145
|
-
function isAssertionKey(node) {
|
|
12146
|
-
return isStringLiteral(node) || isIdentifier(node);
|
|
12147
|
-
}
|
|
12148
12153
|
function isStringTextContainingNode(node) {
|
|
12149
12154
|
return node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
12150
12155
|
}
|
|
12156
|
+
function isImportAttributeName(node) {
|
|
12157
|
+
return isStringLiteral(node) || isIdentifier(node);
|
|
12158
|
+
}
|
|
12151
12159
|
function isGeneratedIdentifier(node) {
|
|
12152
12160
|
var _a;
|
|
12153
12161
|
return isIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0;
|
|
@@ -12396,6 +12404,9 @@ ${lanes.join("\n")}
|
|
|
12396
12404
|
const kind = node.kind;
|
|
12397
12405
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
|
|
12398
12406
|
}
|
|
12407
|
+
function isCallLikeOrFunctionLikeExpression(node) {
|
|
12408
|
+
return isCallLikeExpression(node) || isFunctionLike(node);
|
|
12409
|
+
}
|
|
12399
12410
|
function isCallLikeExpression(node) {
|
|
12400
12411
|
switch (node.kind) {
|
|
12401
12412
|
case 286 /* JsxOpeningElement */:
|
|
@@ -16014,9 +16025,6 @@ ${lanes.join("\n")}
|
|
|
16014
16025
|
function getIndentSize() {
|
|
16015
16026
|
return indentStrings[1].length;
|
|
16016
16027
|
}
|
|
16017
|
-
function isNightly() {
|
|
16018
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
16019
|
-
}
|
|
16020
16028
|
function createTextWriter(newLine) {
|
|
16021
16029
|
var output;
|
|
16022
16030
|
var indent3;
|
|
@@ -17913,7 +17921,7 @@ ${lanes.join("\n")}
|
|
|
17913
17921
|
if (!containsIgnoredPath(symlinkPath)) {
|
|
17914
17922
|
symlinkPath = ensureTrailingDirectorySeparator(symlinkPath);
|
|
17915
17923
|
if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) {
|
|
17916
|
-
(symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(
|
|
17924
|
+
(symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink);
|
|
17917
17925
|
}
|
|
17918
17926
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
17919
17927
|
}
|
|
@@ -17936,7 +17944,10 @@ ${lanes.join("\n")}
|
|
|
17936
17944
|
if (commonResolved && commonOriginal) {
|
|
17937
17945
|
cache.setSymlinkedDirectory(
|
|
17938
17946
|
commonOriginal,
|
|
17939
|
-
{
|
|
17947
|
+
{
|
|
17948
|
+
real: ensureTrailingDirectorySeparator(commonResolved),
|
|
17949
|
+
realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName))
|
|
17950
|
+
}
|
|
17940
17951
|
);
|
|
17941
17952
|
}
|
|
17942
17953
|
}
|
|
@@ -18881,6 +18892,12 @@ ${lanes.join("\n")}
|
|
|
18881
18892
|
function isExpandoPropertyDeclaration(declaration) {
|
|
18882
18893
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
18883
18894
|
}
|
|
18895
|
+
function hasResolutionModeOverride(node) {
|
|
18896
|
+
if (node === void 0) {
|
|
18897
|
+
return false;
|
|
18898
|
+
}
|
|
18899
|
+
return !!getResolutionModeOverride(node.attributes);
|
|
18900
|
+
}
|
|
18884
18901
|
var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
|
|
18885
18902
|
var init_utilities = __esm({
|
|
18886
18903
|
"src/compiler/utilities.ts"() {
|
|
@@ -20350,6 +20367,10 @@ ${lanes.join("\n")}
|
|
|
20350
20367
|
updateAssertEntry,
|
|
20351
20368
|
createImportTypeAssertionContainer,
|
|
20352
20369
|
updateImportTypeAssertionContainer,
|
|
20370
|
+
createImportAttributes,
|
|
20371
|
+
updateImportAttributes,
|
|
20372
|
+
createImportAttribute,
|
|
20373
|
+
updateImportAttribute,
|
|
20353
20374
|
createNamespaceImport,
|
|
20354
20375
|
updateNamespaceImport,
|
|
20355
20376
|
createNamespaceExport,
|
|
@@ -21618,18 +21639,21 @@ ${lanes.join("\n")}
|
|
|
21618
21639
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
21619
21640
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
21620
21641
|
}
|
|
21621
|
-
function createImportTypeNode(argument,
|
|
21642
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
21622
21643
|
const node = createBaseNode(205 /* ImportType */);
|
|
21623
21644
|
node.argument = argument;
|
|
21624
|
-
node.
|
|
21645
|
+
node.attributes = attributes;
|
|
21646
|
+
if (node.assertions && node.assertions.assertClause && node.attributes) {
|
|
21647
|
+
node.assertions.assertClause = node.attributes;
|
|
21648
|
+
}
|
|
21625
21649
|
node.qualifier = qualifier;
|
|
21626
21650
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
21627
21651
|
node.isTypeOf = isTypeOf;
|
|
21628
21652
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
21629
21653
|
return node;
|
|
21630
21654
|
}
|
|
21631
|
-
function updateImportTypeNode(node, argument,
|
|
21632
|
-
return node.argument !== argument || node.
|
|
21655
|
+
function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
21656
|
+
return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node;
|
|
21633
21657
|
}
|
|
21634
21658
|
function createParenthesizedType(type) {
|
|
21635
21659
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -22759,19 +22783,19 @@ ${lanes.join("\n")}
|
|
|
22759
22783
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
22760
22784
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
22761
22785
|
}
|
|
22762
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
22786
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
22763
22787
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
22764
22788
|
node.modifiers = asNodeArray(modifiers);
|
|
22765
22789
|
node.importClause = importClause;
|
|
22766
22790
|
node.moduleSpecifier = moduleSpecifier;
|
|
22767
|
-
node.assertClause =
|
|
22791
|
+
node.attributes = node.assertClause = attributes;
|
|
22768
22792
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
22769
22793
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
22770
22794
|
node.jsDoc = void 0;
|
|
22771
22795
|
return node;
|
|
22772
22796
|
}
|
|
22773
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
22774
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
22797
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
|
|
22798
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
|
|
22775
22799
|
}
|
|
22776
22800
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
22777
22801
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -22792,6 +22816,7 @@ ${lanes.join("\n")}
|
|
|
22792
22816
|
const node = createBaseNode(300 /* AssertClause */);
|
|
22793
22817
|
node.elements = createNodeArray(elements);
|
|
22794
22818
|
node.multiLine = multiLine;
|
|
22819
|
+
node.token = 132 /* AssertKeyword */;
|
|
22795
22820
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
22796
22821
|
return node;
|
|
22797
22822
|
}
|
|
@@ -22817,6 +22842,27 @@ ${lanes.join("\n")}
|
|
|
22817
22842
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
22818
22843
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
22819
22844
|
}
|
|
22845
|
+
function createImportAttributes(elements, multiLine, token) {
|
|
22846
|
+
const node = createBaseNode(300 /* ImportAttributes */);
|
|
22847
|
+
node.token = token ?? 118 /* WithKeyword */;
|
|
22848
|
+
node.elements = createNodeArray(elements);
|
|
22849
|
+
node.multiLine = multiLine;
|
|
22850
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
22851
|
+
return node;
|
|
22852
|
+
}
|
|
22853
|
+
function updateImportAttributes(node, elements, multiLine) {
|
|
22854
|
+
return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
|
|
22855
|
+
}
|
|
22856
|
+
function createImportAttribute(name, value) {
|
|
22857
|
+
const node = createBaseNode(301 /* ImportAttribute */);
|
|
22858
|
+
node.name = name;
|
|
22859
|
+
node.value = value;
|
|
22860
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
22861
|
+
return node;
|
|
22862
|
+
}
|
|
22863
|
+
function updateImportAttribute(node, name, value) {
|
|
22864
|
+
return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
|
|
22865
|
+
}
|
|
22820
22866
|
function createNamespaceImport(name) {
|
|
22821
22867
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
22822
22868
|
node.name = name;
|
|
@@ -22877,20 +22923,20 @@ ${lanes.join("\n")}
|
|
|
22877
22923
|
function updateExportAssignment(node, modifiers, expression) {
|
|
22878
22924
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node;
|
|
22879
22925
|
}
|
|
22880
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
22926
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
22881
22927
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
22882
22928
|
node.modifiers = asNodeArray(modifiers);
|
|
22883
22929
|
node.isTypeOnly = isTypeOnly;
|
|
22884
22930
|
node.exportClause = exportClause;
|
|
22885
22931
|
node.moduleSpecifier = moduleSpecifier;
|
|
22886
|
-
node.assertClause =
|
|
22932
|
+
node.attributes = node.assertClause = attributes;
|
|
22887
22933
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
22888
22934
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
22889
22935
|
node.jsDoc = void 0;
|
|
22890
22936
|
return node;
|
|
22891
22937
|
}
|
|
22892
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
22893
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
22938
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
22939
|
+
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node;
|
|
22894
22940
|
}
|
|
22895
22941
|
function finishUpdateExportDeclaration(updated, original) {
|
|
22896
22942
|
if (updated !== original) {
|
|
@@ -24217,7 +24263,7 @@ ${lanes.join("\n")}
|
|
|
24217
24263
|
} else {
|
|
24218
24264
|
modifierArray = modifiers;
|
|
24219
24265
|
}
|
|
24220
|
-
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.
|
|
24266
|
+
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node);
|
|
24221
24267
|
}
|
|
24222
24268
|
function updateModifierLike(node, modifierArray) {
|
|
24223
24269
|
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
@@ -26593,6 +26639,12 @@ ${lanes.join("\n")}
|
|
|
26593
26639
|
function isAssertEntry(node) {
|
|
26594
26640
|
return node.kind === 301 /* AssertEntry */;
|
|
26595
26641
|
}
|
|
26642
|
+
function isImportAttributes(node) {
|
|
26643
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
26644
|
+
}
|
|
26645
|
+
function isImportAttribute(node) {
|
|
26646
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
26647
|
+
}
|
|
26596
26648
|
function isNamespaceImport(node) {
|
|
26597
26649
|
return node.kind === 274 /* NamespaceImport */;
|
|
26598
26650
|
}
|
|
@@ -27320,7 +27372,7 @@ ${lanes.join("\n")}
|
|
|
27320
27372
|
namedBindings
|
|
27321
27373
|
),
|
|
27322
27374
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
27323
|
-
/*
|
|
27375
|
+
/*attributes*/
|
|
27324
27376
|
void 0
|
|
27325
27377
|
);
|
|
27326
27378
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -28497,7 +28549,7 @@ ${lanes.join("\n")}
|
|
|
28497
28549
|
return visitNode2(cbNode, node.typeParameter);
|
|
28498
28550
|
},
|
|
28499
28551
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
28500
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
28552
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
28501
28553
|
},
|
|
28502
28554
|
[302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
|
|
28503
28555
|
return visitNode2(cbNode, node.assertClause);
|
|
@@ -28671,15 +28723,15 @@ ${lanes.join("\n")}
|
|
|
28671
28723
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
28672
28724
|
},
|
|
28673
28725
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
28674
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
28726
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
28675
28727
|
},
|
|
28676
28728
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
28677
28729
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
28678
28730
|
},
|
|
28679
|
-
[300 /*
|
|
28731
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
28680
28732
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
28681
28733
|
},
|
|
28682
|
-
[301 /*
|
|
28734
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
28683
28735
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
28684
28736
|
},
|
|
28685
28737
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -28694,7 +28746,7 @@ ${lanes.join("\n")}
|
|
|
28694
28746
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
28695
28747
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
28696
28748
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
28697
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
28749
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
28698
28750
|
},
|
|
28699
28751
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
28700
28752
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -29788,7 +29840,7 @@ ${lanes.join("\n")}
|
|
|
29788
29840
|
function isLiteralPropertyName() {
|
|
29789
29841
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
29790
29842
|
}
|
|
29791
|
-
function
|
|
29843
|
+
function isImportAttributeName2() {
|
|
29792
29844
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
29793
29845
|
}
|
|
29794
29846
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -29907,8 +29959,8 @@ ${lanes.join("\n")}
|
|
|
29907
29959
|
return isLiteralPropertyName();
|
|
29908
29960
|
case 9 /* ObjectBindingElements */:
|
|
29909
29961
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
29910
|
-
case 24 /*
|
|
29911
|
-
return
|
|
29962
|
+
case 24 /* ImportAttributes */:
|
|
29963
|
+
return isImportAttributeName2();
|
|
29912
29964
|
case 7 /* HeritageClauseElement */:
|
|
29913
29965
|
if (token() === 19 /* OpenBraceToken */) {
|
|
29914
29966
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -30011,7 +30063,7 @@ ${lanes.join("\n")}
|
|
|
30011
30063
|
case 12 /* ObjectLiteralMembers */:
|
|
30012
30064
|
case 9 /* ObjectBindingElements */:
|
|
30013
30065
|
case 23 /* ImportOrExportSpecifiers */:
|
|
30014
|
-
case 24 /*
|
|
30066
|
+
case 24 /* ImportAttributes */:
|
|
30015
30067
|
return token() === 20 /* CloseBraceToken */;
|
|
30016
30068
|
case 3 /* SwitchClauseStatements */:
|
|
30017
30069
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -30317,7 +30369,7 @@ ${lanes.join("\n")}
|
|
|
30317
30369
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30318
30370
|
case 14 /* JsxChildren */:
|
|
30319
30371
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30320
|
-
case 24 /*
|
|
30372
|
+
case 24 /* ImportAttributes */:
|
|
30321
30373
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
30322
30374
|
case 25 /* JSDocComment */:
|
|
30323
30375
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -31192,28 +31244,6 @@ ${lanes.join("\n")}
|
|
|
31192
31244
|
nextToken();
|
|
31193
31245
|
return token() === 102 /* ImportKeyword */;
|
|
31194
31246
|
}
|
|
31195
|
-
function parseImportTypeAssertions() {
|
|
31196
|
-
const pos = getNodePos();
|
|
31197
|
-
const openBracePosition = scanner2.getTokenStart();
|
|
31198
|
-
parseExpected(19 /* OpenBraceToken */);
|
|
31199
|
-
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
31200
|
-
parseExpected(132 /* AssertKeyword */);
|
|
31201
|
-
parseExpected(59 /* ColonToken */);
|
|
31202
|
-
const clause = parseAssertClause(
|
|
31203
|
-
/*skipAssertKeyword*/
|
|
31204
|
-
true
|
|
31205
|
-
);
|
|
31206
|
-
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
31207
|
-
const lastError = lastOrUndefined(parseDiagnostics);
|
|
31208
|
-
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
31209
|
-
addRelatedInfo(
|
|
31210
|
-
lastError,
|
|
31211
|
-
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
31212
|
-
);
|
|
31213
|
-
}
|
|
31214
|
-
}
|
|
31215
|
-
return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
31216
|
-
}
|
|
31217
31247
|
function parseImportType() {
|
|
31218
31248
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
31219
31249
|
const pos = getNodePos();
|
|
@@ -31221,14 +31251,36 @@ ${lanes.join("\n")}
|
|
|
31221
31251
|
parseExpected(102 /* ImportKeyword */);
|
|
31222
31252
|
parseExpected(21 /* OpenParenToken */);
|
|
31223
31253
|
const type = parseType();
|
|
31224
|
-
let
|
|
31254
|
+
let attributes;
|
|
31225
31255
|
if (parseOptional(28 /* CommaToken */)) {
|
|
31226
|
-
|
|
31256
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
31257
|
+
parseExpected(19 /* OpenBraceToken */);
|
|
31258
|
+
const currentToken2 = token();
|
|
31259
|
+
if (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) {
|
|
31260
|
+
nextToken();
|
|
31261
|
+
} else {
|
|
31262
|
+
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
31263
|
+
}
|
|
31264
|
+
parseExpected(59 /* ColonToken */);
|
|
31265
|
+
attributes = parseImportAttributes(
|
|
31266
|
+
currentToken2,
|
|
31267
|
+
/*skipKeyword*/
|
|
31268
|
+
true
|
|
31269
|
+
);
|
|
31270
|
+
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
31271
|
+
const lastError = lastOrUndefined(parseDiagnostics);
|
|
31272
|
+
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
31273
|
+
addRelatedInfo(
|
|
31274
|
+
lastError,
|
|
31275
|
+
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
31276
|
+
);
|
|
31277
|
+
}
|
|
31278
|
+
}
|
|
31227
31279
|
}
|
|
31228
31280
|
parseExpected(22 /* CloseParenToken */);
|
|
31229
31281
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
31230
31282
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
31231
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
31283
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
31232
31284
|
}
|
|
31233
31285
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
31234
31286
|
nextToken();
|
|
@@ -34290,15 +34342,16 @@ ${lanes.join("\n")}
|
|
|
34290
34342
|
parseExpected(161 /* FromKeyword */);
|
|
34291
34343
|
}
|
|
34292
34344
|
const moduleSpecifier = parseModuleSpecifier();
|
|
34293
|
-
|
|
34294
|
-
|
|
34295
|
-
|
|
34345
|
+
const currentToken2 = token();
|
|
34346
|
+
let attributes;
|
|
34347
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
34348
|
+
attributes = parseImportAttributes(currentToken2);
|
|
34296
34349
|
}
|
|
34297
34350
|
parseSemicolon();
|
|
34298
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
34351
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
34299
34352
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34300
34353
|
}
|
|
34301
|
-
function
|
|
34354
|
+
function parseImportAttribute() {
|
|
34302
34355
|
const pos = getNodePos();
|
|
34303
34356
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
34304
34357
|
parseExpected(59 /* ColonToken */);
|
|
@@ -34306,19 +34359,19 @@ ${lanes.join("\n")}
|
|
|
34306
34359
|
/*allowReturnTypeInArrowFunction*/
|
|
34307
34360
|
true
|
|
34308
34361
|
);
|
|
34309
|
-
return finishNode(factory2.
|
|
34362
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
34310
34363
|
}
|
|
34311
|
-
function
|
|
34364
|
+
function parseImportAttributes(token2, skipKeyword) {
|
|
34312
34365
|
const pos = getNodePos();
|
|
34313
|
-
if (!
|
|
34314
|
-
parseExpected(
|
|
34366
|
+
if (!skipKeyword) {
|
|
34367
|
+
parseExpected(token2);
|
|
34315
34368
|
}
|
|
34316
34369
|
const openBracePosition = scanner2.getTokenStart();
|
|
34317
34370
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
34318
34371
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
34319
34372
|
const elements = parseDelimitedList(
|
|
34320
|
-
24 /*
|
|
34321
|
-
|
|
34373
|
+
24 /* ImportAttributes */,
|
|
34374
|
+
parseImportAttribute,
|
|
34322
34375
|
/*considerSemicolonAsDelimiter*/
|
|
34323
34376
|
true
|
|
34324
34377
|
);
|
|
@@ -34331,7 +34384,7 @@ ${lanes.join("\n")}
|
|
|
34331
34384
|
);
|
|
34332
34385
|
}
|
|
34333
34386
|
}
|
|
34334
|
-
return finishNode(factory2.
|
|
34387
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
34335
34388
|
} else {
|
|
34336
34389
|
const elements = createNodeArray(
|
|
34337
34390
|
[],
|
|
@@ -34341,10 +34394,11 @@ ${lanes.join("\n")}
|
|
|
34341
34394
|
/*hasTrailingComma*/
|
|
34342
34395
|
false
|
|
34343
34396
|
);
|
|
34344
|
-
return finishNode(factory2.
|
|
34397
|
+
return finishNode(factory2.createImportAttributes(
|
|
34345
34398
|
elements,
|
|
34346
34399
|
/*multiLine*/
|
|
34347
|
-
false
|
|
34400
|
+
false,
|
|
34401
|
+
token2
|
|
34348
34402
|
), pos);
|
|
34349
34403
|
}
|
|
34350
34404
|
}
|
|
@@ -34476,7 +34530,7 @@ ${lanes.join("\n")}
|
|
|
34476
34530
|
);
|
|
34477
34531
|
let exportClause;
|
|
34478
34532
|
let moduleSpecifier;
|
|
34479
|
-
let
|
|
34533
|
+
let attributes;
|
|
34480
34534
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
34481
34535
|
const namespaceExportPos = getNodePos();
|
|
34482
34536
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -34492,12 +34546,13 @@ ${lanes.join("\n")}
|
|
|
34492
34546
|
moduleSpecifier = parseModuleSpecifier();
|
|
34493
34547
|
}
|
|
34494
34548
|
}
|
|
34495
|
-
|
|
34496
|
-
|
|
34549
|
+
const currentToken2 = token();
|
|
34550
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
34551
|
+
attributes = parseImportAttributes(currentToken2);
|
|
34497
34552
|
}
|
|
34498
34553
|
parseSemicolon();
|
|
34499
34554
|
setAwaitContext(savedAwaitContext);
|
|
34500
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
34555
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
34501
34556
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34502
34557
|
}
|
|
34503
34558
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -34547,7 +34602,7 @@ ${lanes.join("\n")}
|
|
|
34547
34602
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
34548
34603
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
34549
34604
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
34550
|
-
ParsingContext2[ParsingContext2["
|
|
34605
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
34551
34606
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
34552
34607
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
34553
34608
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -39401,10 +39456,15 @@ ${lanes.join("\n")}
|
|
|
39401
39456
|
const failedLookupLocations = [];
|
|
39402
39457
|
const affectingLocations = [];
|
|
39403
39458
|
let features = getNodeResolutionFeatures(options);
|
|
39404
|
-
if (resolutionMode
|
|
39459
|
+
if (resolutionMode !== void 0) {
|
|
39460
|
+
features |= 30 /* AllFeatures */;
|
|
39461
|
+
}
|
|
39462
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
39463
|
+
if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
|
|
39405
39464
|
features |= 32 /* EsmMode */;
|
|
39406
39465
|
}
|
|
39407
|
-
const
|
|
39466
|
+
const useImportCondition = resolutionMode === 99 /* ESNext */ || (resolutionMode !== void 0 ? false : void 0);
|
|
39467
|
+
const conditions = features & 8 /* Exports */ ? getConditions(options, useImportCondition) : [];
|
|
39408
39468
|
const diagnostics = [];
|
|
39409
39469
|
const moduleResolutionState = {
|
|
39410
39470
|
compilerOptions: options,
|
|
@@ -39573,11 +39633,19 @@ ${lanes.join("\n")}
|
|
|
39573
39633
|
return features;
|
|
39574
39634
|
}
|
|
39575
39635
|
function getConditions(options, esmMode) {
|
|
39576
|
-
const
|
|
39636
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
39637
|
+
if (esmMode === void 0) {
|
|
39638
|
+
if (moduleResolution === 100 /* Bundler */) {
|
|
39639
|
+
esmMode ?? (esmMode = moduleResolution === 100 /* Bundler */);
|
|
39640
|
+
} else if (moduleResolution === 2 /* Node10 */) {
|
|
39641
|
+
return [];
|
|
39642
|
+
}
|
|
39643
|
+
}
|
|
39644
|
+
const conditions = esmMode ? ["import"] : ["require"];
|
|
39577
39645
|
if (!options.noDtsResolution) {
|
|
39578
39646
|
conditions.push("types");
|
|
39579
39647
|
}
|
|
39580
|
-
if (
|
|
39648
|
+
if (moduleResolution !== 100 /* Bundler */) {
|
|
39581
39649
|
conditions.push("node");
|
|
39582
39650
|
}
|
|
39583
39651
|
return concatenate(conditions, options.customConditions);
|
|
@@ -40020,13 +40088,13 @@ ${lanes.join("\n")}
|
|
|
40020
40088
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
40021
40089
|
break;
|
|
40022
40090
|
case 2 /* Node10 */:
|
|
40023
|
-
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
40091
|
+
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
40024
40092
|
break;
|
|
40025
40093
|
case 1 /* Classic */:
|
|
40026
40094
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
40027
40095
|
break;
|
|
40028
40096
|
case 100 /* Bundler */:
|
|
40029
|
-
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
40097
|
+
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
40030
40098
|
break;
|
|
40031
40099
|
default:
|
|
40032
40100
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
@@ -40191,7 +40259,7 @@ ${lanes.join("\n")}
|
|
|
40191
40259
|
resolutionMode
|
|
40192
40260
|
);
|
|
40193
40261
|
}
|
|
40194
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
40262
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) {
|
|
40195
40263
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
40196
40264
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
40197
40265
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
@@ -40208,7 +40276,8 @@ ${lanes.join("\n")}
|
|
|
40208
40276
|
extensions,
|
|
40209
40277
|
/*isConfigLookup*/
|
|
40210
40278
|
false,
|
|
40211
|
-
redirectedReference
|
|
40279
|
+
redirectedReference,
|
|
40280
|
+
conditions
|
|
40212
40281
|
);
|
|
40213
40282
|
}
|
|
40214
40283
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
@@ -40224,10 +40293,12 @@ ${lanes.join("\n")}
|
|
|
40224
40293
|
/*isConfigLookup*/
|
|
40225
40294
|
false,
|
|
40226
40295
|
/*redirectedReference*/
|
|
40296
|
+
void 0,
|
|
40297
|
+
/*conditions*/
|
|
40227
40298
|
void 0
|
|
40228
40299
|
);
|
|
40229
40300
|
}
|
|
40230
|
-
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
40301
|
+
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions) {
|
|
40231
40302
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
40232
40303
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
40233
40304
|
if (getResolveJsonModule(compilerOptions)) {
|
|
@@ -40243,10 +40314,11 @@ ${lanes.join("\n")}
|
|
|
40243
40314
|
extensions,
|
|
40244
40315
|
/*isConfigLookup*/
|
|
40245
40316
|
false,
|
|
40246
|
-
redirectedReference
|
|
40317
|
+
redirectedReference,
|
|
40318
|
+
conditions
|
|
40247
40319
|
);
|
|
40248
40320
|
}
|
|
40249
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
40321
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) {
|
|
40250
40322
|
let extensions;
|
|
40251
40323
|
if (isConfigLookup) {
|
|
40252
40324
|
extensions = 8 /* Json */;
|
|
@@ -40257,7 +40329,7 @@ ${lanes.join("\n")}
|
|
|
40257
40329
|
} else {
|
|
40258
40330
|
extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
40259
40331
|
}
|
|
40260
|
-
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
40332
|
+
return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
|
|
40261
40333
|
}
|
|
40262
40334
|
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
40263
40335
|
return nodeModuleNameResolverWorker(
|
|
@@ -40272,15 +40344,21 @@ ${lanes.join("\n")}
|
|
|
40272
40344
|
/*isConfigLookup*/
|
|
40273
40345
|
true,
|
|
40274
40346
|
/*redirectedReference*/
|
|
40347
|
+
void 0,
|
|
40348
|
+
/*conditions*/
|
|
40275
40349
|
void 0
|
|
40276
40350
|
);
|
|
40277
40351
|
}
|
|
40278
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
40352
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
40279
40353
|
var _a, _b, _c, _d;
|
|
40280
40354
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
40281
40355
|
const failedLookupLocations = [];
|
|
40282
40356
|
const affectingLocations = [];
|
|
40283
|
-
const
|
|
40357
|
+
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
40358
|
+
conditions ?? (conditions = getConditions(
|
|
40359
|
+
compilerOptions,
|
|
40360
|
+
moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 : !!(features & 32 /* EsmMode */)
|
|
40361
|
+
));
|
|
40284
40362
|
const diagnostics = [];
|
|
40285
40363
|
const state = {
|
|
40286
40364
|
compilerOptions,
|
|
@@ -40290,17 +40368,17 @@ ${lanes.join("\n")}
|
|
|
40290
40368
|
affectingLocations,
|
|
40291
40369
|
packageJsonInfoCache: cache,
|
|
40292
40370
|
features,
|
|
40293
|
-
conditions,
|
|
40371
|
+
conditions: conditions ?? emptyArray,
|
|
40294
40372
|
requestContainingDirectory: containingDirectory,
|
|
40295
40373
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40296
40374
|
isConfigLookup,
|
|
40297
40375
|
candidateIsFromPackageJsonField: false
|
|
40298
40376
|
};
|
|
40299
|
-
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(
|
|
40300
|
-
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
40377
|
+
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
40378
|
+
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
|
|
40301
40379
|
}
|
|
40302
40380
|
let result;
|
|
40303
|
-
if (
|
|
40381
|
+
if (moduleResolution === 2 /* Node10 */) {
|
|
40304
40382
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
40305
40383
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
40306
40384
|
result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
|
|
@@ -40308,7 +40386,7 @@ ${lanes.join("\n")}
|
|
|
40308
40386
|
result = tryResolve(extensions, state);
|
|
40309
40387
|
}
|
|
40310
40388
|
let legacyResult;
|
|
40311
|
-
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.includes("import")) {
|
|
40389
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && (conditions == null ? void 0 : conditions.includes("import"))) {
|
|
40312
40390
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
40313
40391
|
const diagnosticState = {
|
|
40314
40392
|
...state,
|
|
@@ -41105,7 +41183,8 @@ ${lanes.join("\n")}
|
|
|
41105
41183
|
extensions,
|
|
41106
41184
|
/*isConfigLookup*/
|
|
41107
41185
|
false,
|
|
41108
|
-
redirectedReference
|
|
41186
|
+
redirectedReference,
|
|
41187
|
+
state.conditions
|
|
41109
41188
|
);
|
|
41110
41189
|
return toSearchResult(
|
|
41111
41190
|
result.resolvedModule ? {
|
|
@@ -45524,7 +45603,7 @@ ${lanes.join("\n")}
|
|
|
45524
45603
|
var externalHelpersModule;
|
|
45525
45604
|
var Symbol47 = objectAllocator.getSymbolConstructor();
|
|
45526
45605
|
var Type27 = objectAllocator.getTypeConstructor();
|
|
45527
|
-
var
|
|
45606
|
+
var Signature14 = objectAllocator.getSignatureConstructor();
|
|
45528
45607
|
var typeCount = 0;
|
|
45529
45608
|
var symbolCount = 0;
|
|
45530
45609
|
var totalInstantiationCount = 0;
|
|
@@ -45750,24 +45829,7 @@ ${lanes.join("\n")}
|
|
|
45750
45829
|
getTypeOfPropertyOfContextualType,
|
|
45751
45830
|
getFullyQualifiedName,
|
|
45752
45831
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45753
|
-
|
|
45754
|
-
if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
|
|
45755
|
-
return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45756
|
-
call,
|
|
45757
|
-
candidatesOutArray,
|
|
45758
|
-
/*argumentCount*/
|
|
45759
|
-
void 0,
|
|
45760
|
-
checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
|
|
45761
|
-
));
|
|
45762
|
-
}
|
|
45763
|
-
return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
45764
|
-
call,
|
|
45765
|
-
candidatesOutArray,
|
|
45766
|
-
/*argumentCount*/
|
|
45767
|
-
void 0,
|
|
45768
|
-
checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
|
|
45769
|
-
));
|
|
45770
|
-
},
|
|
45832
|
+
getCandidateSignaturesForStringLiteralCompletions,
|
|
45771
45833
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45772
45834
|
getExpandedParameters,
|
|
45773
45835
|
hasEffectiveRestParameter,
|
|
@@ -45966,32 +46028,59 @@ ${lanes.join("\n")}
|
|
|
45966
46028
|
isTypeParameterPossiblyReferenced,
|
|
45967
46029
|
typeHasCallOrConstructSignatures
|
|
45968
46030
|
};
|
|
46031
|
+
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
46032
|
+
const candidatesSet = /* @__PURE__ */ new Set();
|
|
46033
|
+
const candidates = [];
|
|
46034
|
+
runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
46035
|
+
call,
|
|
46036
|
+
candidates,
|
|
46037
|
+
/*argumentCount*/
|
|
46038
|
+
void 0,
|
|
46039
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
46040
|
+
));
|
|
46041
|
+
for (const candidate of candidates) {
|
|
46042
|
+
candidatesSet.add(candidate);
|
|
46043
|
+
}
|
|
46044
|
+
candidates.length = 0;
|
|
46045
|
+
runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
46046
|
+
call,
|
|
46047
|
+
candidates,
|
|
46048
|
+
/*argumentCount*/
|
|
46049
|
+
void 0,
|
|
46050
|
+
0 /* Normal */
|
|
46051
|
+
));
|
|
46052
|
+
for (const candidate of candidates) {
|
|
46053
|
+
candidatesSet.add(candidate);
|
|
46054
|
+
}
|
|
46055
|
+
return arrayFrom(candidatesSet);
|
|
46056
|
+
}
|
|
45969
46057
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
45970
|
-
|
|
45971
|
-
|
|
45972
|
-
|
|
45973
|
-
|
|
46058
|
+
node = findAncestor(node, isCallLikeOrFunctionLikeExpression);
|
|
46059
|
+
if (node) {
|
|
46060
|
+
const cachedResolvedSignatures = [];
|
|
46061
|
+
const cachedTypes2 = [];
|
|
46062
|
+
while (node) {
|
|
45974
46063
|
const nodeLinks2 = getNodeLinks(node);
|
|
45975
|
-
|
|
45976
|
-
cachedResolvedSignatures.push([nodeLinks2, resolvedSignature]);
|
|
46064
|
+
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
45977
46065
|
nodeLinks2.resolvedSignature = void 0;
|
|
46066
|
+
if (isFunctionLike(node)) {
|
|
46067
|
+
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
46068
|
+
const type = symbolLinks2.type;
|
|
46069
|
+
cachedTypes2.push([symbolLinks2, type]);
|
|
46070
|
+
symbolLinks2.type = void 0;
|
|
46071
|
+
}
|
|
46072
|
+
node = findAncestor(node.parent, isCallLikeOrFunctionLikeExpression);
|
|
45978
46073
|
}
|
|
45979
|
-
|
|
45980
|
-
|
|
45981
|
-
|
|
45982
|
-
cachedTypes2.push([symbolLinks2, type]);
|
|
45983
|
-
symbolLinks2.type = void 0;
|
|
46074
|
+
const result = fn();
|
|
46075
|
+
for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
|
|
46076
|
+
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
45984
46077
|
}
|
|
45985
|
-
|
|
45986
|
-
|
|
45987
|
-
|
|
45988
|
-
|
|
45989
|
-
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
45990
|
-
}
|
|
45991
|
-
for (const [symbolLinks2, type] of cachedTypes2) {
|
|
45992
|
-
symbolLinks2.type = type;
|
|
46078
|
+
for (const [symbolLinks2, type] of cachedTypes2) {
|
|
46079
|
+
symbolLinks2.type = type;
|
|
46080
|
+
}
|
|
46081
|
+
return result;
|
|
45993
46082
|
}
|
|
45994
|
-
return
|
|
46083
|
+
return fn();
|
|
45995
46084
|
}
|
|
45996
46085
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
45997
46086
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
@@ -48773,7 +48862,7 @@ ${lanes.join("\n")}
|
|
|
48773
48862
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
48774
48863
|
}
|
|
48775
48864
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
48776
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
48865
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
48777
48866
|
if (startsWith(moduleReference, "@types/")) {
|
|
48778
48867
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
48779
48868
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -48828,9 +48917,8 @@ ${lanes.join("\n")}
|
|
|
48828
48917
|
}
|
|
48829
48918
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
48830
48919
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
48831
|
-
const
|
|
48832
|
-
|
|
48833
|
-
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
48920
|
+
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
48921
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
48834
48922
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
48835
48923
|
error2(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
|
|
48836
48924
|
} else {
|
|
@@ -48936,7 +49024,7 @@ ${lanes.join("\n")}
|
|
|
48936
49024
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
48937
49025
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
48938
49026
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
48939
|
-
const suggestedExt = (
|
|
49027
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
48940
49028
|
if (suggestedExt) {
|
|
48941
49029
|
error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
48942
49030
|
} else {
|
|
@@ -50701,7 +50789,7 @@ ${lanes.join("\n")}
|
|
|
50701
50789
|
return factory.updateImportTypeNode(
|
|
50702
50790
|
root,
|
|
50703
50791
|
root.argument,
|
|
50704
|
-
root.
|
|
50792
|
+
root.attributes,
|
|
50705
50793
|
qualifier,
|
|
50706
50794
|
typeArguments,
|
|
50707
50795
|
root.isTypeOf
|
|
@@ -51434,7 +51522,6 @@ ${lanes.join("\n")}
|
|
|
51434
51522
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
51435
51523
|
}
|
|
51436
51524
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
51437
|
-
var _a, _b, _c, _d;
|
|
51438
51525
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
51439
51526
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
51440
51527
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -51443,17 +51530,18 @@ ${lanes.join("\n")}
|
|
|
51443
51530
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
51444
51531
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
51445
51532
|
let specifier;
|
|
51446
|
-
let
|
|
51533
|
+
let attributes;
|
|
51447
51534
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
51448
51535
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
51449
51536
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
51450
|
-
|
|
51451
|
-
factory.
|
|
51452
|
-
factory.
|
|
51453
|
-
|
|
51454
|
-
|
|
51455
|
-
|
|
51456
|
-
|
|
51537
|
+
attributes = factory.createImportAttributes(
|
|
51538
|
+
factory.createNodeArray([
|
|
51539
|
+
factory.createImportAttribute(
|
|
51540
|
+
factory.createStringLiteral("resolution-mode"),
|
|
51541
|
+
factory.createStringLiteral("import")
|
|
51542
|
+
)
|
|
51543
|
+
])
|
|
51544
|
+
);
|
|
51457
51545
|
}
|
|
51458
51546
|
}
|
|
51459
51547
|
if (!specifier) {
|
|
@@ -51467,16 +51555,17 @@ ${lanes.join("\n")}
|
|
|
51467
51555
|
if (specifier.includes("/node_modules/")) {
|
|
51468
51556
|
specifier = oldSpecifier;
|
|
51469
51557
|
} else {
|
|
51470
|
-
|
|
51471
|
-
factory.
|
|
51472
|
-
factory.
|
|
51473
|
-
|
|
51474
|
-
|
|
51475
|
-
|
|
51476
|
-
|
|
51558
|
+
attributes = factory.createImportAttributes(
|
|
51559
|
+
factory.createNodeArray([
|
|
51560
|
+
factory.createImportAttribute(
|
|
51561
|
+
factory.createStringLiteral("resolution-mode"),
|
|
51562
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
51563
|
+
)
|
|
51564
|
+
])
|
|
51565
|
+
);
|
|
51477
51566
|
}
|
|
51478
51567
|
}
|
|
51479
|
-
if (!
|
|
51568
|
+
if (!attributes) {
|
|
51480
51569
|
context.encounteredError = true;
|
|
51481
51570
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
51482
51571
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -51496,11 +51585,11 @@ ${lanes.join("\n")}
|
|
|
51496
51585
|
void 0
|
|
51497
51586
|
);
|
|
51498
51587
|
}
|
|
51499
|
-
return factory.createImportTypeNode(lit,
|
|
51588
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
51500
51589
|
} else {
|
|
51501
51590
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
51502
51591
|
const qualifier = splitNode.objectType.typeName;
|
|
51503
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
51592
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
51504
51593
|
}
|
|
51505
51594
|
}
|
|
51506
51595
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -51976,7 +52065,7 @@ ${lanes.join("\n")}
|
|
|
51976
52065
|
return factory.updateImportTypeNode(
|
|
51977
52066
|
node,
|
|
51978
52067
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
51979
|
-
node.
|
|
52068
|
+
node.attributes,
|
|
51980
52069
|
node.qualifier,
|
|
51981
52070
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
51982
52071
|
node.isTypeOf
|
|
@@ -52196,7 +52285,7 @@ ${lanes.join("\n")}
|
|
|
52196
52285
|
return statements;
|
|
52197
52286
|
}
|
|
52198
52287
|
function inlineExportModifiers(statements) {
|
|
52199
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
52288
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
|
|
52200
52289
|
if (index >= 0) {
|
|
52201
52290
|
const exportDecl = statements[index];
|
|
52202
52291
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -52224,7 +52313,7 @@ ${lanes.join("\n")}
|
|
|
52224
52313
|
replacements
|
|
52225
52314
|
),
|
|
52226
52315
|
exportDecl.moduleSpecifier,
|
|
52227
|
-
exportDecl.
|
|
52316
|
+
exportDecl.attributes
|
|
52228
52317
|
);
|
|
52229
52318
|
}
|
|
52230
52319
|
}
|
|
@@ -52875,7 +52964,7 @@ ${lanes.join("\n")}
|
|
|
52875
52964
|
)])
|
|
52876
52965
|
),
|
|
52877
52966
|
factory.createStringLiteral(specifier2),
|
|
52878
|
-
/*
|
|
52967
|
+
/*attributes*/
|
|
52879
52968
|
void 0
|
|
52880
52969
|
),
|
|
52881
52970
|
0 /* None */
|
|
@@ -52963,7 +53052,7 @@ ${lanes.join("\n")}
|
|
|
52963
53052
|
void 0
|
|
52964
53053
|
),
|
|
52965
53054
|
specifier2,
|
|
52966
|
-
node.parent.
|
|
53055
|
+
node.parent.attributes
|
|
52967
53056
|
),
|
|
52968
53057
|
0 /* None */
|
|
52969
53058
|
);
|
|
@@ -52984,7 +53073,7 @@ ${lanes.join("\n")}
|
|
|
52984
53073
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
52985
53074
|
),
|
|
52986
53075
|
specifier2,
|
|
52987
|
-
node.parent.
|
|
53076
|
+
node.parent.attributes
|
|
52988
53077
|
),
|
|
52989
53078
|
0 /* None */
|
|
52990
53079
|
);
|
|
@@ -53025,7 +53114,7 @@ ${lanes.join("\n")}
|
|
|
53025
53114
|
])
|
|
53026
53115
|
),
|
|
53027
53116
|
specifier2,
|
|
53028
|
-
node.parent.parent.parent.
|
|
53117
|
+
node.parent.parent.parent.attributes
|
|
53029
53118
|
),
|
|
53030
53119
|
0 /* None */
|
|
53031
53120
|
);
|
|
@@ -55811,7 +55900,7 @@ ${lanes.join("\n")}
|
|
|
55811
55900
|
resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
|
|
55812
55901
|
}
|
|
55813
55902
|
function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
|
|
55814
|
-
const sig = new
|
|
55903
|
+
const sig = new Signature14(checker, flags);
|
|
55815
55904
|
sig.declaration = declaration;
|
|
55816
55905
|
sig.typeParameters = typeParameters;
|
|
55817
55906
|
sig.parameters = parameters;
|
|
@@ -62484,6 +62573,7 @@ ${lanes.join("\n")}
|
|
|
62484
62573
|
let skipParentCounter = 0;
|
|
62485
62574
|
let lastSkippedInfo;
|
|
62486
62575
|
let incompatibleStack;
|
|
62576
|
+
let relationCount = 16e6 - relation.size >> 3;
|
|
62487
62577
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
62488
62578
|
const result = isRelatedTo(
|
|
62489
62579
|
source,
|
|
@@ -62497,8 +62587,19 @@ ${lanes.join("\n")}
|
|
|
62497
62587
|
reportIncompatibleStack();
|
|
62498
62588
|
}
|
|
62499
62589
|
if (overflow) {
|
|
62590
|
+
const id = getRelationKey(
|
|
62591
|
+
source,
|
|
62592
|
+
target,
|
|
62593
|
+
/*intersectionState*/
|
|
62594
|
+
0 /* None */,
|
|
62595
|
+
relation,
|
|
62596
|
+
/*ignoreConstraints*/
|
|
62597
|
+
false
|
|
62598
|
+
);
|
|
62599
|
+
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
62500
62600
|
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
62501
|
-
const
|
|
62601
|
+
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
62602
|
+
const diag2 = error2(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
62502
62603
|
if (errorOutputContainer) {
|
|
62503
62604
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
62504
62605
|
}
|
|
@@ -63029,6 +63130,16 @@ ${lanes.join("\n")}
|
|
|
63029
63130
|
}
|
|
63030
63131
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
63031
63132
|
if (source2.flags & 1048576 /* Union */) {
|
|
63133
|
+
if (target2.flags & 1048576 /* Union */) {
|
|
63134
|
+
const sourceOrigin = source2.origin;
|
|
63135
|
+
if (sourceOrigin && sourceOrigin.flags & 2097152 /* Intersection */ && target2.aliasSymbol && contains(sourceOrigin.types, target2)) {
|
|
63136
|
+
return -1 /* True */;
|
|
63137
|
+
}
|
|
63138
|
+
const targetOrigin = target2.origin;
|
|
63139
|
+
if (targetOrigin && targetOrigin.flags & 1048576 /* Union */ && source2.aliasSymbol && contains(targetOrigin.types, source2)) {
|
|
63140
|
+
return -1 /* True */;
|
|
63141
|
+
}
|
|
63142
|
+
}
|
|
63032
63143
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
63033
63144
|
}
|
|
63034
63145
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -63342,6 +63453,10 @@ ${lanes.join("\n")}
|
|
|
63342
63453
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
63343
63454
|
}
|
|
63344
63455
|
}
|
|
63456
|
+
if (relationCount <= 0) {
|
|
63457
|
+
overflow = true;
|
|
63458
|
+
return 0 /* False */;
|
|
63459
|
+
}
|
|
63345
63460
|
if (!maybeKeys) {
|
|
63346
63461
|
maybeKeys = [];
|
|
63347
63462
|
maybeKeysSet = /* @__PURE__ */ new Set();
|
|
@@ -63435,6 +63550,7 @@ ${lanes.join("\n")}
|
|
|
63435
63550
|
}
|
|
63436
63551
|
} else {
|
|
63437
63552
|
relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
|
|
63553
|
+
relationCount--;
|
|
63438
63554
|
resetMaybeStack(
|
|
63439
63555
|
/*markAllAsSucceeded*/
|
|
63440
63556
|
false
|
|
@@ -63446,6 +63562,7 @@ ${lanes.join("\n")}
|
|
|
63446
63562
|
maybeKeysSet.delete(maybeKeys[i]);
|
|
63447
63563
|
if (markAllAsSucceeded) {
|
|
63448
63564
|
relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
|
|
63565
|
+
relationCount--;
|
|
63449
63566
|
}
|
|
63450
63567
|
}
|
|
63451
63568
|
maybeCount = maybeStart;
|
|
@@ -72705,7 +72822,7 @@ ${lanes.join("\n")}
|
|
|
72705
72822
|
}
|
|
72706
72823
|
for (let i = 0; i < argCount; i++) {
|
|
72707
72824
|
const arg = args[i];
|
|
72708
|
-
if (arg.kind !== 232 /* OmittedExpression */) {
|
|
72825
|
+
if (arg.kind !== 232 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
72709
72826
|
const paramType = getTypeAtPosition(signature, i);
|
|
72710
72827
|
if (couldContainTypeVariables(paramType)) {
|
|
72711
72828
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -73308,6 +73425,7 @@ ${lanes.join("\n")}
|
|
|
73308
73425
|
const args = getEffectiveCallArguments(node);
|
|
73309
73426
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
73310
73427
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
73428
|
+
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
73311
73429
|
let candidatesForArgumentError;
|
|
73312
73430
|
let candidateForArgumentArityError;
|
|
73313
73431
|
let candidateForTypeArgumentError;
|
|
@@ -78277,16 +78395,8 @@ ${lanes.join("\n")}
|
|
|
78277
78395
|
}
|
|
78278
78396
|
function checkImportType(node) {
|
|
78279
78397
|
checkSourceElement(node.argument);
|
|
78280
|
-
if (node.
|
|
78281
|
-
|
|
78282
|
-
if (override) {
|
|
78283
|
-
if (!isNightly()) {
|
|
78284
|
-
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
|
|
78285
|
-
}
|
|
78286
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
78287
|
-
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
78288
|
-
}
|
|
78289
|
-
}
|
|
78398
|
+
if (node.attributes) {
|
|
78399
|
+
getResolutionModeOverride(node.attributes, grammarErrorOnNode);
|
|
78290
78400
|
}
|
|
78291
78401
|
checkTypeReferenceOrImport(node);
|
|
78292
78402
|
}
|
|
@@ -82250,12 +82360,13 @@ ${lanes.join("\n")}
|
|
|
82250
82360
|
return false;
|
|
82251
82361
|
}
|
|
82252
82362
|
}
|
|
82253
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
82363
|
+
if (!isImportEqualsDeclaration(node) && node.attributes) {
|
|
82364
|
+
const diagnostic = node.attributes.token === 118 /* WithKeyword */ ? Diagnostics.Import_attribute_values_must_be_string_literal_expressions : Diagnostics.Import_assertion_values_must_be_string_literal_expressions;
|
|
82254
82365
|
let hasError = false;
|
|
82255
|
-
for (const
|
|
82256
|
-
if (!isStringLiteral(
|
|
82366
|
+
for (const attr of node.attributes.elements) {
|
|
82367
|
+
if (!isStringLiteral(attr.value)) {
|
|
82257
82368
|
hasError = true;
|
|
82258
|
-
error2(
|
|
82369
|
+
error2(attr.value, diagnostic);
|
|
82259
82370
|
}
|
|
82260
82371
|
}
|
|
82261
82372
|
return !hasError;
|
|
@@ -82387,32 +82498,26 @@ ${lanes.join("\n")}
|
|
|
82387
82498
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
82388
82499
|
}
|
|
82389
82500
|
}
|
|
82390
|
-
function
|
|
82501
|
+
function checkImportAttributes(declaration) {
|
|
82391
82502
|
var _a;
|
|
82392
|
-
|
|
82393
|
-
|
|
82394
|
-
const
|
|
82395
|
-
|
|
82396
|
-
|
|
82397
|
-
|
|
82398
|
-
}
|
|
82399
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
82400
|
-
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
82401
|
-
}
|
|
82503
|
+
const node = declaration.attributes;
|
|
82504
|
+
if (node) {
|
|
82505
|
+
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
82506
|
+
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
82507
|
+
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
82508
|
+
if (validForTypeAttributes && override) {
|
|
82402
82509
|
return;
|
|
82403
82510
|
}
|
|
82404
82511
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
82405
82512
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
82406
|
-
|
|
82407
|
-
|
|
82408
|
-
moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext
|
|
82409
|
-
);
|
|
82513
|
+
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;
|
|
82514
|
+
return grammarErrorOnNode(node, message);
|
|
82410
82515
|
}
|
|
82411
82516
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
82412
|
-
return grammarErrorOnNode(
|
|
82517
|
+
return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
82413
82518
|
}
|
|
82414
82519
|
if (override) {
|
|
82415
|
-
return grammarErrorOnNode(
|
|
82520
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
82416
82521
|
}
|
|
82417
82522
|
}
|
|
82418
82523
|
}
|
|
@@ -82444,7 +82549,7 @@ ${lanes.join("\n")}
|
|
|
82444
82549
|
}
|
|
82445
82550
|
}
|
|
82446
82551
|
}
|
|
82447
|
-
|
|
82552
|
+
checkImportAttributes(node);
|
|
82448
82553
|
}
|
|
82449
82554
|
function checkImportEqualsDeclaration(node) {
|
|
82450
82555
|
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
@@ -82517,7 +82622,7 @@ ${lanes.join("\n")}
|
|
|
82517
82622
|
}
|
|
82518
82623
|
}
|
|
82519
82624
|
}
|
|
82520
|
-
|
|
82625
|
+
checkImportAttributes(node);
|
|
82521
82626
|
}
|
|
82522
82627
|
function checkGrammarExportDeclaration(node) {
|
|
82523
82628
|
var _a;
|
|
@@ -86307,12 +86412,12 @@ ${lanes.join("\n")}
|
|
|
86307
86412
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
86308
86413
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
86309
86414
|
if (nodeArguments.length > 1) {
|
|
86310
|
-
const
|
|
86311
|
-
return grammarErrorOnNode(
|
|
86415
|
+
const importAttributesArgument = nodeArguments[1];
|
|
86416
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
86312
86417
|
}
|
|
86313
86418
|
}
|
|
86314
86419
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
86315
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
86420
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
|
|
86316
86421
|
}
|
|
86317
86422
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
86318
86423
|
if (spreadElement) {
|
|
@@ -86711,13 +86816,6 @@ ${lanes.join("\n")}
|
|
|
86711
86816
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
86712
86817
|
}
|
|
86713
86818
|
}
|
|
86714
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
86715
|
-
var _a;
|
|
86716
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
86717
|
-
this.onDiagnosticReported();
|
|
86718
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
86719
|
-
}
|
|
86720
|
-
}
|
|
86721
86819
|
onDiagnosticReported() {
|
|
86722
86820
|
this.context.reportedDiagnostic = true;
|
|
86723
86821
|
}
|
|
@@ -87237,7 +87335,7 @@ ${lanes.join("\n")}
|
|
|
87237
87335
|
return context.factory.updateImportTypeNode(
|
|
87238
87336
|
node,
|
|
87239
87337
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
87240
|
-
nodeVisitor(node.
|
|
87338
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes),
|
|
87241
87339
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
87242
87340
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
87243
87341
|
node.isTypeOf
|
|
@@ -87788,20 +87886,20 @@ ${lanes.join("\n")}
|
|
|
87788
87886
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
87789
87887
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
87790
87888
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
87791
|
-
nodeVisitor(node.
|
|
87889
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
87792
87890
|
);
|
|
87793
87891
|
},
|
|
87794
|
-
[300 /*
|
|
87795
|
-
return context.factory.
|
|
87892
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
87893
|
+
return context.factory.updateImportAttributes(
|
|
87796
87894
|
node,
|
|
87797
|
-
nodesVisitor(node.elements, visitor,
|
|
87895
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
87798
87896
|
node.multiLine
|
|
87799
87897
|
);
|
|
87800
87898
|
},
|
|
87801
|
-
[301 /*
|
|
87802
|
-
return context.factory.
|
|
87899
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
87900
|
+
return context.factory.updateImportAttribute(
|
|
87803
87901
|
node,
|
|
87804
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
87902
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
87805
87903
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
87806
87904
|
);
|
|
87807
87905
|
},
|
|
@@ -87853,7 +87951,7 @@ ${lanes.join("\n")}
|
|
|
87853
87951
|
node.isTypeOnly,
|
|
87854
87952
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
87855
87953
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
87856
|
-
nodeVisitor(node.
|
|
87954
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
87857
87955
|
);
|
|
87858
87956
|
},
|
|
87859
87957
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -91381,7 +91479,7 @@ ${lanes.join("\n")}
|
|
|
91381
91479
|
void 0,
|
|
91382
91480
|
importClause,
|
|
91383
91481
|
node.moduleSpecifier,
|
|
91384
|
-
node.
|
|
91482
|
+
node.attributes
|
|
91385
91483
|
) : void 0;
|
|
91386
91484
|
}
|
|
91387
91485
|
function visitImportClause(node) {
|
|
@@ -91431,7 +91529,7 @@ ${lanes.join("\n")}
|
|
|
91431
91529
|
node.isTypeOnly,
|
|
91432
91530
|
exportClause,
|
|
91433
91531
|
node.moduleSpecifier,
|
|
91434
|
-
node.
|
|
91532
|
+
node.attributes
|
|
91435
91533
|
) : void 0;
|
|
91436
91534
|
}
|
|
91437
91535
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -91465,7 +91563,7 @@ ${lanes.join("\n")}
|
|
|
91465
91563
|
/*importClause*/
|
|
91466
91564
|
void 0,
|
|
91467
91565
|
node.moduleReference.expression,
|
|
91468
|
-
/*
|
|
91566
|
+
/*attributes*/
|
|
91469
91567
|
void 0
|
|
91470
91568
|
),
|
|
91471
91569
|
node
|
|
@@ -99703,7 +99801,7 @@ ${lanes.join("\n")}
|
|
|
99703
99801
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
99704
99802
|
),
|
|
99705
99803
|
factory2.createStringLiteral(importSource),
|
|
99706
|
-
/*
|
|
99804
|
+
/*attributes*/
|
|
99707
99805
|
void 0
|
|
99708
99806
|
);
|
|
99709
99807
|
setParentRecursive(
|
|
@@ -109154,7 +109252,9 @@ ${lanes.join("\n")}
|
|
|
109154
109252
|
)
|
|
109155
109253
|
])
|
|
109156
109254
|
),
|
|
109157
|
-
factory2.createStringLiteral("module")
|
|
109255
|
+
factory2.createStringLiteral("module"),
|
|
109256
|
+
/*attributes*/
|
|
109257
|
+
void 0
|
|
109158
109258
|
);
|
|
109159
109259
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
109160
109260
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -109271,7 +109371,7 @@ ${lanes.join("\n")}
|
|
|
109271
109371
|
)
|
|
109272
109372
|
),
|
|
109273
109373
|
node.moduleSpecifier,
|
|
109274
|
-
node.
|
|
109374
|
+
node.attributes
|
|
109275
109375
|
);
|
|
109276
109376
|
setOriginalNode(importDecl, node.exportClause);
|
|
109277
109377
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -109741,8 +109841,7 @@ ${lanes.join("\n")}
|
|
|
109741
109841
|
trackReferencedAmbientModule,
|
|
109742
109842
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
109743
109843
|
reportNonlocalAugmentation,
|
|
109744
|
-
reportNonSerializableProperty
|
|
109745
|
-
reportImportTypeNodeResolutionModeOverride
|
|
109844
|
+
reportNonSerializableProperty
|
|
109746
109845
|
};
|
|
109747
109846
|
let errorNameNode;
|
|
109748
109847
|
let errorFallbackNode;
|
|
@@ -109866,11 +109965,6 @@ ${lanes.join("\n")}
|
|
|
109866
109965
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
109867
109966
|
}
|
|
109868
109967
|
}
|
|
109869
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
109870
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
109871
|
-
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
109872
|
-
}
|
|
109873
|
-
}
|
|
109874
109968
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
109875
109969
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
109876
109970
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -110375,7 +110469,7 @@ ${lanes.join("\n")}
|
|
|
110375
110469
|
decl.modifiers,
|
|
110376
110470
|
decl.importClause,
|
|
110377
110471
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110378
|
-
|
|
110472
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110379
110473
|
);
|
|
110380
110474
|
}
|
|
110381
110475
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -110391,7 +110485,7 @@ ${lanes.join("\n")}
|
|
|
110391
110485
|
void 0
|
|
110392
110486
|
),
|
|
110393
110487
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110394
|
-
|
|
110488
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110395
110489
|
);
|
|
110396
110490
|
}
|
|
110397
110491
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -110409,7 +110503,7 @@ ${lanes.join("\n")}
|
|
|
110409
110503
|
namedBindings
|
|
110410
110504
|
),
|
|
110411
110505
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110412
|
-
|
|
110506
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110413
110507
|
) : void 0;
|
|
110414
110508
|
}
|
|
110415
110509
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -110424,7 +110518,7 @@ ${lanes.join("\n")}
|
|
|
110424
110518
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
110425
110519
|
),
|
|
110426
110520
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110427
|
-
|
|
110521
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110428
110522
|
);
|
|
110429
110523
|
}
|
|
110430
110524
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -110434,19 +110528,13 @@ ${lanes.join("\n")}
|
|
|
110434
110528
|
/*importClause*/
|
|
110435
110529
|
void 0,
|
|
110436
110530
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110437
|
-
|
|
110531
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110438
110532
|
);
|
|
110439
110533
|
}
|
|
110440
110534
|
}
|
|
110441
|
-
function
|
|
110442
|
-
const mode =
|
|
110443
|
-
|
|
110444
|
-
if (!isNightly()) {
|
|
110445
|
-
context.addDiagnostic(createDiagnosticForNode(assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
110446
|
-
}
|
|
110447
|
-
return assertClause;
|
|
110448
|
-
}
|
|
110449
|
-
return void 0;
|
|
110535
|
+
function tryGetResolutionModeOverride(node) {
|
|
110536
|
+
const mode = getResolutionModeOverride(node);
|
|
110537
|
+
return node && mode !== void 0 ? node : void 0;
|
|
110450
110538
|
}
|
|
110451
110539
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
110452
110540
|
while (length(lateMarkedStatements)) {
|
|
@@ -110732,7 +110820,7 @@ ${lanes.join("\n")}
|
|
|
110732
110820
|
return cleanup(factory2.updateImportTypeNode(
|
|
110733
110821
|
input,
|
|
110734
110822
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
110735
|
-
input.
|
|
110823
|
+
input.attributes,
|
|
110736
110824
|
input.qualifier,
|
|
110737
110825
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
110738
110826
|
input.isTypeOf
|
|
@@ -110786,7 +110874,7 @@ ${lanes.join("\n")}
|
|
|
110786
110874
|
input.isTypeOnly,
|
|
110787
110875
|
input.exportClause,
|
|
110788
110876
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
110789
|
-
|
|
110877
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
110790
110878
|
);
|
|
110791
110879
|
}
|
|
110792
110880
|
case 277 /* ExportAssignment */: {
|
|
@@ -113260,10 +113348,10 @@ ${lanes.join("\n")}
|
|
|
113260
113348
|
return emitNamedExports(node);
|
|
113261
113349
|
case 281 /* ExportSpecifier */:
|
|
113262
113350
|
return emitExportSpecifier(node);
|
|
113263
|
-
case 300 /*
|
|
113264
|
-
return
|
|
113265
|
-
case 301 /*
|
|
113266
|
-
return
|
|
113351
|
+
case 300 /* ImportAttributes */:
|
|
113352
|
+
return emitImportAttributes(node);
|
|
113353
|
+
case 301 /* ImportAttribute */:
|
|
113354
|
+
return emitImportAttribute(node);
|
|
113267
113355
|
case 282 /* MissingDeclaration */:
|
|
113268
113356
|
return;
|
|
113269
113357
|
case 283 /* ExternalModuleReference */:
|
|
@@ -114038,16 +114126,16 @@ ${lanes.join("\n")}
|
|
|
114038
114126
|
writeKeyword("import");
|
|
114039
114127
|
writePunctuation("(");
|
|
114040
114128
|
emit(node.argument);
|
|
114041
|
-
if (node.
|
|
114129
|
+
if (node.attributes) {
|
|
114042
114130
|
writePunctuation(",");
|
|
114043
114131
|
writeSpace();
|
|
114044
114132
|
writePunctuation("{");
|
|
114045
114133
|
writeSpace();
|
|
114046
|
-
writeKeyword("assert");
|
|
114134
|
+
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
114047
114135
|
writePunctuation(":");
|
|
114048
114136
|
writeSpace();
|
|
114049
|
-
const elements = node.
|
|
114050
|
-
emitList(node.
|
|
114137
|
+
const elements = node.attributes.elements;
|
|
114138
|
+
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
114051
114139
|
writeSpace();
|
|
114052
114140
|
writePunctuation("}");
|
|
114053
114141
|
}
|
|
@@ -115036,8 +115124,8 @@ ${lanes.join("\n")}
|
|
|
115036
115124
|
writeSpace();
|
|
115037
115125
|
}
|
|
115038
115126
|
emitExpression(node.moduleSpecifier);
|
|
115039
|
-
if (node.
|
|
115040
|
-
emitWithLeadingSpace(node.
|
|
115127
|
+
if (node.attributes) {
|
|
115128
|
+
emitWithLeadingSpace(node.attributes);
|
|
115041
115129
|
}
|
|
115042
115130
|
writeTrailingSemicolon();
|
|
115043
115131
|
}
|
|
@@ -115106,18 +115194,18 @@ ${lanes.join("\n")}
|
|
|
115106
115194
|
writeSpace();
|
|
115107
115195
|
emitExpression(node.moduleSpecifier);
|
|
115108
115196
|
}
|
|
115109
|
-
if (node.
|
|
115110
|
-
emitWithLeadingSpace(node.
|
|
115197
|
+
if (node.attributes) {
|
|
115198
|
+
emitWithLeadingSpace(node.attributes);
|
|
115111
115199
|
}
|
|
115112
115200
|
writeTrailingSemicolon();
|
|
115113
115201
|
}
|
|
115114
|
-
function
|
|
115115
|
-
emitTokenWithComment(
|
|
115202
|
+
function emitImportAttributes(node) {
|
|
115203
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
115116
115204
|
writeSpace();
|
|
115117
115205
|
const elements = node.elements;
|
|
115118
|
-
emitList(node, elements, 526226 /*
|
|
115206
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
115119
115207
|
}
|
|
115120
|
-
function
|
|
115208
|
+
function emitImportAttribute(node) {
|
|
115121
115209
|
emit(node.name);
|
|
115122
115210
|
writePunctuation(":");
|
|
115123
115211
|
writeSpace();
|
|
@@ -118255,8 +118343,6 @@ ${lanes.join("\n")}
|
|
|
118255
118343
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
118256
118344
|
}
|
|
118257
118345
|
function getModeForResolutionAtIndex(file, index) {
|
|
118258
|
-
if (file.impliedNodeFormat === void 0)
|
|
118259
|
-
return void 0;
|
|
118260
118346
|
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
118261
118347
|
}
|
|
118262
118348
|
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
@@ -118270,42 +118356,48 @@ ${lanes.join("\n")}
|
|
|
118270
118356
|
return false;
|
|
118271
118357
|
}
|
|
118272
118358
|
function getModeForUsageLocation(file, usage) {
|
|
118273
|
-
var _a
|
|
118274
|
-
if (file.impliedNodeFormat === void 0)
|
|
118275
|
-
return void 0;
|
|
118359
|
+
var _a;
|
|
118276
118360
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
118277
118361
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
118278
118362
|
if (isTypeOnly) {
|
|
118279
|
-
const override =
|
|
118363
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
118280
118364
|
if (override) {
|
|
118281
118365
|
return override;
|
|
118282
118366
|
}
|
|
118283
118367
|
}
|
|
118284
118368
|
}
|
|
118285
118369
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
118286
|
-
const override =
|
|
118370
|
+
const override = getResolutionModeOverride(usage.parent.parent.attributes);
|
|
118287
118371
|
if (override) {
|
|
118288
118372
|
return override;
|
|
118289
118373
|
}
|
|
118290
118374
|
}
|
|
118375
|
+
if (file.impliedNodeFormat === void 0)
|
|
118376
|
+
return void 0;
|
|
118291
118377
|
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
118292
118378
|
return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
118293
118379
|
}
|
|
118294
|
-
const exprParentParent = (
|
|
118380
|
+
const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent;
|
|
118295
118381
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
118296
118382
|
}
|
|
118297
|
-
function
|
|
118298
|
-
if (!
|
|
118383
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
118384
|
+
if (!node)
|
|
118299
118385
|
return void 0;
|
|
118300
|
-
if (length(
|
|
118301
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118386
|
+
if (length(node.elements) !== 1) {
|
|
118387
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118388
|
+
node,
|
|
118389
|
+
node.token === 118 /* WithKeyword */ ? Diagnostics.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require : Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require
|
|
118390
|
+
);
|
|
118302
118391
|
return void 0;
|
|
118303
118392
|
}
|
|
118304
|
-
const elem =
|
|
118393
|
+
const elem = node.elements[0];
|
|
118305
118394
|
if (!isStringLiteralLike(elem.name))
|
|
118306
118395
|
return void 0;
|
|
118307
118396
|
if (elem.name.text !== "resolution-mode") {
|
|
118308
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118397
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118398
|
+
elem.name,
|
|
118399
|
+
node.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_attributes : Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions
|
|
118400
|
+
);
|
|
118309
118401
|
return void 0;
|
|
118310
118402
|
}
|
|
118311
118403
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -120028,7 +120120,7 @@ ${lanes.join("\n")}
|
|
|
120028
120120
|
/*importClause*/
|
|
120029
120121
|
void 0,
|
|
120030
120122
|
externalHelpersModuleReference,
|
|
120031
|
-
/*
|
|
120123
|
+
/*attributes*/
|
|
120032
120124
|
void 0
|
|
120033
120125
|
);
|
|
120034
120126
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -120504,14 +120596,6 @@ ${lanes.join("\n")}
|
|
|
120504
120596
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
120505
120597
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
120506
120598
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
120507
|
-
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
120508
|
-
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
120509
|
-
kind: 2 /* ResolutionDiagnostics */,
|
|
120510
|
-
diagnostics: [
|
|
120511
|
-
createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)
|
|
120512
|
-
]
|
|
120513
|
-
});
|
|
120514
|
-
}
|
|
120515
120599
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
120516
120600
|
}
|
|
120517
120601
|
}
|
|
@@ -121907,7 +121991,7 @@ ${lanes.join("\n")}
|
|
|
121907
121991
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
121908
121992
|
Diagnostics.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.code,
|
|
121909
121993
|
Diagnostics.Duplicate_label_0.code,
|
|
121910
|
-
Diagnostics.
|
|
121994
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
121911
121995
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
121912
121996
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
121913
121997
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -130438,7 +130522,7 @@ ${lanes.join("\n")}
|
|
|
130438
130522
|
void 0,
|
|
130439
130523
|
defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0,
|
|
130440
130524
|
typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier,
|
|
130441
|
-
/*
|
|
130525
|
+
/*attributes*/
|
|
130442
130526
|
void 0
|
|
130443
130527
|
);
|
|
130444
130528
|
}
|
|
@@ -136205,7 +136289,7 @@ ${lanes.join("\n")}
|
|
|
136205
136289
|
}
|
|
136206
136290
|
case 205 /* ImportType */:
|
|
136207
136291
|
const importTypeNode = parent2;
|
|
136208
|
-
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.
|
|
136292
|
+
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
|
|
136209
136293
|
break;
|
|
136210
136294
|
default:
|
|
136211
136295
|
Debug.failBadSyntaxKind(parent2);
|
|
@@ -136489,7 +136573,7 @@ ${lanes.join("\n")}
|
|
|
136489
136573
|
elements && elements.length ? factory.createNamedImports(elements) : void 0
|
|
136490
136574
|
),
|
|
136491
136575
|
old.moduleSpecifier,
|
|
136492
|
-
/*
|
|
136576
|
+
/*attributes*/
|
|
136493
136577
|
void 0
|
|
136494
136578
|
);
|
|
136495
136579
|
}
|
|
@@ -137375,7 +137459,7 @@ ${lanes.join("\n")}
|
|
|
137375
137459
|
factory.createNamespaceImport(newNamespaceId)
|
|
137376
137460
|
),
|
|
137377
137461
|
newModuleString,
|
|
137378
|
-
/*
|
|
137462
|
+
/*attributes*/
|
|
137379
137463
|
void 0
|
|
137380
137464
|
);
|
|
137381
137465
|
case 271 /* ImportEqualsDeclaration */:
|
|
@@ -137664,7 +137748,7 @@ ${lanes.join("\n")}
|
|
|
137664
137748
|
void 0,
|
|
137665
137749
|
factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings),
|
|
137666
137750
|
getSynthesizedDeepClone(moduleSpecifier),
|
|
137667
|
-
/*
|
|
137751
|
+
/*attributes*/
|
|
137668
137752
|
void 0
|
|
137669
137753
|
) : void 0;
|
|
137670
137754
|
}
|
|
@@ -137988,7 +138072,7 @@ ${lanes.join("\n")}
|
|
|
137988
138072
|
continue;
|
|
137989
138073
|
}
|
|
137990
138074
|
if (length(updatedElements) < length(elements)) {
|
|
137991
|
-
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.
|
|
138075
|
+
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes));
|
|
137992
138076
|
}
|
|
137993
138077
|
}
|
|
137994
138078
|
}
|
|
@@ -148470,7 +148554,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148470
148554
|
false,
|
|
148471
148555
|
factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))),
|
|
148472
148556
|
exportDeclaration.moduleSpecifier,
|
|
148473
|
-
/*
|
|
148557
|
+
/*attributes*/
|
|
148474
148558
|
void 0
|
|
148475
148559
|
);
|
|
148476
148560
|
const typeExportDeclaration = factory.createExportDeclaration(
|
|
@@ -148480,7 +148564,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148480
148564
|
true,
|
|
148481
148565
|
factory.createNamedExports(typeExportSpecifiers),
|
|
148482
148566
|
exportDeclaration.moduleSpecifier,
|
|
148483
|
-
/*
|
|
148567
|
+
/*attributes*/
|
|
148484
148568
|
void 0
|
|
148485
148569
|
);
|
|
148486
148570
|
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {
|
|
@@ -148595,7 +148679,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148595
148679
|
true
|
|
148596
148680
|
),
|
|
148597
148681
|
getSynthesizedDeepClone(
|
|
148598
|
-
declaration.
|
|
148682
|
+
declaration.attributes,
|
|
148599
148683
|
/*includeTrivia*/
|
|
148600
148684
|
true
|
|
148601
148685
|
)
|
|
@@ -148623,7 +148707,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148623
148707
|
true
|
|
148624
148708
|
),
|
|
148625
148709
|
getSynthesizedDeepClone(
|
|
148626
|
-
declaration.
|
|
148710
|
+
declaration.attributes,
|
|
148627
148711
|
/*includeTrivia*/
|
|
148628
148712
|
true
|
|
148629
148713
|
)
|
|
@@ -148646,7 +148730,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148646
148730
|
true,
|
|
148647
148731
|
importClause.name,
|
|
148648
148732
|
newNamedBindings
|
|
148649
|
-
), declaration.moduleSpecifier, declaration.
|
|
148733
|
+
), declaration.moduleSpecifier, declaration.attributes);
|
|
148650
148734
|
changes.replaceNode(sourceFile, declaration, importDeclaration);
|
|
148651
148735
|
}
|
|
148652
148736
|
}
|
|
@@ -150169,7 +150253,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150169
150253
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
|
150170
150254
|
),
|
|
150171
150255
|
quotedModuleSpecifier,
|
|
150172
|
-
/*
|
|
150256
|
+
/*attributes*/
|
|
150173
150257
|
void 0
|
|
150174
150258
|
);
|
|
150175
150259
|
statements = combine(statements, declaration);
|
|
@@ -150787,7 +150871,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150787
150871
|
)
|
|
150788
150872
|
),
|
|
150789
150873
|
node.moduleSpecifier,
|
|
150790
|
-
node.
|
|
150874
|
+
node.attributes
|
|
150791
150875
|
)
|
|
150792
150876
|
);
|
|
150793
150877
|
}
|
|
@@ -150804,7 +150888,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150804
150888
|
)),
|
|
150805
150889
|
/*moduleSpecifier*/
|
|
150806
150890
|
void 0,
|
|
150807
|
-
/*
|
|
150891
|
+
/*attributes*/
|
|
150808
150892
|
void 0
|
|
150809
150893
|
));
|
|
150810
150894
|
}
|
|
@@ -155775,7 +155859,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155775
155859
|
namedImports
|
|
155776
155860
|
),
|
|
155777
155861
|
required,
|
|
155778
|
-
/*
|
|
155862
|
+
/*attributes*/
|
|
155779
155863
|
void 0
|
|
155780
155864
|
)
|
|
155781
155865
|
);
|
|
@@ -155944,7 +156028,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155944
156028
|
const newTypeNode = factory.updateImportTypeNode(
|
|
155945
156029
|
importType,
|
|
155946
156030
|
importType.argument,
|
|
155947
|
-
importType.
|
|
156031
|
+
importType.attributes,
|
|
155948
156032
|
importType.qualifier,
|
|
155949
156033
|
importType.typeArguments,
|
|
155950
156034
|
/*isTypeOf*/
|
|
@@ -156212,7 +156296,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156212
156296
|
void 0
|
|
156213
156297
|
),
|
|
156214
156298
|
importDeclaration.moduleSpecifier,
|
|
156215
|
-
importDeclaration.
|
|
156299
|
+
importDeclaration.attributes
|
|
156216
156300
|
)
|
|
156217
156301
|
);
|
|
156218
156302
|
changes.insertNodeAfter(
|
|
@@ -156229,7 +156313,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156229
156313
|
importClause.namedBindings
|
|
156230
156314
|
),
|
|
156231
156315
|
importDeclaration.moduleSpecifier,
|
|
156232
|
-
importDeclaration.
|
|
156316
|
+
importDeclaration.attributes
|
|
156233
156317
|
)
|
|
156234
156318
|
);
|
|
156235
156319
|
}
|
|
@@ -160600,7 +160684,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160600
160684
|
case 291 /* JsxAttribute */:
|
|
160601
160685
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
160602
160686
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
160603
|
-
return argumentInfo &&
|
|
160687
|
+
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */);
|
|
160604
160688
|
}
|
|
160605
160689
|
case 272 /* ImportDeclaration */:
|
|
160606
160690
|
case 278 /* ExportDeclaration */:
|
|
@@ -160669,12 +160753,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160669
160753
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
160670
160754
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
160671
160755
|
}
|
|
160672
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker
|
|
160756
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
160673
160757
|
let isNewIdentifier = false;
|
|
160674
160758
|
const uniques = /* @__PURE__ */ new Map();
|
|
160675
|
-
const candidates = [];
|
|
160676
160759
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
160677
|
-
checker.
|
|
160760
|
+
const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
|
|
160678
160761
|
const types = flatMap(candidates, (candidate) => {
|
|
160679
160762
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
160680
160763
|
return;
|
|
@@ -165558,7 +165641,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165558
165641
|
/*importClause*/
|
|
165559
165642
|
void 0,
|
|
165560
165643
|
moduleSpecifier,
|
|
165561
|
-
/*
|
|
165644
|
+
/*attributes*/
|
|
165562
165645
|
void 0
|
|
165563
165646
|
));
|
|
165564
165647
|
} else {
|
|
@@ -165724,7 +165807,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165724
165807
|
exportDecl.isTypeOnly,
|
|
165725
165808
|
exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)),
|
|
165726
165809
|
exportDecl.moduleSpecifier,
|
|
165727
|
-
exportDecl.
|
|
165810
|
+
exportDecl.attributes
|
|
165728
165811
|
)
|
|
165729
165812
|
);
|
|
165730
165813
|
}
|
|
@@ -165756,7 +165839,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165756
165839
|
factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings),
|
|
165757
165840
|
// TODO: GH#18217
|
|
165758
165841
|
importDeclaration.moduleSpecifier,
|
|
165759
|
-
importDeclaration.
|
|
165842
|
+
importDeclaration.attributes
|
|
165760
165843
|
);
|
|
165761
165844
|
}
|
|
165762
165845
|
function sortSpecifiers(specifiers, comparer) {
|
|
@@ -166274,10 +166357,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
166274
166357
|
return spanForParenthesizedExpression(n);
|
|
166275
166358
|
case 275 /* NamedImports */:
|
|
166276
166359
|
case 279 /* NamedExports */:
|
|
166360
|
+
case 300 /* ImportAttributes */:
|
|
166277
166361
|
case 300 /* AssertClause */:
|
|
166278
|
-
return
|
|
166362
|
+
return spanForImportExportElements(n);
|
|
166279
166363
|
}
|
|
166280
|
-
function
|
|
166364
|
+
function spanForImportExportElements(node) {
|
|
166281
166365
|
if (!node.elements.length) {
|
|
166282
166366
|
return void 0;
|
|
166283
166367
|
}
|
|
@@ -175799,8 +175883,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175799
175883
|
const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory);
|
|
175800
175884
|
if (isSymlink) {
|
|
175801
175885
|
symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
|
|
175802
|
-
real,
|
|
175803
|
-
realPath: realPath2
|
|
175886
|
+
real: ensureTrailingDirectorySeparator(real),
|
|
175887
|
+
realPath: ensureTrailingDirectorySeparator(realPath2)
|
|
175804
175888
|
});
|
|
175805
175889
|
}
|
|
175806
175890
|
return mapDefined(entrypoints, (entrypoint) => {
|
|
@@ -184896,7 +184980,7 @@ ${e.message}`;
|
|
|
184896
184980
|
getRenameLocation: () => getRenameLocation,
|
|
184897
184981
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
184898
184982
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
184899
|
-
|
|
184983
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
184900
184984
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
184901
184985
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
184902
184986
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -185028,6 +185112,7 @@ ${e.message}`;
|
|
|
185028
185112
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
185029
185113
|
hasQuestionToken: () => hasQuestionToken,
|
|
185030
185114
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
185115
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
185031
185116
|
hasRestParameter: () => hasRestParameter,
|
|
185032
185117
|
hasScopeMarker: () => hasScopeMarker,
|
|
185033
185118
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -185101,7 +185186,6 @@ ${e.message}`;
|
|
|
185101
185186
|
isAssertClause: () => isAssertClause,
|
|
185102
185187
|
isAssertEntry: () => isAssertEntry,
|
|
185103
185188
|
isAssertionExpression: () => isAssertionExpression,
|
|
185104
|
-
isAssertionKey: () => isAssertionKey,
|
|
185105
185189
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
185106
185190
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
185107
185191
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -185142,6 +185226,7 @@ ${e.message}`;
|
|
|
185142
185226
|
isCallExpression: () => isCallExpression,
|
|
185143
185227
|
isCallExpressionTarget: () => isCallExpressionTarget,
|
|
185144
185228
|
isCallLikeExpression: () => isCallLikeExpression,
|
|
185229
|
+
isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
|
|
185145
185230
|
isCallOrNewExpression: () => isCallOrNewExpression,
|
|
185146
185231
|
isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
|
|
185147
185232
|
isCallSignatureDeclaration: () => isCallSignatureDeclaration,
|
|
@@ -185310,6 +185395,9 @@ ${e.message}`;
|
|
|
185310
185395
|
isIfStatement: () => isIfStatement,
|
|
185311
185396
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
185312
185397
|
isImplicitGlob: () => isImplicitGlob,
|
|
185398
|
+
isImportAttribute: () => isImportAttribute,
|
|
185399
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
185400
|
+
isImportAttributes: () => isImportAttributes,
|
|
185313
185401
|
isImportCall: () => isImportCall,
|
|
185314
185402
|
isImportClause: () => isImportClause,
|
|
185315
185403
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -185501,7 +185589,6 @@ ${e.message}`;
|
|
|
185501
185589
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
185502
185590
|
isNewExpression: () => isNewExpression,
|
|
185503
185591
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
185504
|
-
isNightly: () => isNightly,
|
|
185505
185592
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
185506
185593
|
isNode: () => isNode,
|
|
185507
185594
|
isNodeArray: () => isNodeArray,
|
|
@@ -187302,7 +187389,7 @@ ${e.message}`;
|
|
|
187302
187389
|
getRenameLocation: () => getRenameLocation,
|
|
187303
187390
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
187304
187391
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
187305
|
-
|
|
187392
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
187306
187393
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
187307
187394
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
187308
187395
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -187434,6 +187521,7 @@ ${e.message}`;
|
|
|
187434
187521
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
187435
187522
|
hasQuestionToken: () => hasQuestionToken,
|
|
187436
187523
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
187524
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
187437
187525
|
hasRestParameter: () => hasRestParameter,
|
|
187438
187526
|
hasScopeMarker: () => hasScopeMarker,
|
|
187439
187527
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -187507,7 +187595,6 @@ ${e.message}`;
|
|
|
187507
187595
|
isAssertClause: () => isAssertClause,
|
|
187508
187596
|
isAssertEntry: () => isAssertEntry,
|
|
187509
187597
|
isAssertionExpression: () => isAssertionExpression,
|
|
187510
|
-
isAssertionKey: () => isAssertionKey,
|
|
187511
187598
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
187512
187599
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
187513
187600
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -187548,6 +187635,7 @@ ${e.message}`;
|
|
|
187548
187635
|
isCallExpression: () => isCallExpression,
|
|
187549
187636
|
isCallExpressionTarget: () => isCallExpressionTarget,
|
|
187550
187637
|
isCallLikeExpression: () => isCallLikeExpression,
|
|
187638
|
+
isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
|
|
187551
187639
|
isCallOrNewExpression: () => isCallOrNewExpression,
|
|
187552
187640
|
isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
|
|
187553
187641
|
isCallSignatureDeclaration: () => isCallSignatureDeclaration,
|
|
@@ -187716,6 +187804,9 @@ ${e.message}`;
|
|
|
187716
187804
|
isIfStatement: () => isIfStatement,
|
|
187717
187805
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
187718
187806
|
isImplicitGlob: () => isImplicitGlob,
|
|
187807
|
+
isImportAttribute: () => isImportAttribute,
|
|
187808
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
187809
|
+
isImportAttributes: () => isImportAttributes,
|
|
187719
187810
|
isImportCall: () => isImportCall,
|
|
187720
187811
|
isImportClause: () => isImportClause,
|
|
187721
187812
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -187907,7 +187998,6 @@ ${e.message}`;
|
|
|
187907
187998
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
187908
187999
|
isNewExpression: () => isNewExpression,
|
|
187909
188000
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
187910
|
-
isNightly: () => isNightly,
|
|
187911
188001
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
187912
188002
|
isNode: () => isNode,
|
|
187913
188003
|
isNodeArray: () => isNodeArray,
|