@typescript-deploys/pr-build 5.3.0-pr-55880-5 → 5.3.0-pr-55567-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es5.d.ts +9 -1
- package/lib/tsc.js +325 -269
- package/lib/tsserver.js +369 -299
- package/lib/typescript.d.ts +51 -29
- package/lib/typescript.js +364 -296
- package/lib/typingsInstaller.js +170 -115
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -992,7 +992,7 @@ __export(server_exports, {
|
|
|
992
992
|
getRenameLocation: () => getRenameLocation,
|
|
993
993
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
994
994
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
995
|
-
|
|
995
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
996
996
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
997
997
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
998
998
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -1124,6 +1124,7 @@ __export(server_exports, {
|
|
|
1124
1124
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
1125
1125
|
hasQuestionToken: () => hasQuestionToken,
|
|
1126
1126
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
1127
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
1127
1128
|
hasRestParameter: () => hasRestParameter,
|
|
1128
1129
|
hasScopeMarker: () => hasScopeMarker,
|
|
1129
1130
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -1197,7 +1198,6 @@ __export(server_exports, {
|
|
|
1197
1198
|
isAssertClause: () => isAssertClause,
|
|
1198
1199
|
isAssertEntry: () => isAssertEntry,
|
|
1199
1200
|
isAssertionExpression: () => isAssertionExpression,
|
|
1200
|
-
isAssertionKey: () => isAssertionKey,
|
|
1201
1201
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
1202
1202
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
1203
1203
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -1407,6 +1407,9 @@ __export(server_exports, {
|
|
|
1407
1407
|
isIfStatement: () => isIfStatement,
|
|
1408
1408
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
1409
1409
|
isImplicitGlob: () => isImplicitGlob,
|
|
1410
|
+
isImportAttribute: () => isImportAttribute,
|
|
1411
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
1412
|
+
isImportAttributes: () => isImportAttributes,
|
|
1410
1413
|
isImportCall: () => isImportCall,
|
|
1411
1414
|
isImportClause: () => isImportClause,
|
|
1412
1415
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -1598,7 +1601,6 @@ __export(server_exports, {
|
|
|
1598
1601
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
1599
1602
|
isNewExpression: () => isNewExpression,
|
|
1600
1603
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
1601
|
-
isNightly: () => isNightly,
|
|
1602
1604
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
1603
1605
|
isNode: () => isNode,
|
|
1604
1606
|
isNodeArray: () => isNodeArray,
|
|
@@ -2328,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2330
|
|
|
2329
2331
|
// src/compiler/corePublic.ts
|
|
2330
2332
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-insiders.20230927`;
|
|
2332
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6037,8 +6039,10 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6037
6039
|
SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause";
|
|
6038
6040
|
SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause";
|
|
6039
6041
|
SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause";
|
|
6040
|
-
SyntaxKind5[SyntaxKind5["
|
|
6041
|
-
SyntaxKind5[SyntaxKind5["
|
|
6042
|
+
SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes";
|
|
6043
|
+
SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute";
|
|
6044
|
+
SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
6045
|
+
SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
6042
6046
|
SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
|
|
6043
6047
|
SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
6044
6048
|
SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
@@ -7341,7 +7345,8 @@ var ListFormat = /* @__PURE__ */ ((ListFormat2) => {
|
|
|
7341
7345
|
ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
|
|
7342
7346
|
ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
|
|
7343
7347
|
ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
|
|
7344
|
-
ListFormat2[ListFormat2["
|
|
7348
|
+
ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes";
|
|
7349
|
+
ListFormat2[ListFormat2["ImportClauseEntries"] = 526226 /* ImportAttributes */] = "ImportClauseEntries";
|
|
7345
7350
|
ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
|
|
7346
7351
|
ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements";
|
|
7347
7352
|
ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
|
|
@@ -8352,12 +8357,11 @@ var sys = (() => {
|
|
|
8352
8357
|
let activeSession;
|
|
8353
8358
|
let profilePath = "./profile.cpuprofile";
|
|
8354
8359
|
const Buffer2 = require("buffer").Buffer;
|
|
8355
|
-
const
|
|
8356
|
-
const platform = _os.platform();
|
|
8360
|
+
const isWindows = process.platform === "win32";
|
|
8357
8361
|
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
8358
|
-
const fsRealpath = !!_fs.realpathSync.native ?
|
|
8362
|
+
const fsRealpath = !!_fs.realpathSync.native ? isWindows ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
8359
8363
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
8360
|
-
const fsSupportsRecursiveFsWatch =
|
|
8364
|
+
const fsSupportsRecursiveFsWatch = isWindows || process.platform === "darwin";
|
|
8361
8365
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
8362
8366
|
const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
|
|
8363
8367
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -8376,7 +8380,7 @@ var sys = (() => {
|
|
|
8376
8380
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
8377
8381
|
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
8378
8382
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
8379
|
-
inodeWatching:
|
|
8383
|
+
inodeWatching: !isWindows,
|
|
8380
8384
|
sysLog
|
|
8381
8385
|
});
|
|
8382
8386
|
const nodeSystem = {
|
|
@@ -8561,7 +8565,7 @@ var sys = (() => {
|
|
|
8561
8565
|
return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding);
|
|
8562
8566
|
}
|
|
8563
8567
|
function isFileSystemCaseSensitive() {
|
|
8564
|
-
if (
|
|
8568
|
+
if (isWindows) {
|
|
8565
8569
|
return false;
|
|
8566
8570
|
}
|
|
8567
8571
|
return !fileExists(swapCase(__filename));
|
|
@@ -9581,9 +9585,8 @@ var Diagnostics = {
|
|
|
9581
9585
|
_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),
|
|
9582
9586
|
_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),
|
|
9583
9587
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
9584
|
-
|
|
9588
|
+
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),
|
|
9585
9589
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
9586
|
-
resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
9587
9590
|
resolution_mode_should_be_either_require_or_import: diag(1453, 1 /* Error */, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
9588
9591
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, 1 /* Error */, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
9589
9592
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -9593,6 +9596,8 @@ var Diagnostics = {
|
|
|
9593
9596
|
File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3 /* Message */, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`),
|
|
9594
9597
|
File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3 /* Message */, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`),
|
|
9595
9598
|
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"),
|
|
9599
|
+
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."),
|
|
9600
|
+
Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1 /* Error */, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),
|
|
9596
9601
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* Error */, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
9597
9602
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, 1 /* Error */, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),
|
|
9598
9603
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -9619,6 +9624,7 @@ var Diagnostics = {
|
|
|
9619
9624
|
The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
|
|
9620
9625
|
The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
|
|
9621
9626
|
_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."),
|
|
9627
|
+
Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."),
|
|
9622
9628
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
9623
9629
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
9624
9630
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -10148,15 +10154,15 @@ var Diagnostics = {
|
|
|
10148
10154
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
10149
10155
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
10150
10156
|
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."),
|
|
10157
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
10151
10158
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
10152
10159
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
10153
10160
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
10154
|
-
|
|
10161
|
+
Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2836, 1 /* Error */, "Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836", "Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
10155
10162
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1 /* Error */, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
10156
10163
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
10157
10164
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
10158
10165
|
An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
|
|
10159
|
-
The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
10160
10166
|
_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
|
|
10161
10167
|
We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
|
|
10162
10168
|
Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
@@ -10170,6 +10176,10 @@ var Diagnostics = {
|
|
|
10170
10176
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
10171
10177
|
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
10172
10178
|
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."),
|
|
10179
|
+
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."),
|
|
10180
|
+
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."),
|
|
10181
|
+
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."),
|
|
10182
|
+
Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
|
|
10173
10183
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
10174
10184
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
10175
10185
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -10278,7 +10288,6 @@ var Diagnostics = {
|
|
|
10278
10288
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
10279
10289
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
10280
10290
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
10281
|
-
resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, 1 /* Error */, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
10282
10291
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
10283
10292
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
10284
10293
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -14353,12 +14362,12 @@ function isTypeOnlyExportDeclaration(node) {
|
|
|
14353
14362
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
14354
14363
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
14355
14364
|
}
|
|
14356
|
-
function isAssertionKey(node) {
|
|
14357
|
-
return isStringLiteral(node) || isIdentifier(node);
|
|
14358
|
-
}
|
|
14359
14365
|
function isStringTextContainingNode(node) {
|
|
14360
14366
|
return node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
14361
14367
|
}
|
|
14368
|
+
function isImportAttributeName(node) {
|
|
14369
|
+
return isStringLiteral(node) || isIdentifier(node);
|
|
14370
|
+
}
|
|
14362
14371
|
function isGeneratedIdentifier(node) {
|
|
14363
14372
|
var _a;
|
|
14364
14373
|
return isIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0;
|
|
@@ -18713,9 +18722,6 @@ function getIndentString(level) {
|
|
|
18713
18722
|
function getIndentSize() {
|
|
18714
18723
|
return indentStrings[1].length;
|
|
18715
18724
|
}
|
|
18716
|
-
function isNightly() {
|
|
18717
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
18718
|
-
}
|
|
18719
18725
|
function createTextWriter(newLine) {
|
|
18720
18726
|
var output;
|
|
18721
18727
|
var indent3;
|
|
@@ -21660,6 +21666,12 @@ function getPropertyNameFromType(type) {
|
|
|
21660
21666
|
function isExpandoPropertyDeclaration(declaration) {
|
|
21661
21667
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
21662
21668
|
}
|
|
21669
|
+
function hasResolutionModeOverride(node) {
|
|
21670
|
+
if (node === void 0) {
|
|
21671
|
+
return false;
|
|
21672
|
+
}
|
|
21673
|
+
return !!getResolutionModeOverride(node.attributes);
|
|
21674
|
+
}
|
|
21663
21675
|
|
|
21664
21676
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21665
21677
|
function createBaseNodeFactory() {
|
|
@@ -22542,6 +22554,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22542
22554
|
updateAssertEntry,
|
|
22543
22555
|
createImportTypeAssertionContainer,
|
|
22544
22556
|
updateImportTypeAssertionContainer,
|
|
22557
|
+
createImportAttributes,
|
|
22558
|
+
updateImportAttributes,
|
|
22559
|
+
createImportAttribute,
|
|
22560
|
+
updateImportAttribute,
|
|
22545
22561
|
createNamespaceImport,
|
|
22546
22562
|
updateNamespaceImport,
|
|
22547
22563
|
createNamespaceExport,
|
|
@@ -23810,18 +23826,21 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23810
23826
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
23811
23827
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
23812
23828
|
}
|
|
23813
|
-
function createImportTypeNode(argument,
|
|
23829
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
23814
23830
|
const node = createBaseNode(205 /* ImportType */);
|
|
23815
23831
|
node.argument = argument;
|
|
23816
|
-
node.
|
|
23832
|
+
node.attributes = attributes;
|
|
23833
|
+
if (node.assertions && node.assertions.assertClause && node.attributes) {
|
|
23834
|
+
node.assertions.assertClause = node.attributes;
|
|
23835
|
+
}
|
|
23817
23836
|
node.qualifier = qualifier;
|
|
23818
23837
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
23819
23838
|
node.isTypeOf = isTypeOf;
|
|
23820
23839
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23821
23840
|
return node;
|
|
23822
23841
|
}
|
|
23823
|
-
function updateImportTypeNode(node, argument,
|
|
23824
|
-
return node.argument !== argument || node.
|
|
23842
|
+
function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
23843
|
+
return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node;
|
|
23825
23844
|
}
|
|
23826
23845
|
function createParenthesizedType(type) {
|
|
23827
23846
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -24951,19 +24970,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24951
24970
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
24952
24971
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
24953
24972
|
}
|
|
24954
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
24973
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
24955
24974
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
24956
24975
|
node.modifiers = asNodeArray(modifiers);
|
|
24957
24976
|
node.importClause = importClause;
|
|
24958
24977
|
node.moduleSpecifier = moduleSpecifier;
|
|
24959
|
-
node.assertClause =
|
|
24978
|
+
node.attributes = node.assertClause = attributes;
|
|
24960
24979
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
24961
24980
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24962
24981
|
node.jsDoc = void 0;
|
|
24963
24982
|
return node;
|
|
24964
24983
|
}
|
|
24965
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
24966
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
24984
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
|
|
24985
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
|
|
24967
24986
|
}
|
|
24968
24987
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
24969
24988
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -24984,6 +25003,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24984
25003
|
const node = createBaseNode(300 /* AssertClause */);
|
|
24985
25004
|
node.elements = createNodeArray(elements);
|
|
24986
25005
|
node.multiLine = multiLine;
|
|
25006
|
+
node.token = 132 /* AssertKeyword */;
|
|
24987
25007
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
24988
25008
|
return node;
|
|
24989
25009
|
}
|
|
@@ -25009,6 +25029,27 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25009
25029
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
25010
25030
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
25011
25031
|
}
|
|
25032
|
+
function createImportAttributes(elements, multiLine, token) {
|
|
25033
|
+
const node = createBaseNode(300 /* ImportAttributes */);
|
|
25034
|
+
node.token = token ?? 118 /* WithKeyword */;
|
|
25035
|
+
node.elements = createNodeArray(elements);
|
|
25036
|
+
node.multiLine = multiLine;
|
|
25037
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
25038
|
+
return node;
|
|
25039
|
+
}
|
|
25040
|
+
function updateImportAttributes(node, elements, multiLine) {
|
|
25041
|
+
return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
|
|
25042
|
+
}
|
|
25043
|
+
function createImportAttribute(name, value) {
|
|
25044
|
+
const node = createBaseNode(301 /* ImportAttribute */);
|
|
25045
|
+
node.name = name;
|
|
25046
|
+
node.value = value;
|
|
25047
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
25048
|
+
return node;
|
|
25049
|
+
}
|
|
25050
|
+
function updateImportAttribute(node, name, value) {
|
|
25051
|
+
return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
|
|
25052
|
+
}
|
|
25012
25053
|
function createNamespaceImport(name) {
|
|
25013
25054
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
25014
25055
|
node.name = name;
|
|
@@ -25069,20 +25110,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25069
25110
|
function updateExportAssignment(node, modifiers, expression) {
|
|
25070
25111
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node;
|
|
25071
25112
|
}
|
|
25072
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25113
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
25073
25114
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
25074
25115
|
node.modifiers = asNodeArray(modifiers);
|
|
25075
25116
|
node.isTypeOnly = isTypeOnly;
|
|
25076
25117
|
node.exportClause = exportClause;
|
|
25077
25118
|
node.moduleSpecifier = moduleSpecifier;
|
|
25078
|
-
node.assertClause =
|
|
25119
|
+
node.attributes = node.assertClause = attributes;
|
|
25079
25120
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
25080
25121
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
25081
25122
|
node.jsDoc = void 0;
|
|
25082
25123
|
return node;
|
|
25083
25124
|
}
|
|
25084
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25085
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
25125
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
25126
|
+
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node;
|
|
25086
25127
|
}
|
|
25087
25128
|
function finishUpdateExportDeclaration(updated, original) {
|
|
25088
25129
|
if (updated !== original) {
|
|
@@ -26409,7 +26450,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26409
26450
|
} else {
|
|
26410
26451
|
modifierArray = modifiers;
|
|
26411
26452
|
}
|
|
26412
|
-
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.
|
|
26453
|
+
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node);
|
|
26413
26454
|
}
|
|
26414
26455
|
function updateModifierLike(node, modifierArray) {
|
|
26415
26456
|
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
@@ -28758,6 +28799,12 @@ function isAssertClause(node) {
|
|
|
28758
28799
|
function isAssertEntry(node) {
|
|
28759
28800
|
return node.kind === 301 /* AssertEntry */;
|
|
28760
28801
|
}
|
|
28802
|
+
function isImportAttributes(node) {
|
|
28803
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
28804
|
+
}
|
|
28805
|
+
function isImportAttribute(node) {
|
|
28806
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
28807
|
+
}
|
|
28761
28808
|
function isNamespaceImport(node) {
|
|
28762
28809
|
return node.kind === 274 /* NamespaceImport */;
|
|
28763
28810
|
}
|
|
@@ -29479,7 +29526,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
29479
29526
|
namedBindings
|
|
29480
29527
|
),
|
|
29481
29528
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
29482
|
-
/*
|
|
29529
|
+
/*attributes*/
|
|
29483
29530
|
void 0
|
|
29484
29531
|
);
|
|
29485
29532
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -30245,7 +30292,7 @@ var forEachChildTable = {
|
|
|
30245
30292
|
return visitNode2(cbNode, node.typeParameter);
|
|
30246
30293
|
},
|
|
30247
30294
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
30248
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
30295
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
30249
30296
|
},
|
|
30250
30297
|
[302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
|
|
30251
30298
|
return visitNode2(cbNode, node.assertClause);
|
|
@@ -30419,15 +30466,15 @@ var forEachChildTable = {
|
|
|
30419
30466
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
30420
30467
|
},
|
|
30421
30468
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
30422
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
30469
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
30423
30470
|
},
|
|
30424
30471
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
30425
30472
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
30426
30473
|
},
|
|
30427
|
-
[300 /*
|
|
30474
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
30428
30475
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
30429
30476
|
},
|
|
30430
|
-
[301 /*
|
|
30477
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
30431
30478
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
30432
30479
|
},
|
|
30433
30480
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -30442,7 +30489,7 @@ var forEachChildTable = {
|
|
|
30442
30489
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
30443
30490
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
30444
30491
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
30445
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
30492
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
30446
30493
|
},
|
|
30447
30494
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
30448
30495
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -31722,7 +31769,7 @@ var Parser;
|
|
|
31722
31769
|
function isLiteralPropertyName() {
|
|
31723
31770
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
31724
31771
|
}
|
|
31725
|
-
function
|
|
31772
|
+
function isImportAttributeName2() {
|
|
31726
31773
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
31727
31774
|
}
|
|
31728
31775
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -31841,8 +31888,8 @@ var Parser;
|
|
|
31841
31888
|
return isLiteralPropertyName();
|
|
31842
31889
|
case 9 /* ObjectBindingElements */:
|
|
31843
31890
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
31844
|
-
case 24 /*
|
|
31845
|
-
return
|
|
31891
|
+
case 24 /* ImportAttributes */:
|
|
31892
|
+
return isImportAttributeName2();
|
|
31846
31893
|
case 7 /* HeritageClauseElement */:
|
|
31847
31894
|
if (token() === 19 /* OpenBraceToken */) {
|
|
31848
31895
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -31945,7 +31992,7 @@ var Parser;
|
|
|
31945
31992
|
case 12 /* ObjectLiteralMembers */:
|
|
31946
31993
|
case 9 /* ObjectBindingElements */:
|
|
31947
31994
|
case 23 /* ImportOrExportSpecifiers */:
|
|
31948
|
-
case 24 /*
|
|
31995
|
+
case 24 /* ImportAttributes */:
|
|
31949
31996
|
return token() === 20 /* CloseBraceToken */;
|
|
31950
31997
|
case 3 /* SwitchClauseStatements */:
|
|
31951
31998
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -32251,7 +32298,7 @@ var Parser;
|
|
|
32251
32298
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32252
32299
|
case 14 /* JsxChildren */:
|
|
32253
32300
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32254
|
-
case 24 /*
|
|
32301
|
+
case 24 /* ImportAttributes */:
|
|
32255
32302
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
32256
32303
|
case 25 /* JSDocComment */:
|
|
32257
32304
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -33126,28 +33173,6 @@ var Parser;
|
|
|
33126
33173
|
nextToken();
|
|
33127
33174
|
return token() === 102 /* ImportKeyword */;
|
|
33128
33175
|
}
|
|
33129
|
-
function parseImportTypeAssertions() {
|
|
33130
|
-
const pos = getNodePos();
|
|
33131
|
-
const openBracePosition = scanner2.getTokenStart();
|
|
33132
|
-
parseExpected(19 /* OpenBraceToken */);
|
|
33133
|
-
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
33134
|
-
parseExpected(132 /* AssertKeyword */);
|
|
33135
|
-
parseExpected(59 /* ColonToken */);
|
|
33136
|
-
const clause = parseAssertClause(
|
|
33137
|
-
/*skipAssertKeyword*/
|
|
33138
|
-
true
|
|
33139
|
-
);
|
|
33140
|
-
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
33141
|
-
const lastError = lastOrUndefined(parseDiagnostics);
|
|
33142
|
-
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
33143
|
-
addRelatedInfo(
|
|
33144
|
-
lastError,
|
|
33145
|
-
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
33146
|
-
);
|
|
33147
|
-
}
|
|
33148
|
-
}
|
|
33149
|
-
return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
33150
|
-
}
|
|
33151
33176
|
function parseImportType() {
|
|
33152
33177
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
33153
33178
|
const pos = getNodePos();
|
|
@@ -33155,14 +33180,36 @@ var Parser;
|
|
|
33155
33180
|
parseExpected(102 /* ImportKeyword */);
|
|
33156
33181
|
parseExpected(21 /* OpenParenToken */);
|
|
33157
33182
|
const type = parseType();
|
|
33158
|
-
let
|
|
33183
|
+
let attributes;
|
|
33159
33184
|
if (parseOptional(28 /* CommaToken */)) {
|
|
33160
|
-
|
|
33185
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
33186
|
+
parseExpected(19 /* OpenBraceToken */);
|
|
33187
|
+
const currentToken2 = token();
|
|
33188
|
+
if (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) {
|
|
33189
|
+
nextToken();
|
|
33190
|
+
} else {
|
|
33191
|
+
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
33192
|
+
}
|
|
33193
|
+
parseExpected(59 /* ColonToken */);
|
|
33194
|
+
attributes = parseImportAttributes(
|
|
33195
|
+
currentToken2,
|
|
33196
|
+
/*skipKeyword*/
|
|
33197
|
+
true
|
|
33198
|
+
);
|
|
33199
|
+
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
33200
|
+
const lastError = lastOrUndefined(parseDiagnostics);
|
|
33201
|
+
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
33202
|
+
addRelatedInfo(
|
|
33203
|
+
lastError,
|
|
33204
|
+
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
33205
|
+
);
|
|
33206
|
+
}
|
|
33207
|
+
}
|
|
33161
33208
|
}
|
|
33162
33209
|
parseExpected(22 /* CloseParenToken */);
|
|
33163
33210
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
33164
33211
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
33165
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
33212
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
33166
33213
|
}
|
|
33167
33214
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
33168
33215
|
nextToken();
|
|
@@ -36224,15 +36271,16 @@ var Parser;
|
|
|
36224
36271
|
parseExpected(161 /* FromKeyword */);
|
|
36225
36272
|
}
|
|
36226
36273
|
const moduleSpecifier = parseModuleSpecifier();
|
|
36227
|
-
|
|
36228
|
-
|
|
36229
|
-
|
|
36274
|
+
const currentToken2 = token();
|
|
36275
|
+
let attributes;
|
|
36276
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36277
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36230
36278
|
}
|
|
36231
36279
|
parseSemicolon();
|
|
36232
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
36280
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
36233
36281
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36234
36282
|
}
|
|
36235
|
-
function
|
|
36283
|
+
function parseImportAttribute() {
|
|
36236
36284
|
const pos = getNodePos();
|
|
36237
36285
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
36238
36286
|
parseExpected(59 /* ColonToken */);
|
|
@@ -36240,19 +36288,19 @@ var Parser;
|
|
|
36240
36288
|
/*allowReturnTypeInArrowFunction*/
|
|
36241
36289
|
true
|
|
36242
36290
|
);
|
|
36243
|
-
return finishNode(factory2.
|
|
36291
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
36244
36292
|
}
|
|
36245
|
-
function
|
|
36293
|
+
function parseImportAttributes(token2, skipKeyword) {
|
|
36246
36294
|
const pos = getNodePos();
|
|
36247
|
-
if (!
|
|
36248
|
-
parseExpected(
|
|
36295
|
+
if (!skipKeyword) {
|
|
36296
|
+
parseExpected(token2);
|
|
36249
36297
|
}
|
|
36250
36298
|
const openBracePosition = scanner2.getTokenStart();
|
|
36251
36299
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
36252
36300
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
36253
36301
|
const elements = parseDelimitedList(
|
|
36254
|
-
24 /*
|
|
36255
|
-
|
|
36302
|
+
24 /* ImportAttributes */,
|
|
36303
|
+
parseImportAttribute,
|
|
36256
36304
|
/*considerSemicolonAsDelimiter*/
|
|
36257
36305
|
true
|
|
36258
36306
|
);
|
|
@@ -36265,7 +36313,7 @@ var Parser;
|
|
|
36265
36313
|
);
|
|
36266
36314
|
}
|
|
36267
36315
|
}
|
|
36268
|
-
return finishNode(factory2.
|
|
36316
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
36269
36317
|
} else {
|
|
36270
36318
|
const elements = createNodeArray(
|
|
36271
36319
|
[],
|
|
@@ -36275,10 +36323,11 @@ var Parser;
|
|
|
36275
36323
|
/*hasTrailingComma*/
|
|
36276
36324
|
false
|
|
36277
36325
|
);
|
|
36278
|
-
return finishNode(factory2.
|
|
36326
|
+
return finishNode(factory2.createImportAttributes(
|
|
36279
36327
|
elements,
|
|
36280
36328
|
/*multiLine*/
|
|
36281
|
-
false
|
|
36329
|
+
false,
|
|
36330
|
+
token2
|
|
36282
36331
|
), pos);
|
|
36283
36332
|
}
|
|
36284
36333
|
}
|
|
@@ -36410,7 +36459,7 @@ var Parser;
|
|
|
36410
36459
|
);
|
|
36411
36460
|
let exportClause;
|
|
36412
36461
|
let moduleSpecifier;
|
|
36413
|
-
let
|
|
36462
|
+
let attributes;
|
|
36414
36463
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
36415
36464
|
const namespaceExportPos = getNodePos();
|
|
36416
36465
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -36426,12 +36475,13 @@ var Parser;
|
|
|
36426
36475
|
moduleSpecifier = parseModuleSpecifier();
|
|
36427
36476
|
}
|
|
36428
36477
|
}
|
|
36429
|
-
|
|
36430
|
-
|
|
36478
|
+
const currentToken2 = token();
|
|
36479
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36480
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36431
36481
|
}
|
|
36432
36482
|
parseSemicolon();
|
|
36433
36483
|
setAwaitContext(savedAwaitContext);
|
|
36434
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
36484
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
36435
36485
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36436
36486
|
}
|
|
36437
36487
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -36481,7 +36531,7 @@ var Parser;
|
|
|
36481
36531
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
36482
36532
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
36483
36533
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
36484
|
-
ParsingContext2[ParsingContext2["
|
|
36534
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
36485
36535
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
36486
36536
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
36487
36537
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -41549,10 +41599,15 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
41549
41599
|
const failedLookupLocations = [];
|
|
41550
41600
|
const affectingLocations = [];
|
|
41551
41601
|
let features = getNodeResolutionFeatures(options);
|
|
41552
|
-
if (resolutionMode
|
|
41602
|
+
if (resolutionMode !== void 0) {
|
|
41603
|
+
features |= 30 /* AllFeatures */;
|
|
41604
|
+
}
|
|
41605
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
41606
|
+
if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
|
|
41553
41607
|
features |= 32 /* EsmMode */;
|
|
41554
41608
|
}
|
|
41555
|
-
const
|
|
41609
|
+
const useImportCondition = resolutionMode === 99 /* ESNext */ || (resolutionMode !== void 0 ? false : void 0);
|
|
41610
|
+
const conditions = features & 8 /* Exports */ ? getConditions(options, useImportCondition) : [];
|
|
41556
41611
|
const diagnostics = [];
|
|
41557
41612
|
const moduleResolutionState = {
|
|
41558
41613
|
compilerOptions: options,
|
|
@@ -41721,11 +41776,19 @@ function getNodeResolutionFeatures(options) {
|
|
|
41721
41776
|
return features;
|
|
41722
41777
|
}
|
|
41723
41778
|
function getConditions(options, esmMode) {
|
|
41724
|
-
const
|
|
41779
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
41780
|
+
if (esmMode === void 0) {
|
|
41781
|
+
if (moduleResolution === 100 /* Bundler */) {
|
|
41782
|
+
esmMode ?? (esmMode = moduleResolution === 100 /* Bundler */);
|
|
41783
|
+
} else if (moduleResolution === 2 /* Node10 */) {
|
|
41784
|
+
return [];
|
|
41785
|
+
}
|
|
41786
|
+
}
|
|
41787
|
+
const conditions = esmMode ? ["import"] : ["require"];
|
|
41725
41788
|
if (!options.noDtsResolution) {
|
|
41726
41789
|
conditions.push("types");
|
|
41727
41790
|
}
|
|
41728
|
-
if (
|
|
41791
|
+
if (moduleResolution !== 100 /* Bundler */) {
|
|
41729
41792
|
conditions.push("node");
|
|
41730
41793
|
}
|
|
41731
41794
|
return concatenate(conditions, options.customConditions);
|
|
@@ -42168,13 +42231,13 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
42168
42231
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42169
42232
|
break;
|
|
42170
42233
|
case 2 /* Node10 */:
|
|
42171
|
-
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42234
|
+
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
42172
42235
|
break;
|
|
42173
42236
|
case 1 /* Classic */:
|
|
42174
42237
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42175
42238
|
break;
|
|
42176
42239
|
case 100 /* Bundler */:
|
|
42177
|
-
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42240
|
+
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
42178
42241
|
break;
|
|
42179
42242
|
default:
|
|
42180
42243
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
@@ -42352,7 +42415,7 @@ function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
42352
42415
|
resolutionMode
|
|
42353
42416
|
);
|
|
42354
42417
|
}
|
|
42355
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42418
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) {
|
|
42356
42419
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
42357
42420
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
42358
42421
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
@@ -42369,7 +42432,8 @@ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile,
|
|
|
42369
42432
|
extensions,
|
|
42370
42433
|
/*isConfigLookup*/
|
|
42371
42434
|
false,
|
|
42372
|
-
redirectedReference
|
|
42435
|
+
redirectedReference,
|
|
42436
|
+
conditions
|
|
42373
42437
|
);
|
|
42374
42438
|
}
|
|
42375
42439
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
@@ -42385,10 +42449,12 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
42385
42449
|
/*isConfigLookup*/
|
|
42386
42450
|
false,
|
|
42387
42451
|
/*redirectedReference*/
|
|
42452
|
+
void 0,
|
|
42453
|
+
/*conditions*/
|
|
42388
42454
|
void 0
|
|
42389
42455
|
);
|
|
42390
42456
|
}
|
|
42391
|
-
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
42457
|
+
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions) {
|
|
42392
42458
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
42393
42459
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
42394
42460
|
if (getResolveJsonModule(compilerOptions)) {
|
|
@@ -42404,10 +42470,11 @@ function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
42404
42470
|
extensions,
|
|
42405
42471
|
/*isConfigLookup*/
|
|
42406
42472
|
false,
|
|
42407
|
-
redirectedReference
|
|
42473
|
+
redirectedReference,
|
|
42474
|
+
conditions
|
|
42408
42475
|
);
|
|
42409
42476
|
}
|
|
42410
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
42477
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) {
|
|
42411
42478
|
let extensions;
|
|
42412
42479
|
if (isConfigLookup) {
|
|
42413
42480
|
extensions = 8 /* Json */;
|
|
@@ -42418,7 +42485,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
|
|
|
42418
42485
|
} else {
|
|
42419
42486
|
extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
42420
42487
|
}
|
|
42421
|
-
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
42488
|
+
return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
|
|
42422
42489
|
}
|
|
42423
42490
|
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
42424
42491
|
return nodeModuleNameResolverWorker(
|
|
@@ -42433,15 +42500,21 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
|
42433
42500
|
/*isConfigLookup*/
|
|
42434
42501
|
true,
|
|
42435
42502
|
/*redirectedReference*/
|
|
42503
|
+
void 0,
|
|
42504
|
+
/*conditions*/
|
|
42436
42505
|
void 0
|
|
42437
42506
|
);
|
|
42438
42507
|
}
|
|
42439
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
42508
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
42440
42509
|
var _a, _b, _c, _d;
|
|
42441
42510
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
42442
42511
|
const failedLookupLocations = [];
|
|
42443
42512
|
const affectingLocations = [];
|
|
42444
|
-
const
|
|
42513
|
+
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
42514
|
+
conditions ?? (conditions = getConditions(
|
|
42515
|
+
compilerOptions,
|
|
42516
|
+
moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 : !!(features & 32 /* EsmMode */)
|
|
42517
|
+
));
|
|
42445
42518
|
const diagnostics = [];
|
|
42446
42519
|
const state = {
|
|
42447
42520
|
compilerOptions,
|
|
@@ -42451,17 +42524,17 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42451
42524
|
affectingLocations,
|
|
42452
42525
|
packageJsonInfoCache: cache,
|
|
42453
42526
|
features,
|
|
42454
|
-
conditions,
|
|
42527
|
+
conditions: conditions ?? emptyArray,
|
|
42455
42528
|
requestContainingDirectory: containingDirectory,
|
|
42456
42529
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
42457
42530
|
isConfigLookup,
|
|
42458
42531
|
candidateIsFromPackageJsonField: false
|
|
42459
42532
|
};
|
|
42460
|
-
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(
|
|
42461
|
-
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
42533
|
+
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
42534
|
+
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
|
|
42462
42535
|
}
|
|
42463
42536
|
let result;
|
|
42464
|
-
if (
|
|
42537
|
+
if (moduleResolution === 2 /* Node10 */) {
|
|
42465
42538
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
42466
42539
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
42467
42540
|
result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
|
|
@@ -42469,7 +42542,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42469
42542
|
result = tryResolve(extensions, state);
|
|
42470
42543
|
}
|
|
42471
42544
|
let legacyResult;
|
|
42472
|
-
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.includes("import")) {
|
|
42545
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && (conditions == null ? void 0 : conditions.includes("import"))) {
|
|
42473
42546
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
42474
42547
|
const diagnosticState = {
|
|
42475
42548
|
...state,
|
|
@@ -43267,7 +43340,8 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43267
43340
|
extensions,
|
|
43268
43341
|
/*isConfigLookup*/
|
|
43269
43342
|
false,
|
|
43270
|
-
redirectedReference
|
|
43343
|
+
redirectedReference,
|
|
43344
|
+
state.conditions
|
|
43271
43345
|
);
|
|
43272
43346
|
return toSearchResult(
|
|
43273
43347
|
result.resolvedModule ? {
|
|
@@ -51023,7 +51097,7 @@ function createTypeChecker(host) {
|
|
|
51023
51097
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
51024
51098
|
}
|
|
51025
51099
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
51026
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
51100
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
51027
51101
|
if (startsWith(moduleReference, "@types/")) {
|
|
51028
51102
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
51029
51103
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -51078,9 +51152,8 @@ function createTypeChecker(host) {
|
|
|
51078
51152
|
}
|
|
51079
51153
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
51080
51154
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
51081
|
-
const
|
|
51082
|
-
|
|
51083
|
-
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
51155
|
+
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
51156
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
51084
51157
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
51085
51158
|
error2(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
|
|
51086
51159
|
} else {
|
|
@@ -51186,7 +51259,7 @@ function createTypeChecker(host) {
|
|
|
51186
51259
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
51187
51260
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
51188
51261
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
51189
|
-
const suggestedExt = (
|
|
51262
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
51190
51263
|
if (suggestedExt) {
|
|
51191
51264
|
error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
51192
51265
|
} else {
|
|
@@ -52951,7 +53024,7 @@ function createTypeChecker(host) {
|
|
|
52951
53024
|
return factory.updateImportTypeNode(
|
|
52952
53025
|
root,
|
|
52953
53026
|
root.argument,
|
|
52954
|
-
root.
|
|
53027
|
+
root.attributes,
|
|
52955
53028
|
qualifier,
|
|
52956
53029
|
typeArguments,
|
|
52957
53030
|
root.isTypeOf
|
|
@@ -53684,7 +53757,6 @@ function createTypeChecker(host) {
|
|
|
53684
53757
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
53685
53758
|
}
|
|
53686
53759
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
53687
|
-
var _a, _b, _c, _d;
|
|
53688
53760
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
53689
53761
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
53690
53762
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -53693,17 +53765,18 @@ function createTypeChecker(host) {
|
|
|
53693
53765
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
53694
53766
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
53695
53767
|
let specifier;
|
|
53696
|
-
let
|
|
53768
|
+
let attributes;
|
|
53697
53769
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
53698
53770
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
53699
53771
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
53700
|
-
|
|
53701
|
-
factory.
|
|
53702
|
-
factory.
|
|
53703
|
-
|
|
53704
|
-
|
|
53705
|
-
|
|
53706
|
-
|
|
53772
|
+
attributes = factory.createImportAttributes(
|
|
53773
|
+
factory.createNodeArray([
|
|
53774
|
+
factory.createImportAttribute(
|
|
53775
|
+
factory.createStringLiteral("resolution-mode"),
|
|
53776
|
+
factory.createStringLiteral("import")
|
|
53777
|
+
)
|
|
53778
|
+
])
|
|
53779
|
+
);
|
|
53707
53780
|
}
|
|
53708
53781
|
}
|
|
53709
53782
|
if (!specifier) {
|
|
@@ -53717,16 +53790,17 @@ function createTypeChecker(host) {
|
|
|
53717
53790
|
if (specifier.includes("/node_modules/")) {
|
|
53718
53791
|
specifier = oldSpecifier;
|
|
53719
53792
|
} else {
|
|
53720
|
-
|
|
53721
|
-
factory.
|
|
53722
|
-
factory.
|
|
53723
|
-
|
|
53724
|
-
|
|
53725
|
-
|
|
53726
|
-
|
|
53793
|
+
attributes = factory.createImportAttributes(
|
|
53794
|
+
factory.createNodeArray([
|
|
53795
|
+
factory.createImportAttribute(
|
|
53796
|
+
factory.createStringLiteral("resolution-mode"),
|
|
53797
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
53798
|
+
)
|
|
53799
|
+
])
|
|
53800
|
+
);
|
|
53727
53801
|
}
|
|
53728
53802
|
}
|
|
53729
|
-
if (!
|
|
53803
|
+
if (!attributes) {
|
|
53730
53804
|
context.encounteredError = true;
|
|
53731
53805
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
53732
53806
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -53746,11 +53820,11 @@ function createTypeChecker(host) {
|
|
|
53746
53820
|
void 0
|
|
53747
53821
|
);
|
|
53748
53822
|
}
|
|
53749
|
-
return factory.createImportTypeNode(lit,
|
|
53823
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
53750
53824
|
} else {
|
|
53751
53825
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
53752
53826
|
const qualifier = splitNode.objectType.typeName;
|
|
53753
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
53827
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
53754
53828
|
}
|
|
53755
53829
|
}
|
|
53756
53830
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -54226,7 +54300,7 @@ function createTypeChecker(host) {
|
|
|
54226
54300
|
return factory.updateImportTypeNode(
|
|
54227
54301
|
node,
|
|
54228
54302
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
54229
|
-
node.
|
|
54303
|
+
node.attributes,
|
|
54230
54304
|
node.qualifier,
|
|
54231
54305
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
54232
54306
|
node.isTypeOf
|
|
@@ -54446,7 +54520,7 @@ function createTypeChecker(host) {
|
|
|
54446
54520
|
return statements;
|
|
54447
54521
|
}
|
|
54448
54522
|
function inlineExportModifiers(statements) {
|
|
54449
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
54523
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
|
|
54450
54524
|
if (index >= 0) {
|
|
54451
54525
|
const exportDecl = statements[index];
|
|
54452
54526
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -54474,7 +54548,7 @@ function createTypeChecker(host) {
|
|
|
54474
54548
|
replacements
|
|
54475
54549
|
),
|
|
54476
54550
|
exportDecl.moduleSpecifier,
|
|
54477
|
-
exportDecl.
|
|
54551
|
+
exportDecl.attributes
|
|
54478
54552
|
);
|
|
54479
54553
|
}
|
|
54480
54554
|
}
|
|
@@ -55125,7 +55199,7 @@ function createTypeChecker(host) {
|
|
|
55125
55199
|
)])
|
|
55126
55200
|
),
|
|
55127
55201
|
factory.createStringLiteral(specifier2),
|
|
55128
|
-
/*
|
|
55202
|
+
/*attributes*/
|
|
55129
55203
|
void 0
|
|
55130
55204
|
),
|
|
55131
55205
|
0 /* None */
|
|
@@ -55213,7 +55287,7 @@ function createTypeChecker(host) {
|
|
|
55213
55287
|
void 0
|
|
55214
55288
|
),
|
|
55215
55289
|
specifier2,
|
|
55216
|
-
node.parent.
|
|
55290
|
+
node.parent.attributes
|
|
55217
55291
|
),
|
|
55218
55292
|
0 /* None */
|
|
55219
55293
|
);
|
|
@@ -55234,7 +55308,7 @@ function createTypeChecker(host) {
|
|
|
55234
55308
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
55235
55309
|
),
|
|
55236
55310
|
specifier2,
|
|
55237
|
-
node.parent.
|
|
55311
|
+
node.parent.attributes
|
|
55238
55312
|
),
|
|
55239
55313
|
0 /* None */
|
|
55240
55314
|
);
|
|
@@ -55275,7 +55349,7 @@ function createTypeChecker(host) {
|
|
|
55275
55349
|
])
|
|
55276
55350
|
),
|
|
55277
55351
|
specifier2,
|
|
55278
|
-
node.parent.parent.parent.
|
|
55352
|
+
node.parent.parent.parent.attributes
|
|
55279
55353
|
),
|
|
55280
55354
|
0 /* None */
|
|
55281
55355
|
);
|
|
@@ -64734,6 +64808,7 @@ function createTypeChecker(host) {
|
|
|
64734
64808
|
let skipParentCounter = 0;
|
|
64735
64809
|
let lastSkippedInfo;
|
|
64736
64810
|
let incompatibleStack;
|
|
64811
|
+
let relationCount = 16e6 - relation.size >> 3;
|
|
64737
64812
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
64738
64813
|
const result = isRelatedTo(
|
|
64739
64814
|
source,
|
|
@@ -64747,8 +64822,19 @@ function createTypeChecker(host) {
|
|
|
64747
64822
|
reportIncompatibleStack();
|
|
64748
64823
|
}
|
|
64749
64824
|
if (overflow) {
|
|
64825
|
+
const id = getRelationKey(
|
|
64826
|
+
source,
|
|
64827
|
+
target,
|
|
64828
|
+
/*intersectionState*/
|
|
64829
|
+
0 /* None */,
|
|
64830
|
+
relation,
|
|
64831
|
+
/*ignoreConstraints*/
|
|
64832
|
+
false
|
|
64833
|
+
);
|
|
64834
|
+
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
64750
64835
|
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
64751
|
-
const
|
|
64836
|
+
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
64837
|
+
const diag2 = error2(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
64752
64838
|
if (errorOutputContainer) {
|
|
64753
64839
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
64754
64840
|
}
|
|
@@ -65279,6 +65365,16 @@ function createTypeChecker(host) {
|
|
|
65279
65365
|
}
|
|
65280
65366
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
65281
65367
|
if (source2.flags & 1048576 /* Union */) {
|
|
65368
|
+
if (target2.flags & 1048576 /* Union */) {
|
|
65369
|
+
const sourceOrigin = source2.origin;
|
|
65370
|
+
if (sourceOrigin && sourceOrigin.flags & 2097152 /* Intersection */ && target2.aliasSymbol && contains(sourceOrigin.types, target2)) {
|
|
65371
|
+
return -1 /* True */;
|
|
65372
|
+
}
|
|
65373
|
+
const targetOrigin = target2.origin;
|
|
65374
|
+
if (targetOrigin && targetOrigin.flags & 1048576 /* Union */ && source2.aliasSymbol && contains(targetOrigin.types, source2)) {
|
|
65375
|
+
return -1 /* True */;
|
|
65376
|
+
}
|
|
65377
|
+
}
|
|
65282
65378
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
65283
65379
|
}
|
|
65284
65380
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -65592,6 +65688,10 @@ function createTypeChecker(host) {
|
|
|
65592
65688
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
65593
65689
|
}
|
|
65594
65690
|
}
|
|
65691
|
+
if (relationCount <= 0) {
|
|
65692
|
+
overflow = true;
|
|
65693
|
+
return 0 /* False */;
|
|
65694
|
+
}
|
|
65595
65695
|
if (!maybeKeys) {
|
|
65596
65696
|
maybeKeys = [];
|
|
65597
65697
|
maybeKeysSet = /* @__PURE__ */ new Set();
|
|
@@ -65685,6 +65785,7 @@ function createTypeChecker(host) {
|
|
|
65685
65785
|
}
|
|
65686
65786
|
} else {
|
|
65687
65787
|
relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
|
|
65788
|
+
relationCount--;
|
|
65688
65789
|
resetMaybeStack(
|
|
65689
65790
|
/*markAllAsSucceeded*/
|
|
65690
65791
|
false
|
|
@@ -65696,6 +65797,7 @@ function createTypeChecker(host) {
|
|
|
65696
65797
|
maybeKeysSet.delete(maybeKeys[i]);
|
|
65697
65798
|
if (markAllAsSucceeded) {
|
|
65698
65799
|
relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
|
|
65800
|
+
relationCount--;
|
|
65699
65801
|
}
|
|
65700
65802
|
}
|
|
65701
65803
|
maybeCount = maybeStart;
|
|
@@ -67091,10 +67193,7 @@ function createTypeChecker(host) {
|
|
|
67091
67193
|
return false;
|
|
67092
67194
|
}
|
|
67093
67195
|
function getVariances(type) {
|
|
67094
|
-
return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */
|
|
67095
|
-
}
|
|
67096
|
-
function isArraySubtype(type) {
|
|
67097
|
-
return length(type.typeParameters) === 1 && length(getBaseTypes(type)) === 1 && isTypeReferenceWithGenericArguments(getBaseTypes(type)[0]) && getVariances(getBaseTypes(type)[0].target) === arrayVariances && length(getTypeArguments(getBaseTypes(type)[0])) === 1 && getTypeArguments(getBaseTypes(type)[0])[0] === type.typeParameters[0];
|
|
67196
|
+
return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */ ? arrayVariances : getVariancesWorker(type.symbol, type.typeParameters);
|
|
67098
67197
|
}
|
|
67099
67198
|
function getAliasVariances(symbol) {
|
|
67100
67199
|
return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
|
|
@@ -80531,16 +80630,8 @@ function createTypeChecker(host) {
|
|
|
80531
80630
|
}
|
|
80532
80631
|
function checkImportType(node) {
|
|
80533
80632
|
checkSourceElement(node.argument);
|
|
80534
|
-
if (node.
|
|
80535
|
-
|
|
80536
|
-
if (override) {
|
|
80537
|
-
if (!isNightly()) {
|
|
80538
|
-
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);
|
|
80539
|
-
}
|
|
80540
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
80541
|
-
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
80542
|
-
}
|
|
80543
|
-
}
|
|
80633
|
+
if (node.attributes) {
|
|
80634
|
+
getResolutionModeOverride(node.attributes, grammarErrorOnNode);
|
|
80544
80635
|
}
|
|
80545
80636
|
checkTypeReferenceOrImport(node);
|
|
80546
80637
|
}
|
|
@@ -84504,12 +84595,13 @@ function createTypeChecker(host) {
|
|
|
84504
84595
|
return false;
|
|
84505
84596
|
}
|
|
84506
84597
|
}
|
|
84507
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
84598
|
+
if (!isImportEqualsDeclaration(node) && node.attributes) {
|
|
84599
|
+
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;
|
|
84508
84600
|
let hasError = false;
|
|
84509
|
-
for (const
|
|
84510
|
-
if (!isStringLiteral(
|
|
84601
|
+
for (const attr of node.attributes.elements) {
|
|
84602
|
+
if (!isStringLiteral(attr.value)) {
|
|
84511
84603
|
hasError = true;
|
|
84512
|
-
error2(
|
|
84604
|
+
error2(attr.value, diagnostic);
|
|
84513
84605
|
}
|
|
84514
84606
|
}
|
|
84515
84607
|
return !hasError;
|
|
@@ -84641,32 +84733,26 @@ function createTypeChecker(host) {
|
|
|
84641
84733
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
84642
84734
|
}
|
|
84643
84735
|
}
|
|
84644
|
-
function
|
|
84736
|
+
function checkImportAttributes(declaration) {
|
|
84645
84737
|
var _a;
|
|
84646
|
-
|
|
84647
|
-
|
|
84648
|
-
const
|
|
84649
|
-
|
|
84650
|
-
|
|
84651
|
-
|
|
84652
|
-
}
|
|
84653
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
84654
|
-
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
84655
|
-
}
|
|
84738
|
+
const node = declaration.attributes;
|
|
84739
|
+
if (node) {
|
|
84740
|
+
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
84741
|
+
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
84742
|
+
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
84743
|
+
if (validForTypeAttributes && override) {
|
|
84656
84744
|
return;
|
|
84657
84745
|
}
|
|
84658
84746
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
84659
84747
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
84660
|
-
|
|
84661
|
-
|
|
84662
|
-
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
|
|
84663
|
-
);
|
|
84748
|
+
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;
|
|
84749
|
+
return grammarErrorOnNode(node, message);
|
|
84664
84750
|
}
|
|
84665
84751
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
84666
|
-
return grammarErrorOnNode(
|
|
84752
|
+
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);
|
|
84667
84753
|
}
|
|
84668
84754
|
if (override) {
|
|
84669
|
-
return grammarErrorOnNode(
|
|
84755
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
84670
84756
|
}
|
|
84671
84757
|
}
|
|
84672
84758
|
}
|
|
@@ -84698,7 +84784,7 @@ function createTypeChecker(host) {
|
|
|
84698
84784
|
}
|
|
84699
84785
|
}
|
|
84700
84786
|
}
|
|
84701
|
-
|
|
84787
|
+
checkImportAttributes(node);
|
|
84702
84788
|
}
|
|
84703
84789
|
function checkImportEqualsDeclaration(node) {
|
|
84704
84790
|
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)) {
|
|
@@ -84771,7 +84857,7 @@ function createTypeChecker(host) {
|
|
|
84771
84857
|
}
|
|
84772
84858
|
}
|
|
84773
84859
|
}
|
|
84774
|
-
|
|
84860
|
+
checkImportAttributes(node);
|
|
84775
84861
|
}
|
|
84776
84862
|
function checkGrammarExportDeclaration(node) {
|
|
84777
84863
|
var _a;
|
|
@@ -88561,12 +88647,12 @@ function createTypeChecker(host) {
|
|
|
88561
88647
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
88562
88648
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
88563
88649
|
if (nodeArguments.length > 1) {
|
|
88564
|
-
const
|
|
88565
|
-
return grammarErrorOnNode(
|
|
88650
|
+
const importAttributesArgument = nodeArguments[1];
|
|
88651
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
88566
88652
|
}
|
|
88567
88653
|
}
|
|
88568
88654
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
88569
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
88655
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
|
|
88570
88656
|
}
|
|
88571
88657
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
88572
88658
|
if (spreadElement) {
|
|
@@ -88833,13 +88919,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
88833
88919
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
88834
88920
|
}
|
|
88835
88921
|
}
|
|
88836
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
88837
|
-
var _a;
|
|
88838
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
88839
|
-
this.onDiagnosticReported();
|
|
88840
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
88841
|
-
}
|
|
88842
|
-
}
|
|
88843
88922
|
onDiagnosticReported() {
|
|
88844
88923
|
this.context.reportedDiagnostic = true;
|
|
88845
88924
|
}
|
|
@@ -89348,7 +89427,7 @@ var visitEachChildTable = {
|
|
|
89348
89427
|
return context.factory.updateImportTypeNode(
|
|
89349
89428
|
node,
|
|
89350
89429
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
89351
|
-
nodeVisitor(node.
|
|
89430
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes),
|
|
89352
89431
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
89353
89432
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
89354
89433
|
node.isTypeOf
|
|
@@ -89899,20 +89978,20 @@ var visitEachChildTable = {
|
|
|
89899
89978
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
89900
89979
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
89901
89980
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
89902
|
-
nodeVisitor(node.
|
|
89981
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89903
89982
|
);
|
|
89904
89983
|
},
|
|
89905
|
-
[300 /*
|
|
89906
|
-
return context.factory.
|
|
89984
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
89985
|
+
return context.factory.updateImportAttributes(
|
|
89907
89986
|
node,
|
|
89908
|
-
nodesVisitor(node.elements, visitor,
|
|
89987
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
89909
89988
|
node.multiLine
|
|
89910
89989
|
);
|
|
89911
89990
|
},
|
|
89912
|
-
[301 /*
|
|
89913
|
-
return context.factory.
|
|
89991
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
89992
|
+
return context.factory.updateImportAttribute(
|
|
89914
89993
|
node,
|
|
89915
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
89994
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
89916
89995
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
89917
89996
|
);
|
|
89918
89997
|
},
|
|
@@ -89964,7 +90043,7 @@ var visitEachChildTable = {
|
|
|
89964
90043
|
node.isTypeOnly,
|
|
89965
90044
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
89966
90045
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
89967
|
-
nodeVisitor(node.
|
|
90046
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89968
90047
|
);
|
|
89969
90048
|
},
|
|
89970
90049
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -93454,7 +93533,7 @@ function transformTypeScript(context) {
|
|
|
93454
93533
|
void 0,
|
|
93455
93534
|
importClause,
|
|
93456
93535
|
node.moduleSpecifier,
|
|
93457
|
-
node.
|
|
93536
|
+
node.attributes
|
|
93458
93537
|
) : void 0;
|
|
93459
93538
|
}
|
|
93460
93539
|
function visitImportClause(node) {
|
|
@@ -93504,7 +93583,7 @@ function transformTypeScript(context) {
|
|
|
93504
93583
|
node.isTypeOnly,
|
|
93505
93584
|
exportClause,
|
|
93506
93585
|
node.moduleSpecifier,
|
|
93507
|
-
node.
|
|
93586
|
+
node.attributes
|
|
93508
93587
|
) : void 0;
|
|
93509
93588
|
}
|
|
93510
93589
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -93538,7 +93617,7 @@ function transformTypeScript(context) {
|
|
|
93538
93617
|
/*importClause*/
|
|
93539
93618
|
void 0,
|
|
93540
93619
|
node.moduleReference.expression,
|
|
93541
|
-
/*
|
|
93620
|
+
/*attributes*/
|
|
93542
93621
|
void 0
|
|
93543
93622
|
),
|
|
93544
93623
|
node
|
|
@@ -101708,7 +101787,7 @@ function transformJsx(context) {
|
|
|
101708
101787
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
101709
101788
|
),
|
|
101710
101789
|
factory2.createStringLiteral(importSource),
|
|
101711
|
-
/*
|
|
101790
|
+
/*attributes*/
|
|
101712
101791
|
void 0
|
|
101713
101792
|
);
|
|
101714
101793
|
setParentRecursive(
|
|
@@ -111115,7 +111194,9 @@ function transformECMAScriptModule(context) {
|
|
|
111115
111194
|
)
|
|
111116
111195
|
])
|
|
111117
111196
|
),
|
|
111118
|
-
factory2.createStringLiteral("module")
|
|
111197
|
+
factory2.createStringLiteral("module"),
|
|
111198
|
+
/*attributes*/
|
|
111199
|
+
void 0
|
|
111119
111200
|
);
|
|
111120
111201
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
111121
111202
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -111232,7 +111313,7 @@ function transformECMAScriptModule(context) {
|
|
|
111232
111313
|
)
|
|
111233
111314
|
),
|
|
111234
111315
|
node.moduleSpecifier,
|
|
111235
|
-
node.
|
|
111316
|
+
node.attributes
|
|
111236
111317
|
);
|
|
111237
111318
|
setOriginalNode(importDecl, node.exportClause);
|
|
111238
111319
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -111685,8 +111766,7 @@ function transformDeclarations(context) {
|
|
|
111685
111766
|
trackReferencedAmbientModule,
|
|
111686
111767
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
111687
111768
|
reportNonlocalAugmentation,
|
|
111688
|
-
reportNonSerializableProperty
|
|
111689
|
-
reportImportTypeNodeResolutionModeOverride
|
|
111769
|
+
reportNonSerializableProperty
|
|
111690
111770
|
};
|
|
111691
111771
|
let errorNameNode;
|
|
111692
111772
|
let errorFallbackNode;
|
|
@@ -111810,11 +111890,6 @@ function transformDeclarations(context) {
|
|
|
111810
111890
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
111811
111891
|
}
|
|
111812
111892
|
}
|
|
111813
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
111814
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
111815
|
-
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));
|
|
111816
|
-
}
|
|
111817
|
-
}
|
|
111818
111893
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
111819
111894
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
111820
111895
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -112319,7 +112394,7 @@ function transformDeclarations(context) {
|
|
|
112319
112394
|
decl.modifiers,
|
|
112320
112395
|
decl.importClause,
|
|
112321
112396
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112322
|
-
|
|
112397
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112323
112398
|
);
|
|
112324
112399
|
}
|
|
112325
112400
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -112335,7 +112410,7 @@ function transformDeclarations(context) {
|
|
|
112335
112410
|
void 0
|
|
112336
112411
|
),
|
|
112337
112412
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112338
|
-
|
|
112413
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112339
112414
|
);
|
|
112340
112415
|
}
|
|
112341
112416
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -112353,7 +112428,7 @@ function transformDeclarations(context) {
|
|
|
112353
112428
|
namedBindings
|
|
112354
112429
|
),
|
|
112355
112430
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112356
|
-
|
|
112431
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112357
112432
|
) : void 0;
|
|
112358
112433
|
}
|
|
112359
112434
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -112368,7 +112443,7 @@ function transformDeclarations(context) {
|
|
|
112368
112443
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
112369
112444
|
),
|
|
112370
112445
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112371
|
-
|
|
112446
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112372
112447
|
);
|
|
112373
112448
|
}
|
|
112374
112449
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -112378,19 +112453,13 @@ function transformDeclarations(context) {
|
|
|
112378
112453
|
/*importClause*/
|
|
112379
112454
|
void 0,
|
|
112380
112455
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112381
|
-
|
|
112456
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112382
112457
|
);
|
|
112383
112458
|
}
|
|
112384
112459
|
}
|
|
112385
|
-
function
|
|
112386
|
-
const mode =
|
|
112387
|
-
|
|
112388
|
-
if (!isNightly()) {
|
|
112389
|
-
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));
|
|
112390
|
-
}
|
|
112391
|
-
return assertClause;
|
|
112392
|
-
}
|
|
112393
|
-
return void 0;
|
|
112460
|
+
function tryGetResolutionModeOverride(node) {
|
|
112461
|
+
const mode = getResolutionModeOverride(node);
|
|
112462
|
+
return node && mode !== void 0 ? node : void 0;
|
|
112394
112463
|
}
|
|
112395
112464
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
112396
112465
|
while (length(lateMarkedStatements)) {
|
|
@@ -112676,7 +112745,7 @@ function transformDeclarations(context) {
|
|
|
112676
112745
|
return cleanup(factory2.updateImportTypeNode(
|
|
112677
112746
|
input,
|
|
112678
112747
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
112679
|
-
input.
|
|
112748
|
+
input.attributes,
|
|
112680
112749
|
input.qualifier,
|
|
112681
112750
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
112682
112751
|
input.isTypeOf
|
|
@@ -112730,7 +112799,7 @@ function transformDeclarations(context) {
|
|
|
112730
112799
|
input.isTypeOnly,
|
|
112731
112800
|
input.exportClause,
|
|
112732
112801
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
112733
|
-
|
|
112802
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
112734
112803
|
);
|
|
112735
112804
|
}
|
|
112736
112805
|
case 277 /* ExportAssignment */: {
|
|
@@ -115236,10 +115305,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115236
115305
|
return emitNamedExports(node);
|
|
115237
115306
|
case 281 /* ExportSpecifier */:
|
|
115238
115307
|
return emitExportSpecifier(node);
|
|
115239
|
-
case 300 /*
|
|
115240
|
-
return
|
|
115241
|
-
case 301 /*
|
|
115242
|
-
return
|
|
115308
|
+
case 300 /* ImportAttributes */:
|
|
115309
|
+
return emitImportAttributes(node);
|
|
115310
|
+
case 301 /* ImportAttribute */:
|
|
115311
|
+
return emitImportAttribute(node);
|
|
115243
115312
|
case 282 /* MissingDeclaration */:
|
|
115244
115313
|
return;
|
|
115245
115314
|
case 283 /* ExternalModuleReference */:
|
|
@@ -116014,16 +116083,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
116014
116083
|
writeKeyword("import");
|
|
116015
116084
|
writePunctuation("(");
|
|
116016
116085
|
emit(node.argument);
|
|
116017
|
-
if (node.
|
|
116086
|
+
if (node.attributes) {
|
|
116018
116087
|
writePunctuation(",");
|
|
116019
116088
|
writeSpace();
|
|
116020
116089
|
writePunctuation("{");
|
|
116021
116090
|
writeSpace();
|
|
116022
|
-
writeKeyword("assert");
|
|
116091
|
+
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
116023
116092
|
writePunctuation(":");
|
|
116024
116093
|
writeSpace();
|
|
116025
|
-
const elements = node.
|
|
116026
|
-
emitList(node.
|
|
116094
|
+
const elements = node.attributes.elements;
|
|
116095
|
+
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
116027
116096
|
writeSpace();
|
|
116028
116097
|
writePunctuation("}");
|
|
116029
116098
|
}
|
|
@@ -117012,8 +117081,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117012
117081
|
writeSpace();
|
|
117013
117082
|
}
|
|
117014
117083
|
emitExpression(node.moduleSpecifier);
|
|
117015
|
-
if (node.
|
|
117016
|
-
emitWithLeadingSpace(node.
|
|
117084
|
+
if (node.attributes) {
|
|
117085
|
+
emitWithLeadingSpace(node.attributes);
|
|
117017
117086
|
}
|
|
117018
117087
|
writeTrailingSemicolon();
|
|
117019
117088
|
}
|
|
@@ -117082,18 +117151,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117082
117151
|
writeSpace();
|
|
117083
117152
|
emitExpression(node.moduleSpecifier);
|
|
117084
117153
|
}
|
|
117085
|
-
if (node.
|
|
117086
|
-
emitWithLeadingSpace(node.
|
|
117154
|
+
if (node.attributes) {
|
|
117155
|
+
emitWithLeadingSpace(node.attributes);
|
|
117087
117156
|
}
|
|
117088
117157
|
writeTrailingSemicolon();
|
|
117089
117158
|
}
|
|
117090
|
-
function
|
|
117091
|
-
emitTokenWithComment(
|
|
117159
|
+
function emitImportAttributes(node) {
|
|
117160
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
117092
117161
|
writeSpace();
|
|
117093
117162
|
const elements = node.elements;
|
|
117094
|
-
emitList(node, elements, 526226 /*
|
|
117163
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
117095
117164
|
}
|
|
117096
|
-
function
|
|
117165
|
+
function emitImportAttribute(node) {
|
|
117097
117166
|
emit(node.name);
|
|
117098
117167
|
writePunctuation(":");
|
|
117099
117168
|
writeSpace();
|
|
@@ -120180,8 +120249,6 @@ function getModeForFileReference(ref, containingFileMode) {
|
|
|
120180
120249
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
120181
120250
|
}
|
|
120182
120251
|
function getModeForResolutionAtIndex(file, index) {
|
|
120183
|
-
if (file.impliedNodeFormat === void 0)
|
|
120184
|
-
return void 0;
|
|
120185
120252
|
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
120186
120253
|
}
|
|
120187
120254
|
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
@@ -120195,42 +120262,48 @@ function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
|
120195
120262
|
return false;
|
|
120196
120263
|
}
|
|
120197
120264
|
function getModeForUsageLocation(file, usage) {
|
|
120198
|
-
var _a
|
|
120199
|
-
if (file.impliedNodeFormat === void 0)
|
|
120200
|
-
return void 0;
|
|
120265
|
+
var _a;
|
|
120201
120266
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
120202
120267
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
120203
120268
|
if (isTypeOnly) {
|
|
120204
|
-
const override =
|
|
120269
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
120205
120270
|
if (override) {
|
|
120206
120271
|
return override;
|
|
120207
120272
|
}
|
|
120208
120273
|
}
|
|
120209
120274
|
}
|
|
120210
120275
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
120211
|
-
const override =
|
|
120276
|
+
const override = getResolutionModeOverride(usage.parent.parent.attributes);
|
|
120212
120277
|
if (override) {
|
|
120213
120278
|
return override;
|
|
120214
120279
|
}
|
|
120215
120280
|
}
|
|
120281
|
+
if (file.impliedNodeFormat === void 0)
|
|
120282
|
+
return void 0;
|
|
120216
120283
|
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
120217
120284
|
return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
120218
120285
|
}
|
|
120219
|
-
const exprParentParent = (
|
|
120286
|
+
const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent;
|
|
120220
120287
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
120221
120288
|
}
|
|
120222
|
-
function
|
|
120223
|
-
if (!
|
|
120289
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
120290
|
+
if (!node)
|
|
120224
120291
|
return void 0;
|
|
120225
|
-
if (length(
|
|
120226
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120292
|
+
if (length(node.elements) !== 1) {
|
|
120293
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120294
|
+
node,
|
|
120295
|
+
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
|
|
120296
|
+
);
|
|
120227
120297
|
return void 0;
|
|
120228
120298
|
}
|
|
120229
|
-
const elem =
|
|
120299
|
+
const elem = node.elements[0];
|
|
120230
120300
|
if (!isStringLiteralLike(elem.name))
|
|
120231
120301
|
return void 0;
|
|
120232
120302
|
if (elem.name.text !== "resolution-mode") {
|
|
120233
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120303
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120304
|
+
elem.name,
|
|
120305
|
+
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
|
|
120306
|
+
);
|
|
120234
120307
|
return void 0;
|
|
120235
120308
|
}
|
|
120236
120309
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -120529,7 +120602,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
120529
120602
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
120530
120603
|
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,
|
|
120531
120604
|
Diagnostics.Duplicate_label_0.code,
|
|
120532
|
-
Diagnostics.
|
|
120605
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
120533
120606
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
120534
120607
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
120535
120608
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -122063,7 +122136,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122063
122136
|
/*importClause*/
|
|
122064
122137
|
void 0,
|
|
122065
122138
|
externalHelpersModuleReference,
|
|
122066
|
-
/*
|
|
122139
|
+
/*attributes*/
|
|
122067
122140
|
void 0
|
|
122068
122141
|
);
|
|
122069
122142
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -122539,14 +122612,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122539
122612
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
122540
122613
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
122541
122614
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
122542
|
-
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
122543
|
-
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
122544
|
-
kind: 2 /* ResolutionDiagnostics */,
|
|
122545
|
-
diagnostics: [
|
|
122546
|
-
createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)
|
|
122547
|
-
]
|
|
122548
|
-
});
|
|
122549
|
-
}
|
|
122550
122615
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
122551
122616
|
}
|
|
122552
122617
|
}
|
|
@@ -132187,7 +132252,7 @@ function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreferenc
|
|
|
132187
132252
|
void 0,
|
|
132188
132253
|
defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0,
|
|
132189
132254
|
typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier,
|
|
132190
|
-
/*
|
|
132255
|
+
/*attributes*/
|
|
132191
132256
|
void 0
|
|
132192
132257
|
);
|
|
132193
132258
|
}
|
|
@@ -137900,7 +137965,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
|
|
|
137900
137965
|
}
|
|
137901
137966
|
case 205 /* ImportType */:
|
|
137902
137967
|
const importTypeNode = parent2;
|
|
137903
|
-
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.
|
|
137968
|
+
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
|
|
137904
137969
|
break;
|
|
137905
137970
|
default:
|
|
137906
137971
|
Debug.failBadSyntaxKind(parent2);
|
|
@@ -138175,7 +138240,7 @@ function updateImport(old, defaultImportName, elements) {
|
|
|
138175
138240
|
elements && elements.length ? factory.createNamedImports(elements) : void 0
|
|
138176
138241
|
),
|
|
138177
138242
|
old.moduleSpecifier,
|
|
138178
|
-
/*
|
|
138243
|
+
/*attributes*/
|
|
138179
138244
|
void 0
|
|
138180
138245
|
);
|
|
138181
138246
|
}
|
|
@@ -139017,7 +139082,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie
|
|
|
139017
139082
|
factory.createNamespaceImport(newNamespaceId)
|
|
139018
139083
|
),
|
|
139019
139084
|
newModuleString,
|
|
139020
|
-
/*
|
|
139085
|
+
/*attributes*/
|
|
139021
139086
|
void 0
|
|
139022
139087
|
);
|
|
139023
139088
|
case 271 /* ImportEqualsDeclaration */:
|
|
@@ -139306,7 +139371,7 @@ function filterImport(i, moduleSpecifier, keep) {
|
|
|
139306
139371
|
void 0,
|
|
139307
139372
|
factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings),
|
|
139308
139373
|
getSynthesizedDeepClone(moduleSpecifier),
|
|
139309
|
-
/*
|
|
139374
|
+
/*attributes*/
|
|
139310
139375
|
void 0
|
|
139311
139376
|
) : void 0;
|
|
139312
139377
|
}
|
|
@@ -139630,7 +139695,7 @@ function moveStatementsToTargetFile(changes, program, statements, targetFile, to
|
|
|
139630
139695
|
continue;
|
|
139631
139696
|
}
|
|
139632
139697
|
if (length(updatedElements) < length(elements)) {
|
|
139633
|
-
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.
|
|
139698
|
+
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes));
|
|
139634
139699
|
}
|
|
139635
139700
|
}
|
|
139636
139701
|
}
|
|
@@ -149769,7 +149834,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149769
149834
|
false,
|
|
149770
149835
|
factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))),
|
|
149771
149836
|
exportDeclaration.moduleSpecifier,
|
|
149772
|
-
/*
|
|
149837
|
+
/*attributes*/
|
|
149773
149838
|
void 0
|
|
149774
149839
|
);
|
|
149775
149840
|
const typeExportDeclaration = factory.createExportDeclaration(
|
|
@@ -149779,7 +149844,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149779
149844
|
true,
|
|
149780
149845
|
factory.createNamedExports(typeExportSpecifiers),
|
|
149781
149846
|
exportDeclaration.moduleSpecifier,
|
|
149782
|
-
/*
|
|
149847
|
+
/*attributes*/
|
|
149783
149848
|
void 0
|
|
149784
149849
|
);
|
|
149785
149850
|
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {
|
|
@@ -149912,7 +149977,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149912
149977
|
true
|
|
149913
149978
|
),
|
|
149914
149979
|
getSynthesizedDeepClone(
|
|
149915
|
-
declaration.
|
|
149980
|
+
declaration.attributes,
|
|
149916
149981
|
/*includeTrivia*/
|
|
149917
149982
|
true
|
|
149918
149983
|
)
|
|
@@ -149940,7 +150005,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149940
150005
|
true
|
|
149941
150006
|
),
|
|
149942
150007
|
getSynthesizedDeepClone(
|
|
149943
|
-
declaration.
|
|
150008
|
+
declaration.attributes,
|
|
149944
150009
|
/*includeTrivia*/
|
|
149945
150010
|
true
|
|
149946
150011
|
)
|
|
@@ -149963,7 +150028,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149963
150028
|
true,
|
|
149964
150029
|
importClause.name,
|
|
149965
150030
|
newNamedBindings
|
|
149966
|
-
), declaration.moduleSpecifier, declaration.
|
|
150031
|
+
), declaration.moduleSpecifier, declaration.attributes);
|
|
149967
150032
|
changes.replaceNode(sourceFile, declaration, importDeclaration);
|
|
149968
150033
|
}
|
|
149969
150034
|
}
|
|
@@ -151462,7 +151527,7 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp
|
|
|
151462
151527
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
|
151463
151528
|
),
|
|
151464
151529
|
quotedModuleSpecifier,
|
|
151465
|
-
/*
|
|
151530
|
+
/*attributes*/
|
|
151466
151531
|
void 0
|
|
151467
151532
|
);
|
|
151468
151533
|
statements = combine(statements, declaration);
|
|
@@ -152041,7 +152106,7 @@ function updateExport(changes, program, sourceFile, node, names) {
|
|
|
152041
152106
|
)
|
|
152042
152107
|
),
|
|
152043
152108
|
node.moduleSpecifier,
|
|
152044
|
-
node.
|
|
152109
|
+
node.attributes
|
|
152045
152110
|
)
|
|
152046
152111
|
);
|
|
152047
152112
|
}
|
|
@@ -152058,7 +152123,7 @@ function createExport(changes, program, sourceFile, names) {
|
|
|
152058
152123
|
)),
|
|
152059
152124
|
/*moduleSpecifier*/
|
|
152060
152125
|
void 0,
|
|
152061
|
-
/*
|
|
152126
|
+
/*attributes*/
|
|
152062
152127
|
void 0
|
|
152063
152128
|
));
|
|
152064
152129
|
}
|
|
@@ -156733,7 +156798,7 @@ function doChange34(changes, sourceFile, info) {
|
|
|
156733
156798
|
namedImports
|
|
156734
156799
|
),
|
|
156735
156800
|
required,
|
|
156736
|
-
/*
|
|
156801
|
+
/*attributes*/
|
|
156737
156802
|
void 0
|
|
156738
156803
|
)
|
|
156739
156804
|
);
|
|
@@ -156872,7 +156937,7 @@ function doChange36(changes, sourceFile, importType) {
|
|
|
156872
156937
|
const newTypeNode = factory.updateImportTypeNode(
|
|
156873
156938
|
importType,
|
|
156874
156939
|
importType.argument,
|
|
156875
|
-
importType.
|
|
156940
|
+
importType.attributes,
|
|
156876
156941
|
importType.qualifier,
|
|
156877
156942
|
importType.typeArguments,
|
|
156878
156943
|
/*isTypeOf*/
|
|
@@ -157103,7 +157168,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
157103
157168
|
void 0
|
|
157104
157169
|
),
|
|
157105
157170
|
importDeclaration.moduleSpecifier,
|
|
157106
|
-
importDeclaration.
|
|
157171
|
+
importDeclaration.attributes
|
|
157107
157172
|
)
|
|
157108
157173
|
);
|
|
157109
157174
|
changes.insertNodeAfter(
|
|
@@ -157120,7 +157185,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
157120
157185
|
importClause.namedBindings
|
|
157121
157186
|
),
|
|
157122
157187
|
importDeclaration.moduleSpecifier,
|
|
157123
|
-
importDeclaration.
|
|
157188
|
+
importDeclaration.attributes
|
|
157124
157189
|
)
|
|
157125
157190
|
);
|
|
157126
157191
|
}
|
|
@@ -166209,7 +166274,7 @@ function removeUnusedImports(oldImports, sourceFile, program) {
|
|
|
166209
166274
|
/*importClause*/
|
|
166210
166275
|
void 0,
|
|
166211
166276
|
moduleSpecifier,
|
|
166212
|
-
/*
|
|
166277
|
+
/*attributes*/
|
|
166213
166278
|
void 0
|
|
166214
166279
|
));
|
|
166215
166280
|
} else {
|
|
@@ -166375,7 +166440,7 @@ function coalesceExportsWorker(exportGroup, comparer) {
|
|
|
166375
166440
|
exportDecl.isTypeOnly,
|
|
166376
166441
|
exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)),
|
|
166377
166442
|
exportDecl.moduleSpecifier,
|
|
166378
|
-
exportDecl.
|
|
166443
|
+
exportDecl.attributes
|
|
166379
166444
|
)
|
|
166380
166445
|
);
|
|
166381
166446
|
}
|
|
@@ -166407,7 +166472,7 @@ function updateImportDeclarationAndClause(importDeclaration, name, namedBindings
|
|
|
166407
166472
|
factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings),
|
|
166408
166473
|
// TODO: GH#18217
|
|
166409
166474
|
importDeclaration.moduleSpecifier,
|
|
166410
|
-
importDeclaration.
|
|
166475
|
+
importDeclaration.attributes
|
|
166411
166476
|
);
|
|
166412
166477
|
}
|
|
166413
166478
|
function sortSpecifiers(specifiers, comparer) {
|
|
@@ -166902,10 +166967,11 @@ function getOutliningSpanForNode(n, sourceFile) {
|
|
|
166902
166967
|
return spanForParenthesizedExpression(n);
|
|
166903
166968
|
case 275 /* NamedImports */:
|
|
166904
166969
|
case 279 /* NamedExports */:
|
|
166970
|
+
case 300 /* ImportAttributes */:
|
|
166905
166971
|
case 300 /* AssertClause */:
|
|
166906
|
-
return
|
|
166972
|
+
return spanForImportExportElements(n);
|
|
166907
166973
|
}
|
|
166908
|
-
function
|
|
166974
|
+
function spanForImportExportElements(node) {
|
|
166909
166975
|
if (!node.elements.length) {
|
|
166910
166976
|
return void 0;
|
|
166911
166977
|
}
|
|
@@ -173614,7 +173680,7 @@ __export(ts_exports2, {
|
|
|
173614
173680
|
getRenameLocation: () => getRenameLocation,
|
|
173615
173681
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
173616
173682
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
173617
|
-
|
|
173683
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
173618
173684
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
173619
173685
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
173620
173686
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -173746,6 +173812,7 @@ __export(ts_exports2, {
|
|
|
173746
173812
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
173747
173813
|
hasQuestionToken: () => hasQuestionToken,
|
|
173748
173814
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
173815
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
173749
173816
|
hasRestParameter: () => hasRestParameter,
|
|
173750
173817
|
hasScopeMarker: () => hasScopeMarker,
|
|
173751
173818
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -173819,7 +173886,6 @@ __export(ts_exports2, {
|
|
|
173819
173886
|
isAssertClause: () => isAssertClause,
|
|
173820
173887
|
isAssertEntry: () => isAssertEntry,
|
|
173821
173888
|
isAssertionExpression: () => isAssertionExpression,
|
|
173822
|
-
isAssertionKey: () => isAssertionKey,
|
|
173823
173889
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
173824
173890
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
173825
173891
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -174029,6 +174095,9 @@ __export(ts_exports2, {
|
|
|
174029
174095
|
isIfStatement: () => isIfStatement,
|
|
174030
174096
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
174031
174097
|
isImplicitGlob: () => isImplicitGlob,
|
|
174098
|
+
isImportAttribute: () => isImportAttribute,
|
|
174099
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
174100
|
+
isImportAttributes: () => isImportAttributes,
|
|
174032
174101
|
isImportCall: () => isImportCall,
|
|
174033
174102
|
isImportClause: () => isImportClause,
|
|
174034
174103
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -174220,7 +174289,6 @@ __export(ts_exports2, {
|
|
|
174220
174289
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
174221
174290
|
isNewExpression: () => isNewExpression,
|
|
174222
174291
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
174223
|
-
isNightly: () => isNightly,
|
|
174224
174292
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
174225
174293
|
isNode: () => isNode,
|
|
174226
174294
|
isNodeArray: () => isNodeArray,
|
|
@@ -188293,7 +188361,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188293
188361
|
getRenameLocation,
|
|
188294
188362
|
getReplacementSpanForContextToken,
|
|
188295
188363
|
getResolutionDiagnostic,
|
|
188296
|
-
|
|
188364
|
+
getResolutionModeOverride,
|
|
188297
188365
|
getResolveJsonModule,
|
|
188298
188366
|
getResolvePackageJsonExports,
|
|
188299
188367
|
getResolvePackageJsonImports,
|
|
@@ -188425,6 +188493,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188425
188493
|
hasPropertyAccessExpressionWithName,
|
|
188426
188494
|
hasQuestionToken,
|
|
188427
188495
|
hasRecordedExternalHelpers,
|
|
188496
|
+
hasResolutionModeOverride,
|
|
188428
188497
|
hasRestParameter,
|
|
188429
188498
|
hasScopeMarker,
|
|
188430
188499
|
hasStaticModifier,
|
|
@@ -188498,7 +188567,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188498
188567
|
isAssertClause,
|
|
188499
188568
|
isAssertEntry,
|
|
188500
188569
|
isAssertionExpression,
|
|
188501
|
-
isAssertionKey,
|
|
188502
188570
|
isAssertsKeyword,
|
|
188503
188571
|
isAssignmentDeclaration,
|
|
188504
188572
|
isAssignmentExpression,
|
|
@@ -188708,6 +188776,9 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188708
188776
|
isIfStatement,
|
|
188709
188777
|
isIgnoredFileFromWildCardWatching,
|
|
188710
188778
|
isImplicitGlob,
|
|
188779
|
+
isImportAttribute,
|
|
188780
|
+
isImportAttributeName,
|
|
188781
|
+
isImportAttributes,
|
|
188711
188782
|
isImportCall,
|
|
188712
188783
|
isImportClause,
|
|
188713
188784
|
isImportDeclaration,
|
|
@@ -188899,7 +188970,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188899
188970
|
isNamespaceReexportDeclaration,
|
|
188900
188971
|
isNewExpression,
|
|
188901
188972
|
isNewExpressionTarget,
|
|
188902
|
-
isNightly,
|
|
188903
188973
|
isNoSubstitutionTemplateLiteral,
|
|
188904
188974
|
isNode,
|
|
188905
188975
|
isNodeArray,
|