@typescript-deploys/pr-build 4.5.0-pr-46071-5 → 4.5.0-pr-46071-13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.5";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20210927";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20211001";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -3294,6 +3294,7 @@ var ts;
3294
3294
  ModuleKind[ModuleKind["System"] = 4] = "System";
3295
3295
  ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
3296
3296
  ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
3297
+ ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
3297
3298
  ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
3298
3299
  ModuleKind[ModuleKind["Node12"] = 100] = "Node12";
3299
3300
  ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
@@ -5297,7 +5298,7 @@ var ts;
5297
5298
  Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
5298
5299
  Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts.DiagnosticCategory.Error, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
5299
5300
  Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, ts.DiagnosticCategory.Error, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
5300
- Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_umd_node12_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),
5301
+ Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),
5301
5302
  Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext'."),
5302
5303
  Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
5303
5304
  Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."),
@@ -5315,7 +5316,7 @@ var ts;
5315
5316
  Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
5316
5317
  Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
5317
5318
  Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
5318
- The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_system_node12_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_system_node12__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', 'system', 'node12', or 'nodenext'."),
5319
+ The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'."),
5319
5320
  A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
5320
5321
  An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
5321
5322
  This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
@@ -5346,7 +5347,7 @@ var ts;
5346
5347
  await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
5347
5348
  _0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
5348
5349
  _0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
5349
- Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_noden_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5350
+ Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5350
5351
  An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
5351
5352
  An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
5352
5353
  Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
@@ -5398,7 +5399,7 @@ var ts;
5398
5399
  File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
5399
5400
  The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
5400
5401
  for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, ts.DiagnosticCategory.Error, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
5401
- Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_nodenex_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5402
+ Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
5402
5403
  Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."),
5403
5404
  Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
5404
5405
  Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts.DiagnosticCategory.Error, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
@@ -5424,6 +5425,8 @@ var ts;
5424
5425
  Construct_signature_return_types_0_and_1_are_incompatible: diag(2203, ts.DiagnosticCategory.Error, "Construct_signature_return_types_0_and_1_are_incompatible_2203", "Construct signature return types '{0}' and '{1}' are incompatible.", undefined, true),
5425
5426
  Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2204, ts.DiagnosticCategory.Error, "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204", "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
5426
5427
  Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
5428
+ The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
5429
+ The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
5427
5430
  Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
5428
5431
  Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
5429
5432
  Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -9723,7 +9726,7 @@ var ts;
9723
9726
  switch (node.kind) {
9724
9727
  case 269:
9725
9728
  case 274:
9726
- return node.parent.parent.isTypeOnly;
9729
+ return node.isTypeOnly || node.parent.parent.isTypeOnly;
9727
9730
  case 267:
9728
9731
  return node.parent.isTypeOnly;
9729
9732
  case 266:
@@ -15520,6 +15523,7 @@ var ts;
15520
15523
  case ts.ModuleKind.AMD:
15521
15524
  case ts.ModuleKind.ES2015:
15522
15525
  case ts.ModuleKind.ES2020:
15526
+ case ts.ModuleKind.ES2022:
15523
15527
  case ts.ModuleKind.ESNext:
15524
15528
  return true;
15525
15529
  default:
@@ -15689,7 +15693,8 @@ var ts;
15689
15693
  var aParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(a, cwd));
15690
15694
  var bParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(b, cwd));
15691
15695
  var isDirectory = false;
15692
- while (!isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) &&
15696
+ while (aParts.length >= 2 && bParts.length >= 2 &&
15697
+ !isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) &&
15693
15698
  !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) &&
15694
15699
  getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) {
15695
15700
  aParts.pop();
@@ -15699,7 +15704,7 @@ var ts;
15699
15704
  return isDirectory ? [ts.getPathFromPathComponents(aParts), ts.getPathFromPathComponents(bParts)] : undefined;
15700
15705
  }
15701
15706
  function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {
15702
- return getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@");
15707
+ return s !== undefined && (getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@"));
15703
15708
  }
15704
15709
  function stripLeadingDirectorySeparator(s) {
15705
15710
  return ts.isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : undefined;
@@ -16239,10 +16244,6 @@ var ts;
16239
16244
  || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
16240
16245
  }
16241
16246
  ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite;
16242
- function typeOnlyDeclarationIsExport(typeOnlyDeclaration) {
16243
- return typeOnlyDeclaration.kind === 274;
16244
- }
16245
- ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport;
16246
16247
  function isShorthandPropertyNameUseSite(useSite) {
16247
16248
  return ts.isIdentifier(useSite) && ts.isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
16248
16249
  }
@@ -16493,6 +16494,10 @@ var ts;
16493
16494
  return !!declaration && (ts.isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
16494
16495
  }
16495
16496
  ts.isParameterOrCatchClauseVariable = isParameterOrCatchClauseVariable;
16497
+ function isFunctionExpressionOrArrowFunction(node) {
16498
+ return node.kind === 212 || node.kind === 213;
16499
+ }
16500
+ ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
16496
16501
  })(ts || (ts = {}));
16497
16502
  var ts;
16498
16503
  (function (ts) {
@@ -19699,8 +19704,9 @@ var ts;
19699
19704
  ? update(createNamedImports(elements), node)
19700
19705
  : node;
19701
19706
  }
19702
- function createImportSpecifier(propertyName, name) {
19707
+ function createImportSpecifier(isTypeOnly, propertyName, name) {
19703
19708
  var node = createBaseNode(269);
19709
+ node.isTypeOnly = isTypeOnly;
19704
19710
  node.propertyName = propertyName;
19705
19711
  node.name = name;
19706
19712
  node.transformFlags |=
@@ -19709,10 +19715,11 @@ var ts;
19709
19715
  node.transformFlags &= ~16777216;
19710
19716
  return node;
19711
19717
  }
19712
- function updateImportSpecifier(node, propertyName, name) {
19713
- return node.propertyName !== propertyName
19718
+ function updateImportSpecifier(node, isTypeOnly, propertyName, name) {
19719
+ return node.isTypeOnly !== isTypeOnly
19720
+ || node.propertyName !== propertyName
19714
19721
  || node.name !== name
19715
- ? update(createImportSpecifier(propertyName, name), node)
19722
+ ? update(createImportSpecifier(isTypeOnly, propertyName, name), node)
19716
19723
  : node;
19717
19724
  }
19718
19725
  function createExportAssignment(decorators, modifiers, isExportEquals, expression) {
@@ -19766,8 +19773,9 @@ var ts;
19766
19773
  ? update(createNamedExports(elements), node)
19767
19774
  : node;
19768
19775
  }
19769
- function createExportSpecifier(propertyName, name) {
19776
+ function createExportSpecifier(isTypeOnly, propertyName, name) {
19770
19777
  var node = createBaseNode(274);
19778
+ node.isTypeOnly = isTypeOnly;
19771
19779
  node.propertyName = asName(propertyName);
19772
19780
  node.name = asName(name);
19773
19781
  node.transformFlags |=
@@ -19776,10 +19784,11 @@ var ts;
19776
19784
  node.transformFlags &= ~16777216;
19777
19785
  return node;
19778
19786
  }
19779
- function updateExportSpecifier(node, propertyName, name) {
19780
- return node.propertyName !== propertyName
19787
+ function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
19788
+ return node.isTypeOnly !== isTypeOnly
19789
+ || node.propertyName !== propertyName
19781
19790
  || node.name !== name
19782
- ? update(createExportSpecifier(propertyName, name), node)
19791
+ ? update(createExportSpecifier(isTypeOnly, propertyName, name), node)
19783
19792
  : node;
19784
19793
  }
19785
19794
  function createMissingDeclaration() {
@@ -20656,7 +20665,7 @@ var ts;
20656
20665
  }
20657
20666
  function createExternalModuleExport(exportName) {
20658
20667
  return createExportDeclaration(undefined, undefined, false, createNamedExports([
20659
- createExportSpecifier(undefined, exportName)
20668
+ createExportSpecifier(false, undefined, exportName)
20660
20669
  ]));
20661
20670
  }
20662
20671
  function createTypeCheck(value, tag) {
@@ -23307,8 +23316,8 @@ var ts;
23307
23316
  if (ts.some(helperNames)) {
23308
23317
  helperNames.sort(ts.compareStringsCaseSensitive);
23309
23318
  namedBindings = nodeFactory.createNamedImports(ts.map(helperNames, function (name) { return ts.isFileLevelUniqueName(sourceFile, name)
23310
- ? nodeFactory.createImportSpecifier(undefined, nodeFactory.createIdentifier(name))
23311
- : nodeFactory.createImportSpecifier(nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
23319
+ ? nodeFactory.createImportSpecifier(false, undefined, nodeFactory.createIdentifier(name))
23320
+ : nodeFactory.createImportSpecifier(false, nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
23312
23321
  var parseNode = ts.getOriginalNode(sourceFile, ts.isSourceFile);
23313
23322
  var emitNode = ts.getOrCreateEmitNode(parseNode);
23314
23323
  emitNode.externalHelpers = true;
@@ -25288,7 +25297,6 @@ var ts;
25288
25297
  case 88:
25289
25298
  return nextTokenCanFollowDefaultKeyword();
25290
25299
  case 124:
25291
- return nextTokenIsOnSameLineAndCanFollowModifier();
25292
25300
  case 136:
25293
25301
  case 148:
25294
25302
  nextToken();
@@ -28681,7 +28689,7 @@ var ts;
28681
28689
  }
28682
28690
  return list && createNodeArray(list, pos);
28683
28691
  }
28684
- function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
28692
+ function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) {
28685
28693
  var pos = getNodePos();
28686
28694
  var kind = token();
28687
28695
  if (token() === 85 && permitInvalidConstAsModifier) {
@@ -28692,6 +28700,9 @@ var ts;
28692
28700
  else if (stopOnStartOfClassStaticBlock && token() === 124 && lookAhead(nextTokenIsOpenBrace)) {
28693
28701
  return undefined;
28694
28702
  }
28703
+ else if (hasSeenStaticModifier && token() === 124) {
28704
+ return undefined;
28705
+ }
28695
28706
  else {
28696
28707
  if (!parseAnyContextualModifier()) {
28697
28708
  return undefined;
@@ -28701,8 +28712,10 @@ var ts;
28701
28712
  }
28702
28713
  function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
28703
28714
  var pos = getNodePos();
28704
- var list, modifier;
28705
- while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock)) {
28715
+ var list, modifier, hasSeenStatic = false;
28716
+ while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
28717
+ if (modifier.kind === 124)
28718
+ hasSeenStatic = true;
28706
28719
  list = ts.append(list, modifier);
28707
28720
  }
28708
28721
  return list && createNodeArray(list, pos);
@@ -29079,27 +29092,60 @@ var ts;
29079
29092
  var checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
29080
29093
  var checkIdentifierStart = scanner.getTokenPos();
29081
29094
  var checkIdentifierEnd = scanner.getTextPos();
29082
- var identifierName = parseIdentifierName();
29095
+ var isTypeOnly = false;
29083
29096
  var propertyName;
29084
- var name;
29085
- if (token() === 127) {
29086
- propertyName = identifierName;
29087
- parseExpected(127);
29088
- checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
29089
- checkIdentifierStart = scanner.getTokenPos();
29090
- checkIdentifierEnd = scanner.getTextPos();
29091
- name = parseIdentifierName();
29097
+ var canParseAsKeyword = true;
29098
+ var name = parseIdentifierName();
29099
+ if (name.escapedText === "type") {
29100
+ if (token() === 127) {
29101
+ var firstAs = parseIdentifierName();
29102
+ if (token() === 127) {
29103
+ var secondAs = parseIdentifierName();
29104
+ if (ts.tokenIsIdentifierOrKeyword(token())) {
29105
+ isTypeOnly = true;
29106
+ propertyName = firstAs;
29107
+ name = parseNameWithKeywordCheck();
29108
+ canParseAsKeyword = false;
29109
+ }
29110
+ else {
29111
+ propertyName = name;
29112
+ name = secondAs;
29113
+ canParseAsKeyword = false;
29114
+ }
29115
+ }
29116
+ else if (ts.tokenIsIdentifierOrKeyword(token())) {
29117
+ propertyName = name;
29118
+ canParseAsKeyword = false;
29119
+ name = parseNameWithKeywordCheck();
29120
+ }
29121
+ else {
29122
+ isTypeOnly = true;
29123
+ name = firstAs;
29124
+ }
29125
+ }
29126
+ else if (ts.tokenIsIdentifierOrKeyword(token())) {
29127
+ isTypeOnly = true;
29128
+ name = parseNameWithKeywordCheck();
29129
+ }
29092
29130
  }
29093
- else {
29094
- name = identifierName;
29131
+ if (canParseAsKeyword && token() === 127) {
29132
+ propertyName = name;
29133
+ parseExpected(127);
29134
+ name = parseNameWithKeywordCheck();
29095
29135
  }
29096
29136
  if (kind === 269 && checkIdentifierIsKeyword) {
29097
29137
  parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);
29098
29138
  }
29099
29139
  var node = kind === 269
29100
- ? factory.createImportSpecifier(propertyName, name)
29101
- : factory.createExportSpecifier(propertyName, name);
29140
+ ? factory.createImportSpecifier(isTypeOnly, propertyName, name)
29141
+ : factory.createExportSpecifier(isTypeOnly, propertyName, name);
29102
29142
  return finishNode(node, pos);
29143
+ function parseNameWithKeywordCheck() {
29144
+ checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
29145
+ checkIdentifierStart = scanner.getTokenPos();
29146
+ checkIdentifierEnd = scanner.getTextPos();
29147
+ return parseIdentifierName();
29148
+ }
29103
29149
  }
29104
29150
  function parseNamespaceExport(pos) {
29105
29151
  return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos);
@@ -30970,6 +31016,7 @@ var ts;
30970
31016
  es6: ts.ModuleKind.ES2015,
30971
31017
  es2015: ts.ModuleKind.ES2015,
30972
31018
  es2020: ts.ModuleKind.ES2020,
31019
+ es2022: ts.ModuleKind.ES2022,
30973
31020
  esnext: ts.ModuleKind.ESNext,
30974
31021
  node12: ts.ModuleKind.Node12,
30975
31022
  nodenext: ts.ModuleKind.NodeNext,
@@ -32566,29 +32613,39 @@ var ts;
32566
32613
  }
32567
32614
  return result;
32568
32615
  }
32569
- function generateTSConfig(options, fileNames, newLine) {
32616
+ function getCompilerOptionsDiffValue(options, newLine) {
32617
+ var compilerOptionsMap = getSerializedCompilerOption(options);
32618
+ return getOverwrittenDefaultOptions();
32619
+ function makePadding(paddingLength) {
32620
+ return Array(paddingLength + 1).join(" ");
32621
+ }
32622
+ function getOverwrittenDefaultOptions() {
32623
+ var result = [];
32624
+ var tab = makePadding(2);
32625
+ commandOptionsWithoutBuild.forEach(function (cmd) {
32626
+ if (!compilerOptionsMap.has(cmd.name)) {
32627
+ return;
32628
+ }
32629
+ var newValue = compilerOptionsMap.get(cmd.name);
32630
+ var defaultValue = getDefaultValueForOption(cmd);
32631
+ if (newValue !== defaultValue) {
32632
+ result.push("" + tab + cmd.name + ": " + newValue);
32633
+ }
32634
+ else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
32635
+ result.push("" + tab + cmd.name + ": " + defaultValue);
32636
+ }
32637
+ });
32638
+ return result.join(newLine) + newLine;
32639
+ }
32640
+ }
32641
+ ts.getCompilerOptionsDiffValue = getCompilerOptionsDiffValue;
32642
+ function getSerializedCompilerOption(options) {
32570
32643
  var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
32571
- var compilerOptionsMap = serializeCompilerOptions(compilerOptions);
32644
+ return serializeCompilerOptions(compilerOptions);
32645
+ }
32646
+ function generateTSConfig(options, fileNames, newLine) {
32647
+ var compilerOptionsMap = getSerializedCompilerOption(options);
32572
32648
  return writeConfigurations();
32573
- function getDefaultValueForOption(option) {
32574
- switch (option.type) {
32575
- case "number":
32576
- return 1;
32577
- case "boolean":
32578
- return true;
32579
- case "string":
32580
- return option.isFilePath ? "./" : "";
32581
- case "list":
32582
- return [];
32583
- case "object":
32584
- return {};
32585
- default:
32586
- var iterResult = option.type.keys().next();
32587
- if (!iterResult.done)
32588
- return iterResult.value;
32589
- return ts.Debug.fail("Expected 'option.type' to have entries.");
32590
- }
32591
- }
32592
32649
  function makePadding(paddingLength) {
32593
32650
  return Array(paddingLength + 1).join(" ");
32594
32651
  }
@@ -33416,6 +33473,25 @@ var ts;
33416
33473
  });
33417
33474
  }
33418
33475
  }
33476
+ function getDefaultValueForOption(option) {
33477
+ switch (option.type) {
33478
+ case "number":
33479
+ return 1;
33480
+ case "boolean":
33481
+ return true;
33482
+ case "string":
33483
+ return option.isFilePath ? "./" : "";
33484
+ case "list":
33485
+ return [];
33486
+ case "object":
33487
+ return {};
33488
+ default:
33489
+ var iterResult = option.type.keys().next();
33490
+ if (!iterResult.done)
33491
+ return iterResult.value;
33492
+ return ts.Debug.fail("Expected 'option.type' to have entries.");
33493
+ }
33494
+ }
33419
33495
  })(ts || (ts = {}));
33420
33496
  var ts;
33421
33497
  (function (ts) {
@@ -37996,7 +38072,6 @@ var ts;
37996
38072
  Capitalize: 2,
37997
38073
  Uncapitalize: 3
37998
38074
  }));
37999
- var DEFAULT_TYPE_CHARS_LENGTH_TO_ADD_NEW_LINES = 30;
38000
38075
  function SymbolLinks() {
38001
38076
  }
38002
38077
  function NodeLinks() {
@@ -38402,6 +38477,7 @@ var ts;
38402
38477
  getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: getLocalTypeParametersOfClassOrInterfaceOrTypeAlias,
38403
38478
  isDeclarationVisible: isDeclarationVisible,
38404
38479
  isPropertyAccessible: isPropertyAccessible,
38480
+ getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
38405
38481
  };
38406
38482
  function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
38407
38483
  var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
@@ -38660,17 +38736,9 @@ var ts;
38660
38736
  }
38661
38737
  }
38662
38738
  else {
38663
- if (file.localJsxNamespace) {
38664
- return file.localJsxNamespace;
38665
- }
38666
- var jsxPragma = file.pragmas.get("jsx");
38667
- if (jsxPragma) {
38668
- var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
38669
- file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
38670
- ts.visitNode(file.localJsxFactory, markAsSynthetic);
38671
- if (file.localJsxFactory) {
38672
- return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
38673
- }
38739
+ var localJsxNamespace = getLocalJsxNamespace(file);
38740
+ if (localJsxNamespace) {
38741
+ return file.localJsxNamespace = localJsxNamespace;
38674
38742
  }
38675
38743
  }
38676
38744
  }
@@ -38692,11 +38760,25 @@ var ts;
38692
38760
  _jsxFactoryEntity = ts.factory.createQualifiedName(ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(_jsxNamespace)), "createElement");
38693
38761
  }
38694
38762
  return _jsxNamespace;
38695
- function markAsSynthetic(node) {
38696
- ts.setTextRangePosEnd(node, -1, -1);
38697
- return ts.visitEachChild(node, markAsSynthetic, ts.nullTransformationContext);
38763
+ }
38764
+ function getLocalJsxNamespace(file) {
38765
+ if (file.localJsxNamespace) {
38766
+ return file.localJsxNamespace;
38767
+ }
38768
+ var jsxPragma = file.pragmas.get("jsx");
38769
+ if (jsxPragma) {
38770
+ var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
38771
+ file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
38772
+ ts.visitNode(file.localJsxFactory, markAsSynthetic);
38773
+ if (file.localJsxFactory) {
38774
+ return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
38775
+ }
38698
38776
  }
38699
38777
  }
38778
+ function markAsSynthetic(node) {
38779
+ ts.setTextRangePosEnd(node, -1, -1);
38780
+ return ts.visitEachChild(node, markAsSynthetic, ts.nullTransformationContext);
38781
+ }
38700
38782
  function getEmitResolver(sourceFile, cancellationToken) {
38701
38783
  getDiagnostics(sourceFile, cancellationToken);
38702
38784
  return emitResolver;
@@ -39581,8 +39663,7 @@ var ts;
39581
39663
  if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {
39582
39664
  var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);
39583
39665
  if (typeOnlyDeclaration) {
39584
- var isExport = ts.typeOnlyDeclarationIsExport(typeOnlyDeclaration);
39585
- var message = isExport
39666
+ var message = typeOnlyDeclaration.kind === 274
39586
39667
  ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
39587
39668
  : ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
39588
39669
  var unescapedName = ts.unescapeLeadingUnderscores(name);
@@ -39593,7 +39674,7 @@ var ts;
39593
39674
  function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) {
39594
39675
  if (!typeOnlyDeclaration)
39595
39676
  return diagnostic;
39596
- return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration, ts.typeOnlyDeclarationIsExport(typeOnlyDeclaration) ? ts.Diagnostics._0_was_exported_here : ts.Diagnostics._0_was_imported_here, unescapedName));
39677
+ return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration, typeOnlyDeclaration.kind === 274 ? ts.Diagnostics._0_was_exported_here : ts.Diagnostics._0_was_imported_here, unescapedName));
39597
39678
  }
39598
39679
  function getIsDeferredContext(location, lastLocation) {
39599
39680
  if (location.kind !== 213 && location.kind !== 212) {
@@ -39886,7 +39967,7 @@ var ts;
39886
39967
  function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
39887
39968
  if (markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false) && !node.isTypeOnly) {
39888
39969
  var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
39889
- var isExport = ts.typeOnlyDeclarationIsExport(typeOnlyDeclaration);
39970
+ var isExport = typeOnlyDeclaration.kind === 274;
39890
39971
  var message = isExport
39891
39972
  ? ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type
39892
39973
  : ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
@@ -39907,7 +39988,20 @@ var ts;
39907
39988
  function isSyntacticDefault(node) {
39908
39989
  return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasSyntacticModifier(node, 512) || ts.isExportSpecifier(node));
39909
39990
  }
39910
- function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) {
39991
+ function getUsageModeForExpression(usage) {
39992
+ return ts.isStringLiteralLike(usage) ? ts.getModeForUsageLocation(ts.getSourceFileOfNode(usage), usage) : undefined;
39993
+ }
39994
+ function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
39995
+ return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
39996
+ }
39997
+ function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
39998
+ var usageMode = file && getUsageModeForExpression(usage);
39999
+ if (file && usageMode !== undefined) {
40000
+ var result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
40001
+ if (usageMode === ts.ModuleKind.ESNext || result) {
40002
+ return result;
40003
+ }
40004
+ }
39911
40005
  if (!allowSyntheticDefaultImports) {
39912
40006
  return false;
39913
40007
  }
@@ -39938,7 +40032,7 @@ var ts;
39938
40032
  exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", node, dontResolveAlias);
39939
40033
  }
39940
40034
  var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
39941
- var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias);
40035
+ var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
39942
40036
  if (!exportDefaultSymbol && !hasSyntheticDefault) {
39943
40037
  if (hasExportAssignmentSymbol(moduleSymbol)) {
39944
40038
  var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
@@ -40057,7 +40151,7 @@ var ts;
40057
40151
  var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
40058
40152
  if (symbolFromModule === undefined && name.escapedText === "default") {
40059
40153
  var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
40060
- if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) {
40154
+ if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
40061
40155
  symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
40062
40156
  }
40063
40157
  }
@@ -40666,7 +40760,7 @@ var ts;
40666
40760
  sigs = getSignaturesOfStructuredType(type, 1);
40667
40761
  }
40668
40762
  if (sigs && sigs.length) {
40669
- var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol);
40763
+ var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, ts.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier);
40670
40764
  var result = createSymbol(symbol.flags, symbol.escapedName);
40671
40765
  result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
40672
40766
  result.parent = symbol.parent;
@@ -43088,7 +43182,7 @@ var ts;
43088
43182
  var name_2 = ns.name;
43089
43183
  var body = ns.body;
43090
43184
  if (ts.length(excessExports)) {
43091
- ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements, true), [ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(undefined, id); })), undefined)], false))));
43185
+ ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements, true), [ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(false, undefined, id); })), undefined)], false))));
43092
43186
  statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, nsIndex), true), [ns], false), statements.slice(nsIndex + 1), true);
43093
43187
  }
43094
43188
  if (!ts.find(statements, function (s) { return s !== ns && ts.nodeHasName(s, name_2); })) {
@@ -43270,7 +43364,7 @@ var ts;
43270
43364
  if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
43271
43365
  && ((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
43272
43366
  var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
43273
- addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0);
43367
+ addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, alias, localName)])), 0);
43274
43368
  context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551);
43275
43369
  }
43276
43370
  else {
@@ -43279,7 +43373,7 @@ var ts;
43279
43373
  ], flags)), textRange);
43280
43374
  addResult(statement, name !== localName ? modifierFlags & ~1 : modifierFlags);
43281
43375
  if (name !== localName && !isPrivate) {
43282
- addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0);
43376
+ addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, name, localName)])), 0);
43283
43377
  needsExportDeclaration = false;
43284
43378
  needsPostExportDefault = false;
43285
43379
  }
@@ -43328,7 +43422,7 @@ var ts;
43328
43422
  addResult(ts.factory.createExportAssignment(undefined, undefined, false, ts.factory.createIdentifier(getInternalSymbolName(symbol, symbolName))), 0);
43329
43423
  }
43330
43424
  else if (needsExportDeclaration) {
43331
- addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(getInternalSymbolName(symbol, symbolName), symbolName)])), 0);
43425
+ addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, getInternalSymbolName(symbol, symbolName), symbolName)])), 0);
43332
43426
  }
43333
43427
  }
43334
43428
  function includePrivateSymbol(symbol) {
@@ -43433,7 +43527,7 @@ var ts;
43433
43527
  var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, true);
43434
43528
  includePrivateSymbol(target || s);
43435
43529
  var targetName = target ? getInternalSymbolName(target, ts.unescapeLeadingUnderscores(target.escapedName)) : localName;
43436
- return ts.factory.createExportSpecifier(name === targetName ? undefined : targetName, name);
43530
+ return ts.factory.createExportSpecifier(false, name === targetName ? undefined : targetName, name);
43437
43531
  })))]);
43438
43532
  addResult(ts.factory.createModuleDeclaration(undefined, undefined, ts.factory.createIdentifier(localName), nsBody, 16), 0);
43439
43533
  }
@@ -43493,7 +43587,7 @@ var ts;
43493
43587
  addingDeclare = oldAddingDeclare;
43494
43588
  var declarations = results;
43495
43589
  results = oldResults;
43496
- var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(d.expression, ts.factory.createIdentifier("default"))])) : d; });
43590
+ var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, d.expression, ts.factory.createIdentifier("default"))])) : d; });
43497
43591
  var exportModifierStripped = ts.every(defaultReplaced, function (d) { return ts.hasSyntacticModifier(d, 1); }) ? ts.map(defaultReplaced, removeExportModifier) : defaultReplaced;
43498
43592
  fakespace = ts.factory.updateModuleDeclaration(fakespace, fakespace.decorators, fakespace.modifiers, fakespace.name, ts.factory.createModuleBlock(exportModifierStripped));
43499
43593
  addResult(fakespace, modifierFlags);
@@ -43616,7 +43710,7 @@ var ts;
43616
43710
  if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 253) {
43617
43711
  var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context);
43618
43712
  var propertyName = node.propertyName;
43619
- addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1), undefined), 0);
43713
+ addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(false, propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1), undefined), 0);
43620
43714
  break;
43621
43715
  }
43622
43716
  ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
@@ -43659,7 +43753,7 @@ var ts;
43659
43753
  break;
43660
43754
  case 269:
43661
43755
  addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([
43662
- ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
43756
+ ts.factory.createImportSpecifier(false, localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
43663
43757
  ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context)), undefined), 0);
43664
43758
  break;
43665
43759
  case 274:
@@ -43684,7 +43778,7 @@ var ts;
43684
43778
  }
43685
43779
  }
43686
43780
  function serializeExportSpecifier(localName, targetName, specifier) {
43687
- addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(localName !== targetName ? targetName : undefined, localName)]), specifier), 0);
43781
+ addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, localName !== targetName ? targetName : undefined, localName)]), specifier), 0);
43688
43782
  }
43689
43783
  function serializeMaybeAliasAssignment(symbol) {
43690
43784
  if (symbol.flags & 4194304) {
@@ -46710,6 +46804,23 @@ var ts;
46710
46804
  function getIsLateCheckFlag(s) {
46711
46805
  return ts.getCheckFlags(s) & 4096;
46712
46806
  }
46807
+ function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
46808
+ for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
46809
+ var prop = _a[_i];
46810
+ cb(getLiteralTypeFromProperty(prop, include));
46811
+ }
46812
+ if (type.flags & 1) {
46813
+ cb(stringType);
46814
+ }
46815
+ else {
46816
+ for (var _b = 0, _c = getIndexInfosOfType(type); _b < _c.length; _b++) {
46817
+ var info = _c[_b];
46818
+ if (!stringsOnly || info.keyType.flags & (4 | 134217728)) {
46819
+ cb(info.keyType);
46820
+ }
46821
+ }
46822
+ }
46823
+ }
46713
46824
  function resolveMappedTypeMembers(type) {
46714
46825
  var members = ts.createSymbolTable();
46715
46826
  var indexInfos;
@@ -46722,21 +46833,7 @@ var ts;
46722
46833
  var templateModifiers = getMappedTypeModifiers(type);
46723
46834
  var include = keyofStringsOnly ? 128 : 8576;
46724
46835
  if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
46725
- for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) {
46726
- var prop = _a[_i];
46727
- addMemberForKeyType(getLiteralTypeFromProperty(prop, include));
46728
- }
46729
- if (modifiersType.flags & 1) {
46730
- addMemberForKeyType(stringType);
46731
- }
46732
- else {
46733
- for (var _b = 0, _c = getIndexInfosOfType(modifiersType); _b < _c.length; _b++) {
46734
- var info = _c[_b];
46735
- if (!keyofStringsOnly || info.keyType.flags & (4 | 134217728)) {
46736
- addMemberForKeyType(info.keyType);
46737
- }
46738
- }
46739
- }
46836
+ forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, include, keyofStringsOnly, addMemberForKeyType);
46740
46837
  }
46741
46838
  else {
46742
46839
  forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
@@ -47338,7 +47435,7 @@ var ts;
47338
47435
  else if (type !== firstType) {
47339
47436
  checkFlags |= 64;
47340
47437
  }
47341
- if (isLiteralType(type)) {
47438
+ if (isLiteralType(type) || isPatternLiteralType(type)) {
47342
47439
  checkFlags |= 128;
47343
47440
  }
47344
47441
  if (type.flags & 131072) {
@@ -49496,16 +49593,38 @@ var ts;
49496
49593
  type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, true)) :
49497
49594
  type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, false));
49498
49595
  }
49499
- function instantiateTypeAsMappedNameType(nameType, type, t) {
49500
- return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t));
49501
- }
49502
- function getIndexTypeForMappedType(type, noIndexSignatures) {
49503
- var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 | 4)); });
49504
- var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType);
49505
- var properties = nameType && everyType(constraint, function (t) { return !!(t.flags & (4 | 8 | 131072)); }) && getPropertiesOfType(getApparentType(getModifiersTypeFromMappedType(type)));
49506
- return nameType ?
49507
- getUnionType([mapType(constraint, function (t) { return instantiateTypeAsMappedNameType(nameType, type, t); }), mapType(getUnionType(ts.map(properties || ts.emptyArray, function (p) { return getLiteralTypeFromProperty(p, 8576); })), function (t) { return instantiateTypeAsMappedNameType(nameType, type, t); })]) :
49508
- constraint;
49596
+ function getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) {
49597
+ var typeParameter = getTypeParameterFromMappedType(type);
49598
+ var constraintType = getConstraintTypeFromMappedType(type);
49599
+ var nameType = getNameTypeFromMappedType(type.target || type);
49600
+ if (!nameType && !noIndexSignatures) {
49601
+ return constraintType;
49602
+ }
49603
+ var keyTypes = [];
49604
+ if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
49605
+ if (!isGenericIndexType(constraintType)) {
49606
+ var modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
49607
+ forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, stringsOnly, addMemberForKeyType);
49608
+ }
49609
+ else {
49610
+ return getIndexTypeForGenericType(type, stringsOnly);
49611
+ }
49612
+ }
49613
+ else {
49614
+ forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
49615
+ }
49616
+ if (isGenericIndexType(constraintType)) {
49617
+ forEachType(constraintType, addMemberForKeyType);
49618
+ }
49619
+ var result = noIndexSignatures ? filterType(getUnionType(keyTypes), function (t) { return !(t.flags & (1 | 4)); }) : getUnionType(keyTypes);
49620
+ if (result.flags & 1048576 && constraintType.flags & 1048576 && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
49621
+ return constraintType;
49622
+ }
49623
+ return result;
49624
+ function addMemberForKeyType(keyType) {
49625
+ var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType;
49626
+ keyTypes.push(propNameType === stringType ? stringOrNumberType : propNameType);
49627
+ }
49509
49628
  }
49510
49629
  function hasDistributiveNameType(mappedType) {
49511
49630
  var typeVariable = getTypeParameterFromMappedType(mappedType);
@@ -49557,7 +49676,7 @@ var ts;
49557
49676
  return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
49558
49677
  type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
49559
49678
  type.flags & 58982400 || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
49560
- ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, noIndexSignatures) :
49679
+ ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
49561
49680
  type === wildcardType ? wildcardType :
49562
49681
  type.flags & 2 ? neverType :
49563
49682
  type.flags & (1 | 131072) ? keyofConstraintType :
@@ -51239,7 +51358,7 @@ var ts;
51239
51358
  return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 234 && isContextSensitive(node.body);
51240
51359
  }
51241
51360
  function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
51242
- return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
51361
+ return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || ts.isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
51243
51362
  isContextSensitiveFunctionLikeDeclaration(func);
51244
51363
  }
51245
51364
  function getTypeWithoutSignatures(type) {
@@ -52023,7 +52142,8 @@ var ts;
52023
52142
  var sourceStack;
52024
52143
  var targetStack;
52025
52144
  var maybeCount = 0;
52026
- var depth = 0;
52145
+ var sourceDepth = 0;
52146
+ var targetDepth = 0;
52027
52147
  var expandingFlags = 0;
52028
52148
  var overflow = false;
52029
52149
  var overrideNextErrorInfo = 0;
@@ -52031,12 +52151,12 @@ var ts;
52031
52151
  var incompatibleStack = [];
52032
52152
  var inPropertyCheck = false;
52033
52153
  ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
52034
- var result = isRelatedTo(source, target, !!errorNode, headMessage);
52154
+ var result = isRelatedTo(source, target, 3, !!errorNode, headMessage);
52035
52155
  if (incompatibleStack.length) {
52036
52156
  reportIncompatibleStack();
52037
52157
  }
52038
52158
  if (overflow) {
52039
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth });
52159
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth: targetDepth });
52040
52160
  var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target));
52041
52161
  if (errorOutputContainer) {
52042
52162
  (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -52249,9 +52369,9 @@ var ts;
52249
52369
  }
52250
52370
  }
52251
52371
  message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1;
52252
- if (shouldInsertNewLines([sourceType, targetType])) {
52253
- reportError(transformMessageToSupportNewLines(message), sourceType, targetType);
52254
- return;
52372
+ var typeLengthLimit = 30;
52373
+ if (!errorInfo && compilerOptions.pretty && (sourceType.length > typeLengthLimit || targetType.length > typeLengthLimit)) {
52374
+ message = formatMessageForTypes(message, typeLengthLimit, sourceType, targetType);
52255
52375
  }
52256
52376
  }
52257
52377
  }
@@ -52262,15 +52382,13 @@ var ts;
52262
52382
  }
52263
52383
  reportError(message, generalizedSourceType, targetType);
52264
52384
  }
52265
- function shouldInsertNewLines(types, charsLength) {
52266
- if (charsLength === void 0) { charsLength = DEFAULT_TYPE_CHARS_LENGTH_TO_ADD_NEW_LINES; }
52267
- return types.filter(function (type) { return type.length > charsLength; }).length > 0;
52268
- }
52269
- function transformMessageToSupportNewLines(message) {
52270
- return __assign(__assign({}, message), { message: message.message
52271
- .replace(" '{0}' ", ":\n{0}\n\n")
52272
- .replace(" '{1}'", ":\n{1}\n")
52273
- .replace(".", "") });
52385
+ function formatMessageForTypes(diagnostic, typeLengthLimit, source, target) {
52386
+ var message = diagnostic.message;
52387
+ if (source.length > typeLengthLimit)
52388
+ message = message.replace(" '{0}' ", ":\n{0}\n\n");
52389
+ if (target.length > typeLengthLimit)
52390
+ message = message.replace(" '{1}'", ":\n{1}").replace(".", "");
52391
+ return __assign(__assign({}, diagnostic), { message: message });
52274
52392
  }
52275
52393
  function tryElaborateErrorsForPrimitivesAndObjects(source, target) {
52276
52394
  var sourceType = symbolValueDeclarationIsContextSensitive(source.symbol) ? typeToString(source, source.symbol.valueDeclaration) : typeToString(source);
@@ -52303,7 +52421,11 @@ var ts;
52303
52421
  }
52304
52422
  return true;
52305
52423
  }
52306
- function isRelatedTo(originalSource, originalTarget, reportErrors, headMessage, intersectionState) {
52424
+ function isRelatedToWorker(source, target, reportErrors) {
52425
+ return isRelatedTo(source, target, 3, reportErrors);
52426
+ }
52427
+ function isRelatedTo(originalSource, originalTarget, recursionFlags, reportErrors, headMessage, intersectionState) {
52428
+ if (recursionFlags === void 0) { recursionFlags = 3; }
52307
52429
  if (reportErrors === void 0) { reportErrors = false; }
52308
52430
  if (intersectionState === void 0) { intersectionState = 0; }
52309
52431
  if (originalSource.flags & 524288 && originalTarget.flags & 131068) {
@@ -52318,7 +52440,7 @@ var ts;
52318
52440
  if (source === target)
52319
52441
  return -1;
52320
52442
  if (relation === identityRelation) {
52321
- return isIdenticalTo(source, target);
52443
+ return isIdenticalTo(source, target, recursionFlags);
52322
52444
  }
52323
52445
  if (source.flags & 262144 && getConstraintOfType(source) === target) {
52324
52446
  return -1;
@@ -52355,8 +52477,8 @@ var ts;
52355
52477
  var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
52356
52478
  var calls = getSignaturesOfType(source, 0);
52357
52479
  var constructs = getSignaturesOfType(source, 1);
52358
- if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, false) ||
52359
- constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, false)) {
52480
+ if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
52481
+ constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
52360
52482
  reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
52361
52483
  }
52362
52484
  else {
@@ -52370,11 +52492,11 @@ var ts;
52370
52492
  var saveErrorInfo = captureErrorCalculationState();
52371
52493
  if (source.flags & 3145728 || target.flags & 3145728) {
52372
52494
  result = getConstituentCount(source) * getConstituentCount(target) >= 4 ?
52373
- recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8) :
52495
+ recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags) :
52374
52496
  structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
52375
52497
  }
52376
52498
  if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
52377
- if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) {
52499
+ if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
52378
52500
  resetErrorInfo(saveErrorInfo);
52379
52501
  }
52380
52502
  }
@@ -52382,7 +52504,7 @@ var ts;
52382
52504
  var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
52383
52505
  if (constraint && (source.flags & 2097152 || target.flags & 1048576)) {
52384
52506
  if (everyType(constraint, function (c) { return c !== source; })) {
52385
- if (result = isRelatedTo(constraint, target, false, undefined, intersectionState)) {
52507
+ if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
52386
52508
  resetErrorInfo(saveErrorInfo);
52387
52509
  }
52388
52510
  }
@@ -52391,7 +52513,7 @@ var ts;
52391
52513
  if (result && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
52392
52514
  isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288); }))) {
52393
52515
  inPropertyCheck = true;
52394
- result &= recursiveTypeRelatedTo(source, target, reportErrors, 4);
52516
+ result &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
52395
52517
  inPropertyCheck = false;
52396
52518
  }
52397
52519
  reportErrorResults(source, target, result, isComparingJsxAttributes);
@@ -52463,7 +52585,7 @@ var ts;
52463
52585
  }
52464
52586
  }
52465
52587
  }
52466
- function isIdenticalTo(source, target) {
52588
+ function isIdenticalTo(source, target, recursionFlags) {
52467
52589
  if (source.flags !== target.flags)
52468
52590
  return 0;
52469
52591
  if (source.flags & 67358815)
@@ -52476,7 +52598,7 @@ var ts;
52476
52598
  }
52477
52599
  return result_7;
52478
52600
  }
52479
- return recursiveTypeRelatedTo(source, target, false, 0);
52601
+ return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
52480
52602
  }
52481
52603
  function getTypeOfPropertyInTypes(types, name) {
52482
52604
  var appendPropType = function (propTypes, type) {
@@ -52547,7 +52669,7 @@ var ts;
52547
52669
  }
52548
52670
  return { value: true };
52549
52671
  }
52550
- if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), reportErrors)) {
52672
+ if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), 3, reportErrors)) {
52551
52673
  if (reportErrors) {
52552
52674
  reportIncompatibleError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(prop));
52553
52675
  }
@@ -52587,7 +52709,7 @@ var ts;
52587
52709
  }
52588
52710
  var match = getMatchingUnionConstituentForType(target, source);
52589
52711
  if (match) {
52590
- var related = isRelatedTo(source, match, false);
52712
+ var related = isRelatedTo(source, match, 2, false);
52591
52713
  if (related) {
52592
52714
  return related;
52593
52715
  }
@@ -52595,14 +52717,14 @@ var ts;
52595
52717
  }
52596
52718
  for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {
52597
52719
  var type = targetTypes_1[_i];
52598
- var related = isRelatedTo(source, type, false);
52720
+ var related = isRelatedTo(source, type, 2, false);
52599
52721
  if (related) {
52600
52722
  return related;
52601
52723
  }
52602
52724
  }
52603
52725
  if (reportErrors) {
52604
52726
  var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
52605
- isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], true);
52727
+ isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2, true);
52606
52728
  }
52607
52729
  return 0;
52608
52730
  }
@@ -52611,7 +52733,7 @@ var ts;
52611
52733
  var targetTypes = target.types;
52612
52734
  for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) {
52613
52735
  var targetType = targetTypes_2[_i];
52614
- var related = isRelatedTo(source, targetType, reportErrors, undefined, intersectionState);
52736
+ var related = isRelatedTo(source, targetType, 2, reportErrors, undefined, intersectionState);
52615
52737
  if (!related) {
52616
52738
  return 0;
52617
52739
  }
@@ -52626,7 +52748,7 @@ var ts;
52626
52748
  }
52627
52749
  var len = sourceTypes.length;
52628
52750
  for (var i = 0; i < len; i++) {
52629
- var related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1, undefined, intersectionState);
52751
+ var related = isRelatedTo(sourceTypes[i], target, 1, reportErrors && i === len - 1, undefined, intersectionState);
52630
52752
  if (related) {
52631
52753
  return related;
52632
52754
  }
@@ -52647,13 +52769,13 @@ var ts;
52647
52769
  for (var i = 0; i < sourceTypes.length; i++) {
52648
52770
  var sourceType = sourceTypes[i];
52649
52771
  if (undefinedStrippedTarget.flags & 1048576 && sourceTypes.length >= undefinedStrippedTarget.types.length && sourceTypes.length % undefinedStrippedTarget.types.length === 0) {
52650
- var related_1 = isRelatedTo(sourceType, undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], false, undefined, intersectionState);
52772
+ var related_1 = isRelatedTo(sourceType, undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], 3, false, undefined, intersectionState);
52651
52773
  if (related_1) {
52652
52774
  result &= related_1;
52653
52775
  continue;
52654
52776
  }
52655
52777
  }
52656
- var related = isRelatedTo(sourceType, target, reportErrors, undefined, intersectionState);
52778
+ var related = isRelatedTo(sourceType, target, 1, reportErrors, undefined, intersectionState);
52657
52779
  if (!related) {
52658
52780
  return 0;
52659
52781
  }
@@ -52678,24 +52800,24 @@ var ts;
52678
52800
  var t = targets[i];
52679
52801
  var related = -1;
52680
52802
  if (varianceFlags & 8) {
52681
- related = relation === identityRelation ? isRelatedTo(s, t, false) : compareTypesIdentical(s, t);
52803
+ related = relation === identityRelation ? isRelatedTo(s, t, 3, false) : compareTypesIdentical(s, t);
52682
52804
  }
52683
52805
  else if (variance === 1) {
52684
- related = isRelatedTo(s, t, reportErrors, undefined, intersectionState);
52806
+ related = isRelatedTo(s, t, 3, reportErrors, undefined, intersectionState);
52685
52807
  }
52686
52808
  else if (variance === 2) {
52687
- related = isRelatedTo(t, s, reportErrors, undefined, intersectionState);
52809
+ related = isRelatedTo(t, s, 3, reportErrors, undefined, intersectionState);
52688
52810
  }
52689
52811
  else if (variance === 3) {
52690
- related = isRelatedTo(t, s, false);
52812
+ related = isRelatedTo(t, s, 3, false);
52691
52813
  if (!related) {
52692
- related = isRelatedTo(s, t, reportErrors, undefined, intersectionState);
52814
+ related = isRelatedTo(s, t, 3, reportErrors, undefined, intersectionState);
52693
52815
  }
52694
52816
  }
52695
52817
  else {
52696
- related = isRelatedTo(s, t, reportErrors, undefined, intersectionState);
52818
+ related = isRelatedTo(s, t, 3, reportErrors, undefined, intersectionState);
52697
52819
  if (related) {
52698
- related &= isRelatedTo(t, s, reportErrors, undefined, intersectionState);
52820
+ related &= isRelatedTo(t, s, 3, reportErrors, undefined, intersectionState);
52699
52821
  }
52700
52822
  }
52701
52823
  if (!related) {
@@ -52706,7 +52828,7 @@ var ts;
52706
52828
  }
52707
52829
  return result;
52708
52830
  }
52709
- function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState) {
52831
+ function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags) {
52710
52832
  if (overflow) {
52711
52833
  return 0;
52712
52834
  }
@@ -52743,7 +52865,7 @@ var ts;
52743
52865
  return 3;
52744
52866
  }
52745
52867
  }
52746
- if (depth === 100) {
52868
+ if (sourceDepth === 100 || targetDepth === 100) {
52747
52869
  overflow = true;
52748
52870
  return 0;
52749
52871
  }
@@ -52751,13 +52873,18 @@ var ts;
52751
52873
  var maybeStart = maybeCount;
52752
52874
  maybeKeys[maybeCount] = id;
52753
52875
  maybeCount++;
52754
- sourceStack[depth] = source;
52755
- targetStack[depth] = target;
52756
- depth++;
52876
+ if (recursionFlags & 1) {
52877
+ sourceStack[sourceDepth] = source;
52878
+ sourceDepth++;
52879
+ }
52880
+ if (recursionFlags & 2) {
52881
+ targetStack[targetDepth] = target;
52882
+ targetDepth++;
52883
+ }
52757
52884
  var saveExpandingFlags = expandingFlags;
52758
- if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, depth))
52885
+ if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, sourceDepth))
52759
52886
  expandingFlags |= 1;
52760
- if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth))
52887
+ if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, targetDepth))
52761
52888
  expandingFlags |= 2;
52762
52889
  var originalHandler;
52763
52890
  var propagatingVarianceFlags = 0;
@@ -52774,7 +52901,8 @@ var ts;
52774
52901
  sourceIdStack: sourceStack.map(function (t) { return t.id; }),
52775
52902
  targetId: target.id,
52776
52903
  targetIdStack: targetStack.map(function (t) { return t.id; }),
52777
- depth: depth,
52904
+ depth: sourceDepth,
52905
+ targetDepth: targetDepth
52778
52906
  });
52779
52907
  }
52780
52908
  var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3;
@@ -52782,9 +52910,14 @@ var ts;
52782
52910
  outofbandVarianceMarkerHandler = originalHandler;
52783
52911
  }
52784
52912
  expandingFlags = saveExpandingFlags;
52785
- depth--;
52913
+ if (recursionFlags & 1) {
52914
+ sourceDepth--;
52915
+ }
52916
+ if (recursionFlags & 2) {
52917
+ targetDepth--;
52918
+ }
52786
52919
  if (result) {
52787
- if (result === -1 || depth === 0) {
52920
+ if (result === -1 || (sourceDepth === 0 && targetDepth === 0)) {
52788
52921
  if (result === -1 || result === 3) {
52789
52922
  for (var i = maybeStart; i < maybeCount; i++) {
52790
52923
  relation.set(maybeKeys[i], 1 | propagatingVarianceFlags);
@@ -52826,7 +52959,7 @@ var ts;
52826
52959
  if (constraints !== source.types) {
52827
52960
  source = getIntersectionType(constraints);
52828
52961
  if (!(source.flags & 2097152)) {
52829
- return isRelatedTo(source, target, false);
52962
+ return isRelatedTo(source, target, 1, false);
52830
52963
  }
52831
52964
  }
52832
52965
  }
@@ -52835,22 +52968,22 @@ var ts;
52835
52968
  var flags = source.flags & target.flags;
52836
52969
  if (relation === identityRelation && !(flags & 524288)) {
52837
52970
  if (flags & 4194304) {
52838
- return isRelatedTo(source.type, target.type, false);
52971
+ return isRelatedTo(source.type, target.type, 3, false);
52839
52972
  }
52840
52973
  var result_8 = 0;
52841
52974
  if (flags & 8388608) {
52842
- if (result_8 = isRelatedTo(source.objectType, target.objectType, false)) {
52843
- if (result_8 &= isRelatedTo(source.indexType, target.indexType, false)) {
52975
+ if (result_8 = isRelatedTo(source.objectType, target.objectType, 3, false)) {
52976
+ if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3, false)) {
52844
52977
  return result_8;
52845
52978
  }
52846
52979
  }
52847
52980
  }
52848
52981
  if (flags & 16777216) {
52849
52982
  if (source.root.isDistributive === target.root.isDistributive) {
52850
- if (result_8 = isRelatedTo(source.checkType, target.checkType, false)) {
52851
- if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, false)) {
52852
- if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), false)) {
52853
- if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), false)) {
52983
+ if (result_8 = isRelatedTo(source.checkType, target.checkType, 3, false)) {
52984
+ if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3, false)) {
52985
+ if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3, false)) {
52986
+ if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, false)) {
52854
52987
  return result_8;
52855
52988
  }
52856
52989
  }
@@ -52859,7 +52992,7 @@ var ts;
52859
52992
  }
52860
52993
  }
52861
52994
  if (flags & 33554432) {
52862
- return isRelatedTo(source.substitute, target.substitute, false);
52995
+ return isRelatedTo(source.substitute, target.substitute, 3, false);
52863
52996
  }
52864
52997
  return 0;
52865
52998
  }
@@ -52879,37 +53012,54 @@ var ts;
52879
53012
  return varianceResult;
52880
53013
  }
52881
53014
  }
52882
- if (isSingleElementGenericTupleType(source) && !source.target.readonly && (result = isRelatedTo(getTypeArguments(source)[0], target)) ||
52883
- isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0]))) {
53015
+ if (isSingleElementGenericTupleType(source) && !source.target.readonly && (result = isRelatedTo(getTypeArguments(source)[0], target, 1)) ||
53016
+ isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2))) {
52884
53017
  return result;
52885
53018
  }
52886
53019
  if (target.flags & 262144) {
52887
- if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) {
53020
+ if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3)) {
52888
53021
  if (!(getMappedTypeModifiers(source) & 4)) {
52889
53022
  var templateType = getTemplateTypeFromMappedType(source);
52890
53023
  var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source));
52891
- if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) {
53024
+ if (result = isRelatedTo(templateType, indexedAccessType, 3, reportErrors)) {
52892
53025
  return result;
52893
53026
  }
52894
53027
  }
52895
53028
  }
52896
53029
  }
52897
53030
  else if (target.flags & 4194304) {
52898
- var targetType = target.type;
53031
+ var targetType_1 = target.type;
52899
53032
  if (source.flags & 4194304) {
52900
- if (result = isRelatedTo(targetType, source.type, false)) {
53033
+ if (result = isRelatedTo(targetType_1, source.type, 3, false)) {
52901
53034
  return result;
52902
53035
  }
52903
53036
  }
52904
- if (isTupleType(targetType)) {
52905
- if (result = isRelatedTo(source, getKnownKeysOfTupleType(targetType), reportErrors)) {
53037
+ if (isTupleType(targetType_1)) {
53038
+ if (result = isRelatedTo(source, getKnownKeysOfTupleType(targetType_1), 2, reportErrors)) {
52906
53039
  return result;
52907
53040
  }
52908
53041
  }
52909
53042
  else {
52910
- var constraint = getSimplifiedTypeOrConstraint(targetType);
53043
+ var constraint = getSimplifiedTypeOrConstraint(targetType_1);
52911
53044
  if (constraint) {
52912
- if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1) {
53045
+ if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), 2, reportErrors) === -1) {
53046
+ return -1;
53047
+ }
53048
+ }
53049
+ else if (isGenericMappedType(targetType_1)) {
53050
+ var nameType_1 = getNameTypeFromMappedType(targetType_1);
53051
+ var constraintType = getConstraintTypeFromMappedType(targetType_1);
53052
+ var targetKeys = void 0;
53053
+ if (nameType_1 && isMappedTypeWithKeyofConstraintDeclaration(targetType_1)) {
53054
+ var modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType_1));
53055
+ var mappedKeys_1 = [];
53056
+ forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, false, function (t) { return void mappedKeys_1.push(instantiateType(nameType_1, appendTypeMapping(targetType_1.mapper, getTypeParameterFromMappedType(targetType_1), t))); });
53057
+ targetKeys = getUnionType(__spreadArray(__spreadArray([], mappedKeys_1, true), [nameType_1], false));
53058
+ }
53059
+ else {
53060
+ targetKeys = nameType_1 || constraintType;
53061
+ }
53062
+ if (isRelatedTo(source, targetKeys, 2, reportErrors) === -1) {
52913
53063
  return -1;
52914
53064
  }
52915
53065
  }
@@ -52917,8 +53067,8 @@ var ts;
52917
53067
  }
52918
53068
  else if (target.flags & 8388608) {
52919
53069
  if (source.flags & 8388608) {
52920
- if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {
52921
- result &= isRelatedTo(source.indexType, target.indexType, reportErrors);
53070
+ if (result = isRelatedTo(source.objectType, target.objectType, 3, reportErrors)) {
53071
+ result &= isRelatedTo(source.indexType, target.indexType, 3, reportErrors);
52922
53072
  }
52923
53073
  if (result) {
52924
53074
  resetErrorInfo(saveErrorInfo);
@@ -52940,7 +53090,7 @@ var ts;
52940
53090
  if (reportErrors && originalErrorInfo) {
52941
53091
  resetErrorInfo(saveErrorInfo);
52942
53092
  }
52943
- if (result = isRelatedTo(source, constraint, reportErrors)) {
53093
+ if (result = isRelatedTo(source, constraint, 2, reportErrors)) {
52944
53094
  return result;
52945
53095
  }
52946
53096
  if (reportErrors && originalErrorInfo && errorInfo) {
@@ -52969,11 +53119,12 @@ var ts;
52969
53119
  var filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : undefined;
52970
53120
  if (includeOptional
52971
53121
  ? !(filteredByApplicability.flags & 131072)
52972
- : isRelatedTo(targetKeys, sourceKeys)) {
53122
+ : isRelatedTo(targetKeys, sourceKeys, 3)) {
53123
+ var templateType_1 = getTemplateTypeFromMappedType(target);
52973
53124
  var typeParameter = getTypeParameterFromMappedType(target);
52974
- var nonNullComponent = extractTypesOfKind(templateType, ~98304);
53125
+ var nonNullComponent = extractTypesOfKind(templateType_1, ~98304);
52975
53126
  if (!keysRemapped && nonNullComponent.flags & 8388608 && nonNullComponent.indexType === typeParameter) {
52976
- if (result = isRelatedTo(source, nonNullComponent.objectType, reportErrors)) {
53127
+ if (result = isRelatedTo(source, nonNullComponent.objectType, 2, reportErrors)) {
52977
53128
  return result;
52978
53129
  }
52979
53130
  }
@@ -52984,7 +53135,7 @@ var ts;
52984
53135
  ? getIntersectionType([filteredByApplicability, typeParameter])
52985
53136
  : typeParameter;
52986
53137
  var indexedAccessType = getIndexedAccessType(source, indexingType);
52987
- if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {
53138
+ if (result = isRelatedTo(indexedAccessType, templateType_1, 3, reportErrors)) {
52988
53139
  return result;
52989
53140
  }
52990
53141
  }
@@ -53005,10 +53156,11 @@ var ts;
53005
53156
  distributionMapper = prependTypeMapping(checkVar, newParam, c.mapper);
53006
53157
  newParam.mapper = distributionMapper;
53007
53158
  }
53008
- var localResult = void 0;
53009
- if (skipTrue || (localResult = isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.trueType), distributionMapper) : getTrueTypeFromConditionalType(c), false))) {
53010
- if (!skipFalse) {
53011
- localResult = (localResult || 3) & isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.falseType), distributionMapper) : getFalseTypeFromConditionalType(c), false);
53159
+ var expanding = isDeeplyNestedType(target, targetStack, targetDepth);
53160
+ var localResult = expanding ? 3 : undefined;
53161
+ if (skipTrue || expanding || (localResult = isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.trueType), distributionMapper) : getTrueTypeFromConditionalType(c), 2, false))) {
53162
+ if (!skipFalse && !expanding) {
53163
+ localResult = (localResult || 3) & isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.falseType), distributionMapper) : getFalseTypeFromConditionalType(c), 2, false);
53012
53164
  }
53013
53165
  }
53014
53166
  if (localResult) {
@@ -53018,6 +53170,9 @@ var ts;
53018
53170
  }
53019
53171
  else if (target.flags & 134217728) {
53020
53172
  if (source.flags & 134217728) {
53173
+ if (relation === comparableRelation) {
53174
+ return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 : -1;
53175
+ }
53021
53176
  instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
53022
53177
  }
53023
53178
  var result_9 = inferTypesFromTemplateLiteralType(source, target);
@@ -53029,32 +53184,31 @@ var ts;
53029
53184
  if (!(source.flags & 8388608 && target.flags & 8388608)) {
53030
53185
  var constraint = getConstraintOfType(source);
53031
53186
  if (!constraint || (source.flags & 262144 && constraint.flags & 1)) {
53032
- if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864))) {
53187
+ if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
53033
53188
  resetErrorInfo(saveErrorInfo);
53034
53189
  return result;
53035
53190
  }
53036
53191
  }
53037
- else if (result = isRelatedTo(constraint, target, false, undefined, intersectionState)) {
53192
+ else if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
53038
53193
  resetErrorInfo(saveErrorInfo);
53039
53194
  return result;
53040
53195
  }
53041
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors && !(target.flags & source.flags & 262144), undefined, intersectionState)) {
53196
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(target.flags & source.flags & 262144), undefined, intersectionState)) {
53042
53197
  resetErrorInfo(saveErrorInfo);
53043
53198
  return result;
53044
53199
  }
53045
53200
  }
53046
53201
  }
53047
53202
  else if (source.flags & 4194304) {
53048
- if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
53203
+ if (result = isRelatedTo(keyofConstraintType, target, 1, reportErrors)) {
53049
53204
  resetErrorInfo(saveErrorInfo);
53050
53205
  return result;
53051
53206
  }
53052
53207
  }
53053
- else if (source.flags & 134217728) {
53208
+ else if (source.flags & 134217728 && !(target.flags & 524288)) {
53054
53209
  if (!(target.flags & 134217728)) {
53055
- var baseConstraint = getBaseConstraintOfType(source);
53056
- var constraint = baseConstraint && baseConstraint !== source ? baseConstraint : stringType;
53057
- if (result = isRelatedTo(constraint, target, reportErrors)) {
53210
+ var constraint = getBaseConstraintOfType(source);
53211
+ if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
53058
53212
  resetErrorInfo(saveErrorInfo);
53059
53213
  return result;
53060
53214
  }
@@ -53062,14 +53216,14 @@ var ts;
53062
53216
  }
53063
53217
  else if (source.flags & 268435456) {
53064
53218
  if (target.flags & 268435456 && source.symbol === target.symbol) {
53065
- if (result = isRelatedTo(source.type, target.type, reportErrors)) {
53219
+ if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
53066
53220
  resetErrorInfo(saveErrorInfo);
53067
53221
  return result;
53068
53222
  }
53069
53223
  }
53070
53224
  else {
53071
53225
  var constraint = getBaseConstraintOfType(source);
53072
- if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) {
53226
+ if (constraint && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
53073
53227
  resetErrorInfo(saveErrorInfo);
53074
53228
  return result;
53075
53229
  }
@@ -53077,40 +53231,44 @@ var ts;
53077
53231
  }
53078
53232
  else if (source.flags & 16777216) {
53079
53233
  if (target.flags & 16777216) {
53080
- var sourceParams = source.root.inferTypeParameters;
53081
- var sourceExtends = source.extendsType;
53082
- var mapper = void 0;
53083
- if (sourceParams) {
53084
- var ctx = createInferenceContext(sourceParams, undefined, 0, isRelatedTo);
53085
- inferTypes(ctx.inferences, target.extendsType, sourceExtends, 512 | 1024);
53086
- sourceExtends = instantiateType(sourceExtends, ctx.mapper);
53087
- mapper = ctx.mapper;
53088
- }
53089
- if (isTypeIdenticalTo(sourceExtends, target.extendsType) &&
53090
- (isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {
53091
- if (result = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source), mapper), getTrueTypeFromConditionalType(target), reportErrors)) {
53092
- result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors);
53234
+ if (!isDeeplyNestedType(source, sourceStack, sourceDepth) && !isDeeplyNestedType(target, targetStack, targetDepth)) {
53235
+ var sourceParams = source.root.inferTypeParameters;
53236
+ var sourceExtends = source.extendsType;
53237
+ var mapper = void 0;
53238
+ if (sourceParams) {
53239
+ var ctx = createInferenceContext(sourceParams, undefined, 0, isRelatedToWorker);
53240
+ inferTypes(ctx.inferences, target.extendsType, sourceExtends, 512 | 1024);
53241
+ sourceExtends = instantiateType(sourceExtends, ctx.mapper);
53242
+ mapper = ctx.mapper;
53093
53243
  }
53094
- if (result) {
53095
- resetErrorInfo(saveErrorInfo);
53096
- return result;
53244
+ if (isTypeIdenticalTo(sourceExtends, target.extendsType) &&
53245
+ (isRelatedTo(source.checkType, target.checkType, 3) || isRelatedTo(target.checkType, source.checkType, 3))) {
53246
+ if (result = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source), mapper), getTrueTypeFromConditionalType(target), 3, reportErrors)) {
53247
+ result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, reportErrors);
53248
+ }
53249
+ if (result) {
53250
+ resetErrorInfo(saveErrorInfo);
53251
+ return result;
53252
+ }
53097
53253
  }
53098
53254
  }
53099
53255
  }
53100
53256
  else {
53101
53257
  var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);
53102
53258
  if (distributiveConstraint) {
53103
- if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) {
53259
+ if (result = isRelatedTo(distributiveConstraint, target, 1, reportErrors)) {
53104
53260
  resetErrorInfo(saveErrorInfo);
53105
53261
  return result;
53106
53262
  }
53107
53263
  }
53108
53264
  }
53109
- var defaultConstraint = getDefaultConstraintOfConditionalType(source);
53110
- if (defaultConstraint) {
53111
- if (result = isRelatedTo(defaultConstraint, target, reportErrors)) {
53112
- resetErrorInfo(saveErrorInfo);
53113
- return result;
53265
+ if (!isDeeplyNestedType(source, sourceStack, sourceDepth)) {
53266
+ var defaultConstraint = getDefaultConstraintOfConditionalType(source);
53267
+ if (defaultConstraint) {
53268
+ if (result = isRelatedTo(defaultConstraint, target, 1, reportErrors)) {
53269
+ resetErrorInfo(saveErrorInfo);
53270
+ return result;
53271
+ }
53114
53272
  }
53115
53273
  }
53116
53274
  }
@@ -53147,7 +53305,7 @@ var ts;
53147
53305
  }
53148
53306
  else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
53149
53307
  if (relation !== identityRelation) {
53150
- return isRelatedTo(getIndexTypeOfType(source, numberType) || anyType, getIndexTypeOfType(target, numberType) || anyType, reportErrors);
53308
+ return isRelatedTo(getIndexTypeOfType(source, numberType) || anyType, getIndexTypeOfType(target, numberType) || anyType, 3, reportErrors);
53151
53309
  }
53152
53310
  else {
53153
53311
  return 0;
@@ -53230,10 +53388,10 @@ var ts;
53230
53388
  var result_11;
53231
53389
  var targetConstraint = getConstraintTypeFromMappedType(target);
53232
53390
  var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
53233
- if (result_11 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) {
53391
+ if (result_11 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors)) {
53234
53392
  var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
53235
53393
  if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
53236
- return result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);
53394
+ return result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3, reportErrors);
53237
53395
  }
53238
53396
  }
53239
53397
  }
@@ -53339,7 +53497,7 @@ var ts;
53339
53497
  var targetIsOptional = strictNullChecks && !!(ts.getCheckFlags(targetProp) & 48);
53340
53498
  var effectiveTarget = addOptionality(getNonMissingTypeOfSymbol(targetProp), false, targetIsOptional);
53341
53499
  var effectiveSource = getTypeOfSourceProperty(sourceProp);
53342
- return isRelatedTo(effectiveSource, effectiveTarget, reportErrors, undefined, intersectionState);
53500
+ return isRelatedTo(effectiveSource, effectiveTarget, 3, reportErrors, undefined, intersectionState);
53343
53501
  }
53344
53502
  function propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState, skipOptional) {
53345
53503
  var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp);
@@ -53509,7 +53667,7 @@ var ts;
53509
53667
  var targetType = targetTypeArguments[i];
53510
53668
  var targetCheckType = sourceFlags & 8 && targetFlags & 4 ? createArrayType(targetType) :
53511
53669
  removeMissingType(targetType, !!(targetFlags & 2));
53512
- var related = isRelatedTo(sourceType, targetCheckType, reportErrors, undefined, intersectionState);
53670
+ var related = isRelatedTo(sourceType, targetCheckType, 3, reportErrors, undefined, intersectionState);
53513
53671
  if (!related) {
53514
53672
  if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
53515
53673
  if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
@@ -53684,7 +53842,7 @@ var ts;
53684
53842
  return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source), typeToString(target)); };
53685
53843
  }
53686
53844
  function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) {
53687
- return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers));
53845
+ return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, makeFunctionTypeMapper(reportUnreliableMarkers));
53688
53846
  }
53689
53847
  function signaturesIdenticalTo(source, target, kind) {
53690
53848
  var sourceSignatures = getSignaturesOfType(source, kind);
@@ -53716,7 +53874,7 @@ var ts;
53716
53874
  var type = exactOptionalPropertyTypes || propType.flags & 32768 || keyType === numberType || !(prop.flags & 16777216)
53717
53875
  ? propType
53718
53876
  : getTypeWithFacts(propType, 524288);
53719
- var related = isRelatedTo(type, targetInfo.type, reportErrors);
53877
+ var related = isRelatedTo(type, targetInfo.type, 3, reportErrors);
53720
53878
  if (!related) {
53721
53879
  if (reportErrors) {
53722
53880
  reportError(ts.Diagnostics.Property_0_is_incompatible_with_index_signature, symbolToString(prop));
@@ -53739,7 +53897,7 @@ var ts;
53739
53897
  return result;
53740
53898
  }
53741
53899
  function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors) {
53742
- var related = isRelatedTo(sourceInfo.type, targetInfo.type, reportErrors);
53900
+ var related = isRelatedTo(sourceInfo.type, targetInfo.type, 3, reportErrors);
53743
53901
  if (!related && reportErrors) {
53744
53902
  if (sourceInfo.keyType === targetInfo.keyType) {
53745
53903
  reportError(ts.Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
@@ -53760,7 +53918,7 @@ var ts;
53760
53918
  for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
53761
53919
  var targetInfo = indexInfos_3[_i];
53762
53920
  var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 :
53763
- isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors) :
53921
+ isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3, reportErrors) :
53764
53922
  typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
53765
53923
  if (!related) {
53766
53924
  return 0;
@@ -53791,7 +53949,7 @@ var ts;
53791
53949
  for (var _i = 0, targetInfos_1 = targetInfos; _i < targetInfos_1.length; _i++) {
53792
53950
  var targetInfo = targetInfos_1[_i];
53793
53951
  var sourceInfo = getIndexInfoOfType(source, targetInfo.keyType);
53794
- if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
53952
+ if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, 3) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
53795
53953
  return 0;
53796
53954
  }
53797
53955
  }
@@ -55021,6 +55179,16 @@ var ts;
55021
55179
  function isFromInferenceBlockedSource(type) {
55022
55180
  return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag));
55023
55181
  }
55182
+ function templateLiteralTypesDefinitelyUnrelated(source, target) {
55183
+ var sourceStart = source.texts[0];
55184
+ var targetStart = target.texts[0];
55185
+ var sourceEnd = source.texts[source.texts.length - 1];
55186
+ var targetEnd = target.texts[target.texts.length - 1];
55187
+ var startLen = Math.min(sourceStart.length, targetStart.length);
55188
+ var endLen = Math.min(sourceEnd.length, targetEnd.length);
55189
+ return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) ||
55190
+ sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen);
55191
+ }
55024
55192
  function isValidBigIntString(s) {
55025
55193
  var scanner = ts.createScanner(99, false);
55026
55194
  var success = true;
@@ -55925,7 +56093,7 @@ var ts;
55925
56093
  if (prop.isDiscriminantProperty === undefined) {
55926
56094
  prop.isDiscriminantProperty =
55927
56095
  (prop.checkFlags & 192) === 192 &&
55928
- !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 & ~134217728);
56096
+ !isGenericType(getTypeOfSymbol(prop));
55929
56097
  }
55930
56098
  return !!prop.isDiscriminantProperty;
55931
56099
  }
@@ -56415,13 +56583,13 @@ var ts;
56415
56583
  return filterType(type, function (t) { return (t.flags & kind) !== 0; });
56416
56584
  }
56417
56585
  function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) {
56418
- if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 128) ||
56419
- isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 256) ||
56420
- isTypeSubsetOf(bigintType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 2048)) {
56586
+ if (maybeTypeOfKind(typeWithPrimitives, 4 | 134217728 | 8 | 64) &&
56587
+ maybeTypeOfKind(typeWithLiterals, 128 | 134217728 | 268435456 | 256 | 2048)) {
56421
56588
  return mapType(typeWithPrimitives, function (t) {
56422
- return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 128) :
56423
- t.flags & 8 ? extractTypesOfKind(typeWithLiterals, 8 | 256) :
56424
- t.flags & 64 ? extractTypesOfKind(typeWithLiterals, 64 | 2048) : t;
56589
+ return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 128 | 134217728 | 268435456) :
56590
+ isPatternLiteralType(t) && !maybeTypeOfKind(typeWithLiterals, 4 | 134217728 | 268435456) ? extractTypesOfKind(typeWithLiterals, 128) :
56591
+ t.flags & 8 ? extractTypesOfKind(typeWithLiterals, 8 | 256) :
56592
+ t.flags & 64 ? extractTypesOfKind(typeWithLiterals, 64 | 2048) : t;
56425
56593
  });
56426
56594
  }
56427
56595
  return typeWithPrimitives;
@@ -56492,10 +56660,10 @@ var ts;
56492
56660
  isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296);
56493
56661
  return isLengthPushOrUnshift || isElementAssignment;
56494
56662
  }
56495
- function isDeclarationWithExplicitTypeAnnotation(declaration) {
56496
- return (declaration.kind === 253 || declaration.kind === 163 ||
56497
- declaration.kind === 166 || declaration.kind === 165) &&
56498
- !!ts.getEffectiveTypeAnnotationNode(declaration);
56663
+ function isDeclarationWithExplicitTypeAnnotation(node) {
56664
+ return (ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertySignature(node) || ts.isParameter(node)) &&
56665
+ !!(ts.getEffectiveTypeAnnotationNode(node) ||
56666
+ ts.isInJSFile(node) && ts.hasInitializer(node) && node.initializer && ts.isFunctionExpressionOrArrowFunction(node.initializer) && ts.getEffectiveReturnTypeNode(node.initializer));
56499
56667
  }
56500
56668
  function getExplicitTypeOfSymbol(symbol, diagnostic) {
56501
56669
  if (symbol.flags & (16 | 8192 | 32 | 512)) {
@@ -57118,7 +57286,7 @@ var ts;
57118
57286
  var narrowedPropType = narrowType(propType);
57119
57287
  return filterType(type, function (t) {
57120
57288
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
57121
- return !(discriminantType.flags & 131072) && isTypeComparableTo(discriminantType, narrowedPropType);
57289
+ return !(narrowedPropType.flags & 131072) && isTypeComparableTo(narrowedPropType, discriminantType);
57122
57290
  });
57123
57291
  }
57124
57292
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -57512,16 +57680,7 @@ var ts;
57512
57680
  }
57513
57681
  function getNarrowedType(type, candidate, assumeTrue, isRelated) {
57514
57682
  if (!assumeTrue) {
57515
- return filterType(type, function (t) {
57516
- if (!isRelated(t, candidate)) {
57517
- return true;
57518
- }
57519
- var constraint = getBaseConstraintOfType(t);
57520
- if (constraint && constraint !== t) {
57521
- return !isRelated(constraint, candidate);
57522
- }
57523
- return false;
57524
- });
57683
+ return filterType(type, function (t) { return !isRelated(t, candidate); });
57525
57684
  }
57526
57685
  if (type.flags & 1048576) {
57527
57686
  var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });
@@ -58721,8 +58880,8 @@ var ts;
58721
58880
  return getTypeOfPropertyOfContextualType(type, getSymbolOfNode(element).escapedName);
58722
58881
  }
58723
58882
  if (element.name) {
58724
- var nameType_1 = getLiteralTypeFromPropertyName(element.name);
58725
- return mapType(type, function (t) { var _a; return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType_1)) === null || _a === void 0 ? void 0 : _a.type; }, true);
58883
+ var nameType_2 = getLiteralTypeFromPropertyName(element.name);
58884
+ return mapType(type, function (t) { var _a; return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType_2)) === null || _a === void 0 ? void 0 : _a.type; }, true);
58726
58885
  }
58727
58886
  }
58728
58887
  return undefined;
@@ -59112,11 +59271,8 @@ var ts;
59112
59271
  }
59113
59272
  return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount;
59114
59273
  }
59115
- function isFunctionExpressionOrArrowFunction(node) {
59116
- return node.kind === 212 || node.kind === 213;
59117
- }
59118
59274
  function getContextualSignatureForFunctionLikeDeclaration(node) {
59119
- return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
59275
+ return ts.isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
59120
59276
  ? getContextualSignature(node)
59121
59277
  : undefined;
59122
59278
  }
@@ -59922,6 +60078,13 @@ var ts;
59922
60078
  markAliasSymbolAsReferenced(jsxFactorySym);
59923
60079
  }
59924
60080
  }
60081
+ if (ts.isJsxOpeningFragment(node)) {
60082
+ var file = ts.getSourceFileOfNode(node);
60083
+ var localJsxNamespace = getLocalJsxNamespace(file);
60084
+ if (localJsxNamespace) {
60085
+ resolveName(jsxFactoryLocation, localJsxNamespace, 111551, jsxFactoryRefErr, localJsxNamespace, true);
60086
+ }
60087
+ }
59925
60088
  }
59926
60089
  if (isNodeOpeningLikeElement) {
59927
60090
  var jsxOpeningLikeNode = node;
@@ -61345,7 +61508,7 @@ var ts;
61345
61508
  return false;
61346
61509
  var symbol = resolveName(node.expression, node.expression.escapedText, 111551, undefined, undefined, false);
61347
61510
  var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration;
61348
- if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) {
61511
+ if (!decl || !ts.isParameter(decl) || !ts.isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) {
61349
61512
  return false;
61350
61513
  }
61351
61514
  var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(false);
@@ -62385,18 +62548,18 @@ var ts;
62385
62548
  if (moduleSymbol) {
62386
62549
  var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true, false);
62387
62550
  if (esModuleSymbol) {
62388
- return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol));
62551
+ return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
62389
62552
  }
62390
62553
  }
62391
62554
  return createPromiseReturnType(node, anyType);
62392
62555
  }
62393
- function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) {
62556
+ function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
62394
62557
  var _a;
62395
62558
  if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
62396
62559
  var synthType = type;
62397
62560
  if (!synthType.syntheticType) {
62398
62561
  var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
62399
- var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false);
62562
+ var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false, moduleSpecifier);
62400
62563
  if (hasSyntheticDefault) {
62401
62564
  var memberTable = ts.createSymbolTable();
62402
62565
  var newSymbol = createSymbol(2097152, "default");
@@ -62555,16 +62718,14 @@ var ts;
62555
62718
  }
62556
62719
  }
62557
62720
  function checkImportMetaProperty(node) {
62558
- if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) {
62559
- if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
62560
- if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
62561
- error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
62562
- }
62563
- }
62564
- else {
62565
- error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_system_node12_or_nodenext);
62721
+ if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
62722
+ if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
62723
+ error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
62566
62724
  }
62567
62725
  }
62726
+ else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
62727
+ error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);
62728
+ }
62568
62729
  var file = ts.getSourceFileOfNode(node);
62569
62730
  ts.Debug.assert(!!(file.flags & 2097152), "Containing file is missing import meta node flag.");
62570
62731
  return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
@@ -63390,9 +63551,9 @@ var ts;
63390
63551
  var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module);
63391
63552
  diagnostics.add(diagnostic);
63392
63553
  }
63393
- if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
63554
+ if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
63394
63555
  span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
63395
- var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher);
63556
+ var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher);
63396
63557
  diagnostics.add(diagnostic);
63397
63558
  }
63398
63559
  }
@@ -64671,7 +64832,7 @@ var ts;
64671
64832
  }
64672
64833
  }
64673
64834
  function checkParenthesizedExpression(node, checkMode) {
64674
- if (ts.isJSDocTypeAssertion(node)) {
64835
+ if (ts.hasJSDocNodes(node) && ts.isJSDocTypeAssertion(node)) {
64675
64836
  var type = ts.getJSDocTypeAssertionType(node);
64676
64837
  return checkAssertionWorker(type, type, node.expression, checkMode);
64677
64838
  }
@@ -66257,6 +66418,12 @@ var ts;
66257
66418
  }
66258
66419
  }
66259
66420
  }
66421
+ function checkJSDocAccessibilityModifiers(node) {
66422
+ var host = ts.getJSDocHost(node);
66423
+ if (host && ts.isPrivateIdentifierClassElementDeclaration(host)) {
66424
+ error(node, ts.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);
66425
+ }
66426
+ }
66260
66427
  function getIdentifierFromEntityNameExpression(node) {
66261
66428
  switch (node.kind) {
66262
66429
  case 79:
@@ -69076,11 +69243,15 @@ var ts;
69076
69243
  }
69077
69244
  function checkGrammarExportDeclaration(node) {
69078
69245
  var _a;
69079
- var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 272;
69080
- if (isTypeOnlyExportStar) {
69081
- grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type);
69246
+ if (node.isTypeOnly) {
69247
+ if (((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) === 272) {
69248
+ return checkGrammarNamedImportsOrExports(node.exportClause);
69249
+ }
69250
+ else {
69251
+ return grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type);
69252
+ }
69082
69253
  }
69083
- return !isTypeOnlyExportStar;
69254
+ return false;
69084
69255
  }
69085
69256
  function checkGrammarModuleElementContext(node, errorMessage) {
69086
69257
  var isInAppropriateContext = node.parent.kind === 303 || node.parent.kind === 261 || node.parent.kind === 260;
@@ -69374,6 +69545,10 @@ var ts;
69374
69545
  return;
69375
69546
  case 307:
69376
69547
  return checkSourceElement(node.type);
69548
+ case 331:
69549
+ case 333:
69550
+ case 332:
69551
+ return checkJSDocAccessibilityModifiers(node);
69377
69552
  case 193:
69378
69553
  return checkIndexedAccessType(node);
69379
69554
  case 194:
@@ -71817,8 +71992,8 @@ var ts;
71817
71992
  if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
71818
71993
  diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module));
71819
71994
  }
71820
- if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
71821
- diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
71995
+ if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
71996
+ diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
71822
71997
  }
71823
71998
  }
71824
71999
  }
@@ -72425,14 +72600,27 @@ var ts;
72425
72600
  return ambientModulesCache;
72426
72601
  }
72427
72602
  function checkGrammarImportClause(node) {
72603
+ var _a;
72428
72604
  if (node.isTypeOnly && node.name && node.namedBindings) {
72429
72605
  return grammarErrorOnNode(node, ts.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
72430
72606
  }
72607
+ if (node.isTypeOnly && ((_a = node.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 268) {
72608
+ return checkGrammarNamedImportsOrExports(node.namedBindings);
72609
+ }
72431
72610
  return false;
72432
72611
  }
72612
+ function checkGrammarNamedImportsOrExports(namedBindings) {
72613
+ return !!ts.forEach(namedBindings.elements, function (specifier) {
72614
+ if (specifier.isTypeOnly) {
72615
+ return grammarErrorOnFirstToken(specifier, specifier.kind === 269
72616
+ ? ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement
72617
+ : ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement);
72618
+ }
72619
+ });
72620
+ }
72433
72621
  function checkGrammarImportCallExpression(node) {
72434
72622
  if (moduleKind === ts.ModuleKind.ES2015) {
72435
- return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_umd_node12_or_nodenext);
72623
+ return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);
72436
72624
  }
72437
72625
  if (node.typeArguments) {
72438
72626
  return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_cannot_have_type_arguments);
@@ -73103,7 +73291,7 @@ var ts;
73103
73291
  return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
73104
73292
  case 269:
73105
73293
  ts.Debug.type(node);
73106
- return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
73294
+ return factory.updateImportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
73107
73295
  case 270:
73108
73296
  ts.Debug.type(node);
73109
73297
  return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression));
@@ -73115,7 +73303,7 @@ var ts;
73115
73303
  return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
73116
73304
  case 274:
73117
73305
  ts.Debug.type(node);
73118
- return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
73306
+ return factory.updateExportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
73119
73307
  case 276:
73120
73308
  ts.Debug.type(node);
73121
73309
  return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression));
@@ -73446,7 +73634,7 @@ var ts;
73446
73634
  }
73447
73635
  }
73448
73636
  ts.createSourceMapGenerator = createSourceMapGenerator;
73449
- var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)$/;
73637
+ var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/;
73450
73638
  var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
73451
73639
  function getLineInfo(text, lineStarts) {
73452
73640
  return {
@@ -75736,6 +75924,7 @@ var ts;
75736
75924
  || (isExternalModuleExport(node)
75737
75925
  && moduleKind !== ts.ModuleKind.ES2015
75738
75926
  && moduleKind !== ts.ModuleKind.ES2020
75927
+ && moduleKind !== ts.ModuleKind.ES2022
75739
75928
  && moduleKind !== ts.ModuleKind.ESNext
75740
75929
  && moduleKind !== ts.ModuleKind.System);
75741
75930
  }
@@ -75893,12 +76082,14 @@ var ts;
75893
76082
  return shouldEmitAliasDeclaration(node) ? node : undefined;
75894
76083
  }
75895
76084
  else {
76085
+ var allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 ||
76086
+ compilerOptions.importsNotUsedAsValues === 2);
75896
76087
  var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);
75897
- return ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
76088
+ return allowEmpty || ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
75898
76089
  }
75899
76090
  }
75900
76091
  function visitImportSpecifier(node) {
75901
- return shouldEmitAliasDeclaration(node) ? node : undefined;
76092
+ return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : undefined;
75902
76093
  }
75903
76094
  function visitExportAssignment(node) {
75904
76095
  return resolver.isValueAliasDeclaration(node)
@@ -75912,26 +76103,25 @@ var ts;
75912
76103
  if (!node.exportClause || ts.isNamespaceExport(node.exportClause)) {
75913
76104
  return node;
75914
76105
  }
75915
- if (!resolver.isValueAliasDeclaration(node)) {
75916
- return undefined;
75917
- }
75918
- var exportClause = ts.visitNode(node.exportClause, visitNamedExportBindings, ts.isNamedExportBindings);
76106
+ var allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 ||
76107
+ compilerOptions.importsNotUsedAsValues === 2);
76108
+ var exportClause = ts.visitNode(node.exportClause, function (bindings) { return visitNamedExportBindings(bindings, allowEmpty); }, ts.isNamedExportBindings);
75919
76109
  return exportClause
75920
76110
  ? factory.updateExportDeclaration(node, undefined, undefined, node.isTypeOnly, exportClause, node.moduleSpecifier, node.assertClause)
75921
76111
  : undefined;
75922
76112
  }
75923
- function visitNamedExports(node) {
76113
+ function visitNamedExports(node, allowEmpty) {
75924
76114
  var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);
75925
- return ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
76115
+ return allowEmpty || ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
75926
76116
  }
75927
76117
  function visitNamespaceExports(node) {
75928
76118
  return factory.updateNamespaceExport(node, ts.visitNode(node.name, visitor, ts.isIdentifier));
75929
76119
  }
75930
- function visitNamedExportBindings(node) {
75931
- return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node);
76120
+ function visitNamedExportBindings(node, allowEmpty) {
76121
+ return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty);
75932
76122
  }
75933
76123
  function visitExportSpecifier(node) {
75934
- return resolver.isValueAliasDeclaration(node) ? node : undefined;
76124
+ return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : undefined;
75935
76125
  }
75936
76126
  function shouldEmitImportEqualsDeclaration(node) {
75937
76127
  return shouldEmitAliasDeclaration(node)
@@ -78905,7 +79095,7 @@ var ts;
78905
79095
  currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
78906
79096
  }
78907
79097
  var generatedName = factory.createUniqueName("_" + name, 16 | 32 | 64);
78908
- var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName);
79098
+ var specifier = factory.createImportSpecifier(false, factory.createIdentifier(name), generatedName);
78909
79099
  generatedName.generatedImportReference = specifier;
78910
79100
  specifierSourceImports.set(name, specifier);
78911
79101
  return generatedName;
@@ -85223,7 +85413,7 @@ var ts;
85223
85413
  if (!importRequireStatements) {
85224
85414
  var createRequireName = factory.createUniqueName("_createRequire", 16 | 32);
85225
85415
  var importStatement = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamedImports([
85226
- factory.createImportSpecifier(factory.createIdentifier("createRequire"), createRequireName)
85416
+ factory.createImportSpecifier(false, factory.createIdentifier("createRequire"), createRequireName)
85227
85417
  ])), factory.createStringLiteral("module"));
85228
85418
  var requireHelperName = factory.createUniqueName("__require", 16 | 32);
85229
85419
  var requireStatement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
@@ -85248,7 +85438,7 @@ var ts;
85248
85438
  }
85249
85439
  function appendExportsOfImportEqualsDeclaration(statements, node) {
85250
85440
  if (ts.hasSyntacticModifier(node, 1)) {
85251
- statements = ts.append(statements, factory.createExportDeclaration(undefined, undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(undefined, ts.idText(node.name))])));
85441
+ statements = ts.append(statements, factory.createExportDeclaration(undefined, undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(false, undefined, ts.idText(node.name))])));
85252
85442
  }
85253
85443
  return statements;
85254
85444
  }
@@ -85266,7 +85456,7 @@ var ts;
85266
85456
  var synthName = factory.getGeneratedNameForNode(oldIdentifier);
85267
85457
  var importDecl = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier, node.assertClause);
85268
85458
  ts.setOriginalNode(importDecl, node.exportClause);
85269
- var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)]));
85459
+ var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(false, synthName, oldIdentifier)]));
85270
85460
  ts.setOriginalNode(exportDecl, node);
85271
85461
  return [importDecl, exportDecl];
85272
85462
  }
@@ -86680,7 +86870,7 @@ var ts;
86680
86870
  else {
86681
86871
  declarations.push(factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports(ts.map(exportMappings_1, function (_a) {
86682
86872
  var gen = _a[0], exp = _a[1];
86683
- return factory.createExportSpecifier(gen, exp);
86873
+ return factory.createExportSpecifier(false, gen, exp);
86684
86874
  }))));
86685
86875
  }
86686
86876
  var namespaceDecl = factory.createModuleDeclaration(undefined, ensureModifiers(input), input.name, factory.createModuleBlock(declarations), 16);
@@ -87017,6 +87207,7 @@ var ts;
87017
87207
  function getModuleTransformer(moduleKind) {
87018
87208
  switch (moduleKind) {
87019
87209
  case ts.ModuleKind.ESNext:
87210
+ case ts.ModuleKind.ES2022:
87020
87211
  case ts.ModuleKind.ES2020:
87021
87212
  case ts.ModuleKind.ES2015:
87022
87213
  return ts.transformECMAScriptModule;
@@ -90274,6 +90465,10 @@ var ts;
90274
90465
  writePunctuation("}");
90275
90466
  }
90276
90467
  function emitImportOrExportSpecifier(node) {
90468
+ if (node.isTypeOnly) {
90469
+ writeKeyword("type");
90470
+ writeSpace();
90471
+ }
90277
90472
  if (node.propertyName) {
90278
90473
  emit(node.propertyName);
90279
90474
  writeSpace();
@@ -98096,7 +98291,7 @@ var ts;
98096
98291
  }
98097
98292
  var nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
98098
98293
  var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
98099
- return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName;
98294
+ return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
98100
98295
  function tryDirectoryWithPackageJson(packageRootIndex) {
98101
98296
  var packageRootPath = path.substring(0, packageRootIndex);
98102
98297
  var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
@@ -101137,7 +101332,7 @@ var ts;
101137
101332
  }
101138
101333
  function printEasyHelp(sys, simpleOptions) {
101139
101334
  var colors = createColors(sys);
101140
- var output = __spreadArray([], getHelpHeader(sys), true);
101335
+ var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
101141
101336
  output.push(colors.bold(ts.getDiagnosticText(ts.Diagnostics.COMMON_COMMANDS)) + sys.newLine + sys.newLine);
101142
101337
  example("tsc", ts.Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
101143
101338
  example("tsc app.ts util.ts", ts.Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
@@ -101163,7 +101358,7 @@ var ts;
101163
101358
  }
101164
101359
  }
101165
101360
  function printAllHelp(sys, compilerOptions, buildOptions, watchOptions) {
101166
- var output = __spreadArray([], getHelpHeader(sys), true);
101361
+ var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
101167
101362
  output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, true, undefined, ts.formatMessage(undefined, ts.Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference")), true);
101168
101363
  output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.WATCH_OPTIONS), watchOptions, false, ts.getDiagnosticText(ts.Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon)), true);
101169
101364
  output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
@@ -101173,31 +101368,30 @@ var ts;
101173
101368
  }
101174
101369
  }
101175
101370
  function printBuildHelp(sys, buildOptions) {
101176
- var output = __spreadArray([], getHelpHeader(sys), true);
101371
+ var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
101177
101372
  output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
101178
101373
  for (var _i = 0, output_3 = output; _i < output_3.length; _i++) {
101179
101374
  var line = output_3[_i];
101180
101375
  sys.write(line);
101181
101376
  }
101182
101377
  }
101183
- function getHelpHeader(sys) {
101378
+ function getHeader(sys, message) {
101184
101379
  var _a, _b;
101185
101380
  var colors = createColors(sys);
101186
101381
  var header = [];
101187
- var tscExplanation = ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version);
101188
101382
  var terminalWidth = (_b = (_a = sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(sys)) !== null && _b !== void 0 ? _b : 0;
101189
101383
  ;
101190
101384
  var tsIconLength = 5;
101191
101385
  var tsIconFirstLine = colors.blueBackground(ts.padLeft("", tsIconLength));
101192
101386
  var tsIconSecondLine = colors.blueBackground(colors.brightWhite(ts.padLeft("TS ", tsIconLength)));
101193
- if (terminalWidth >= tscExplanation.length + tsIconLength) {
101387
+ if (terminalWidth >= message.length + tsIconLength) {
101194
101388
  var rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
101195
101389
  var leftAlign = rightAlign - tsIconLength;
101196
- header.push(ts.padRight(tscExplanation, leftAlign) + tsIconFirstLine + sys.newLine);
101390
+ header.push(ts.padRight(message, leftAlign) + tsIconFirstLine + sys.newLine);
101197
101391
  header.push(ts.padLeft("", leftAlign) + tsIconSecondLine + sys.newLine);
101198
101392
  }
101199
101393
  else {
101200
- header.push(tscExplanation + sys.newLine);
101394
+ header.push(message + sys.newLine);
101201
101395
  header.push(sys.newLine);
101202
101396
  }
101203
101397
  return header;
@@ -101612,7 +101806,13 @@ var ts;
101612
101806
  }
101613
101807
  else {
101614
101808
  sys.writeFile(file, ts.generateTSConfig(options, fileNames, sys.newLine));
101615
- reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Successfully_created_a_tsconfig_json_file));
101809
+ var output = __spreadArray([sys.newLine], getHeader(sys, "Created a new tsconfig.json with:"), true);
101810
+ output.push(ts.getCompilerOptionsDiffValue(options, sys.newLine) + sys.newLine + sys.newLine);
101811
+ output.push("You can learn more at https://aka.ms/tsconfig.json" + sys.newLine);
101812
+ for (var _i = 0, output_4 = output; _i < output_4.length; _i++) {
101813
+ var line = output_4[_i];
101814
+ sys.write(line);
101815
+ }
101616
101816
  }
101617
101817
  return;
101618
101818
  }