typescript 5.3.0-dev.20230926 → 5.3.0-dev.20230928
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 +319 -259
- package/lib/tsserver.js +363 -289
- package/lib/typescript.d.ts +51 -29
- package/lib/typescript.js +358 -286
- package/lib/typingsInstaller.js +165 -109
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -992,7 +992,7 @@ __export(server_exports, {
|
|
|
992
992
|
getRenameLocation: () => getRenameLocation,
|
|
993
993
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
994
994
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
995
|
-
|
|
995
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
996
996
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
997
997
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
998
998
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -1124,6 +1124,7 @@ __export(server_exports, {
|
|
|
1124
1124
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
1125
1125
|
hasQuestionToken: () => hasQuestionToken,
|
|
1126
1126
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
1127
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
1127
1128
|
hasRestParameter: () => hasRestParameter,
|
|
1128
1129
|
hasScopeMarker: () => hasScopeMarker,
|
|
1129
1130
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -1197,7 +1198,6 @@ __export(server_exports, {
|
|
|
1197
1198
|
isAssertClause: () => isAssertClause,
|
|
1198
1199
|
isAssertEntry: () => isAssertEntry,
|
|
1199
1200
|
isAssertionExpression: () => isAssertionExpression,
|
|
1200
|
-
isAssertionKey: () => isAssertionKey,
|
|
1201
1201
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
1202
1202
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
1203
1203
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -1407,6 +1407,9 @@ __export(server_exports, {
|
|
|
1407
1407
|
isIfStatement: () => isIfStatement,
|
|
1408
1408
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
1409
1409
|
isImplicitGlob: () => isImplicitGlob,
|
|
1410
|
+
isImportAttribute: () => isImportAttribute,
|
|
1411
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
1412
|
+
isImportAttributes: () => isImportAttributes,
|
|
1410
1413
|
isImportCall: () => isImportCall,
|
|
1411
1414
|
isImportClause: () => isImportClause,
|
|
1412
1415
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -1598,7 +1601,6 @@ __export(server_exports, {
|
|
|
1598
1601
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
1599
1602
|
isNewExpression: () => isNewExpression,
|
|
1600
1603
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
1601
|
-
isNightly: () => isNightly,
|
|
1602
1604
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
1603
1605
|
isNode: () => isNode,
|
|
1604
1606
|
isNodeArray: () => isNodeArray,
|
|
@@ -2328,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2330
|
|
|
2329
2331
|
// src/compiler/corePublic.ts
|
|
2330
2332
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-dev.20230928`;
|
|
2332
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6037,8 +6039,10 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6037
6039
|
SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause";
|
|
6038
6040
|
SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause";
|
|
6039
6041
|
SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause";
|
|
6040
|
-
SyntaxKind5[SyntaxKind5["
|
|
6041
|
-
SyntaxKind5[SyntaxKind5["
|
|
6042
|
+
SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes";
|
|
6043
|
+
SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute";
|
|
6044
|
+
SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
6045
|
+
SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
6042
6046
|
SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
|
|
6043
6047
|
SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
6044
6048
|
SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
@@ -7341,7 +7345,8 @@ var ListFormat = /* @__PURE__ */ ((ListFormat2) => {
|
|
|
7341
7345
|
ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
|
|
7342
7346
|
ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
|
|
7343
7347
|
ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
|
|
7344
|
-
ListFormat2[ListFormat2["
|
|
7348
|
+
ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes";
|
|
7349
|
+
ListFormat2[ListFormat2["ImportClauseEntries"] = 526226 /* ImportAttributes */] = "ImportClauseEntries";
|
|
7345
7350
|
ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
|
|
7346
7351
|
ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements";
|
|
7347
7352
|
ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
|
|
@@ -9581,9 +9586,8 @@ var Diagnostics = {
|
|
|
9581
9586
|
_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."),
|
|
9582
9587
|
_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."),
|
|
9583
9588
|
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."),
|
|
9584
|
-
|
|
9589
|
+
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"),
|
|
9585
9590
|
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"),
|
|
9586
|
-
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`."),
|
|
9587
9591
|
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`."),
|
|
9588
9592
|
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."),
|
|
9589
9593
|
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."),
|
|
@@ -9593,6 +9597,8 @@ var Diagnostics = {
|
|
|
9593
9597
|
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"`),
|
|
9594
9598
|
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"`),
|
|
9595
9599
|
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"),
|
|
9600
|
+
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."),
|
|
9601
|
+
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'."),
|
|
9596
9602
|
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."),
|
|
9597
9603
|
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."),
|
|
9598
9604
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -9619,6 +9625,7 @@ var Diagnostics = {
|
|
|
9619
9625
|
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."),
|
|
9620
9626
|
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."),
|
|
9621
9627
|
_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."),
|
|
9628
|
+
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."),
|
|
9622
9629
|
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."),
|
|
9623
9630
|
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."),
|
|
9624
9631
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -10148,15 +10155,15 @@ var Diagnostics = {
|
|
|
10148
10155
|
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}'?"),
|
|
10149
10156
|
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'."),
|
|
10150
10157
|
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."),
|
|
10158
|
+
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'."),
|
|
10151
10159
|
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}'?"),
|
|
10152
10160
|
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."),
|
|
10153
10161
|
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}'?"),
|
|
10154
|
-
|
|
10162
|
+
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."),
|
|
10155
10163
|
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."),
|
|
10156
10164
|
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."),
|
|
10157
10165
|
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."),
|
|
10158
10166
|
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"),
|
|
10159
|
-
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'."),
|
|
10160
10167
|
_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?"),
|
|
10161
10168
|
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."),
|
|
10162
10169
|
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."),
|
|
@@ -10170,6 +10177,10 @@ var Diagnostics = {
|
|
|
10170
10177
|
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."),
|
|
10171
10178
|
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."),
|
|
10172
10179
|
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."),
|
|
10180
|
+
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."),
|
|
10181
|
+
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."),
|
|
10182
|
+
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."),
|
|
10183
|
+
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}'."),
|
|
10173
10184
|
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}'."),
|
|
10174
10185
|
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}'."),
|
|
10175
10186
|
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}'."),
|
|
@@ -10278,7 +10289,6 @@ var Diagnostics = {
|
|
|
10278
10289
|
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}'."),
|
|
10279
10290
|
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}'?"),
|
|
10280
10291
|
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'."),
|
|
10281
|
-
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'."),
|
|
10282
10292
|
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."),
|
|
10283
10293
|
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."),
|
|
10284
10294
|
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}'."),
|
|
@@ -14353,12 +14363,12 @@ function isTypeOnlyExportDeclaration(node) {
|
|
|
14353
14363
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
14354
14364
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
14355
14365
|
}
|
|
14356
|
-
function isAssertionKey(node) {
|
|
14357
|
-
return isStringLiteral(node) || isIdentifier(node);
|
|
14358
|
-
}
|
|
14359
14366
|
function isStringTextContainingNode(node) {
|
|
14360
14367
|
return node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
14361
14368
|
}
|
|
14369
|
+
function isImportAttributeName(node) {
|
|
14370
|
+
return isStringLiteral(node) || isIdentifier(node);
|
|
14371
|
+
}
|
|
14362
14372
|
function isGeneratedIdentifier(node) {
|
|
14363
14373
|
var _a;
|
|
14364
14374
|
return isIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0;
|
|
@@ -18713,9 +18723,6 @@ function getIndentString(level) {
|
|
|
18713
18723
|
function getIndentSize() {
|
|
18714
18724
|
return indentStrings[1].length;
|
|
18715
18725
|
}
|
|
18716
|
-
function isNightly() {
|
|
18717
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
18718
|
-
}
|
|
18719
18726
|
function createTextWriter(newLine) {
|
|
18720
18727
|
var output;
|
|
18721
18728
|
var indent3;
|
|
@@ -21660,6 +21667,12 @@ function getPropertyNameFromType(type) {
|
|
|
21660
21667
|
function isExpandoPropertyDeclaration(declaration) {
|
|
21661
21668
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
21662
21669
|
}
|
|
21670
|
+
function hasResolutionModeOverride(node) {
|
|
21671
|
+
if (node === void 0) {
|
|
21672
|
+
return false;
|
|
21673
|
+
}
|
|
21674
|
+
return !!getResolutionModeOverride(node.attributes);
|
|
21675
|
+
}
|
|
21663
21676
|
|
|
21664
21677
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21665
21678
|
function createBaseNodeFactory() {
|
|
@@ -22542,6 +22555,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22542
22555
|
updateAssertEntry,
|
|
22543
22556
|
createImportTypeAssertionContainer,
|
|
22544
22557
|
updateImportTypeAssertionContainer,
|
|
22558
|
+
createImportAttributes,
|
|
22559
|
+
updateImportAttributes,
|
|
22560
|
+
createImportAttribute,
|
|
22561
|
+
updateImportAttribute,
|
|
22545
22562
|
createNamespaceImport,
|
|
22546
22563
|
updateNamespaceImport,
|
|
22547
22564
|
createNamespaceExport,
|
|
@@ -23810,18 +23827,21 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23810
23827
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
23811
23828
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
23812
23829
|
}
|
|
23813
|
-
function createImportTypeNode(argument,
|
|
23830
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
23814
23831
|
const node = createBaseNode(205 /* ImportType */);
|
|
23815
23832
|
node.argument = argument;
|
|
23816
|
-
node.
|
|
23833
|
+
node.attributes = attributes;
|
|
23834
|
+
if (node.assertions && node.assertions.assertClause && node.attributes) {
|
|
23835
|
+
node.assertions.assertClause = node.attributes;
|
|
23836
|
+
}
|
|
23817
23837
|
node.qualifier = qualifier;
|
|
23818
23838
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
23819
23839
|
node.isTypeOf = isTypeOf;
|
|
23820
23840
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23821
23841
|
return node;
|
|
23822
23842
|
}
|
|
23823
|
-
function updateImportTypeNode(node, argument,
|
|
23824
|
-
return node.argument !== argument || node.
|
|
23843
|
+
function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
23844
|
+
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;
|
|
23825
23845
|
}
|
|
23826
23846
|
function createParenthesizedType(type) {
|
|
23827
23847
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -24951,19 +24971,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24951
24971
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
24952
24972
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
24953
24973
|
}
|
|
24954
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
24974
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
24955
24975
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
24956
24976
|
node.modifiers = asNodeArray(modifiers);
|
|
24957
24977
|
node.importClause = importClause;
|
|
24958
24978
|
node.moduleSpecifier = moduleSpecifier;
|
|
24959
|
-
node.assertClause =
|
|
24979
|
+
node.attributes = node.assertClause = attributes;
|
|
24960
24980
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
24961
24981
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24962
24982
|
node.jsDoc = void 0;
|
|
24963
24983
|
return node;
|
|
24964
24984
|
}
|
|
24965
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
24966
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
24985
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
|
|
24986
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
|
|
24967
24987
|
}
|
|
24968
24988
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
24969
24989
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -24984,6 +25004,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24984
25004
|
const node = createBaseNode(300 /* AssertClause */);
|
|
24985
25005
|
node.elements = createNodeArray(elements);
|
|
24986
25006
|
node.multiLine = multiLine;
|
|
25007
|
+
node.token = 132 /* AssertKeyword */;
|
|
24987
25008
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
24988
25009
|
return node;
|
|
24989
25010
|
}
|
|
@@ -25009,6 +25030,27 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25009
25030
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
25010
25031
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
25011
25032
|
}
|
|
25033
|
+
function createImportAttributes(elements, multiLine, token) {
|
|
25034
|
+
const node = createBaseNode(300 /* ImportAttributes */);
|
|
25035
|
+
node.token = token ?? 118 /* WithKeyword */;
|
|
25036
|
+
node.elements = createNodeArray(elements);
|
|
25037
|
+
node.multiLine = multiLine;
|
|
25038
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
25039
|
+
return node;
|
|
25040
|
+
}
|
|
25041
|
+
function updateImportAttributes(node, elements, multiLine) {
|
|
25042
|
+
return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
|
|
25043
|
+
}
|
|
25044
|
+
function createImportAttribute(name, value) {
|
|
25045
|
+
const node = createBaseNode(301 /* ImportAttribute */);
|
|
25046
|
+
node.name = name;
|
|
25047
|
+
node.value = value;
|
|
25048
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
25049
|
+
return node;
|
|
25050
|
+
}
|
|
25051
|
+
function updateImportAttribute(node, name, value) {
|
|
25052
|
+
return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
|
|
25053
|
+
}
|
|
25012
25054
|
function createNamespaceImport(name) {
|
|
25013
25055
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
25014
25056
|
node.name = name;
|
|
@@ -25069,20 +25111,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25069
25111
|
function updateExportAssignment(node, modifiers, expression) {
|
|
25070
25112
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node;
|
|
25071
25113
|
}
|
|
25072
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25114
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
25073
25115
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
25074
25116
|
node.modifiers = asNodeArray(modifiers);
|
|
25075
25117
|
node.isTypeOnly = isTypeOnly;
|
|
25076
25118
|
node.exportClause = exportClause;
|
|
25077
25119
|
node.moduleSpecifier = moduleSpecifier;
|
|
25078
|
-
node.assertClause =
|
|
25120
|
+
node.attributes = node.assertClause = attributes;
|
|
25079
25121
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
25080
25122
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
25081
25123
|
node.jsDoc = void 0;
|
|
25082
25124
|
return node;
|
|
25083
25125
|
}
|
|
25084
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25085
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
25126
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
25127
|
+
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;
|
|
25086
25128
|
}
|
|
25087
25129
|
function finishUpdateExportDeclaration(updated, original) {
|
|
25088
25130
|
if (updated !== original) {
|
|
@@ -26409,7 +26451,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26409
26451
|
} else {
|
|
26410
26452
|
modifierArray = modifiers;
|
|
26411
26453
|
}
|
|
26412
|
-
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.
|
|
26454
|
+
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);
|
|
26413
26455
|
}
|
|
26414
26456
|
function updateModifierLike(node, modifierArray) {
|
|
26415
26457
|
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);
|
|
@@ -28758,6 +28800,12 @@ function isAssertClause(node) {
|
|
|
28758
28800
|
function isAssertEntry(node) {
|
|
28759
28801
|
return node.kind === 301 /* AssertEntry */;
|
|
28760
28802
|
}
|
|
28803
|
+
function isImportAttributes(node) {
|
|
28804
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
28805
|
+
}
|
|
28806
|
+
function isImportAttribute(node) {
|
|
28807
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
28808
|
+
}
|
|
28761
28809
|
function isNamespaceImport(node) {
|
|
28762
28810
|
return node.kind === 274 /* NamespaceImport */;
|
|
28763
28811
|
}
|
|
@@ -29479,7 +29527,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
29479
29527
|
namedBindings
|
|
29480
29528
|
),
|
|
29481
29529
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
29482
|
-
/*
|
|
29530
|
+
/*attributes*/
|
|
29483
29531
|
void 0
|
|
29484
29532
|
);
|
|
29485
29533
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -30245,7 +30293,7 @@ var forEachChildTable = {
|
|
|
30245
30293
|
return visitNode2(cbNode, node.typeParameter);
|
|
30246
30294
|
},
|
|
30247
30295
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
30248
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
30296
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
30249
30297
|
},
|
|
30250
30298
|
[302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
|
|
30251
30299
|
return visitNode2(cbNode, node.assertClause);
|
|
@@ -30419,15 +30467,15 @@ var forEachChildTable = {
|
|
|
30419
30467
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
30420
30468
|
},
|
|
30421
30469
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
30422
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
30470
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
30423
30471
|
},
|
|
30424
30472
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
30425
30473
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
30426
30474
|
},
|
|
30427
|
-
[300 /*
|
|
30475
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
30428
30476
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
30429
30477
|
},
|
|
30430
|
-
[301 /*
|
|
30478
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
30431
30479
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
30432
30480
|
},
|
|
30433
30481
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -30442,7 +30490,7 @@ var forEachChildTable = {
|
|
|
30442
30490
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
30443
30491
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
30444
30492
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
30445
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
30493
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
30446
30494
|
},
|
|
30447
30495
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
30448
30496
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -31722,7 +31770,7 @@ var Parser;
|
|
|
31722
31770
|
function isLiteralPropertyName() {
|
|
31723
31771
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
31724
31772
|
}
|
|
31725
|
-
function
|
|
31773
|
+
function isImportAttributeName2() {
|
|
31726
31774
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
31727
31775
|
}
|
|
31728
31776
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -31841,8 +31889,8 @@ var Parser;
|
|
|
31841
31889
|
return isLiteralPropertyName();
|
|
31842
31890
|
case 9 /* ObjectBindingElements */:
|
|
31843
31891
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
31844
|
-
case 24 /*
|
|
31845
|
-
return
|
|
31892
|
+
case 24 /* ImportAttributes */:
|
|
31893
|
+
return isImportAttributeName2();
|
|
31846
31894
|
case 7 /* HeritageClauseElement */:
|
|
31847
31895
|
if (token() === 19 /* OpenBraceToken */) {
|
|
31848
31896
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -31945,7 +31993,7 @@ var Parser;
|
|
|
31945
31993
|
case 12 /* ObjectLiteralMembers */:
|
|
31946
31994
|
case 9 /* ObjectBindingElements */:
|
|
31947
31995
|
case 23 /* ImportOrExportSpecifiers */:
|
|
31948
|
-
case 24 /*
|
|
31996
|
+
case 24 /* ImportAttributes */:
|
|
31949
31997
|
return token() === 20 /* CloseBraceToken */;
|
|
31950
31998
|
case 3 /* SwitchClauseStatements */:
|
|
31951
31999
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -32251,7 +32299,7 @@ var Parser;
|
|
|
32251
32299
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32252
32300
|
case 14 /* JsxChildren */:
|
|
32253
32301
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32254
|
-
case 24 /*
|
|
32302
|
+
case 24 /* ImportAttributes */:
|
|
32255
32303
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
32256
32304
|
case 25 /* JSDocComment */:
|
|
32257
32305
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -33126,28 +33174,6 @@ var Parser;
|
|
|
33126
33174
|
nextToken();
|
|
33127
33175
|
return token() === 102 /* ImportKeyword */;
|
|
33128
33176
|
}
|
|
33129
|
-
function parseImportTypeAssertions() {
|
|
33130
|
-
const pos = getNodePos();
|
|
33131
|
-
const openBracePosition = scanner2.getTokenStart();
|
|
33132
|
-
parseExpected(19 /* OpenBraceToken */);
|
|
33133
|
-
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
33134
|
-
parseExpected(132 /* AssertKeyword */);
|
|
33135
|
-
parseExpected(59 /* ColonToken */);
|
|
33136
|
-
const clause = parseAssertClause(
|
|
33137
|
-
/*skipAssertKeyword*/
|
|
33138
|
-
true
|
|
33139
|
-
);
|
|
33140
|
-
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
33141
|
-
const lastError = lastOrUndefined(parseDiagnostics);
|
|
33142
|
-
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
33143
|
-
addRelatedInfo(
|
|
33144
|
-
lastError,
|
|
33145
|
-
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
33146
|
-
);
|
|
33147
|
-
}
|
|
33148
|
-
}
|
|
33149
|
-
return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
33150
|
-
}
|
|
33151
33177
|
function parseImportType() {
|
|
33152
33178
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
33153
33179
|
const pos = getNodePos();
|
|
@@ -33155,14 +33181,36 @@ var Parser;
|
|
|
33155
33181
|
parseExpected(102 /* ImportKeyword */);
|
|
33156
33182
|
parseExpected(21 /* OpenParenToken */);
|
|
33157
33183
|
const type = parseType();
|
|
33158
|
-
let
|
|
33184
|
+
let attributes;
|
|
33159
33185
|
if (parseOptional(28 /* CommaToken */)) {
|
|
33160
|
-
|
|
33186
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
33187
|
+
parseExpected(19 /* OpenBraceToken */);
|
|
33188
|
+
const currentToken2 = token();
|
|
33189
|
+
if (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) {
|
|
33190
|
+
nextToken();
|
|
33191
|
+
} else {
|
|
33192
|
+
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
33193
|
+
}
|
|
33194
|
+
parseExpected(59 /* ColonToken */);
|
|
33195
|
+
attributes = parseImportAttributes(
|
|
33196
|
+
currentToken2,
|
|
33197
|
+
/*skipKeyword*/
|
|
33198
|
+
true
|
|
33199
|
+
);
|
|
33200
|
+
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
33201
|
+
const lastError = lastOrUndefined(parseDiagnostics);
|
|
33202
|
+
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
33203
|
+
addRelatedInfo(
|
|
33204
|
+
lastError,
|
|
33205
|
+
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
33206
|
+
);
|
|
33207
|
+
}
|
|
33208
|
+
}
|
|
33161
33209
|
}
|
|
33162
33210
|
parseExpected(22 /* CloseParenToken */);
|
|
33163
33211
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
33164
33212
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
33165
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
33213
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
33166
33214
|
}
|
|
33167
33215
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
33168
33216
|
nextToken();
|
|
@@ -36224,15 +36272,16 @@ var Parser;
|
|
|
36224
36272
|
parseExpected(161 /* FromKeyword */);
|
|
36225
36273
|
}
|
|
36226
36274
|
const moduleSpecifier = parseModuleSpecifier();
|
|
36227
|
-
|
|
36228
|
-
|
|
36229
|
-
|
|
36275
|
+
const currentToken2 = token();
|
|
36276
|
+
let attributes;
|
|
36277
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36278
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36230
36279
|
}
|
|
36231
36280
|
parseSemicolon();
|
|
36232
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
36281
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
36233
36282
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36234
36283
|
}
|
|
36235
|
-
function
|
|
36284
|
+
function parseImportAttribute() {
|
|
36236
36285
|
const pos = getNodePos();
|
|
36237
36286
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
36238
36287
|
parseExpected(59 /* ColonToken */);
|
|
@@ -36240,19 +36289,19 @@ var Parser;
|
|
|
36240
36289
|
/*allowReturnTypeInArrowFunction*/
|
|
36241
36290
|
true
|
|
36242
36291
|
);
|
|
36243
|
-
return finishNode(factory2.
|
|
36292
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
36244
36293
|
}
|
|
36245
|
-
function
|
|
36294
|
+
function parseImportAttributes(token2, skipKeyword) {
|
|
36246
36295
|
const pos = getNodePos();
|
|
36247
|
-
if (!
|
|
36248
|
-
parseExpected(
|
|
36296
|
+
if (!skipKeyword) {
|
|
36297
|
+
parseExpected(token2);
|
|
36249
36298
|
}
|
|
36250
36299
|
const openBracePosition = scanner2.getTokenStart();
|
|
36251
36300
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
36252
36301
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
36253
36302
|
const elements = parseDelimitedList(
|
|
36254
|
-
24 /*
|
|
36255
|
-
|
|
36303
|
+
24 /* ImportAttributes */,
|
|
36304
|
+
parseImportAttribute,
|
|
36256
36305
|
/*considerSemicolonAsDelimiter*/
|
|
36257
36306
|
true
|
|
36258
36307
|
);
|
|
@@ -36265,7 +36314,7 @@ var Parser;
|
|
|
36265
36314
|
);
|
|
36266
36315
|
}
|
|
36267
36316
|
}
|
|
36268
|
-
return finishNode(factory2.
|
|
36317
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
36269
36318
|
} else {
|
|
36270
36319
|
const elements = createNodeArray(
|
|
36271
36320
|
[],
|
|
@@ -36275,10 +36324,11 @@ var Parser;
|
|
|
36275
36324
|
/*hasTrailingComma*/
|
|
36276
36325
|
false
|
|
36277
36326
|
);
|
|
36278
|
-
return finishNode(factory2.
|
|
36327
|
+
return finishNode(factory2.createImportAttributes(
|
|
36279
36328
|
elements,
|
|
36280
36329
|
/*multiLine*/
|
|
36281
|
-
false
|
|
36330
|
+
false,
|
|
36331
|
+
token2
|
|
36282
36332
|
), pos);
|
|
36283
36333
|
}
|
|
36284
36334
|
}
|
|
@@ -36410,7 +36460,7 @@ var Parser;
|
|
|
36410
36460
|
);
|
|
36411
36461
|
let exportClause;
|
|
36412
36462
|
let moduleSpecifier;
|
|
36413
|
-
let
|
|
36463
|
+
let attributes;
|
|
36414
36464
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
36415
36465
|
const namespaceExportPos = getNodePos();
|
|
36416
36466
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -36426,12 +36476,13 @@ var Parser;
|
|
|
36426
36476
|
moduleSpecifier = parseModuleSpecifier();
|
|
36427
36477
|
}
|
|
36428
36478
|
}
|
|
36429
|
-
|
|
36430
|
-
|
|
36479
|
+
const currentToken2 = token();
|
|
36480
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36481
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36431
36482
|
}
|
|
36432
36483
|
parseSemicolon();
|
|
36433
36484
|
setAwaitContext(savedAwaitContext);
|
|
36434
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
36485
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
36435
36486
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36436
36487
|
}
|
|
36437
36488
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -36481,7 +36532,7 @@ var Parser;
|
|
|
36481
36532
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
36482
36533
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
36483
36534
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
36484
|
-
ParsingContext2[ParsingContext2["
|
|
36535
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
36485
36536
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
36486
36537
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
36487
36538
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -41549,10 +41600,15 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
41549
41600
|
const failedLookupLocations = [];
|
|
41550
41601
|
const affectingLocations = [];
|
|
41551
41602
|
let features = getNodeResolutionFeatures(options);
|
|
41552
|
-
if (resolutionMode
|
|
41603
|
+
if (resolutionMode !== void 0) {
|
|
41604
|
+
features |= 30 /* AllFeatures */;
|
|
41605
|
+
}
|
|
41606
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
41607
|
+
if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
|
|
41553
41608
|
features |= 32 /* EsmMode */;
|
|
41554
41609
|
}
|
|
41555
|
-
const
|
|
41610
|
+
const useImportCondition = resolutionMode === 99 /* ESNext */ || (resolutionMode !== void 0 ? false : void 0);
|
|
41611
|
+
const conditions = features & 8 /* Exports */ ? getConditions(options, useImportCondition) : [];
|
|
41556
41612
|
const diagnostics = [];
|
|
41557
41613
|
const moduleResolutionState = {
|
|
41558
41614
|
compilerOptions: options,
|
|
@@ -41721,11 +41777,19 @@ function getNodeResolutionFeatures(options) {
|
|
|
41721
41777
|
return features;
|
|
41722
41778
|
}
|
|
41723
41779
|
function getConditions(options, esmMode) {
|
|
41724
|
-
const
|
|
41780
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
41781
|
+
if (esmMode === void 0) {
|
|
41782
|
+
if (moduleResolution === 100 /* Bundler */) {
|
|
41783
|
+
esmMode ?? (esmMode = moduleResolution === 100 /* Bundler */);
|
|
41784
|
+
} else if (moduleResolution === 2 /* Node10 */) {
|
|
41785
|
+
return [];
|
|
41786
|
+
}
|
|
41787
|
+
}
|
|
41788
|
+
const conditions = esmMode ? ["import"] : ["require"];
|
|
41725
41789
|
if (!options.noDtsResolution) {
|
|
41726
41790
|
conditions.push("types");
|
|
41727
41791
|
}
|
|
41728
|
-
if (
|
|
41792
|
+
if (moduleResolution !== 100 /* Bundler */) {
|
|
41729
41793
|
conditions.push("node");
|
|
41730
41794
|
}
|
|
41731
41795
|
return concatenate(conditions, options.customConditions);
|
|
@@ -42168,13 +42232,13 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
42168
42232
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42169
42233
|
break;
|
|
42170
42234
|
case 2 /* Node10 */:
|
|
42171
|
-
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42235
|
+
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
42172
42236
|
break;
|
|
42173
42237
|
case 1 /* Classic */:
|
|
42174
42238
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42175
42239
|
break;
|
|
42176
42240
|
case 100 /* Bundler */:
|
|
42177
|
-
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42241
|
+
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
42178
42242
|
break;
|
|
42179
42243
|
default:
|
|
42180
42244
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
@@ -42352,7 +42416,7 @@ function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
42352
42416
|
resolutionMode
|
|
42353
42417
|
);
|
|
42354
42418
|
}
|
|
42355
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42419
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) {
|
|
42356
42420
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
42357
42421
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
42358
42422
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
@@ -42369,7 +42433,8 @@ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile,
|
|
|
42369
42433
|
extensions,
|
|
42370
42434
|
/*isConfigLookup*/
|
|
42371
42435
|
false,
|
|
42372
|
-
redirectedReference
|
|
42436
|
+
redirectedReference,
|
|
42437
|
+
conditions
|
|
42373
42438
|
);
|
|
42374
42439
|
}
|
|
42375
42440
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
@@ -42385,10 +42450,12 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
42385
42450
|
/*isConfigLookup*/
|
|
42386
42451
|
false,
|
|
42387
42452
|
/*redirectedReference*/
|
|
42453
|
+
void 0,
|
|
42454
|
+
/*conditions*/
|
|
42388
42455
|
void 0
|
|
42389
42456
|
);
|
|
42390
42457
|
}
|
|
42391
|
-
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
42458
|
+
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions) {
|
|
42392
42459
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
42393
42460
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
42394
42461
|
if (getResolveJsonModule(compilerOptions)) {
|
|
@@ -42404,10 +42471,11 @@ function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
42404
42471
|
extensions,
|
|
42405
42472
|
/*isConfigLookup*/
|
|
42406
42473
|
false,
|
|
42407
|
-
redirectedReference
|
|
42474
|
+
redirectedReference,
|
|
42475
|
+
conditions
|
|
42408
42476
|
);
|
|
42409
42477
|
}
|
|
42410
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
42478
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) {
|
|
42411
42479
|
let extensions;
|
|
42412
42480
|
if (isConfigLookup) {
|
|
42413
42481
|
extensions = 8 /* Json */;
|
|
@@ -42418,7 +42486,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
|
|
|
42418
42486
|
} else {
|
|
42419
42487
|
extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
42420
42488
|
}
|
|
42421
|
-
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
42489
|
+
return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
|
|
42422
42490
|
}
|
|
42423
42491
|
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
42424
42492
|
return nodeModuleNameResolverWorker(
|
|
@@ -42433,15 +42501,21 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
|
42433
42501
|
/*isConfigLookup*/
|
|
42434
42502
|
true,
|
|
42435
42503
|
/*redirectedReference*/
|
|
42504
|
+
void 0,
|
|
42505
|
+
/*conditions*/
|
|
42436
42506
|
void 0
|
|
42437
42507
|
);
|
|
42438
42508
|
}
|
|
42439
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
42509
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
42440
42510
|
var _a, _b, _c, _d;
|
|
42441
42511
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
42442
42512
|
const failedLookupLocations = [];
|
|
42443
42513
|
const affectingLocations = [];
|
|
42444
|
-
const
|
|
42514
|
+
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
42515
|
+
conditions ?? (conditions = getConditions(
|
|
42516
|
+
compilerOptions,
|
|
42517
|
+
moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 : !!(features & 32 /* EsmMode */)
|
|
42518
|
+
));
|
|
42445
42519
|
const diagnostics = [];
|
|
42446
42520
|
const state = {
|
|
42447
42521
|
compilerOptions,
|
|
@@ -42451,17 +42525,17 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42451
42525
|
affectingLocations,
|
|
42452
42526
|
packageJsonInfoCache: cache,
|
|
42453
42527
|
features,
|
|
42454
|
-
conditions,
|
|
42528
|
+
conditions: conditions ?? emptyArray,
|
|
42455
42529
|
requestContainingDirectory: containingDirectory,
|
|
42456
42530
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
42457
42531
|
isConfigLookup,
|
|
42458
42532
|
candidateIsFromPackageJsonField: false
|
|
42459
42533
|
};
|
|
42460
|
-
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(
|
|
42461
|
-
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
42534
|
+
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
42535
|
+
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
|
|
42462
42536
|
}
|
|
42463
42537
|
let result;
|
|
42464
|
-
if (
|
|
42538
|
+
if (moduleResolution === 2 /* Node10 */) {
|
|
42465
42539
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
42466
42540
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
42467
42541
|
result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
|
|
@@ -42469,7 +42543,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42469
42543
|
result = tryResolve(extensions, state);
|
|
42470
42544
|
}
|
|
42471
42545
|
let legacyResult;
|
|
42472
|
-
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")) {
|
|
42546
|
+
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"))) {
|
|
42473
42547
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
42474
42548
|
const diagnosticState = {
|
|
42475
42549
|
...state,
|
|
@@ -43267,7 +43341,8 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43267
43341
|
extensions,
|
|
43268
43342
|
/*isConfigLookup*/
|
|
43269
43343
|
false,
|
|
43270
|
-
redirectedReference
|
|
43344
|
+
redirectedReference,
|
|
43345
|
+
state.conditions
|
|
43271
43346
|
);
|
|
43272
43347
|
return toSearchResult(
|
|
43273
43348
|
result.resolvedModule ? {
|
|
@@ -51023,7 +51098,7 @@ function createTypeChecker(host) {
|
|
|
51023
51098
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
51024
51099
|
}
|
|
51025
51100
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
51026
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
51101
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
51027
51102
|
if (startsWith(moduleReference, "@types/")) {
|
|
51028
51103
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
51029
51104
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -51078,9 +51153,8 @@ function createTypeChecker(host) {
|
|
|
51078
51153
|
}
|
|
51079
51154
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
51080
51155
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
51081
|
-
const
|
|
51082
|
-
|
|
51083
|
-
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
51156
|
+
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
51157
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
51084
51158
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
51085
51159
|
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);
|
|
51086
51160
|
} else {
|
|
@@ -51186,7 +51260,7 @@ function createTypeChecker(host) {
|
|
|
51186
51260
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
51187
51261
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
51188
51262
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
51189
|
-
const suggestedExt = (
|
|
51263
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
51190
51264
|
if (suggestedExt) {
|
|
51191
51265
|
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);
|
|
51192
51266
|
} else {
|
|
@@ -52951,7 +53025,7 @@ function createTypeChecker(host) {
|
|
|
52951
53025
|
return factory.updateImportTypeNode(
|
|
52952
53026
|
root,
|
|
52953
53027
|
root.argument,
|
|
52954
|
-
root.
|
|
53028
|
+
root.attributes,
|
|
52955
53029
|
qualifier,
|
|
52956
53030
|
typeArguments,
|
|
52957
53031
|
root.isTypeOf
|
|
@@ -53684,7 +53758,6 @@ function createTypeChecker(host) {
|
|
|
53684
53758
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
53685
53759
|
}
|
|
53686
53760
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
53687
|
-
var _a, _b, _c, _d;
|
|
53688
53761
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
53689
53762
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
53690
53763
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -53693,17 +53766,18 @@ function createTypeChecker(host) {
|
|
|
53693
53766
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
53694
53767
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
53695
53768
|
let specifier;
|
|
53696
|
-
let
|
|
53769
|
+
let attributes;
|
|
53697
53770
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
53698
53771
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
53699
53772
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
53700
|
-
|
|
53701
|
-
factory.
|
|
53702
|
-
factory.
|
|
53703
|
-
|
|
53704
|
-
|
|
53705
|
-
|
|
53706
|
-
|
|
53773
|
+
attributes = factory.createImportAttributes(
|
|
53774
|
+
factory.createNodeArray([
|
|
53775
|
+
factory.createImportAttribute(
|
|
53776
|
+
factory.createStringLiteral("resolution-mode"),
|
|
53777
|
+
factory.createStringLiteral("import")
|
|
53778
|
+
)
|
|
53779
|
+
])
|
|
53780
|
+
);
|
|
53707
53781
|
}
|
|
53708
53782
|
}
|
|
53709
53783
|
if (!specifier) {
|
|
@@ -53717,16 +53791,17 @@ function createTypeChecker(host) {
|
|
|
53717
53791
|
if (specifier.includes("/node_modules/")) {
|
|
53718
53792
|
specifier = oldSpecifier;
|
|
53719
53793
|
} else {
|
|
53720
|
-
|
|
53721
|
-
factory.
|
|
53722
|
-
factory.
|
|
53723
|
-
|
|
53724
|
-
|
|
53725
|
-
|
|
53726
|
-
|
|
53794
|
+
attributes = factory.createImportAttributes(
|
|
53795
|
+
factory.createNodeArray([
|
|
53796
|
+
factory.createImportAttribute(
|
|
53797
|
+
factory.createStringLiteral("resolution-mode"),
|
|
53798
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
53799
|
+
)
|
|
53800
|
+
])
|
|
53801
|
+
);
|
|
53727
53802
|
}
|
|
53728
53803
|
}
|
|
53729
|
-
if (!
|
|
53804
|
+
if (!attributes) {
|
|
53730
53805
|
context.encounteredError = true;
|
|
53731
53806
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
53732
53807
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -53746,11 +53821,11 @@ function createTypeChecker(host) {
|
|
|
53746
53821
|
void 0
|
|
53747
53822
|
);
|
|
53748
53823
|
}
|
|
53749
|
-
return factory.createImportTypeNode(lit,
|
|
53824
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
53750
53825
|
} else {
|
|
53751
53826
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
53752
53827
|
const qualifier = splitNode.objectType.typeName;
|
|
53753
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
53828
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
53754
53829
|
}
|
|
53755
53830
|
}
|
|
53756
53831
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -54226,7 +54301,7 @@ function createTypeChecker(host) {
|
|
|
54226
54301
|
return factory.updateImportTypeNode(
|
|
54227
54302
|
node,
|
|
54228
54303
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
54229
|
-
node.
|
|
54304
|
+
node.attributes,
|
|
54230
54305
|
node.qualifier,
|
|
54231
54306
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
54232
54307
|
node.isTypeOf
|
|
@@ -54446,7 +54521,7 @@ function createTypeChecker(host) {
|
|
|
54446
54521
|
return statements;
|
|
54447
54522
|
}
|
|
54448
54523
|
function inlineExportModifiers(statements) {
|
|
54449
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
54524
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
|
|
54450
54525
|
if (index >= 0) {
|
|
54451
54526
|
const exportDecl = statements[index];
|
|
54452
54527
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -54474,7 +54549,7 @@ function createTypeChecker(host) {
|
|
|
54474
54549
|
replacements
|
|
54475
54550
|
),
|
|
54476
54551
|
exportDecl.moduleSpecifier,
|
|
54477
|
-
exportDecl.
|
|
54552
|
+
exportDecl.attributes
|
|
54478
54553
|
);
|
|
54479
54554
|
}
|
|
54480
54555
|
}
|
|
@@ -55125,7 +55200,7 @@ function createTypeChecker(host) {
|
|
|
55125
55200
|
)])
|
|
55126
55201
|
),
|
|
55127
55202
|
factory.createStringLiteral(specifier2),
|
|
55128
|
-
/*
|
|
55203
|
+
/*attributes*/
|
|
55129
55204
|
void 0
|
|
55130
55205
|
),
|
|
55131
55206
|
0 /* None */
|
|
@@ -55213,7 +55288,7 @@ function createTypeChecker(host) {
|
|
|
55213
55288
|
void 0
|
|
55214
55289
|
),
|
|
55215
55290
|
specifier2,
|
|
55216
|
-
node.parent.
|
|
55291
|
+
node.parent.attributes
|
|
55217
55292
|
),
|
|
55218
55293
|
0 /* None */
|
|
55219
55294
|
);
|
|
@@ -55234,7 +55309,7 @@ function createTypeChecker(host) {
|
|
|
55234
55309
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
55235
55310
|
),
|
|
55236
55311
|
specifier2,
|
|
55237
|
-
node.parent.
|
|
55312
|
+
node.parent.attributes
|
|
55238
55313
|
),
|
|
55239
55314
|
0 /* None */
|
|
55240
55315
|
);
|
|
@@ -55275,7 +55350,7 @@ function createTypeChecker(host) {
|
|
|
55275
55350
|
])
|
|
55276
55351
|
),
|
|
55277
55352
|
specifier2,
|
|
55278
|
-
node.parent.parent.parent.
|
|
55353
|
+
node.parent.parent.parent.attributes
|
|
55279
55354
|
),
|
|
55280
55355
|
0 /* None */
|
|
55281
55356
|
);
|
|
@@ -64734,6 +64809,7 @@ function createTypeChecker(host) {
|
|
|
64734
64809
|
let skipParentCounter = 0;
|
|
64735
64810
|
let lastSkippedInfo;
|
|
64736
64811
|
let incompatibleStack;
|
|
64812
|
+
let relationCount = 16e6 - relation.size >> 3;
|
|
64737
64813
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
64738
64814
|
const result = isRelatedTo(
|
|
64739
64815
|
source,
|
|
@@ -64747,8 +64823,19 @@ function createTypeChecker(host) {
|
|
|
64747
64823
|
reportIncompatibleStack();
|
|
64748
64824
|
}
|
|
64749
64825
|
if (overflow) {
|
|
64826
|
+
const id = getRelationKey(
|
|
64827
|
+
source,
|
|
64828
|
+
target,
|
|
64829
|
+
/*intersectionState*/
|
|
64830
|
+
0 /* None */,
|
|
64831
|
+
relation,
|
|
64832
|
+
/*ignoreConstraints*/
|
|
64833
|
+
false
|
|
64834
|
+
);
|
|
64835
|
+
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
64750
64836
|
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
64751
|
-
const
|
|
64837
|
+
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
64838
|
+
const diag2 = error2(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
64752
64839
|
if (errorOutputContainer) {
|
|
64753
64840
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
64754
64841
|
}
|
|
@@ -65279,6 +65366,16 @@ function createTypeChecker(host) {
|
|
|
65279
65366
|
}
|
|
65280
65367
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
65281
65368
|
if (source2.flags & 1048576 /* Union */) {
|
|
65369
|
+
if (target2.flags & 1048576 /* Union */) {
|
|
65370
|
+
const sourceOrigin = source2.origin;
|
|
65371
|
+
if (sourceOrigin && sourceOrigin.flags & 2097152 /* Intersection */ && target2.aliasSymbol && contains(sourceOrigin.types, target2)) {
|
|
65372
|
+
return -1 /* True */;
|
|
65373
|
+
}
|
|
65374
|
+
const targetOrigin = target2.origin;
|
|
65375
|
+
if (targetOrigin && targetOrigin.flags & 1048576 /* Union */ && source2.aliasSymbol && contains(targetOrigin.types, source2)) {
|
|
65376
|
+
return -1 /* True */;
|
|
65377
|
+
}
|
|
65378
|
+
}
|
|
65282
65379
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
65283
65380
|
}
|
|
65284
65381
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -65592,6 +65689,10 @@ function createTypeChecker(host) {
|
|
|
65592
65689
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
65593
65690
|
}
|
|
65594
65691
|
}
|
|
65692
|
+
if (relationCount <= 0) {
|
|
65693
|
+
overflow = true;
|
|
65694
|
+
return 0 /* False */;
|
|
65695
|
+
}
|
|
65595
65696
|
if (!maybeKeys) {
|
|
65596
65697
|
maybeKeys = [];
|
|
65597
65698
|
maybeKeysSet = /* @__PURE__ */ new Set();
|
|
@@ -65685,6 +65786,7 @@ function createTypeChecker(host) {
|
|
|
65685
65786
|
}
|
|
65686
65787
|
} else {
|
|
65687
65788
|
relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
|
|
65789
|
+
relationCount--;
|
|
65688
65790
|
resetMaybeStack(
|
|
65689
65791
|
/*markAllAsSucceeded*/
|
|
65690
65792
|
false
|
|
@@ -65696,6 +65798,7 @@ function createTypeChecker(host) {
|
|
|
65696
65798
|
maybeKeysSet.delete(maybeKeys[i]);
|
|
65697
65799
|
if (markAllAsSucceeded) {
|
|
65698
65800
|
relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
|
|
65801
|
+
relationCount--;
|
|
65699
65802
|
}
|
|
65700
65803
|
}
|
|
65701
65804
|
maybeCount = maybeStart;
|
|
@@ -80528,16 +80631,8 @@ function createTypeChecker(host) {
|
|
|
80528
80631
|
}
|
|
80529
80632
|
function checkImportType(node) {
|
|
80530
80633
|
checkSourceElement(node.argument);
|
|
80531
|
-
if (node.
|
|
80532
|
-
|
|
80533
|
-
if (override) {
|
|
80534
|
-
if (!isNightly()) {
|
|
80535
|
-
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);
|
|
80536
|
-
}
|
|
80537
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
80538
|
-
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
80539
|
-
}
|
|
80540
|
-
}
|
|
80634
|
+
if (node.attributes) {
|
|
80635
|
+
getResolutionModeOverride(node.attributes, grammarErrorOnNode);
|
|
80541
80636
|
}
|
|
80542
80637
|
checkTypeReferenceOrImport(node);
|
|
80543
80638
|
}
|
|
@@ -84501,12 +84596,13 @@ function createTypeChecker(host) {
|
|
|
84501
84596
|
return false;
|
|
84502
84597
|
}
|
|
84503
84598
|
}
|
|
84504
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
84599
|
+
if (!isImportEqualsDeclaration(node) && node.attributes) {
|
|
84600
|
+
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;
|
|
84505
84601
|
let hasError = false;
|
|
84506
|
-
for (const
|
|
84507
|
-
if (!isStringLiteral(
|
|
84602
|
+
for (const attr of node.attributes.elements) {
|
|
84603
|
+
if (!isStringLiteral(attr.value)) {
|
|
84508
84604
|
hasError = true;
|
|
84509
|
-
error2(
|
|
84605
|
+
error2(attr.value, diagnostic);
|
|
84510
84606
|
}
|
|
84511
84607
|
}
|
|
84512
84608
|
return !hasError;
|
|
@@ -84638,32 +84734,26 @@ function createTypeChecker(host) {
|
|
|
84638
84734
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
84639
84735
|
}
|
|
84640
84736
|
}
|
|
84641
|
-
function
|
|
84737
|
+
function checkImportAttributes(declaration) {
|
|
84642
84738
|
var _a;
|
|
84643
|
-
|
|
84644
|
-
|
|
84645
|
-
const
|
|
84646
|
-
|
|
84647
|
-
|
|
84648
|
-
|
|
84649
|
-
}
|
|
84650
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
84651
|
-
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
84652
|
-
}
|
|
84739
|
+
const node = declaration.attributes;
|
|
84740
|
+
if (node) {
|
|
84741
|
+
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
84742
|
+
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
84743
|
+
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
84744
|
+
if (validForTypeAttributes && override) {
|
|
84653
84745
|
return;
|
|
84654
84746
|
}
|
|
84655
84747
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
84656
84748
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
84657
|
-
|
|
84658
|
-
|
|
84659
|
-
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
|
|
84660
|
-
);
|
|
84749
|
+
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;
|
|
84750
|
+
return grammarErrorOnNode(node, message);
|
|
84661
84751
|
}
|
|
84662
84752
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
84663
|
-
return grammarErrorOnNode(
|
|
84753
|
+
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);
|
|
84664
84754
|
}
|
|
84665
84755
|
if (override) {
|
|
84666
|
-
return grammarErrorOnNode(
|
|
84756
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
84667
84757
|
}
|
|
84668
84758
|
}
|
|
84669
84759
|
}
|
|
@@ -84695,7 +84785,7 @@ function createTypeChecker(host) {
|
|
|
84695
84785
|
}
|
|
84696
84786
|
}
|
|
84697
84787
|
}
|
|
84698
|
-
|
|
84788
|
+
checkImportAttributes(node);
|
|
84699
84789
|
}
|
|
84700
84790
|
function checkImportEqualsDeclaration(node) {
|
|
84701
84791
|
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)) {
|
|
@@ -84768,7 +84858,7 @@ function createTypeChecker(host) {
|
|
|
84768
84858
|
}
|
|
84769
84859
|
}
|
|
84770
84860
|
}
|
|
84771
|
-
|
|
84861
|
+
checkImportAttributes(node);
|
|
84772
84862
|
}
|
|
84773
84863
|
function checkGrammarExportDeclaration(node) {
|
|
84774
84864
|
var _a;
|
|
@@ -88558,12 +88648,12 @@ function createTypeChecker(host) {
|
|
|
88558
88648
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
88559
88649
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
88560
88650
|
if (nodeArguments.length > 1) {
|
|
88561
|
-
const
|
|
88562
|
-
return grammarErrorOnNode(
|
|
88651
|
+
const importAttributesArgument = nodeArguments[1];
|
|
88652
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
88563
88653
|
}
|
|
88564
88654
|
}
|
|
88565
88655
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
88566
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
88656
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
|
|
88567
88657
|
}
|
|
88568
88658
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
88569
88659
|
if (spreadElement) {
|
|
@@ -88830,13 +88920,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
88830
88920
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
88831
88921
|
}
|
|
88832
88922
|
}
|
|
88833
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
88834
|
-
var _a;
|
|
88835
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
88836
|
-
this.onDiagnosticReported();
|
|
88837
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
88838
|
-
}
|
|
88839
|
-
}
|
|
88840
88923
|
onDiagnosticReported() {
|
|
88841
88924
|
this.context.reportedDiagnostic = true;
|
|
88842
88925
|
}
|
|
@@ -89345,7 +89428,7 @@ var visitEachChildTable = {
|
|
|
89345
89428
|
return context.factory.updateImportTypeNode(
|
|
89346
89429
|
node,
|
|
89347
89430
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
89348
|
-
nodeVisitor(node.
|
|
89431
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes),
|
|
89349
89432
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
89350
89433
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
89351
89434
|
node.isTypeOf
|
|
@@ -89896,20 +89979,20 @@ var visitEachChildTable = {
|
|
|
89896
89979
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
89897
89980
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
89898
89981
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
89899
|
-
nodeVisitor(node.
|
|
89982
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89900
89983
|
);
|
|
89901
89984
|
},
|
|
89902
|
-
[300 /*
|
|
89903
|
-
return context.factory.
|
|
89985
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
89986
|
+
return context.factory.updateImportAttributes(
|
|
89904
89987
|
node,
|
|
89905
|
-
nodesVisitor(node.elements, visitor,
|
|
89988
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
89906
89989
|
node.multiLine
|
|
89907
89990
|
);
|
|
89908
89991
|
},
|
|
89909
|
-
[301 /*
|
|
89910
|
-
return context.factory.
|
|
89992
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
89993
|
+
return context.factory.updateImportAttribute(
|
|
89911
89994
|
node,
|
|
89912
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
89995
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
89913
89996
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
89914
89997
|
);
|
|
89915
89998
|
},
|
|
@@ -89961,7 +90044,7 @@ var visitEachChildTable = {
|
|
|
89961
90044
|
node.isTypeOnly,
|
|
89962
90045
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
89963
90046
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
89964
|
-
nodeVisitor(node.
|
|
90047
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89965
90048
|
);
|
|
89966
90049
|
},
|
|
89967
90050
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -93451,7 +93534,7 @@ function transformTypeScript(context) {
|
|
|
93451
93534
|
void 0,
|
|
93452
93535
|
importClause,
|
|
93453
93536
|
node.moduleSpecifier,
|
|
93454
|
-
node.
|
|
93537
|
+
node.attributes
|
|
93455
93538
|
) : void 0;
|
|
93456
93539
|
}
|
|
93457
93540
|
function visitImportClause(node) {
|
|
@@ -93501,7 +93584,7 @@ function transformTypeScript(context) {
|
|
|
93501
93584
|
node.isTypeOnly,
|
|
93502
93585
|
exportClause,
|
|
93503
93586
|
node.moduleSpecifier,
|
|
93504
|
-
node.
|
|
93587
|
+
node.attributes
|
|
93505
93588
|
) : void 0;
|
|
93506
93589
|
}
|
|
93507
93590
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -93535,7 +93618,7 @@ function transformTypeScript(context) {
|
|
|
93535
93618
|
/*importClause*/
|
|
93536
93619
|
void 0,
|
|
93537
93620
|
node.moduleReference.expression,
|
|
93538
|
-
/*
|
|
93621
|
+
/*attributes*/
|
|
93539
93622
|
void 0
|
|
93540
93623
|
),
|
|
93541
93624
|
node
|
|
@@ -101705,7 +101788,7 @@ function transformJsx(context) {
|
|
|
101705
101788
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
101706
101789
|
),
|
|
101707
101790
|
factory2.createStringLiteral(importSource),
|
|
101708
|
-
/*
|
|
101791
|
+
/*attributes*/
|
|
101709
101792
|
void 0
|
|
101710
101793
|
);
|
|
101711
101794
|
setParentRecursive(
|
|
@@ -111112,7 +111195,9 @@ function transformECMAScriptModule(context) {
|
|
|
111112
111195
|
)
|
|
111113
111196
|
])
|
|
111114
111197
|
),
|
|
111115
|
-
factory2.createStringLiteral("module")
|
|
111198
|
+
factory2.createStringLiteral("module"),
|
|
111199
|
+
/*attributes*/
|
|
111200
|
+
void 0
|
|
111116
111201
|
);
|
|
111117
111202
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
111118
111203
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -111229,7 +111314,7 @@ function transformECMAScriptModule(context) {
|
|
|
111229
111314
|
)
|
|
111230
111315
|
),
|
|
111231
111316
|
node.moduleSpecifier,
|
|
111232
|
-
node.
|
|
111317
|
+
node.attributes
|
|
111233
111318
|
);
|
|
111234
111319
|
setOriginalNode(importDecl, node.exportClause);
|
|
111235
111320
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -111682,8 +111767,7 @@ function transformDeclarations(context) {
|
|
|
111682
111767
|
trackReferencedAmbientModule,
|
|
111683
111768
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
111684
111769
|
reportNonlocalAugmentation,
|
|
111685
|
-
reportNonSerializableProperty
|
|
111686
|
-
reportImportTypeNodeResolutionModeOverride
|
|
111770
|
+
reportNonSerializableProperty
|
|
111687
111771
|
};
|
|
111688
111772
|
let errorNameNode;
|
|
111689
111773
|
let errorFallbackNode;
|
|
@@ -111807,11 +111891,6 @@ function transformDeclarations(context) {
|
|
|
111807
111891
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
111808
111892
|
}
|
|
111809
111893
|
}
|
|
111810
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
111811
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
111812
|
-
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));
|
|
111813
|
-
}
|
|
111814
|
-
}
|
|
111815
111894
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
111816
111895
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
111817
111896
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -112316,7 +112395,7 @@ function transformDeclarations(context) {
|
|
|
112316
112395
|
decl.modifiers,
|
|
112317
112396
|
decl.importClause,
|
|
112318
112397
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112319
|
-
|
|
112398
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112320
112399
|
);
|
|
112321
112400
|
}
|
|
112322
112401
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -112332,7 +112411,7 @@ function transformDeclarations(context) {
|
|
|
112332
112411
|
void 0
|
|
112333
112412
|
),
|
|
112334
112413
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112335
|
-
|
|
112414
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112336
112415
|
);
|
|
112337
112416
|
}
|
|
112338
112417
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -112350,7 +112429,7 @@ function transformDeclarations(context) {
|
|
|
112350
112429
|
namedBindings
|
|
112351
112430
|
),
|
|
112352
112431
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112353
|
-
|
|
112432
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112354
112433
|
) : void 0;
|
|
112355
112434
|
}
|
|
112356
112435
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -112365,7 +112444,7 @@ function transformDeclarations(context) {
|
|
|
112365
112444
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
112366
112445
|
),
|
|
112367
112446
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112368
|
-
|
|
112447
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112369
112448
|
);
|
|
112370
112449
|
}
|
|
112371
112450
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -112375,19 +112454,13 @@ function transformDeclarations(context) {
|
|
|
112375
112454
|
/*importClause*/
|
|
112376
112455
|
void 0,
|
|
112377
112456
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112378
|
-
|
|
112457
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112379
112458
|
);
|
|
112380
112459
|
}
|
|
112381
112460
|
}
|
|
112382
|
-
function
|
|
112383
|
-
const mode =
|
|
112384
|
-
|
|
112385
|
-
if (!isNightly()) {
|
|
112386
|
-
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));
|
|
112387
|
-
}
|
|
112388
|
-
return assertClause;
|
|
112389
|
-
}
|
|
112390
|
-
return void 0;
|
|
112461
|
+
function tryGetResolutionModeOverride(node) {
|
|
112462
|
+
const mode = getResolutionModeOverride(node);
|
|
112463
|
+
return node && mode !== void 0 ? node : void 0;
|
|
112391
112464
|
}
|
|
112392
112465
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
112393
112466
|
while (length(lateMarkedStatements)) {
|
|
@@ -112673,7 +112746,7 @@ function transformDeclarations(context) {
|
|
|
112673
112746
|
return cleanup(factory2.updateImportTypeNode(
|
|
112674
112747
|
input,
|
|
112675
112748
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
112676
|
-
input.
|
|
112749
|
+
input.attributes,
|
|
112677
112750
|
input.qualifier,
|
|
112678
112751
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
112679
112752
|
input.isTypeOf
|
|
@@ -112727,7 +112800,7 @@ function transformDeclarations(context) {
|
|
|
112727
112800
|
input.isTypeOnly,
|
|
112728
112801
|
input.exportClause,
|
|
112729
112802
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
112730
|
-
|
|
112803
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
112731
112804
|
);
|
|
112732
112805
|
}
|
|
112733
112806
|
case 277 /* ExportAssignment */: {
|
|
@@ -115233,10 +115306,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115233
115306
|
return emitNamedExports(node);
|
|
115234
115307
|
case 281 /* ExportSpecifier */:
|
|
115235
115308
|
return emitExportSpecifier(node);
|
|
115236
|
-
case 300 /*
|
|
115237
|
-
return
|
|
115238
|
-
case 301 /*
|
|
115239
|
-
return
|
|
115309
|
+
case 300 /* ImportAttributes */:
|
|
115310
|
+
return emitImportAttributes(node);
|
|
115311
|
+
case 301 /* ImportAttribute */:
|
|
115312
|
+
return emitImportAttribute(node);
|
|
115240
115313
|
case 282 /* MissingDeclaration */:
|
|
115241
115314
|
return;
|
|
115242
115315
|
case 283 /* ExternalModuleReference */:
|
|
@@ -116011,16 +116084,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
116011
116084
|
writeKeyword("import");
|
|
116012
116085
|
writePunctuation("(");
|
|
116013
116086
|
emit(node.argument);
|
|
116014
|
-
if (node.
|
|
116087
|
+
if (node.attributes) {
|
|
116015
116088
|
writePunctuation(",");
|
|
116016
116089
|
writeSpace();
|
|
116017
116090
|
writePunctuation("{");
|
|
116018
116091
|
writeSpace();
|
|
116019
|
-
writeKeyword("assert");
|
|
116092
|
+
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
116020
116093
|
writePunctuation(":");
|
|
116021
116094
|
writeSpace();
|
|
116022
|
-
const elements = node.
|
|
116023
|
-
emitList(node.
|
|
116095
|
+
const elements = node.attributes.elements;
|
|
116096
|
+
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
116024
116097
|
writeSpace();
|
|
116025
116098
|
writePunctuation("}");
|
|
116026
116099
|
}
|
|
@@ -117009,8 +117082,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117009
117082
|
writeSpace();
|
|
117010
117083
|
}
|
|
117011
117084
|
emitExpression(node.moduleSpecifier);
|
|
117012
|
-
if (node.
|
|
117013
|
-
emitWithLeadingSpace(node.
|
|
117085
|
+
if (node.attributes) {
|
|
117086
|
+
emitWithLeadingSpace(node.attributes);
|
|
117014
117087
|
}
|
|
117015
117088
|
writeTrailingSemicolon();
|
|
117016
117089
|
}
|
|
@@ -117079,18 +117152,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117079
117152
|
writeSpace();
|
|
117080
117153
|
emitExpression(node.moduleSpecifier);
|
|
117081
117154
|
}
|
|
117082
|
-
if (node.
|
|
117083
|
-
emitWithLeadingSpace(node.
|
|
117155
|
+
if (node.attributes) {
|
|
117156
|
+
emitWithLeadingSpace(node.attributes);
|
|
117084
117157
|
}
|
|
117085
117158
|
writeTrailingSemicolon();
|
|
117086
117159
|
}
|
|
117087
|
-
function
|
|
117088
|
-
emitTokenWithComment(
|
|
117160
|
+
function emitImportAttributes(node) {
|
|
117161
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
117089
117162
|
writeSpace();
|
|
117090
117163
|
const elements = node.elements;
|
|
117091
|
-
emitList(node, elements, 526226 /*
|
|
117164
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
117092
117165
|
}
|
|
117093
|
-
function
|
|
117166
|
+
function emitImportAttribute(node) {
|
|
117094
117167
|
emit(node.name);
|
|
117095
117168
|
writePunctuation(":");
|
|
117096
117169
|
writeSpace();
|
|
@@ -120177,8 +120250,6 @@ function getModeForFileReference(ref, containingFileMode) {
|
|
|
120177
120250
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
120178
120251
|
}
|
|
120179
120252
|
function getModeForResolutionAtIndex(file, index) {
|
|
120180
|
-
if (file.impliedNodeFormat === void 0)
|
|
120181
|
-
return void 0;
|
|
120182
120253
|
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
120183
120254
|
}
|
|
120184
120255
|
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
@@ -120192,42 +120263,48 @@ function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
|
120192
120263
|
return false;
|
|
120193
120264
|
}
|
|
120194
120265
|
function getModeForUsageLocation(file, usage) {
|
|
120195
|
-
var _a
|
|
120196
|
-
if (file.impliedNodeFormat === void 0)
|
|
120197
|
-
return void 0;
|
|
120266
|
+
var _a;
|
|
120198
120267
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
120199
120268
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
120200
120269
|
if (isTypeOnly) {
|
|
120201
|
-
const override =
|
|
120270
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
120202
120271
|
if (override) {
|
|
120203
120272
|
return override;
|
|
120204
120273
|
}
|
|
120205
120274
|
}
|
|
120206
120275
|
}
|
|
120207
120276
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
120208
|
-
const override =
|
|
120277
|
+
const override = getResolutionModeOverride(usage.parent.parent.attributes);
|
|
120209
120278
|
if (override) {
|
|
120210
120279
|
return override;
|
|
120211
120280
|
}
|
|
120212
120281
|
}
|
|
120282
|
+
if (file.impliedNodeFormat === void 0)
|
|
120283
|
+
return void 0;
|
|
120213
120284
|
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
120214
120285
|
return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
120215
120286
|
}
|
|
120216
|
-
const exprParentParent = (
|
|
120287
|
+
const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent;
|
|
120217
120288
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
120218
120289
|
}
|
|
120219
|
-
function
|
|
120220
|
-
if (!
|
|
120290
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
120291
|
+
if (!node)
|
|
120221
120292
|
return void 0;
|
|
120222
|
-
if (length(
|
|
120223
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120293
|
+
if (length(node.elements) !== 1) {
|
|
120294
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120295
|
+
node,
|
|
120296
|
+
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
|
|
120297
|
+
);
|
|
120224
120298
|
return void 0;
|
|
120225
120299
|
}
|
|
120226
|
-
const elem =
|
|
120300
|
+
const elem = node.elements[0];
|
|
120227
120301
|
if (!isStringLiteralLike(elem.name))
|
|
120228
120302
|
return void 0;
|
|
120229
120303
|
if (elem.name.text !== "resolution-mode") {
|
|
120230
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120304
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120305
|
+
elem.name,
|
|
120306
|
+
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
|
|
120307
|
+
);
|
|
120231
120308
|
return void 0;
|
|
120232
120309
|
}
|
|
120233
120310
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -120526,7 +120603,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
120526
120603
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
120527
120604
|
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,
|
|
120528
120605
|
Diagnostics.Duplicate_label_0.code,
|
|
120529
|
-
Diagnostics.
|
|
120606
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
120530
120607
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
120531
120608
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
120532
120609
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -122060,7 +122137,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122060
122137
|
/*importClause*/
|
|
122061
122138
|
void 0,
|
|
122062
122139
|
externalHelpersModuleReference,
|
|
122063
|
-
/*
|
|
122140
|
+
/*attributes*/
|
|
122064
122141
|
void 0
|
|
122065
122142
|
);
|
|
122066
122143
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -122536,14 +122613,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122536
122613
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
122537
122614
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
122538
122615
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
122539
|
-
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
122540
|
-
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
122541
|
-
kind: 2 /* ResolutionDiagnostics */,
|
|
122542
|
-
diagnostics: [
|
|
122543
|
-
createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)
|
|
122544
|
-
]
|
|
122545
|
-
});
|
|
122546
|
-
}
|
|
122547
122616
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
122548
122617
|
}
|
|
122549
122618
|
}
|
|
@@ -132184,7 +132253,7 @@ function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreferenc
|
|
|
132184
132253
|
void 0,
|
|
132185
132254
|
defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0,
|
|
132186
132255
|
typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier,
|
|
132187
|
-
/*
|
|
132256
|
+
/*attributes*/
|
|
132188
132257
|
void 0
|
|
132189
132258
|
);
|
|
132190
132259
|
}
|
|
@@ -137897,7 +137966,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
|
|
|
137897
137966
|
}
|
|
137898
137967
|
case 205 /* ImportType */:
|
|
137899
137968
|
const importTypeNode = parent2;
|
|
137900
|
-
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.
|
|
137969
|
+
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
|
|
137901
137970
|
break;
|
|
137902
137971
|
default:
|
|
137903
137972
|
Debug.failBadSyntaxKind(parent2);
|
|
@@ -138172,7 +138241,7 @@ function updateImport(old, defaultImportName, elements) {
|
|
|
138172
138241
|
elements && elements.length ? factory.createNamedImports(elements) : void 0
|
|
138173
138242
|
),
|
|
138174
138243
|
old.moduleSpecifier,
|
|
138175
|
-
/*
|
|
138244
|
+
/*attributes*/
|
|
138176
138245
|
void 0
|
|
138177
138246
|
);
|
|
138178
138247
|
}
|
|
@@ -139014,7 +139083,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie
|
|
|
139014
139083
|
factory.createNamespaceImport(newNamespaceId)
|
|
139015
139084
|
),
|
|
139016
139085
|
newModuleString,
|
|
139017
|
-
/*
|
|
139086
|
+
/*attributes*/
|
|
139018
139087
|
void 0
|
|
139019
139088
|
);
|
|
139020
139089
|
case 271 /* ImportEqualsDeclaration */:
|
|
@@ -139303,7 +139372,7 @@ function filterImport(i, moduleSpecifier, keep) {
|
|
|
139303
139372
|
void 0,
|
|
139304
139373
|
factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings),
|
|
139305
139374
|
getSynthesizedDeepClone(moduleSpecifier),
|
|
139306
|
-
/*
|
|
139375
|
+
/*attributes*/
|
|
139307
139376
|
void 0
|
|
139308
139377
|
) : void 0;
|
|
139309
139378
|
}
|
|
@@ -139627,7 +139696,7 @@ function moveStatementsToTargetFile(changes, program, statements, targetFile, to
|
|
|
139627
139696
|
continue;
|
|
139628
139697
|
}
|
|
139629
139698
|
if (length(updatedElements) < length(elements)) {
|
|
139630
|
-
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.
|
|
139699
|
+
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes));
|
|
139631
139700
|
}
|
|
139632
139701
|
}
|
|
139633
139702
|
}
|
|
@@ -149766,7 +149835,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149766
149835
|
false,
|
|
149767
149836
|
factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))),
|
|
149768
149837
|
exportDeclaration.moduleSpecifier,
|
|
149769
|
-
/*
|
|
149838
|
+
/*attributes*/
|
|
149770
149839
|
void 0
|
|
149771
149840
|
);
|
|
149772
149841
|
const typeExportDeclaration = factory.createExportDeclaration(
|
|
@@ -149776,7 +149845,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149776
149845
|
true,
|
|
149777
149846
|
factory.createNamedExports(typeExportSpecifiers),
|
|
149778
149847
|
exportDeclaration.moduleSpecifier,
|
|
149779
|
-
/*
|
|
149848
|
+
/*attributes*/
|
|
149780
149849
|
void 0
|
|
149781
149850
|
);
|
|
149782
149851
|
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {
|
|
@@ -149909,7 +149978,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149909
149978
|
true
|
|
149910
149979
|
),
|
|
149911
149980
|
getSynthesizedDeepClone(
|
|
149912
|
-
declaration.
|
|
149981
|
+
declaration.attributes,
|
|
149913
149982
|
/*includeTrivia*/
|
|
149914
149983
|
true
|
|
149915
149984
|
)
|
|
@@ -149937,7 +150006,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149937
150006
|
true
|
|
149938
150007
|
),
|
|
149939
150008
|
getSynthesizedDeepClone(
|
|
149940
|
-
declaration.
|
|
150009
|
+
declaration.attributes,
|
|
149941
150010
|
/*includeTrivia*/
|
|
149942
150011
|
true
|
|
149943
150012
|
)
|
|
@@ -149960,7 +150029,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149960
150029
|
true,
|
|
149961
150030
|
importClause.name,
|
|
149962
150031
|
newNamedBindings
|
|
149963
|
-
), declaration.moduleSpecifier, declaration.
|
|
150032
|
+
), declaration.moduleSpecifier, declaration.attributes);
|
|
149964
150033
|
changes.replaceNode(sourceFile, declaration, importDeclaration);
|
|
149965
150034
|
}
|
|
149966
150035
|
}
|
|
@@ -151459,7 +151528,7 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp
|
|
|
151459
151528
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
|
151460
151529
|
),
|
|
151461
151530
|
quotedModuleSpecifier,
|
|
151462
|
-
/*
|
|
151531
|
+
/*attributes*/
|
|
151463
151532
|
void 0
|
|
151464
151533
|
);
|
|
151465
151534
|
statements = combine(statements, declaration);
|
|
@@ -152038,7 +152107,7 @@ function updateExport(changes, program, sourceFile, node, names) {
|
|
|
152038
152107
|
)
|
|
152039
152108
|
),
|
|
152040
152109
|
node.moduleSpecifier,
|
|
152041
|
-
node.
|
|
152110
|
+
node.attributes
|
|
152042
152111
|
)
|
|
152043
152112
|
);
|
|
152044
152113
|
}
|
|
@@ -152055,7 +152124,7 @@ function createExport(changes, program, sourceFile, names) {
|
|
|
152055
152124
|
)),
|
|
152056
152125
|
/*moduleSpecifier*/
|
|
152057
152126
|
void 0,
|
|
152058
|
-
/*
|
|
152127
|
+
/*attributes*/
|
|
152059
152128
|
void 0
|
|
152060
152129
|
));
|
|
152061
152130
|
}
|
|
@@ -156730,7 +156799,7 @@ function doChange34(changes, sourceFile, info) {
|
|
|
156730
156799
|
namedImports
|
|
156731
156800
|
),
|
|
156732
156801
|
required,
|
|
156733
|
-
/*
|
|
156802
|
+
/*attributes*/
|
|
156734
156803
|
void 0
|
|
156735
156804
|
)
|
|
156736
156805
|
);
|
|
@@ -156869,7 +156938,7 @@ function doChange36(changes, sourceFile, importType) {
|
|
|
156869
156938
|
const newTypeNode = factory.updateImportTypeNode(
|
|
156870
156939
|
importType,
|
|
156871
156940
|
importType.argument,
|
|
156872
|
-
importType.
|
|
156941
|
+
importType.attributes,
|
|
156873
156942
|
importType.qualifier,
|
|
156874
156943
|
importType.typeArguments,
|
|
156875
156944
|
/*isTypeOf*/
|
|
@@ -157100,7 +157169,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
157100
157169
|
void 0
|
|
157101
157170
|
),
|
|
157102
157171
|
importDeclaration.moduleSpecifier,
|
|
157103
|
-
importDeclaration.
|
|
157172
|
+
importDeclaration.attributes
|
|
157104
157173
|
)
|
|
157105
157174
|
);
|
|
157106
157175
|
changes.insertNodeAfter(
|
|
@@ -157117,7 +157186,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
157117
157186
|
importClause.namedBindings
|
|
157118
157187
|
),
|
|
157119
157188
|
importDeclaration.moduleSpecifier,
|
|
157120
|
-
importDeclaration.
|
|
157189
|
+
importDeclaration.attributes
|
|
157121
157190
|
)
|
|
157122
157191
|
);
|
|
157123
157192
|
}
|
|
@@ -166206,7 +166275,7 @@ function removeUnusedImports(oldImports, sourceFile, program) {
|
|
|
166206
166275
|
/*importClause*/
|
|
166207
166276
|
void 0,
|
|
166208
166277
|
moduleSpecifier,
|
|
166209
|
-
/*
|
|
166278
|
+
/*attributes*/
|
|
166210
166279
|
void 0
|
|
166211
166280
|
));
|
|
166212
166281
|
} else {
|
|
@@ -166372,7 +166441,7 @@ function coalesceExportsWorker(exportGroup, comparer) {
|
|
|
166372
166441
|
exportDecl.isTypeOnly,
|
|
166373
166442
|
exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)),
|
|
166374
166443
|
exportDecl.moduleSpecifier,
|
|
166375
|
-
exportDecl.
|
|
166444
|
+
exportDecl.attributes
|
|
166376
166445
|
)
|
|
166377
166446
|
);
|
|
166378
166447
|
}
|
|
@@ -166404,7 +166473,7 @@ function updateImportDeclarationAndClause(importDeclaration, name, namedBindings
|
|
|
166404
166473
|
factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings),
|
|
166405
166474
|
// TODO: GH#18217
|
|
166406
166475
|
importDeclaration.moduleSpecifier,
|
|
166407
|
-
importDeclaration.
|
|
166476
|
+
importDeclaration.attributes
|
|
166408
166477
|
);
|
|
166409
166478
|
}
|
|
166410
166479
|
function sortSpecifiers(specifiers, comparer) {
|
|
@@ -166899,10 +166968,11 @@ function getOutliningSpanForNode(n, sourceFile) {
|
|
|
166899
166968
|
return spanForParenthesizedExpression(n);
|
|
166900
166969
|
case 275 /* NamedImports */:
|
|
166901
166970
|
case 279 /* NamedExports */:
|
|
166971
|
+
case 300 /* ImportAttributes */:
|
|
166902
166972
|
case 300 /* AssertClause */:
|
|
166903
|
-
return
|
|
166973
|
+
return spanForImportExportElements(n);
|
|
166904
166974
|
}
|
|
166905
|
-
function
|
|
166975
|
+
function spanForImportExportElements(node) {
|
|
166906
166976
|
if (!node.elements.length) {
|
|
166907
166977
|
return void 0;
|
|
166908
166978
|
}
|
|
@@ -173611,7 +173681,7 @@ __export(ts_exports2, {
|
|
|
173611
173681
|
getRenameLocation: () => getRenameLocation,
|
|
173612
173682
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
173613
173683
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
173614
|
-
|
|
173684
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
173615
173685
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
173616
173686
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
173617
173687
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -173743,6 +173813,7 @@ __export(ts_exports2, {
|
|
|
173743
173813
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
173744
173814
|
hasQuestionToken: () => hasQuestionToken,
|
|
173745
173815
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
173816
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
173746
173817
|
hasRestParameter: () => hasRestParameter,
|
|
173747
173818
|
hasScopeMarker: () => hasScopeMarker,
|
|
173748
173819
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -173816,7 +173887,6 @@ __export(ts_exports2, {
|
|
|
173816
173887
|
isAssertClause: () => isAssertClause,
|
|
173817
173888
|
isAssertEntry: () => isAssertEntry,
|
|
173818
173889
|
isAssertionExpression: () => isAssertionExpression,
|
|
173819
|
-
isAssertionKey: () => isAssertionKey,
|
|
173820
173890
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
173821
173891
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
173822
173892
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -174026,6 +174096,9 @@ __export(ts_exports2, {
|
|
|
174026
174096
|
isIfStatement: () => isIfStatement,
|
|
174027
174097
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
174028
174098
|
isImplicitGlob: () => isImplicitGlob,
|
|
174099
|
+
isImportAttribute: () => isImportAttribute,
|
|
174100
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
174101
|
+
isImportAttributes: () => isImportAttributes,
|
|
174029
174102
|
isImportCall: () => isImportCall,
|
|
174030
174103
|
isImportClause: () => isImportClause,
|
|
174031
174104
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -174217,7 +174290,6 @@ __export(ts_exports2, {
|
|
|
174217
174290
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
174218
174291
|
isNewExpression: () => isNewExpression,
|
|
174219
174292
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
174220
|
-
isNightly: () => isNightly,
|
|
174221
174293
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
174222
174294
|
isNode: () => isNode,
|
|
174223
174295
|
isNodeArray: () => isNodeArray,
|
|
@@ -188290,7 +188362,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188290
188362
|
getRenameLocation,
|
|
188291
188363
|
getReplacementSpanForContextToken,
|
|
188292
188364
|
getResolutionDiagnostic,
|
|
188293
|
-
|
|
188365
|
+
getResolutionModeOverride,
|
|
188294
188366
|
getResolveJsonModule,
|
|
188295
188367
|
getResolvePackageJsonExports,
|
|
188296
188368
|
getResolvePackageJsonImports,
|
|
@@ -188422,6 +188494,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188422
188494
|
hasPropertyAccessExpressionWithName,
|
|
188423
188495
|
hasQuestionToken,
|
|
188424
188496
|
hasRecordedExternalHelpers,
|
|
188497
|
+
hasResolutionModeOverride,
|
|
188425
188498
|
hasRestParameter,
|
|
188426
188499
|
hasScopeMarker,
|
|
188427
188500
|
hasStaticModifier,
|
|
@@ -188495,7 +188568,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188495
188568
|
isAssertClause,
|
|
188496
188569
|
isAssertEntry,
|
|
188497
188570
|
isAssertionExpression,
|
|
188498
|
-
isAssertionKey,
|
|
188499
188571
|
isAssertsKeyword,
|
|
188500
188572
|
isAssignmentDeclaration,
|
|
188501
188573
|
isAssignmentExpression,
|
|
@@ -188705,6 +188777,9 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188705
188777
|
isIfStatement,
|
|
188706
188778
|
isIgnoredFileFromWildCardWatching,
|
|
188707
188779
|
isImplicitGlob,
|
|
188780
|
+
isImportAttribute,
|
|
188781
|
+
isImportAttributeName,
|
|
188782
|
+
isImportAttributes,
|
|
188708
188783
|
isImportCall,
|
|
188709
188784
|
isImportClause,
|
|
188710
188785
|
isImportDeclaration,
|
|
@@ -188896,7 +188971,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188896
188971
|
isNamespaceReexportDeclaration,
|
|
188897
188972
|
isNewExpression,
|
|
188898
188973
|
isNewExpressionTarget,
|
|
188899
|
-
isNightly,
|
|
188900
188974
|
isNoSubstitutionTemplateLiteral,
|
|
188901
188975
|
isNode,
|
|
188902
188976
|
isNodeArray,
|