typescript 5.3.0-dev.20230925 → 5.3.0-dev.20230927
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es5.d.ts +9 -1
- package/lib/tsc.js +377 -300
- package/lib/tsserver.js +431 -338
- package/lib/typescript.d.ts +51 -29
- package/lib/typescript.js +425 -335
- package/lib/typingsInstaller.js +165 -109
- package/package.json +2 -2
package/lib/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,
|
|
@@ -1238,6 +1238,7 @@ __export(server_exports, {
|
|
|
1238
1238
|
isCallExpression: () => isCallExpression,
|
|
1239
1239
|
isCallExpressionTarget: () => isCallExpressionTarget,
|
|
1240
1240
|
isCallLikeExpression: () => isCallLikeExpression,
|
|
1241
|
+
isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
|
|
1241
1242
|
isCallOrNewExpression: () => isCallOrNewExpression,
|
|
1242
1243
|
isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
|
|
1243
1244
|
isCallSignatureDeclaration: () => isCallSignatureDeclaration,
|
|
@@ -1406,6 +1407,9 @@ __export(server_exports, {
|
|
|
1406
1407
|
isIfStatement: () => isIfStatement,
|
|
1407
1408
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
1408
1409
|
isImplicitGlob: () => isImplicitGlob,
|
|
1410
|
+
isImportAttribute: () => isImportAttribute,
|
|
1411
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
1412
|
+
isImportAttributes: () => isImportAttributes,
|
|
1409
1413
|
isImportCall: () => isImportCall,
|
|
1410
1414
|
isImportClause: () => isImportClause,
|
|
1411
1415
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -1597,7 +1601,6 @@ __export(server_exports, {
|
|
|
1597
1601
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
1598
1602
|
isNewExpression: () => isNewExpression,
|
|
1599
1603
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
1600
|
-
isNightly: () => isNightly,
|
|
1601
1604
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
1602
1605
|
isNode: () => isNode,
|
|
1603
1606
|
isNodeArray: () => isNodeArray,
|
|
@@ -2327,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2327
2330
|
|
|
2328
2331
|
// src/compiler/corePublic.ts
|
|
2329
2332
|
var versionMajorMinor = "5.3";
|
|
2330
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-dev.20230927`;
|
|
2331
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2332
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2333
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6036,8 +6039,10 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6036
6039
|
SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause";
|
|
6037
6040
|
SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause";
|
|
6038
6041
|
SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause";
|
|
6039
|
-
SyntaxKind5[SyntaxKind5["
|
|
6040
|
-
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";
|
|
6041
6046
|
SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
|
|
6042
6047
|
SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
6043
6048
|
SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
@@ -7340,7 +7345,8 @@ var ListFormat = /* @__PURE__ */ ((ListFormat2) => {
|
|
|
7340
7345
|
ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
|
|
7341
7346
|
ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
|
|
7342
7347
|
ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
|
|
7343
|
-
ListFormat2[ListFormat2["
|
|
7348
|
+
ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes";
|
|
7349
|
+
ListFormat2[ListFormat2["ImportClauseEntries"] = 526226 /* ImportAttributes */] = "ImportClauseEntries";
|
|
7344
7350
|
ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
|
|
7345
7351
|
ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements";
|
|
7346
7352
|
ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
|
|
@@ -9580,9 +9586,8 @@ var Diagnostics = {
|
|
|
9580
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."),
|
|
9581
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."),
|
|
9582
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."),
|
|
9583
|
-
|
|
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"),
|
|
9584
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"),
|
|
9585
|
-
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`."),
|
|
9586
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`."),
|
|
9587
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."),
|
|
9588
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."),
|
|
@@ -9592,6 +9597,8 @@ var Diagnostics = {
|
|
|
9592
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"`),
|
|
9593
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"`),
|
|
9594
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'."),
|
|
9595
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."),
|
|
9596
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."),
|
|
9597
9604
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -9618,6 +9625,7 @@ var Diagnostics = {
|
|
|
9618
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."),
|
|
9619
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."),
|
|
9620
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."),
|
|
9621
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."),
|
|
9622
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."),
|
|
9623
9631
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -10147,15 +10155,15 @@ var Diagnostics = {
|
|
|
10147
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}'?"),
|
|
10148
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'."),
|
|
10149
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'."),
|
|
10150
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}'?"),
|
|
10151
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."),
|
|
10152
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}'?"),
|
|
10153
|
-
|
|
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."),
|
|
10154
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."),
|
|
10155
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."),
|
|
10156
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."),
|
|
10157
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"),
|
|
10158
|
-
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'."),
|
|
10159
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?"),
|
|
10160
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."),
|
|
10161
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."),
|
|
@@ -10169,6 +10177,10 @@ var Diagnostics = {
|
|
|
10169
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."),
|
|
10170
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."),
|
|
10171
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}'."),
|
|
10172
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}'."),
|
|
10173
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}'."),
|
|
10174
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}'."),
|
|
@@ -10277,7 +10289,6 @@ var Diagnostics = {
|
|
|
10277
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}'."),
|
|
10278
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}'?"),
|
|
10279
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'."),
|
|
10280
|
-
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'."),
|
|
10281
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."),
|
|
10282
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."),
|
|
10283
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}'."),
|
|
@@ -14352,12 +14363,12 @@ function isTypeOnlyExportDeclaration(node) {
|
|
|
14352
14363
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
14353
14364
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
14354
14365
|
}
|
|
14355
|
-
function isAssertionKey(node) {
|
|
14356
|
-
return isStringLiteral(node) || isIdentifier(node);
|
|
14357
|
-
}
|
|
14358
14366
|
function isStringTextContainingNode(node) {
|
|
14359
14367
|
return node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
14360
14368
|
}
|
|
14369
|
+
function isImportAttributeName(node) {
|
|
14370
|
+
return isStringLiteral(node) || isIdentifier(node);
|
|
14371
|
+
}
|
|
14361
14372
|
function isGeneratedIdentifier(node) {
|
|
14362
14373
|
var _a;
|
|
14363
14374
|
return isIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0;
|
|
@@ -14606,6 +14617,9 @@ function isPropertyAccessOrQualifiedName(node) {
|
|
|
14606
14617
|
const kind = node.kind;
|
|
14607
14618
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
|
|
14608
14619
|
}
|
|
14620
|
+
function isCallLikeOrFunctionLikeExpression(node) {
|
|
14621
|
+
return isCallLikeExpression(node) || isFunctionLike(node);
|
|
14622
|
+
}
|
|
14609
14623
|
function isCallLikeExpression(node) {
|
|
14610
14624
|
switch (node.kind) {
|
|
14611
14625
|
case 286 /* JsxOpeningElement */:
|
|
@@ -18709,9 +18723,6 @@ function getIndentString(level) {
|
|
|
18709
18723
|
function getIndentSize() {
|
|
18710
18724
|
return indentStrings[1].length;
|
|
18711
18725
|
}
|
|
18712
|
-
function isNightly() {
|
|
18713
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
18714
|
-
}
|
|
18715
18726
|
function createTextWriter(newLine) {
|
|
18716
18727
|
var output;
|
|
18717
18728
|
var indent3;
|
|
@@ -20624,7 +20635,7 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
20624
20635
|
if (!containsIgnoredPath(symlinkPath)) {
|
|
20625
20636
|
symlinkPath = ensureTrailingDirectorySeparator(symlinkPath);
|
|
20626
20637
|
if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) {
|
|
20627
|
-
(symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(
|
|
20638
|
+
(symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink);
|
|
20628
20639
|
}
|
|
20629
20640
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
20630
20641
|
}
|
|
@@ -20647,7 +20658,10 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
20647
20658
|
if (commonResolved && commonOriginal) {
|
|
20648
20659
|
cache.setSymlinkedDirectory(
|
|
20649
20660
|
commonOriginal,
|
|
20650
|
-
{
|
|
20661
|
+
{
|
|
20662
|
+
real: ensureTrailingDirectorySeparator(commonResolved),
|
|
20663
|
+
realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName))
|
|
20664
|
+
}
|
|
20651
20665
|
);
|
|
20652
20666
|
}
|
|
20653
20667
|
}
|
|
@@ -21653,6 +21667,12 @@ function getPropertyNameFromType(type) {
|
|
|
21653
21667
|
function isExpandoPropertyDeclaration(declaration) {
|
|
21654
21668
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
21655
21669
|
}
|
|
21670
|
+
function hasResolutionModeOverride(node) {
|
|
21671
|
+
if (node === void 0) {
|
|
21672
|
+
return false;
|
|
21673
|
+
}
|
|
21674
|
+
return !!getResolutionModeOverride(node.attributes);
|
|
21675
|
+
}
|
|
21656
21676
|
|
|
21657
21677
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21658
21678
|
function createBaseNodeFactory() {
|
|
@@ -22535,6 +22555,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22535
22555
|
updateAssertEntry,
|
|
22536
22556
|
createImportTypeAssertionContainer,
|
|
22537
22557
|
updateImportTypeAssertionContainer,
|
|
22558
|
+
createImportAttributes,
|
|
22559
|
+
updateImportAttributes,
|
|
22560
|
+
createImportAttribute,
|
|
22561
|
+
updateImportAttribute,
|
|
22538
22562
|
createNamespaceImport,
|
|
22539
22563
|
updateNamespaceImport,
|
|
22540
22564
|
createNamespaceExport,
|
|
@@ -23803,18 +23827,21 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23803
23827
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
23804
23828
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
23805
23829
|
}
|
|
23806
|
-
function createImportTypeNode(argument,
|
|
23830
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
23807
23831
|
const node = createBaseNode(205 /* ImportType */);
|
|
23808
23832
|
node.argument = argument;
|
|
23809
|
-
node.
|
|
23833
|
+
node.attributes = attributes;
|
|
23834
|
+
if (node.assertions && node.assertions.assertClause && node.attributes) {
|
|
23835
|
+
node.assertions.assertClause = node.attributes;
|
|
23836
|
+
}
|
|
23810
23837
|
node.qualifier = qualifier;
|
|
23811
23838
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
23812
23839
|
node.isTypeOf = isTypeOf;
|
|
23813
23840
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23814
23841
|
return node;
|
|
23815
23842
|
}
|
|
23816
|
-
function updateImportTypeNode(node, argument,
|
|
23817
|
-
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;
|
|
23818
23845
|
}
|
|
23819
23846
|
function createParenthesizedType(type) {
|
|
23820
23847
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -24944,19 +24971,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24944
24971
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
24945
24972
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
24946
24973
|
}
|
|
24947
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
24974
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
24948
24975
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
24949
24976
|
node.modifiers = asNodeArray(modifiers);
|
|
24950
24977
|
node.importClause = importClause;
|
|
24951
24978
|
node.moduleSpecifier = moduleSpecifier;
|
|
24952
|
-
node.assertClause =
|
|
24979
|
+
node.attributes = node.assertClause = attributes;
|
|
24953
24980
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
24954
24981
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24955
24982
|
node.jsDoc = void 0;
|
|
24956
24983
|
return node;
|
|
24957
24984
|
}
|
|
24958
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
24959
|
-
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;
|
|
24960
24987
|
}
|
|
24961
24988
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
24962
24989
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -24977,6 +25004,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24977
25004
|
const node = createBaseNode(300 /* AssertClause */);
|
|
24978
25005
|
node.elements = createNodeArray(elements);
|
|
24979
25006
|
node.multiLine = multiLine;
|
|
25007
|
+
node.token = 132 /* AssertKeyword */;
|
|
24980
25008
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
24981
25009
|
return node;
|
|
24982
25010
|
}
|
|
@@ -25002,6 +25030,27 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25002
25030
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
25003
25031
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
25004
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
|
+
}
|
|
25005
25054
|
function createNamespaceImport(name) {
|
|
25006
25055
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
25007
25056
|
node.name = name;
|
|
@@ -25062,20 +25111,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25062
25111
|
function updateExportAssignment(node, modifiers, expression) {
|
|
25063
25112
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node;
|
|
25064
25113
|
}
|
|
25065
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25114
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
25066
25115
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
25067
25116
|
node.modifiers = asNodeArray(modifiers);
|
|
25068
25117
|
node.isTypeOnly = isTypeOnly;
|
|
25069
25118
|
node.exportClause = exportClause;
|
|
25070
25119
|
node.moduleSpecifier = moduleSpecifier;
|
|
25071
|
-
node.assertClause =
|
|
25120
|
+
node.attributes = node.assertClause = attributes;
|
|
25072
25121
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
25073
25122
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
25074
25123
|
node.jsDoc = void 0;
|
|
25075
25124
|
return node;
|
|
25076
25125
|
}
|
|
25077
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25078
|
-
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;
|
|
25079
25128
|
}
|
|
25080
25129
|
function finishUpdateExportDeclaration(updated, original) {
|
|
25081
25130
|
if (updated !== original) {
|
|
@@ -26402,7 +26451,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26402
26451
|
} else {
|
|
26403
26452
|
modifierArray = modifiers;
|
|
26404
26453
|
}
|
|
26405
|
-
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);
|
|
26406
26455
|
}
|
|
26407
26456
|
function updateModifierLike(node, modifierArray) {
|
|
26408
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);
|
|
@@ -28751,6 +28800,12 @@ function isAssertClause(node) {
|
|
|
28751
28800
|
function isAssertEntry(node) {
|
|
28752
28801
|
return node.kind === 301 /* AssertEntry */;
|
|
28753
28802
|
}
|
|
28803
|
+
function isImportAttributes(node) {
|
|
28804
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
28805
|
+
}
|
|
28806
|
+
function isImportAttribute(node) {
|
|
28807
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
28808
|
+
}
|
|
28754
28809
|
function isNamespaceImport(node) {
|
|
28755
28810
|
return node.kind === 274 /* NamespaceImport */;
|
|
28756
28811
|
}
|
|
@@ -29472,7 +29527,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
29472
29527
|
namedBindings
|
|
29473
29528
|
),
|
|
29474
29529
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
29475
|
-
/*
|
|
29530
|
+
/*attributes*/
|
|
29476
29531
|
void 0
|
|
29477
29532
|
);
|
|
29478
29533
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -30238,7 +30293,7 @@ var forEachChildTable = {
|
|
|
30238
30293
|
return visitNode2(cbNode, node.typeParameter);
|
|
30239
30294
|
},
|
|
30240
30295
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
30241
|
-
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);
|
|
30242
30297
|
},
|
|
30243
30298
|
[302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
|
|
30244
30299
|
return visitNode2(cbNode, node.assertClause);
|
|
@@ -30412,15 +30467,15 @@ var forEachChildTable = {
|
|
|
30412
30467
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
30413
30468
|
},
|
|
30414
30469
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
30415
|
-
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);
|
|
30416
30471
|
},
|
|
30417
30472
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
30418
30473
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
30419
30474
|
},
|
|
30420
|
-
[300 /*
|
|
30475
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
30421
30476
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
30422
30477
|
},
|
|
30423
|
-
[301 /*
|
|
30478
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
30424
30479
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
30425
30480
|
},
|
|
30426
30481
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -30435,7 +30490,7 @@ var forEachChildTable = {
|
|
|
30435
30490
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
30436
30491
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
30437
30492
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
30438
|
-
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);
|
|
30439
30494
|
},
|
|
30440
30495
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
30441
30496
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -31715,7 +31770,7 @@ var Parser;
|
|
|
31715
31770
|
function isLiteralPropertyName() {
|
|
31716
31771
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
31717
31772
|
}
|
|
31718
|
-
function
|
|
31773
|
+
function isImportAttributeName2() {
|
|
31719
31774
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
31720
31775
|
}
|
|
31721
31776
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -31834,8 +31889,8 @@ var Parser;
|
|
|
31834
31889
|
return isLiteralPropertyName();
|
|
31835
31890
|
case 9 /* ObjectBindingElements */:
|
|
31836
31891
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
31837
|
-
case 24 /*
|
|
31838
|
-
return
|
|
31892
|
+
case 24 /* ImportAttributes */:
|
|
31893
|
+
return isImportAttributeName2();
|
|
31839
31894
|
case 7 /* HeritageClauseElement */:
|
|
31840
31895
|
if (token() === 19 /* OpenBraceToken */) {
|
|
31841
31896
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -31938,7 +31993,7 @@ var Parser;
|
|
|
31938
31993
|
case 12 /* ObjectLiteralMembers */:
|
|
31939
31994
|
case 9 /* ObjectBindingElements */:
|
|
31940
31995
|
case 23 /* ImportOrExportSpecifiers */:
|
|
31941
|
-
case 24 /*
|
|
31996
|
+
case 24 /* ImportAttributes */:
|
|
31942
31997
|
return token() === 20 /* CloseBraceToken */;
|
|
31943
31998
|
case 3 /* SwitchClauseStatements */:
|
|
31944
31999
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -32244,7 +32299,7 @@ var Parser;
|
|
|
32244
32299
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32245
32300
|
case 14 /* JsxChildren */:
|
|
32246
32301
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32247
|
-
case 24 /*
|
|
32302
|
+
case 24 /* ImportAttributes */:
|
|
32248
32303
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
32249
32304
|
case 25 /* JSDocComment */:
|
|
32250
32305
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -33119,28 +33174,6 @@ var Parser;
|
|
|
33119
33174
|
nextToken();
|
|
33120
33175
|
return token() === 102 /* ImportKeyword */;
|
|
33121
33176
|
}
|
|
33122
|
-
function parseImportTypeAssertions() {
|
|
33123
|
-
const pos = getNodePos();
|
|
33124
|
-
const openBracePosition = scanner2.getTokenStart();
|
|
33125
|
-
parseExpected(19 /* OpenBraceToken */);
|
|
33126
|
-
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
33127
|
-
parseExpected(132 /* AssertKeyword */);
|
|
33128
|
-
parseExpected(59 /* ColonToken */);
|
|
33129
|
-
const clause = parseAssertClause(
|
|
33130
|
-
/*skipAssertKeyword*/
|
|
33131
|
-
true
|
|
33132
|
-
);
|
|
33133
|
-
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
33134
|
-
const lastError = lastOrUndefined(parseDiagnostics);
|
|
33135
|
-
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
33136
|
-
addRelatedInfo(
|
|
33137
|
-
lastError,
|
|
33138
|
-
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
33139
|
-
);
|
|
33140
|
-
}
|
|
33141
|
-
}
|
|
33142
|
-
return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
33143
|
-
}
|
|
33144
33177
|
function parseImportType() {
|
|
33145
33178
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
33146
33179
|
const pos = getNodePos();
|
|
@@ -33148,14 +33181,36 @@ var Parser;
|
|
|
33148
33181
|
parseExpected(102 /* ImportKeyword */);
|
|
33149
33182
|
parseExpected(21 /* OpenParenToken */);
|
|
33150
33183
|
const type = parseType();
|
|
33151
|
-
let
|
|
33184
|
+
let attributes;
|
|
33152
33185
|
if (parseOptional(28 /* CommaToken */)) {
|
|
33153
|
-
|
|
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
|
+
}
|
|
33154
33209
|
}
|
|
33155
33210
|
parseExpected(22 /* CloseParenToken */);
|
|
33156
33211
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
33157
33212
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
33158
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
33213
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
33159
33214
|
}
|
|
33160
33215
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
33161
33216
|
nextToken();
|
|
@@ -36217,15 +36272,16 @@ var Parser;
|
|
|
36217
36272
|
parseExpected(161 /* FromKeyword */);
|
|
36218
36273
|
}
|
|
36219
36274
|
const moduleSpecifier = parseModuleSpecifier();
|
|
36220
|
-
|
|
36221
|
-
|
|
36222
|
-
|
|
36275
|
+
const currentToken2 = token();
|
|
36276
|
+
let attributes;
|
|
36277
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36278
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36223
36279
|
}
|
|
36224
36280
|
parseSemicolon();
|
|
36225
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
36281
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
36226
36282
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36227
36283
|
}
|
|
36228
|
-
function
|
|
36284
|
+
function parseImportAttribute() {
|
|
36229
36285
|
const pos = getNodePos();
|
|
36230
36286
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
36231
36287
|
parseExpected(59 /* ColonToken */);
|
|
@@ -36233,19 +36289,19 @@ var Parser;
|
|
|
36233
36289
|
/*allowReturnTypeInArrowFunction*/
|
|
36234
36290
|
true
|
|
36235
36291
|
);
|
|
36236
|
-
return finishNode(factory2.
|
|
36292
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
36237
36293
|
}
|
|
36238
|
-
function
|
|
36294
|
+
function parseImportAttributes(token2, skipKeyword) {
|
|
36239
36295
|
const pos = getNodePos();
|
|
36240
|
-
if (!
|
|
36241
|
-
parseExpected(
|
|
36296
|
+
if (!skipKeyword) {
|
|
36297
|
+
parseExpected(token2);
|
|
36242
36298
|
}
|
|
36243
36299
|
const openBracePosition = scanner2.getTokenStart();
|
|
36244
36300
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
36245
36301
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
36246
36302
|
const elements = parseDelimitedList(
|
|
36247
|
-
24 /*
|
|
36248
|
-
|
|
36303
|
+
24 /* ImportAttributes */,
|
|
36304
|
+
parseImportAttribute,
|
|
36249
36305
|
/*considerSemicolonAsDelimiter*/
|
|
36250
36306
|
true
|
|
36251
36307
|
);
|
|
@@ -36258,7 +36314,7 @@ var Parser;
|
|
|
36258
36314
|
);
|
|
36259
36315
|
}
|
|
36260
36316
|
}
|
|
36261
|
-
return finishNode(factory2.
|
|
36317
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
36262
36318
|
} else {
|
|
36263
36319
|
const elements = createNodeArray(
|
|
36264
36320
|
[],
|
|
@@ -36268,10 +36324,11 @@ var Parser;
|
|
|
36268
36324
|
/*hasTrailingComma*/
|
|
36269
36325
|
false
|
|
36270
36326
|
);
|
|
36271
|
-
return finishNode(factory2.
|
|
36327
|
+
return finishNode(factory2.createImportAttributes(
|
|
36272
36328
|
elements,
|
|
36273
36329
|
/*multiLine*/
|
|
36274
|
-
false
|
|
36330
|
+
false,
|
|
36331
|
+
token2
|
|
36275
36332
|
), pos);
|
|
36276
36333
|
}
|
|
36277
36334
|
}
|
|
@@ -36403,7 +36460,7 @@ var Parser;
|
|
|
36403
36460
|
);
|
|
36404
36461
|
let exportClause;
|
|
36405
36462
|
let moduleSpecifier;
|
|
36406
|
-
let
|
|
36463
|
+
let attributes;
|
|
36407
36464
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
36408
36465
|
const namespaceExportPos = getNodePos();
|
|
36409
36466
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -36419,12 +36476,13 @@ var Parser;
|
|
|
36419
36476
|
moduleSpecifier = parseModuleSpecifier();
|
|
36420
36477
|
}
|
|
36421
36478
|
}
|
|
36422
|
-
|
|
36423
|
-
|
|
36479
|
+
const currentToken2 = token();
|
|
36480
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36481
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36424
36482
|
}
|
|
36425
36483
|
parseSemicolon();
|
|
36426
36484
|
setAwaitContext(savedAwaitContext);
|
|
36427
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
36485
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
36428
36486
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36429
36487
|
}
|
|
36430
36488
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -36474,7 +36532,7 @@ var Parser;
|
|
|
36474
36532
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
36475
36533
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
36476
36534
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
36477
|
-
ParsingContext2[ParsingContext2["
|
|
36535
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
36478
36536
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
36479
36537
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
36480
36538
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -41542,10 +41600,15 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
41542
41600
|
const failedLookupLocations = [];
|
|
41543
41601
|
const affectingLocations = [];
|
|
41544
41602
|
let features = getNodeResolutionFeatures(options);
|
|
41545
|
-
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 */)) {
|
|
41546
41608
|
features |= 32 /* EsmMode */;
|
|
41547
41609
|
}
|
|
41548
|
-
const
|
|
41610
|
+
const useImportCondition = resolutionMode === 99 /* ESNext */ || (resolutionMode !== void 0 ? false : void 0);
|
|
41611
|
+
const conditions = features & 8 /* Exports */ ? getConditions(options, useImportCondition) : [];
|
|
41549
41612
|
const diagnostics = [];
|
|
41550
41613
|
const moduleResolutionState = {
|
|
41551
41614
|
compilerOptions: options,
|
|
@@ -41714,11 +41777,19 @@ function getNodeResolutionFeatures(options) {
|
|
|
41714
41777
|
return features;
|
|
41715
41778
|
}
|
|
41716
41779
|
function getConditions(options, esmMode) {
|
|
41717
|
-
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"];
|
|
41718
41789
|
if (!options.noDtsResolution) {
|
|
41719
41790
|
conditions.push("types");
|
|
41720
41791
|
}
|
|
41721
|
-
if (
|
|
41792
|
+
if (moduleResolution !== 100 /* Bundler */) {
|
|
41722
41793
|
conditions.push("node");
|
|
41723
41794
|
}
|
|
41724
41795
|
return concatenate(conditions, options.customConditions);
|
|
@@ -42161,13 +42232,13 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
42161
42232
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42162
42233
|
break;
|
|
42163
42234
|
case 2 /* Node10 */:
|
|
42164
|
-
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);
|
|
42165
42236
|
break;
|
|
42166
42237
|
case 1 /* Classic */:
|
|
42167
42238
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42168
42239
|
break;
|
|
42169
42240
|
case 100 /* Bundler */:
|
|
42170
|
-
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);
|
|
42171
42242
|
break;
|
|
42172
42243
|
default:
|
|
42173
42244
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
@@ -42345,7 +42416,7 @@ function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
42345
42416
|
resolutionMode
|
|
42346
42417
|
);
|
|
42347
42418
|
}
|
|
42348
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42419
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) {
|
|
42349
42420
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
42350
42421
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
42351
42422
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
@@ -42362,7 +42433,8 @@ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile,
|
|
|
42362
42433
|
extensions,
|
|
42363
42434
|
/*isConfigLookup*/
|
|
42364
42435
|
false,
|
|
42365
|
-
redirectedReference
|
|
42436
|
+
redirectedReference,
|
|
42437
|
+
conditions
|
|
42366
42438
|
);
|
|
42367
42439
|
}
|
|
42368
42440
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
@@ -42378,10 +42450,12 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
42378
42450
|
/*isConfigLookup*/
|
|
42379
42451
|
false,
|
|
42380
42452
|
/*redirectedReference*/
|
|
42453
|
+
void 0,
|
|
42454
|
+
/*conditions*/
|
|
42381
42455
|
void 0
|
|
42382
42456
|
);
|
|
42383
42457
|
}
|
|
42384
|
-
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
42458
|
+
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions) {
|
|
42385
42459
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
42386
42460
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
42387
42461
|
if (getResolveJsonModule(compilerOptions)) {
|
|
@@ -42397,10 +42471,11 @@ function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
42397
42471
|
extensions,
|
|
42398
42472
|
/*isConfigLookup*/
|
|
42399
42473
|
false,
|
|
42400
|
-
redirectedReference
|
|
42474
|
+
redirectedReference,
|
|
42475
|
+
conditions
|
|
42401
42476
|
);
|
|
42402
42477
|
}
|
|
42403
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
42478
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) {
|
|
42404
42479
|
let extensions;
|
|
42405
42480
|
if (isConfigLookup) {
|
|
42406
42481
|
extensions = 8 /* Json */;
|
|
@@ -42411,7 +42486,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
|
|
|
42411
42486
|
} else {
|
|
42412
42487
|
extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
42413
42488
|
}
|
|
42414
|
-
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);
|
|
42415
42490
|
}
|
|
42416
42491
|
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
42417
42492
|
return nodeModuleNameResolverWorker(
|
|
@@ -42426,15 +42501,21 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
|
42426
42501
|
/*isConfigLookup*/
|
|
42427
42502
|
true,
|
|
42428
42503
|
/*redirectedReference*/
|
|
42504
|
+
void 0,
|
|
42505
|
+
/*conditions*/
|
|
42429
42506
|
void 0
|
|
42430
42507
|
);
|
|
42431
42508
|
}
|
|
42432
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
42509
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
42433
42510
|
var _a, _b, _c, _d;
|
|
42434
42511
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
42435
42512
|
const failedLookupLocations = [];
|
|
42436
42513
|
const affectingLocations = [];
|
|
42437
|
-
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
|
+
));
|
|
42438
42519
|
const diagnostics = [];
|
|
42439
42520
|
const state = {
|
|
42440
42521
|
compilerOptions,
|
|
@@ -42444,17 +42525,17 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42444
42525
|
affectingLocations,
|
|
42445
42526
|
packageJsonInfoCache: cache,
|
|
42446
42527
|
features,
|
|
42447
|
-
conditions,
|
|
42528
|
+
conditions: conditions ?? emptyArray,
|
|
42448
42529
|
requestContainingDirectory: containingDirectory,
|
|
42449
42530
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
42450
42531
|
isConfigLookup,
|
|
42451
42532
|
candidateIsFromPackageJsonField: false
|
|
42452
42533
|
};
|
|
42453
|
-
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(
|
|
42454
|
-
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(", "));
|
|
42455
42536
|
}
|
|
42456
42537
|
let result;
|
|
42457
|
-
if (
|
|
42538
|
+
if (moduleResolution === 2 /* Node10 */) {
|
|
42458
42539
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
42459
42540
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
42460
42541
|
result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
|
|
@@ -42462,7 +42543,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42462
42543
|
result = tryResolve(extensions, state);
|
|
42463
42544
|
}
|
|
42464
42545
|
let legacyResult;
|
|
42465
|
-
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"))) {
|
|
42466
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);
|
|
42467
42548
|
const diagnosticState = {
|
|
42468
42549
|
...state,
|
|
@@ -43260,7 +43341,8 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43260
43341
|
extensions,
|
|
43261
43342
|
/*isConfigLookup*/
|
|
43262
43343
|
false,
|
|
43263
|
-
redirectedReference
|
|
43344
|
+
redirectedReference,
|
|
43345
|
+
state.conditions
|
|
43264
43346
|
);
|
|
43265
43347
|
return toSearchResult(
|
|
43266
43348
|
result.resolvedModule ? {
|
|
@@ -47757,7 +47839,7 @@ function createTypeChecker(host) {
|
|
|
47757
47839
|
var externalHelpersModule;
|
|
47758
47840
|
var Symbol47 = objectAllocator.getSymbolConstructor();
|
|
47759
47841
|
var Type27 = objectAllocator.getTypeConstructor();
|
|
47760
|
-
var
|
|
47842
|
+
var Signature14 = objectAllocator.getSignatureConstructor();
|
|
47761
47843
|
var typeCount = 0;
|
|
47762
47844
|
var symbolCount = 0;
|
|
47763
47845
|
var totalInstantiationCount = 0;
|
|
@@ -47983,24 +48065,7 @@ function createTypeChecker(host) {
|
|
|
47983
48065
|
getTypeOfPropertyOfContextualType,
|
|
47984
48066
|
getFullyQualifiedName,
|
|
47985
48067
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
47986
|
-
|
|
47987
|
-
if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
|
|
47988
|
-
return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
47989
|
-
call,
|
|
47990
|
-
candidatesOutArray,
|
|
47991
|
-
/*argumentCount*/
|
|
47992
|
-
void 0,
|
|
47993
|
-
checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
|
|
47994
|
-
));
|
|
47995
|
-
}
|
|
47996
|
-
return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
47997
|
-
call,
|
|
47998
|
-
candidatesOutArray,
|
|
47999
|
-
/*argumentCount*/
|
|
48000
|
-
void 0,
|
|
48001
|
-
checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
|
|
48002
|
-
));
|
|
48003
|
-
},
|
|
48068
|
+
getCandidateSignaturesForStringLiteralCompletions,
|
|
48004
48069
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
48005
48070
|
getExpandedParameters,
|
|
48006
48071
|
hasEffectiveRestParameter,
|
|
@@ -48199,32 +48264,59 @@ function createTypeChecker(host) {
|
|
|
48199
48264
|
isTypeParameterPossiblyReferenced,
|
|
48200
48265
|
typeHasCallOrConstructSignatures
|
|
48201
48266
|
};
|
|
48267
|
+
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
48268
|
+
const candidatesSet = /* @__PURE__ */ new Set();
|
|
48269
|
+
const candidates = [];
|
|
48270
|
+
runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
48271
|
+
call,
|
|
48272
|
+
candidates,
|
|
48273
|
+
/*argumentCount*/
|
|
48274
|
+
void 0,
|
|
48275
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
48276
|
+
));
|
|
48277
|
+
for (const candidate of candidates) {
|
|
48278
|
+
candidatesSet.add(candidate);
|
|
48279
|
+
}
|
|
48280
|
+
candidates.length = 0;
|
|
48281
|
+
runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
48282
|
+
call,
|
|
48283
|
+
candidates,
|
|
48284
|
+
/*argumentCount*/
|
|
48285
|
+
void 0,
|
|
48286
|
+
0 /* Normal */
|
|
48287
|
+
));
|
|
48288
|
+
for (const candidate of candidates) {
|
|
48289
|
+
candidatesSet.add(candidate);
|
|
48290
|
+
}
|
|
48291
|
+
return arrayFrom(candidatesSet);
|
|
48292
|
+
}
|
|
48202
48293
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
48203
|
-
|
|
48204
|
-
|
|
48205
|
-
|
|
48206
|
-
|
|
48294
|
+
node = findAncestor(node, isCallLikeOrFunctionLikeExpression);
|
|
48295
|
+
if (node) {
|
|
48296
|
+
const cachedResolvedSignatures = [];
|
|
48297
|
+
const cachedTypes2 = [];
|
|
48298
|
+
while (node) {
|
|
48207
48299
|
const nodeLinks2 = getNodeLinks(node);
|
|
48208
|
-
|
|
48209
|
-
cachedResolvedSignatures.push([nodeLinks2, resolvedSignature]);
|
|
48300
|
+
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
48210
48301
|
nodeLinks2.resolvedSignature = void 0;
|
|
48302
|
+
if (isFunctionLike(node)) {
|
|
48303
|
+
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
48304
|
+
const type = symbolLinks2.type;
|
|
48305
|
+
cachedTypes2.push([symbolLinks2, type]);
|
|
48306
|
+
symbolLinks2.type = void 0;
|
|
48307
|
+
}
|
|
48308
|
+
node = findAncestor(node.parent, isCallLikeOrFunctionLikeExpression);
|
|
48211
48309
|
}
|
|
48212
|
-
|
|
48213
|
-
|
|
48214
|
-
|
|
48215
|
-
cachedTypes2.push([symbolLinks2, type]);
|
|
48216
|
-
symbolLinks2.type = void 0;
|
|
48310
|
+
const result = fn();
|
|
48311
|
+
for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
|
|
48312
|
+
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
48217
48313
|
}
|
|
48218
|
-
|
|
48219
|
-
|
|
48220
|
-
|
|
48221
|
-
|
|
48222
|
-
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
48223
|
-
}
|
|
48224
|
-
for (const [symbolLinks2, type] of cachedTypes2) {
|
|
48225
|
-
symbolLinks2.type = type;
|
|
48314
|
+
for (const [symbolLinks2, type] of cachedTypes2) {
|
|
48315
|
+
symbolLinks2.type = type;
|
|
48316
|
+
}
|
|
48317
|
+
return result;
|
|
48226
48318
|
}
|
|
48227
|
-
return
|
|
48319
|
+
return fn();
|
|
48228
48320
|
}
|
|
48229
48321
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
48230
48322
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
@@ -51006,7 +51098,7 @@ function createTypeChecker(host) {
|
|
|
51006
51098
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
51007
51099
|
}
|
|
51008
51100
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
51009
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
51101
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
51010
51102
|
if (startsWith(moduleReference, "@types/")) {
|
|
51011
51103
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
51012
51104
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -51061,9 +51153,8 @@ function createTypeChecker(host) {
|
|
|
51061
51153
|
}
|
|
51062
51154
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
51063
51155
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
51064
|
-
const
|
|
51065
|
-
|
|
51066
|
-
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)) {
|
|
51067
51158
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
51068
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);
|
|
51069
51160
|
} else {
|
|
@@ -51169,7 +51260,7 @@ function createTypeChecker(host) {
|
|
|
51169
51260
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
51170
51261
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
51171
51262
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
51172
|
-
const suggestedExt = (
|
|
51263
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
51173
51264
|
if (suggestedExt) {
|
|
51174
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);
|
|
51175
51266
|
} else {
|
|
@@ -52934,7 +53025,7 @@ function createTypeChecker(host) {
|
|
|
52934
53025
|
return factory.updateImportTypeNode(
|
|
52935
53026
|
root,
|
|
52936
53027
|
root.argument,
|
|
52937
|
-
root.
|
|
53028
|
+
root.attributes,
|
|
52938
53029
|
qualifier,
|
|
52939
53030
|
typeArguments,
|
|
52940
53031
|
root.isTypeOf
|
|
@@ -53667,7 +53758,6 @@ function createTypeChecker(host) {
|
|
|
53667
53758
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
53668
53759
|
}
|
|
53669
53760
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
53670
|
-
var _a, _b, _c, _d;
|
|
53671
53761
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
53672
53762
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
53673
53763
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -53676,17 +53766,18 @@ function createTypeChecker(host) {
|
|
|
53676
53766
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
53677
53767
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
53678
53768
|
let specifier;
|
|
53679
|
-
let
|
|
53769
|
+
let attributes;
|
|
53680
53770
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
53681
53771
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
53682
53772
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
53683
|
-
|
|
53684
|
-
factory.
|
|
53685
|
-
factory.
|
|
53686
|
-
|
|
53687
|
-
|
|
53688
|
-
|
|
53689
|
-
|
|
53773
|
+
attributes = factory.createImportAttributes(
|
|
53774
|
+
factory.createNodeArray([
|
|
53775
|
+
factory.createImportAttribute(
|
|
53776
|
+
factory.createStringLiteral("resolution-mode"),
|
|
53777
|
+
factory.createStringLiteral("import")
|
|
53778
|
+
)
|
|
53779
|
+
])
|
|
53780
|
+
);
|
|
53690
53781
|
}
|
|
53691
53782
|
}
|
|
53692
53783
|
if (!specifier) {
|
|
@@ -53700,16 +53791,17 @@ function createTypeChecker(host) {
|
|
|
53700
53791
|
if (specifier.includes("/node_modules/")) {
|
|
53701
53792
|
specifier = oldSpecifier;
|
|
53702
53793
|
} else {
|
|
53703
|
-
|
|
53704
|
-
factory.
|
|
53705
|
-
factory.
|
|
53706
|
-
|
|
53707
|
-
|
|
53708
|
-
|
|
53709
|
-
|
|
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
|
+
);
|
|
53710
53802
|
}
|
|
53711
53803
|
}
|
|
53712
|
-
if (!
|
|
53804
|
+
if (!attributes) {
|
|
53713
53805
|
context.encounteredError = true;
|
|
53714
53806
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
53715
53807
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -53729,11 +53821,11 @@ function createTypeChecker(host) {
|
|
|
53729
53821
|
void 0
|
|
53730
53822
|
);
|
|
53731
53823
|
}
|
|
53732
|
-
return factory.createImportTypeNode(lit,
|
|
53824
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
53733
53825
|
} else {
|
|
53734
53826
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
53735
53827
|
const qualifier = splitNode.objectType.typeName;
|
|
53736
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
53828
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
53737
53829
|
}
|
|
53738
53830
|
}
|
|
53739
53831
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -54209,7 +54301,7 @@ function createTypeChecker(host) {
|
|
|
54209
54301
|
return factory.updateImportTypeNode(
|
|
54210
54302
|
node,
|
|
54211
54303
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
54212
|
-
node.
|
|
54304
|
+
node.attributes,
|
|
54213
54305
|
node.qualifier,
|
|
54214
54306
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
54215
54307
|
node.isTypeOf
|
|
@@ -54429,7 +54521,7 @@ function createTypeChecker(host) {
|
|
|
54429
54521
|
return statements;
|
|
54430
54522
|
}
|
|
54431
54523
|
function inlineExportModifiers(statements) {
|
|
54432
|
-
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));
|
|
54433
54525
|
if (index >= 0) {
|
|
54434
54526
|
const exportDecl = statements[index];
|
|
54435
54527
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -54457,7 +54549,7 @@ function createTypeChecker(host) {
|
|
|
54457
54549
|
replacements
|
|
54458
54550
|
),
|
|
54459
54551
|
exportDecl.moduleSpecifier,
|
|
54460
|
-
exportDecl.
|
|
54552
|
+
exportDecl.attributes
|
|
54461
54553
|
);
|
|
54462
54554
|
}
|
|
54463
54555
|
}
|
|
@@ -55108,7 +55200,7 @@ function createTypeChecker(host) {
|
|
|
55108
55200
|
)])
|
|
55109
55201
|
),
|
|
55110
55202
|
factory.createStringLiteral(specifier2),
|
|
55111
|
-
/*
|
|
55203
|
+
/*attributes*/
|
|
55112
55204
|
void 0
|
|
55113
55205
|
),
|
|
55114
55206
|
0 /* None */
|
|
@@ -55196,7 +55288,7 @@ function createTypeChecker(host) {
|
|
|
55196
55288
|
void 0
|
|
55197
55289
|
),
|
|
55198
55290
|
specifier2,
|
|
55199
|
-
node.parent.
|
|
55291
|
+
node.parent.attributes
|
|
55200
55292
|
),
|
|
55201
55293
|
0 /* None */
|
|
55202
55294
|
);
|
|
@@ -55217,7 +55309,7 @@ function createTypeChecker(host) {
|
|
|
55217
55309
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
55218
55310
|
),
|
|
55219
55311
|
specifier2,
|
|
55220
|
-
node.parent.
|
|
55312
|
+
node.parent.attributes
|
|
55221
55313
|
),
|
|
55222
55314
|
0 /* None */
|
|
55223
55315
|
);
|
|
@@ -55258,7 +55350,7 @@ function createTypeChecker(host) {
|
|
|
55258
55350
|
])
|
|
55259
55351
|
),
|
|
55260
55352
|
specifier2,
|
|
55261
|
-
node.parent.parent.parent.
|
|
55353
|
+
node.parent.parent.parent.attributes
|
|
55262
55354
|
),
|
|
55263
55355
|
0 /* None */
|
|
55264
55356
|
);
|
|
@@ -58044,7 +58136,7 @@ function createTypeChecker(host) {
|
|
|
58044
58136
|
resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
|
|
58045
58137
|
}
|
|
58046
58138
|
function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
|
|
58047
|
-
const sig = new
|
|
58139
|
+
const sig = new Signature14(checker, flags);
|
|
58048
58140
|
sig.declaration = declaration;
|
|
58049
58141
|
sig.typeParameters = typeParameters;
|
|
58050
58142
|
sig.parameters = parameters;
|
|
@@ -64717,6 +64809,7 @@ function createTypeChecker(host) {
|
|
|
64717
64809
|
let skipParentCounter = 0;
|
|
64718
64810
|
let lastSkippedInfo;
|
|
64719
64811
|
let incompatibleStack;
|
|
64812
|
+
let relationCount = 16e6 - relation.size >> 3;
|
|
64720
64813
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
64721
64814
|
const result = isRelatedTo(
|
|
64722
64815
|
source,
|
|
@@ -64730,8 +64823,19 @@ function createTypeChecker(host) {
|
|
|
64730
64823
|
reportIncompatibleStack();
|
|
64731
64824
|
}
|
|
64732
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 */);
|
|
64733
64836
|
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
64734
|
-
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));
|
|
64735
64839
|
if (errorOutputContainer) {
|
|
64736
64840
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
64737
64841
|
}
|
|
@@ -65262,6 +65366,16 @@ function createTypeChecker(host) {
|
|
|
65262
65366
|
}
|
|
65263
65367
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
65264
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
|
+
}
|
|
65265
65379
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
65266
65380
|
}
|
|
65267
65381
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -65575,6 +65689,10 @@ function createTypeChecker(host) {
|
|
|
65575
65689
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
65576
65690
|
}
|
|
65577
65691
|
}
|
|
65692
|
+
if (relationCount <= 0) {
|
|
65693
|
+
overflow = true;
|
|
65694
|
+
return 0 /* False */;
|
|
65695
|
+
}
|
|
65578
65696
|
if (!maybeKeys) {
|
|
65579
65697
|
maybeKeys = [];
|
|
65580
65698
|
maybeKeysSet = /* @__PURE__ */ new Set();
|
|
@@ -65668,6 +65786,7 @@ function createTypeChecker(host) {
|
|
|
65668
65786
|
}
|
|
65669
65787
|
} else {
|
|
65670
65788
|
relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
|
|
65789
|
+
relationCount--;
|
|
65671
65790
|
resetMaybeStack(
|
|
65672
65791
|
/*markAllAsSucceeded*/
|
|
65673
65792
|
false
|
|
@@ -65679,6 +65798,7 @@ function createTypeChecker(host) {
|
|
|
65679
65798
|
maybeKeysSet.delete(maybeKeys[i]);
|
|
65680
65799
|
if (markAllAsSucceeded) {
|
|
65681
65800
|
relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
|
|
65801
|
+
relationCount--;
|
|
65682
65802
|
}
|
|
65683
65803
|
}
|
|
65684
65804
|
maybeCount = maybeStart;
|
|
@@ -74938,7 +75058,7 @@ function createTypeChecker(host) {
|
|
|
74938
75058
|
}
|
|
74939
75059
|
for (let i = 0; i < argCount; i++) {
|
|
74940
75060
|
const arg = args[i];
|
|
74941
|
-
if (arg.kind !== 232 /* OmittedExpression */) {
|
|
75061
|
+
if (arg.kind !== 232 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
74942
75062
|
const paramType = getTypeAtPosition(signature, i);
|
|
74943
75063
|
if (couldContainTypeVariables(paramType)) {
|
|
74944
75064
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -75541,6 +75661,7 @@ function createTypeChecker(host) {
|
|
|
75541
75661
|
const args = getEffectiveCallArguments(node);
|
|
75542
75662
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
75543
75663
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
75664
|
+
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
75544
75665
|
let candidatesForArgumentError;
|
|
75545
75666
|
let candidateForArgumentArityError;
|
|
75546
75667
|
let candidateForTypeArgumentError;
|
|
@@ -80510,16 +80631,8 @@ function createTypeChecker(host) {
|
|
|
80510
80631
|
}
|
|
80511
80632
|
function checkImportType(node) {
|
|
80512
80633
|
checkSourceElement(node.argument);
|
|
80513
|
-
if (node.
|
|
80514
|
-
|
|
80515
|
-
if (override) {
|
|
80516
|
-
if (!isNightly()) {
|
|
80517
|
-
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);
|
|
80518
|
-
}
|
|
80519
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
80520
|
-
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
80521
|
-
}
|
|
80522
|
-
}
|
|
80634
|
+
if (node.attributes) {
|
|
80635
|
+
getResolutionModeOverride(node.attributes, grammarErrorOnNode);
|
|
80523
80636
|
}
|
|
80524
80637
|
checkTypeReferenceOrImport(node);
|
|
80525
80638
|
}
|
|
@@ -84483,12 +84596,13 @@ function createTypeChecker(host) {
|
|
|
84483
84596
|
return false;
|
|
84484
84597
|
}
|
|
84485
84598
|
}
|
|
84486
|
-
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;
|
|
84487
84601
|
let hasError = false;
|
|
84488
|
-
for (const
|
|
84489
|
-
if (!isStringLiteral(
|
|
84602
|
+
for (const attr of node.attributes.elements) {
|
|
84603
|
+
if (!isStringLiteral(attr.value)) {
|
|
84490
84604
|
hasError = true;
|
|
84491
|
-
error2(
|
|
84605
|
+
error2(attr.value, diagnostic);
|
|
84492
84606
|
}
|
|
84493
84607
|
}
|
|
84494
84608
|
return !hasError;
|
|
@@ -84620,32 +84734,26 @@ function createTypeChecker(host) {
|
|
|
84620
84734
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
84621
84735
|
}
|
|
84622
84736
|
}
|
|
84623
|
-
function
|
|
84737
|
+
function checkImportAttributes(declaration) {
|
|
84624
84738
|
var _a;
|
|
84625
|
-
|
|
84626
|
-
|
|
84627
|
-
const
|
|
84628
|
-
|
|
84629
|
-
|
|
84630
|
-
|
|
84631
|
-
}
|
|
84632
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
84633
|
-
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
84634
|
-
}
|
|
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) {
|
|
84635
84745
|
return;
|
|
84636
84746
|
}
|
|
84637
84747
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
84638
84748
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
84639
|
-
|
|
84640
|
-
|
|
84641
|
-
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
|
|
84642
|
-
);
|
|
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);
|
|
84643
84751
|
}
|
|
84644
84752
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
84645
|
-
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);
|
|
84646
84754
|
}
|
|
84647
84755
|
if (override) {
|
|
84648
|
-
return grammarErrorOnNode(
|
|
84756
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
84649
84757
|
}
|
|
84650
84758
|
}
|
|
84651
84759
|
}
|
|
@@ -84677,7 +84785,7 @@ function createTypeChecker(host) {
|
|
|
84677
84785
|
}
|
|
84678
84786
|
}
|
|
84679
84787
|
}
|
|
84680
|
-
|
|
84788
|
+
checkImportAttributes(node);
|
|
84681
84789
|
}
|
|
84682
84790
|
function checkImportEqualsDeclaration(node) {
|
|
84683
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)) {
|
|
@@ -84750,7 +84858,7 @@ function createTypeChecker(host) {
|
|
|
84750
84858
|
}
|
|
84751
84859
|
}
|
|
84752
84860
|
}
|
|
84753
|
-
|
|
84861
|
+
checkImportAttributes(node);
|
|
84754
84862
|
}
|
|
84755
84863
|
function checkGrammarExportDeclaration(node) {
|
|
84756
84864
|
var _a;
|
|
@@ -88540,12 +88648,12 @@ function createTypeChecker(host) {
|
|
|
88540
88648
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
88541
88649
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
88542
88650
|
if (nodeArguments.length > 1) {
|
|
88543
|
-
const
|
|
88544
|
-
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);
|
|
88545
88653
|
}
|
|
88546
88654
|
}
|
|
88547
88655
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
88548
|
-
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);
|
|
88549
88657
|
}
|
|
88550
88658
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
88551
88659
|
if (spreadElement) {
|
|
@@ -88812,13 +88920,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
88812
88920
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
88813
88921
|
}
|
|
88814
88922
|
}
|
|
88815
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
88816
|
-
var _a;
|
|
88817
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
88818
|
-
this.onDiagnosticReported();
|
|
88819
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
88820
|
-
}
|
|
88821
|
-
}
|
|
88822
88923
|
onDiagnosticReported() {
|
|
88823
88924
|
this.context.reportedDiagnostic = true;
|
|
88824
88925
|
}
|
|
@@ -89327,7 +89428,7 @@ var visitEachChildTable = {
|
|
|
89327
89428
|
return context.factory.updateImportTypeNode(
|
|
89328
89429
|
node,
|
|
89329
89430
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
89330
|
-
nodeVisitor(node.
|
|
89431
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes),
|
|
89331
89432
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
89332
89433
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
89333
89434
|
node.isTypeOf
|
|
@@ -89878,20 +89979,20 @@ var visitEachChildTable = {
|
|
|
89878
89979
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
89879
89980
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
89880
89981
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
89881
|
-
nodeVisitor(node.
|
|
89982
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89882
89983
|
);
|
|
89883
89984
|
},
|
|
89884
|
-
[300 /*
|
|
89885
|
-
return context.factory.
|
|
89985
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
89986
|
+
return context.factory.updateImportAttributes(
|
|
89886
89987
|
node,
|
|
89887
|
-
nodesVisitor(node.elements, visitor,
|
|
89988
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
89888
89989
|
node.multiLine
|
|
89889
89990
|
);
|
|
89890
89991
|
},
|
|
89891
|
-
[301 /*
|
|
89892
|
-
return context.factory.
|
|
89992
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
89993
|
+
return context.factory.updateImportAttribute(
|
|
89893
89994
|
node,
|
|
89894
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
89995
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
89895
89996
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
89896
89997
|
);
|
|
89897
89998
|
},
|
|
@@ -89943,7 +90044,7 @@ var visitEachChildTable = {
|
|
|
89943
90044
|
node.isTypeOnly,
|
|
89944
90045
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
89945
90046
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
89946
|
-
nodeVisitor(node.
|
|
90047
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89947
90048
|
);
|
|
89948
90049
|
},
|
|
89949
90050
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -93433,7 +93534,7 @@ function transformTypeScript(context) {
|
|
|
93433
93534
|
void 0,
|
|
93434
93535
|
importClause,
|
|
93435
93536
|
node.moduleSpecifier,
|
|
93436
|
-
node.
|
|
93537
|
+
node.attributes
|
|
93437
93538
|
) : void 0;
|
|
93438
93539
|
}
|
|
93439
93540
|
function visitImportClause(node) {
|
|
@@ -93483,7 +93584,7 @@ function transformTypeScript(context) {
|
|
|
93483
93584
|
node.isTypeOnly,
|
|
93484
93585
|
exportClause,
|
|
93485
93586
|
node.moduleSpecifier,
|
|
93486
|
-
node.
|
|
93587
|
+
node.attributes
|
|
93487
93588
|
) : void 0;
|
|
93488
93589
|
}
|
|
93489
93590
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -93517,7 +93618,7 @@ function transformTypeScript(context) {
|
|
|
93517
93618
|
/*importClause*/
|
|
93518
93619
|
void 0,
|
|
93519
93620
|
node.moduleReference.expression,
|
|
93520
|
-
/*
|
|
93621
|
+
/*attributes*/
|
|
93521
93622
|
void 0
|
|
93522
93623
|
),
|
|
93523
93624
|
node
|
|
@@ -101687,7 +101788,7 @@ function transformJsx(context) {
|
|
|
101687
101788
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
101688
101789
|
),
|
|
101689
101790
|
factory2.createStringLiteral(importSource),
|
|
101690
|
-
/*
|
|
101791
|
+
/*attributes*/
|
|
101691
101792
|
void 0
|
|
101692
101793
|
);
|
|
101693
101794
|
setParentRecursive(
|
|
@@ -111094,7 +111195,9 @@ function transformECMAScriptModule(context) {
|
|
|
111094
111195
|
)
|
|
111095
111196
|
])
|
|
111096
111197
|
),
|
|
111097
|
-
factory2.createStringLiteral("module")
|
|
111198
|
+
factory2.createStringLiteral("module"),
|
|
111199
|
+
/*attributes*/
|
|
111200
|
+
void 0
|
|
111098
111201
|
);
|
|
111099
111202
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
111100
111203
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -111211,7 +111314,7 @@ function transformECMAScriptModule(context) {
|
|
|
111211
111314
|
)
|
|
111212
111315
|
),
|
|
111213
111316
|
node.moduleSpecifier,
|
|
111214
|
-
node.
|
|
111317
|
+
node.attributes
|
|
111215
111318
|
);
|
|
111216
111319
|
setOriginalNode(importDecl, node.exportClause);
|
|
111217
111320
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -111664,8 +111767,7 @@ function transformDeclarations(context) {
|
|
|
111664
111767
|
trackReferencedAmbientModule,
|
|
111665
111768
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
111666
111769
|
reportNonlocalAugmentation,
|
|
111667
|
-
reportNonSerializableProperty
|
|
111668
|
-
reportImportTypeNodeResolutionModeOverride
|
|
111770
|
+
reportNonSerializableProperty
|
|
111669
111771
|
};
|
|
111670
111772
|
let errorNameNode;
|
|
111671
111773
|
let errorFallbackNode;
|
|
@@ -111789,11 +111891,6 @@ function transformDeclarations(context) {
|
|
|
111789
111891
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
111790
111892
|
}
|
|
111791
111893
|
}
|
|
111792
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
111793
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
111794
|
-
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));
|
|
111795
|
-
}
|
|
111796
|
-
}
|
|
111797
111894
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
111798
111895
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
111799
111896
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -112298,7 +112395,7 @@ function transformDeclarations(context) {
|
|
|
112298
112395
|
decl.modifiers,
|
|
112299
112396
|
decl.importClause,
|
|
112300
112397
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112301
|
-
|
|
112398
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112302
112399
|
);
|
|
112303
112400
|
}
|
|
112304
112401
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -112314,7 +112411,7 @@ function transformDeclarations(context) {
|
|
|
112314
112411
|
void 0
|
|
112315
112412
|
),
|
|
112316
112413
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112317
|
-
|
|
112414
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112318
112415
|
);
|
|
112319
112416
|
}
|
|
112320
112417
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -112332,7 +112429,7 @@ function transformDeclarations(context) {
|
|
|
112332
112429
|
namedBindings
|
|
112333
112430
|
),
|
|
112334
112431
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112335
|
-
|
|
112432
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112336
112433
|
) : void 0;
|
|
112337
112434
|
}
|
|
112338
112435
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -112347,7 +112444,7 @@ function transformDeclarations(context) {
|
|
|
112347
112444
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
112348
112445
|
),
|
|
112349
112446
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112350
|
-
|
|
112447
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112351
112448
|
);
|
|
112352
112449
|
}
|
|
112353
112450
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -112357,19 +112454,13 @@ function transformDeclarations(context) {
|
|
|
112357
112454
|
/*importClause*/
|
|
112358
112455
|
void 0,
|
|
112359
112456
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112360
|
-
|
|
112457
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112361
112458
|
);
|
|
112362
112459
|
}
|
|
112363
112460
|
}
|
|
112364
|
-
function
|
|
112365
|
-
const mode =
|
|
112366
|
-
|
|
112367
|
-
if (!isNightly()) {
|
|
112368
|
-
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));
|
|
112369
|
-
}
|
|
112370
|
-
return assertClause;
|
|
112371
|
-
}
|
|
112372
|
-
return void 0;
|
|
112461
|
+
function tryGetResolutionModeOverride(node) {
|
|
112462
|
+
const mode = getResolutionModeOverride(node);
|
|
112463
|
+
return node && mode !== void 0 ? node : void 0;
|
|
112373
112464
|
}
|
|
112374
112465
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
112375
112466
|
while (length(lateMarkedStatements)) {
|
|
@@ -112655,7 +112746,7 @@ function transformDeclarations(context) {
|
|
|
112655
112746
|
return cleanup(factory2.updateImportTypeNode(
|
|
112656
112747
|
input,
|
|
112657
112748
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
112658
|
-
input.
|
|
112749
|
+
input.attributes,
|
|
112659
112750
|
input.qualifier,
|
|
112660
112751
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
112661
112752
|
input.isTypeOf
|
|
@@ -112709,7 +112800,7 @@ function transformDeclarations(context) {
|
|
|
112709
112800
|
input.isTypeOnly,
|
|
112710
112801
|
input.exportClause,
|
|
112711
112802
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
112712
|
-
|
|
112803
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
112713
112804
|
);
|
|
112714
112805
|
}
|
|
112715
112806
|
case 277 /* ExportAssignment */: {
|
|
@@ -115215,10 +115306,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115215
115306
|
return emitNamedExports(node);
|
|
115216
115307
|
case 281 /* ExportSpecifier */:
|
|
115217
115308
|
return emitExportSpecifier(node);
|
|
115218
|
-
case 300 /*
|
|
115219
|
-
return
|
|
115220
|
-
case 301 /*
|
|
115221
|
-
return
|
|
115309
|
+
case 300 /* ImportAttributes */:
|
|
115310
|
+
return emitImportAttributes(node);
|
|
115311
|
+
case 301 /* ImportAttribute */:
|
|
115312
|
+
return emitImportAttribute(node);
|
|
115222
115313
|
case 282 /* MissingDeclaration */:
|
|
115223
115314
|
return;
|
|
115224
115315
|
case 283 /* ExternalModuleReference */:
|
|
@@ -115993,16 +116084,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115993
116084
|
writeKeyword("import");
|
|
115994
116085
|
writePunctuation("(");
|
|
115995
116086
|
emit(node.argument);
|
|
115996
|
-
if (node.
|
|
116087
|
+
if (node.attributes) {
|
|
115997
116088
|
writePunctuation(",");
|
|
115998
116089
|
writeSpace();
|
|
115999
116090
|
writePunctuation("{");
|
|
116000
116091
|
writeSpace();
|
|
116001
|
-
writeKeyword("assert");
|
|
116092
|
+
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
116002
116093
|
writePunctuation(":");
|
|
116003
116094
|
writeSpace();
|
|
116004
|
-
const elements = node.
|
|
116005
|
-
emitList(node.
|
|
116095
|
+
const elements = node.attributes.elements;
|
|
116096
|
+
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
116006
116097
|
writeSpace();
|
|
116007
116098
|
writePunctuation("}");
|
|
116008
116099
|
}
|
|
@@ -116991,8 +117082,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
116991
117082
|
writeSpace();
|
|
116992
117083
|
}
|
|
116993
117084
|
emitExpression(node.moduleSpecifier);
|
|
116994
|
-
if (node.
|
|
116995
|
-
emitWithLeadingSpace(node.
|
|
117085
|
+
if (node.attributes) {
|
|
117086
|
+
emitWithLeadingSpace(node.attributes);
|
|
116996
117087
|
}
|
|
116997
117088
|
writeTrailingSemicolon();
|
|
116998
117089
|
}
|
|
@@ -117061,18 +117152,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117061
117152
|
writeSpace();
|
|
117062
117153
|
emitExpression(node.moduleSpecifier);
|
|
117063
117154
|
}
|
|
117064
|
-
if (node.
|
|
117065
|
-
emitWithLeadingSpace(node.
|
|
117155
|
+
if (node.attributes) {
|
|
117156
|
+
emitWithLeadingSpace(node.attributes);
|
|
117066
117157
|
}
|
|
117067
117158
|
writeTrailingSemicolon();
|
|
117068
117159
|
}
|
|
117069
|
-
function
|
|
117070
|
-
emitTokenWithComment(
|
|
117160
|
+
function emitImportAttributes(node) {
|
|
117161
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
117071
117162
|
writeSpace();
|
|
117072
117163
|
const elements = node.elements;
|
|
117073
|
-
emitList(node, elements, 526226 /*
|
|
117164
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
117074
117165
|
}
|
|
117075
|
-
function
|
|
117166
|
+
function emitImportAttribute(node) {
|
|
117076
117167
|
emit(node.name);
|
|
117077
117168
|
writePunctuation(":");
|
|
117078
117169
|
writeSpace();
|
|
@@ -120159,8 +120250,6 @@ function getModeForFileReference(ref, containingFileMode) {
|
|
|
120159
120250
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
120160
120251
|
}
|
|
120161
120252
|
function getModeForResolutionAtIndex(file, index) {
|
|
120162
|
-
if (file.impliedNodeFormat === void 0)
|
|
120163
|
-
return void 0;
|
|
120164
120253
|
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
120165
120254
|
}
|
|
120166
120255
|
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
@@ -120174,42 +120263,48 @@ function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
|
120174
120263
|
return false;
|
|
120175
120264
|
}
|
|
120176
120265
|
function getModeForUsageLocation(file, usage) {
|
|
120177
|
-
var _a
|
|
120178
|
-
if (file.impliedNodeFormat === void 0)
|
|
120179
|
-
return void 0;
|
|
120266
|
+
var _a;
|
|
120180
120267
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
120181
120268
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
120182
120269
|
if (isTypeOnly) {
|
|
120183
|
-
const override =
|
|
120270
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
120184
120271
|
if (override) {
|
|
120185
120272
|
return override;
|
|
120186
120273
|
}
|
|
120187
120274
|
}
|
|
120188
120275
|
}
|
|
120189
120276
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
120190
|
-
const override =
|
|
120277
|
+
const override = getResolutionModeOverride(usage.parent.parent.attributes);
|
|
120191
120278
|
if (override) {
|
|
120192
120279
|
return override;
|
|
120193
120280
|
}
|
|
120194
120281
|
}
|
|
120282
|
+
if (file.impliedNodeFormat === void 0)
|
|
120283
|
+
return void 0;
|
|
120195
120284
|
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
120196
120285
|
return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
120197
120286
|
}
|
|
120198
|
-
const exprParentParent = (
|
|
120287
|
+
const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent;
|
|
120199
120288
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
120200
120289
|
}
|
|
120201
|
-
function
|
|
120202
|
-
if (!
|
|
120290
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
120291
|
+
if (!node)
|
|
120203
120292
|
return void 0;
|
|
120204
|
-
if (length(
|
|
120205
|
-
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
|
+
);
|
|
120206
120298
|
return void 0;
|
|
120207
120299
|
}
|
|
120208
|
-
const elem =
|
|
120300
|
+
const elem = node.elements[0];
|
|
120209
120301
|
if (!isStringLiteralLike(elem.name))
|
|
120210
120302
|
return void 0;
|
|
120211
120303
|
if (elem.name.text !== "resolution-mode") {
|
|
120212
|
-
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
|
+
);
|
|
120213
120308
|
return void 0;
|
|
120214
120309
|
}
|
|
120215
120310
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -120508,7 +120603,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
120508
120603
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
120509
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,
|
|
120510
120605
|
Diagnostics.Duplicate_label_0.code,
|
|
120511
|
-
Diagnostics.
|
|
120606
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
120512
120607
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
120513
120608
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
120514
120609
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -122042,7 +122137,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122042
122137
|
/*importClause*/
|
|
122043
122138
|
void 0,
|
|
122044
122139
|
externalHelpersModuleReference,
|
|
122045
|
-
/*
|
|
122140
|
+
/*attributes*/
|
|
122046
122141
|
void 0
|
|
122047
122142
|
);
|
|
122048
122143
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -122518,14 +122613,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122518
122613
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
122519
122614
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
122520
122615
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
122521
|
-
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
122522
|
-
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
122523
|
-
kind: 2 /* ResolutionDiagnostics */,
|
|
122524
|
-
diagnostics: [
|
|
122525
|
-
createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)
|
|
122526
|
-
]
|
|
122527
|
-
});
|
|
122528
|
-
}
|
|
122529
122616
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
122530
122617
|
}
|
|
122531
122618
|
}
|
|
@@ -132166,7 +132253,7 @@ function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreferenc
|
|
|
132166
132253
|
void 0,
|
|
132167
132254
|
defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0,
|
|
132168
132255
|
typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier,
|
|
132169
|
-
/*
|
|
132256
|
+
/*attributes*/
|
|
132170
132257
|
void 0
|
|
132171
132258
|
);
|
|
132172
132259
|
}
|
|
@@ -137879,7 +137966,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
|
|
|
137879
137966
|
}
|
|
137880
137967
|
case 205 /* ImportType */:
|
|
137881
137968
|
const importTypeNode = parent2;
|
|
137882
|
-
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));
|
|
137883
137970
|
break;
|
|
137884
137971
|
default:
|
|
137885
137972
|
Debug.failBadSyntaxKind(parent2);
|
|
@@ -138154,7 +138241,7 @@ function updateImport(old, defaultImportName, elements) {
|
|
|
138154
138241
|
elements && elements.length ? factory.createNamedImports(elements) : void 0
|
|
138155
138242
|
),
|
|
138156
138243
|
old.moduleSpecifier,
|
|
138157
|
-
/*
|
|
138244
|
+
/*attributes*/
|
|
138158
138245
|
void 0
|
|
138159
138246
|
);
|
|
138160
138247
|
}
|
|
@@ -138996,7 +139083,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie
|
|
|
138996
139083
|
factory.createNamespaceImport(newNamespaceId)
|
|
138997
139084
|
),
|
|
138998
139085
|
newModuleString,
|
|
138999
|
-
/*
|
|
139086
|
+
/*attributes*/
|
|
139000
139087
|
void 0
|
|
139001
139088
|
);
|
|
139002
139089
|
case 271 /* ImportEqualsDeclaration */:
|
|
@@ -139285,7 +139372,7 @@ function filterImport(i, moduleSpecifier, keep) {
|
|
|
139285
139372
|
void 0,
|
|
139286
139373
|
factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings),
|
|
139287
139374
|
getSynthesizedDeepClone(moduleSpecifier),
|
|
139288
|
-
/*
|
|
139375
|
+
/*attributes*/
|
|
139289
139376
|
void 0
|
|
139290
139377
|
) : void 0;
|
|
139291
139378
|
}
|
|
@@ -139609,7 +139696,7 @@ function moveStatementsToTargetFile(changes, program, statements, targetFile, to
|
|
|
139609
139696
|
continue;
|
|
139610
139697
|
}
|
|
139611
139698
|
if (length(updatedElements) < length(elements)) {
|
|
139612
|
-
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));
|
|
139613
139700
|
}
|
|
139614
139701
|
}
|
|
139615
139702
|
}
|
|
@@ -149748,7 +149835,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149748
149835
|
false,
|
|
149749
149836
|
factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))),
|
|
149750
149837
|
exportDeclaration.moduleSpecifier,
|
|
149751
|
-
/*
|
|
149838
|
+
/*attributes*/
|
|
149752
149839
|
void 0
|
|
149753
149840
|
);
|
|
149754
149841
|
const typeExportDeclaration = factory.createExportDeclaration(
|
|
@@ -149758,7 +149845,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149758
149845
|
true,
|
|
149759
149846
|
factory.createNamedExports(typeExportSpecifiers),
|
|
149760
149847
|
exportDeclaration.moduleSpecifier,
|
|
149761
|
-
/*
|
|
149848
|
+
/*attributes*/
|
|
149762
149849
|
void 0
|
|
149763
149850
|
);
|
|
149764
149851
|
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {
|
|
@@ -149891,7 +149978,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149891
149978
|
true
|
|
149892
149979
|
),
|
|
149893
149980
|
getSynthesizedDeepClone(
|
|
149894
|
-
declaration.
|
|
149981
|
+
declaration.attributes,
|
|
149895
149982
|
/*includeTrivia*/
|
|
149896
149983
|
true
|
|
149897
149984
|
)
|
|
@@ -149919,7 +150006,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149919
150006
|
true
|
|
149920
150007
|
),
|
|
149921
150008
|
getSynthesizedDeepClone(
|
|
149922
|
-
declaration.
|
|
150009
|
+
declaration.attributes,
|
|
149923
150010
|
/*includeTrivia*/
|
|
149924
150011
|
true
|
|
149925
150012
|
)
|
|
@@ -149942,7 +150029,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149942
150029
|
true,
|
|
149943
150030
|
importClause.name,
|
|
149944
150031
|
newNamedBindings
|
|
149945
|
-
), declaration.moduleSpecifier, declaration.
|
|
150032
|
+
), declaration.moduleSpecifier, declaration.attributes);
|
|
149946
150033
|
changes.replaceNode(sourceFile, declaration, importDeclaration);
|
|
149947
150034
|
}
|
|
149948
150035
|
}
|
|
@@ -151441,7 +151528,7 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp
|
|
|
151441
151528
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
|
151442
151529
|
),
|
|
151443
151530
|
quotedModuleSpecifier,
|
|
151444
|
-
/*
|
|
151531
|
+
/*attributes*/
|
|
151445
151532
|
void 0
|
|
151446
151533
|
);
|
|
151447
151534
|
statements = combine(statements, declaration);
|
|
@@ -152020,7 +152107,7 @@ function updateExport(changes, program, sourceFile, node, names) {
|
|
|
152020
152107
|
)
|
|
152021
152108
|
),
|
|
152022
152109
|
node.moduleSpecifier,
|
|
152023
|
-
node.
|
|
152110
|
+
node.attributes
|
|
152024
152111
|
)
|
|
152025
152112
|
);
|
|
152026
152113
|
}
|
|
@@ -152037,7 +152124,7 @@ function createExport(changes, program, sourceFile, names) {
|
|
|
152037
152124
|
)),
|
|
152038
152125
|
/*moduleSpecifier*/
|
|
152039
152126
|
void 0,
|
|
152040
|
-
/*
|
|
152127
|
+
/*attributes*/
|
|
152041
152128
|
void 0
|
|
152042
152129
|
));
|
|
152043
152130
|
}
|
|
@@ -156712,7 +156799,7 @@ function doChange34(changes, sourceFile, info) {
|
|
|
156712
156799
|
namedImports
|
|
156713
156800
|
),
|
|
156714
156801
|
required,
|
|
156715
|
-
/*
|
|
156802
|
+
/*attributes*/
|
|
156716
156803
|
void 0
|
|
156717
156804
|
)
|
|
156718
156805
|
);
|
|
@@ -156851,7 +156938,7 @@ function doChange36(changes, sourceFile, importType) {
|
|
|
156851
156938
|
const newTypeNode = factory.updateImportTypeNode(
|
|
156852
156939
|
importType,
|
|
156853
156940
|
importType.argument,
|
|
156854
|
-
importType.
|
|
156941
|
+
importType.attributes,
|
|
156855
156942
|
importType.qualifier,
|
|
156856
156943
|
importType.typeArguments,
|
|
156857
156944
|
/*isTypeOf*/
|
|
@@ -157082,7 +157169,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
157082
157169
|
void 0
|
|
157083
157170
|
),
|
|
157084
157171
|
importDeclaration.moduleSpecifier,
|
|
157085
|
-
importDeclaration.
|
|
157172
|
+
importDeclaration.attributes
|
|
157086
157173
|
)
|
|
157087
157174
|
);
|
|
157088
157175
|
changes.insertNodeAfter(
|
|
@@ -157099,7 +157186,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
157099
157186
|
importClause.namedBindings
|
|
157100
157187
|
),
|
|
157101
157188
|
importDeclaration.moduleSpecifier,
|
|
157102
|
-
importDeclaration.
|
|
157189
|
+
importDeclaration.attributes
|
|
157103
157190
|
)
|
|
157104
157191
|
);
|
|
157105
157192
|
}
|
|
@@ -161324,7 +161411,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
161324
161411
|
case 291 /* JsxAttribute */:
|
|
161325
161412
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
161326
161413
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
161327
|
-
return argumentInfo &&
|
|
161414
|
+
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */);
|
|
161328
161415
|
}
|
|
161329
161416
|
case 272 /* ImportDeclaration */:
|
|
161330
161417
|
case 278 /* ExportDeclaration */:
|
|
@@ -161393,12 +161480,11 @@ function walkUpParentheses(node) {
|
|
|
161393
161480
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
161394
161481
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
161395
161482
|
}
|
|
161396
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker
|
|
161483
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
161397
161484
|
let isNewIdentifier = false;
|
|
161398
161485
|
const uniques = /* @__PURE__ */ new Map();
|
|
161399
|
-
const candidates = [];
|
|
161400
161486
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
161401
|
-
checker.
|
|
161487
|
+
const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
|
|
161402
161488
|
const types = flatMap(candidates, (candidate) => {
|
|
161403
161489
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
161404
161490
|
return;
|
|
@@ -166189,7 +166275,7 @@ function removeUnusedImports(oldImports, sourceFile, program) {
|
|
|
166189
166275
|
/*importClause*/
|
|
166190
166276
|
void 0,
|
|
166191
166277
|
moduleSpecifier,
|
|
166192
|
-
/*
|
|
166278
|
+
/*attributes*/
|
|
166193
166279
|
void 0
|
|
166194
166280
|
));
|
|
166195
166281
|
} else {
|
|
@@ -166355,7 +166441,7 @@ function coalesceExportsWorker(exportGroup, comparer) {
|
|
|
166355
166441
|
exportDecl.isTypeOnly,
|
|
166356
166442
|
exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)),
|
|
166357
166443
|
exportDecl.moduleSpecifier,
|
|
166358
|
-
exportDecl.
|
|
166444
|
+
exportDecl.attributes
|
|
166359
166445
|
)
|
|
166360
166446
|
);
|
|
166361
166447
|
}
|
|
@@ -166387,7 +166473,7 @@ function updateImportDeclarationAndClause(importDeclaration, name, namedBindings
|
|
|
166387
166473
|
factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings),
|
|
166388
166474
|
// TODO: GH#18217
|
|
166389
166475
|
importDeclaration.moduleSpecifier,
|
|
166390
|
-
importDeclaration.
|
|
166476
|
+
importDeclaration.attributes
|
|
166391
166477
|
);
|
|
166392
166478
|
}
|
|
166393
166479
|
function sortSpecifiers(specifiers, comparer) {
|
|
@@ -166882,10 +166968,11 @@ function getOutliningSpanForNode(n, sourceFile) {
|
|
|
166882
166968
|
return spanForParenthesizedExpression(n);
|
|
166883
166969
|
case 275 /* NamedImports */:
|
|
166884
166970
|
case 279 /* NamedExports */:
|
|
166971
|
+
case 300 /* ImportAttributes */:
|
|
166885
166972
|
case 300 /* AssertClause */:
|
|
166886
|
-
return
|
|
166973
|
+
return spanForImportExportElements(n);
|
|
166887
166974
|
}
|
|
166888
|
-
function
|
|
166975
|
+
function spanForImportExportElements(node) {
|
|
166889
166976
|
if (!node.elements.length) {
|
|
166890
166977
|
return void 0;
|
|
166891
166978
|
}
|
|
@@ -173594,7 +173681,7 @@ __export(ts_exports2, {
|
|
|
173594
173681
|
getRenameLocation: () => getRenameLocation,
|
|
173595
173682
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
173596
173683
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
173597
|
-
|
|
173684
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
173598
173685
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
173599
173686
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
173600
173687
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -173726,6 +173813,7 @@ __export(ts_exports2, {
|
|
|
173726
173813
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
173727
173814
|
hasQuestionToken: () => hasQuestionToken,
|
|
173728
173815
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
173816
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
173729
173817
|
hasRestParameter: () => hasRestParameter,
|
|
173730
173818
|
hasScopeMarker: () => hasScopeMarker,
|
|
173731
173819
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -173799,7 +173887,6 @@ __export(ts_exports2, {
|
|
|
173799
173887
|
isAssertClause: () => isAssertClause,
|
|
173800
173888
|
isAssertEntry: () => isAssertEntry,
|
|
173801
173889
|
isAssertionExpression: () => isAssertionExpression,
|
|
173802
|
-
isAssertionKey: () => isAssertionKey,
|
|
173803
173890
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
173804
173891
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
173805
173892
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -173840,6 +173927,7 @@ __export(ts_exports2, {
|
|
|
173840
173927
|
isCallExpression: () => isCallExpression,
|
|
173841
173928
|
isCallExpressionTarget: () => isCallExpressionTarget,
|
|
173842
173929
|
isCallLikeExpression: () => isCallLikeExpression,
|
|
173930
|
+
isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
|
|
173843
173931
|
isCallOrNewExpression: () => isCallOrNewExpression,
|
|
173844
173932
|
isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
|
|
173845
173933
|
isCallSignatureDeclaration: () => isCallSignatureDeclaration,
|
|
@@ -174008,6 +174096,9 @@ __export(ts_exports2, {
|
|
|
174008
174096
|
isIfStatement: () => isIfStatement,
|
|
174009
174097
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
174010
174098
|
isImplicitGlob: () => isImplicitGlob,
|
|
174099
|
+
isImportAttribute: () => isImportAttribute,
|
|
174100
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
174101
|
+
isImportAttributes: () => isImportAttributes,
|
|
174011
174102
|
isImportCall: () => isImportCall,
|
|
174012
174103
|
isImportClause: () => isImportClause,
|
|
174013
174104
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -174199,7 +174290,6 @@ __export(ts_exports2, {
|
|
|
174199
174290
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
174200
174291
|
isNewExpression: () => isNewExpression,
|
|
174201
174292
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
174202
|
-
isNightly: () => isNightly,
|
|
174203
174293
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
174204
174294
|
isNode: () => isNode,
|
|
174205
174295
|
isNodeArray: () => isNodeArray,
|
|
@@ -178482,8 +178572,8 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
178482
178572
|
const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory);
|
|
178483
178573
|
if (isSymlink) {
|
|
178484
178574
|
symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
|
|
178485
|
-
real,
|
|
178486
|
-
realPath: realPath2
|
|
178575
|
+
real: ensureTrailingDirectorySeparator(real),
|
|
178576
|
+
realPath: ensureTrailingDirectorySeparator(realPath2)
|
|
178487
178577
|
});
|
|
178488
178578
|
}
|
|
178489
178579
|
return mapDefined(entrypoints, (entrypoint) => {
|
|
@@ -188272,7 +188362,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188272
188362
|
getRenameLocation,
|
|
188273
188363
|
getReplacementSpanForContextToken,
|
|
188274
188364
|
getResolutionDiagnostic,
|
|
188275
|
-
|
|
188365
|
+
getResolutionModeOverride,
|
|
188276
188366
|
getResolveJsonModule,
|
|
188277
188367
|
getResolvePackageJsonExports,
|
|
188278
188368
|
getResolvePackageJsonImports,
|
|
@@ -188404,6 +188494,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188404
188494
|
hasPropertyAccessExpressionWithName,
|
|
188405
188495
|
hasQuestionToken,
|
|
188406
188496
|
hasRecordedExternalHelpers,
|
|
188497
|
+
hasResolutionModeOverride,
|
|
188407
188498
|
hasRestParameter,
|
|
188408
188499
|
hasScopeMarker,
|
|
188409
188500
|
hasStaticModifier,
|
|
@@ -188477,7 +188568,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188477
188568
|
isAssertClause,
|
|
188478
188569
|
isAssertEntry,
|
|
188479
188570
|
isAssertionExpression,
|
|
188480
|
-
isAssertionKey,
|
|
188481
188571
|
isAssertsKeyword,
|
|
188482
188572
|
isAssignmentDeclaration,
|
|
188483
188573
|
isAssignmentExpression,
|
|
@@ -188518,6 +188608,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188518
188608
|
isCallExpression,
|
|
188519
188609
|
isCallExpressionTarget,
|
|
188520
188610
|
isCallLikeExpression,
|
|
188611
|
+
isCallLikeOrFunctionLikeExpression,
|
|
188521
188612
|
isCallOrNewExpression,
|
|
188522
188613
|
isCallOrNewExpressionTarget,
|
|
188523
188614
|
isCallSignatureDeclaration,
|
|
@@ -188686,6 +188777,9 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188686
188777
|
isIfStatement,
|
|
188687
188778
|
isIgnoredFileFromWildCardWatching,
|
|
188688
188779
|
isImplicitGlob,
|
|
188780
|
+
isImportAttribute,
|
|
188781
|
+
isImportAttributeName,
|
|
188782
|
+
isImportAttributes,
|
|
188689
188783
|
isImportCall,
|
|
188690
188784
|
isImportClause,
|
|
188691
188785
|
isImportDeclaration,
|
|
@@ -188877,7 +188971,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188877
188971
|
isNamespaceReexportDeclaration,
|
|
188878
188972
|
isNewExpression,
|
|
188879
188973
|
isNewExpressionTarget,
|
|
188880
|
-
isNightly,
|
|
188881
188974
|
isNoSubstitutionTemplateLiteral,
|
|
188882
188975
|
isNode,
|
|
188883
188976
|
isNodeArray,
|