typescript 4.5.0-dev.20211024 → 4.5.0-dev.20211028

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.
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "{0} je definované jako přístupový objekt ve třídě {1}, ale v {2} se tady přepisuje jako vlastnost instance.",
1662
1662
  "_0_is_deprecated_6385": "{0} je zastaralé.",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "{0} není platnou metavlastností pro klíčové slovo {1}. Měli jste na mysli {2}?",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "{0} není povolen jako název parametru.",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "{0} se nepovoluje jako název deklarace proměnné.",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "Na {0} se přímo nebo nepřímo odkazuje ve vlastním základním výrazu.",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "Na {0} se odkazuje přímo nebo nepřímo v jeho vlastní anotaci typu.",
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "\"{0}\" ist als Accessor in der Klasse \"{1}\" definiert, wird aber hier in \"{2}\" als Instanzeigenschaft überschrieben.",
1662
1662
  "_0_is_deprecated_6385": "\"{0}\" ist veraltet.",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "\"{0}\" ist keine gültige Metaeigenschaft für das Schlüsselwort \"{1}\". Meinten Sie \"{2}\"?",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "\"{0}\" ist als Parametername nicht zulässig.",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "\"{0}\" ist als Name für Variablendeklarationen nicht zulässig.",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "Auf \"{0}\" wird direkt oder indirekt im eigenen Basisausdruck verwiesen.",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "Auf \"{0}\" wird direkt oder indirekt in der eigenen Typanmerkung verwiesen.",
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' est défini en tant qu'accesseur dans la classe '{1}', mais il est remplacé ici dans '{2}' en tant que propriété d'instance.",
1662
1662
  "_0_is_deprecated_6385": "'{0}' est déprécié.",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' n'est pas une métapropriété valide pour le mot clé '{1}'. Est-ce qu'il ne s'agit pas plutôt de '{2}' ?",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "'{0}' n'est pas autorisé comme nom de paramètre.",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' n'est pas autorisé en tant que nom de déclaration de variable.",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' est référencé directement ou indirectement dans sa propre expression de base.",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' est référencé directement ou indirectement dans sa propre annotation de type.",
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' è definito come funzione di accesso nella classe '{1}', ma in questo punto ne viene eseguito l'override in '{2}' come proprietà di istanza.",
1662
1662
  "_0_is_deprecated_6385": "'{0}' è deprecato.",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' non è una metaproprietà valida per la parola chiave '{1}'. Si intendeva '{2}'?",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "'{0}' non è un nome di parametro consentito.",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' non è consentito come nome di una dichiarazione di variabile.",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' viene usato come riferimento diretto o indiretto nella relativa espressione di base.",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' viene usato come riferimento diretto o indiretto nella relativa annotazione di tipo.",
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' はクラス '{1}' でアクセサーとして定義されていますが、ここではインスタンス プロパティとして '{2}' でオーバーライドされています。",
1662
1662
  "_0_is_deprecated_6385": "'{0}' は非推奨です。",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' はキーワード '{1}' に関するメタプロパティとして無効です。候補: '{2}'。",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "'{0}' はパラメーター名として使用できません。",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' は変数宣言の名前として使用できません。",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' はそれ自身のベース式内で直接または間接的に参照されます。",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' はそれ自身の型の注釈内で直接または間接的に参照されます。",
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}'은(는) '{1}' 클래스의 접근자로 정의되지만, '{2}'에서 인스턴스 속성으로 재정의됩니다.",
1662
1662
  "_0_is_deprecated_6385": "'{0}'은(는) 사용되지 않습니다.",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}'은(는) '{1}' 키워드에 대한 올바른 메타 속성이 아닙니다. '{2}'을(를) 사용하시겠습니까?",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "'{0}'은(는) 매개 변수 이름으로 사용할 수 없습니다.",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}'은(는) 변수 선언 이름으로 사용할 수 없습니다.",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}'은(는) 자체 기본 식에서 직간접적으로 참조됩니다.",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}'은(는) 자체 형식 주석에서 직간접적으로 참조됩니다.",
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "Element „{0}” jest zdefiniowany jako metoda dostępu w klasie „{1}”, ale jest przesłaniany tutaj w elemencie „{2}” jako właściwość wystąpienia.",
1662
1662
  "_0_is_deprecated_6385": "Element „{0}” jest przestarzały.",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "„{0}” nie jest prawidłową metawłaściwością słowa kluczowego „{1}”. Czy miał to być element „{2}”?",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "„{0}” jest niedozwolone jako nazwa parametru.",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "Element „{0}” nie jest dozwolony jako nazwa deklaracji zmiennej.",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "Element „{0}” jest przywoływany bezpośrednio lub pośrednio w jego własnym wyrażeniu podstawowym.",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "Element „{0}” jest przywoływany bezpośrednio lub pośrednio w jego własnej adnotacji typu.",
@@ -1661,6 +1661,7 @@
1661
1661
  "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}', '{1}' sınıfında bir erişimci olarak tanımlandı ancak burada, '{2}' içinde örnek özelliği olarak geçersiz kılındı.",
1662
1662
  "_0_is_deprecated_6385": "'{0}' kullanım dışı bırakıldı.",
1663
1663
  "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}', '{1}' anahtar sözcüğü için geçerli bir meta özellik değil. Bunu mu demek istediniz: '{2}'?",
1664
+ "_0_is_not_allowed_as_a_parameter_name_1390": "'{0}' öğesine parametre adı olarak izin verilmiyor.",
1664
1665
  "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' öğesinin değişken bildirim adı olarak kullanılmasına izin verilmiyor.",
1665
1666
  "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' öğesine kendi temel ifadesinde doğrudan veya dolaylı olarak başvuruluyor.",
1666
1667
  "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' öğesine kendi tür ek açıklamasında doğrudan veya dolaylı olarak başvuruluyor.",
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-dev.20211024";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20211028";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -6565,6 +6565,7 @@ var ts;
6565
6565
  This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
6566
6566
  This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
6567
6567
  A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
6568
+ JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
6568
6569
  You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
6569
6570
  You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
6570
6571
  import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
@@ -15532,6 +15533,8 @@ var ts;
15532
15533
  case ts.ModuleKind.ES2020:
15533
15534
  case ts.ModuleKind.ES2022:
15534
15535
  case ts.ModuleKind.ESNext:
15536
+ case ts.ModuleKind.Node12:
15537
+ case ts.ModuleKind.NodeNext:
15535
15538
  return true;
15536
15539
  default:
15537
15540
  return false;
@@ -40055,6 +40058,10 @@ var ts;
40055
40058
  function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
40056
40059
  return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
40057
40060
  }
40061
+ function isOnlyImportedAsDefault(usage) {
40062
+ var usageMode = getUsageModeForExpression(usage);
40063
+ return usageMode === ts.ModuleKind.ESNext && ts.endsWith(usage.text, ".json");
40064
+ }
40058
40065
  function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
40059
40066
  var usageMode = file && getUsageModeForExpression(usage);
40060
40067
  if (file && usageMode !== undefined) {
@@ -40093,8 +40100,9 @@ var ts;
40093
40100
  exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", node, dontResolveAlias);
40094
40101
  }
40095
40102
  var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
40103
+ var hasDefaultOnly = isOnlyImportedAsDefault(node.parent.moduleSpecifier);
40096
40104
  var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
40097
- if (!exportDefaultSymbol && !hasSyntheticDefault) {
40105
+ if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
40098
40106
  if (hasExportAssignmentSymbol(moduleSymbol)) {
40099
40107
  var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
40100
40108
  var exportEqualsSymbol = moduleSymbol.exports.get("export=");
@@ -40108,7 +40116,7 @@ var ts;
40108
40116
  reportNonDefaultExport(moduleSymbol, node);
40109
40117
  }
40110
40118
  }
40111
- else if (hasSyntheticDefault) {
40119
+ else if (hasSyntheticDefault || hasDefaultOnly) {
40112
40120
  var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
40113
40121
  markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, false);
40114
40122
  return resolved;
@@ -40212,7 +40220,7 @@ var ts;
40212
40220
  var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
40213
40221
  if (symbolFromModule === undefined && name.escapedText === "default") {
40214
40222
  var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
40215
- if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
40223
+ if (isOnlyImportedAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
40216
40224
  symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
40217
40225
  }
40218
40226
  }
@@ -40557,21 +40565,28 @@ var ts;
40557
40565
  var namespaceName = getFullyQualifiedName(namespace);
40558
40566
  var declarationName = ts.declarationNameToString(right);
40559
40567
  var suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace);
40560
- var exportedTypeSymbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, 788968));
40561
- var containingQualifiedName = ts.isQualifiedName(name) && getContainingQualifiedNameNode(name);
40562
- var canSuggestTypeof = containingQualifiedName && !ts.isTypeOfExpression(containingQualifiedName.parent) && tryGetQualifiedNameAsValue(containingQualifiedName);
40563
40568
  if (suggestionForNonexistentModule) {
40564
40569
  error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestionForNonexistentModule));
40570
+ return undefined;
40565
40571
  }
40566
- else if (canSuggestTypeof) {
40572
+ var containingQualifiedName = ts.isQualifiedName(name) && getContainingQualifiedNameNode(name);
40573
+ var canSuggestTypeof = globalObjectType
40574
+ && (meaning & 788968)
40575
+ && containingQualifiedName
40576
+ && !ts.isTypeOfExpression(containingQualifiedName.parent)
40577
+ && tryGetQualifiedNameAsValue(containingQualifiedName);
40578
+ if (canSuggestTypeof) {
40567
40579
  error(containingQualifiedName, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.entityNameToString(containingQualifiedName));
40580
+ return undefined;
40568
40581
  }
40569
- else if (meaning & 1920 && exportedTypeSymbol && ts.isQualifiedName(name.parent)) {
40570
- error(name.parent.right, ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, symbolToString(exportedTypeSymbol), ts.unescapeLeadingUnderscores(name.parent.right.escapedText));
40571
- }
40572
- else {
40573
- error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName);
40582
+ if (meaning & 1920 && ts.isQualifiedName(name.parent)) {
40583
+ var exportedTypeSymbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, 788968));
40584
+ if (exportedTypeSymbol) {
40585
+ error(name.parent.right, ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, symbolToString(exportedTypeSymbol), ts.unescapeLeadingUnderscores(name.parent.right.escapedText));
40586
+ return undefined;
40587
+ }
40574
40588
  }
40589
+ error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName);
40575
40590
  }
40576
40591
  return undefined;
40577
40592
  }
@@ -40693,6 +40708,9 @@ var ts;
40693
40708
  if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
40694
40709
  error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
40695
40710
  }
40711
+ if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json") {
40712
+ error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
40713
+ }
40696
40714
  }
40697
40715
  return getMergedSymbol(sourceFile.symbol);
40698
40716
  }
@@ -40812,39 +40830,47 @@ var ts;
40812
40830
  error(referencingLocation, ts.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
40813
40831
  return symbol;
40814
40832
  }
40815
- if (ts.getESModuleInterop(compilerOptions)) {
40816
- var referenceParent = referencingLocation.parent;
40817
- if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||
40818
- ts.isImportCall(referenceParent)) {
40819
- var type = getTypeOfSymbol(symbol);
40833
+ var referenceParent = referencingLocation.parent;
40834
+ if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||
40835
+ ts.isImportCall(referenceParent)) {
40836
+ var reference = ts.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier;
40837
+ var type = getTypeOfSymbol(symbol);
40838
+ var defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol, reference);
40839
+ if (defaultOnlyType) {
40840
+ return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
40841
+ }
40842
+ if (ts.getESModuleInterop(compilerOptions)) {
40820
40843
  var sigs = getSignaturesOfStructuredType(type, 0);
40821
40844
  if (!sigs || !sigs.length) {
40822
40845
  sigs = getSignaturesOfStructuredType(type, 1);
40823
40846
  }
40824
- if (sigs && sigs.length) {
40825
- var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, ts.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier);
40826
- var result = createSymbol(symbol.flags, symbol.escapedName);
40827
- result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
40828
- result.parent = symbol.parent;
40829
- result.target = symbol;
40830
- result.originatingImport = referenceParent;
40831
- if (symbol.valueDeclaration)
40832
- result.valueDeclaration = symbol.valueDeclaration;
40833
- if (symbol.constEnumOnlyModule)
40834
- result.constEnumOnlyModule = true;
40835
- if (symbol.members)
40836
- result.members = new ts.Map(symbol.members);
40837
- if (symbol.exports)
40838
- result.exports = new ts.Map(symbol.exports);
40839
- var resolvedModuleType = resolveStructuredTypeMembers(moduleType);
40840
- result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.indexInfos);
40841
- return result;
40847
+ if ((sigs && sigs.length) || getPropertyOfType(type, "default")) {
40848
+ var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
40849
+ return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
40842
40850
  }
40843
40851
  }
40844
40852
  }
40845
40853
  }
40846
40854
  return symbol;
40847
40855
  }
40856
+ function cloneTypeAsModuleType(symbol, moduleType, referenceParent) {
40857
+ var result = createSymbol(symbol.flags, symbol.escapedName);
40858
+ result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
40859
+ result.parent = symbol.parent;
40860
+ result.target = symbol;
40861
+ result.originatingImport = referenceParent;
40862
+ if (symbol.valueDeclaration)
40863
+ result.valueDeclaration = symbol.valueDeclaration;
40864
+ if (symbol.constEnumOnlyModule)
40865
+ result.constEnumOnlyModule = true;
40866
+ if (symbol.members)
40867
+ result.members = new ts.Map(symbol.members);
40868
+ if (symbol.exports)
40869
+ result.exports = new ts.Map(symbol.exports);
40870
+ var resolvedModuleType = resolveStructuredTypeMembers(moduleType);
40871
+ result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.indexInfos);
40872
+ return result;
40873
+ }
40848
40874
  function hasExportAssignmentSymbol(moduleSymbol) {
40849
40875
  return moduleSymbol.exports.get("export=") !== undefined;
40850
40876
  }
@@ -49226,7 +49252,7 @@ var ts;
49226
49252
  var _loop_16 = function () {
49227
49253
  i--;
49228
49254
  var t = types[i];
49229
- if (t.flags & 128 && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) {
49255
+ if (t.flags & 128 && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
49230
49256
  ts.orderedRemoveItemAt(types, i);
49231
49257
  }
49232
49258
  };
@@ -51178,7 +51204,8 @@ var ts;
51178
51204
  return mapTypeWithAlias(getReducedType(mappedTypeVariable), function (t) {
51179
51205
  if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && !isErrorType(t)) {
51180
51206
  if (!type.declaration.nameType) {
51181
- if (isArrayType(t)) {
51207
+ var constraint = void 0;
51208
+ if (isArrayType(t) || (t.flags & 1) && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
51182
51209
  return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
51183
51210
  }
51184
51211
  if (isGenericTupleType(t)) {
@@ -52551,10 +52578,11 @@ var ts;
52551
52578
  traceUnionsOrIntersectionsTooLarge(source, target);
52552
52579
  var result = 0;
52553
52580
  var saveErrorInfo = captureErrorCalculationState();
52554
- if (source.flags & 3145728 || target.flags & 3145728) {
52555
- result = getConstituentCount(source) * getConstituentCount(target) >= 4 ?
52556
- recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags) :
52557
- structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
52581
+ if ((source.flags & 1048576 || target.flags & 1048576) && getConstituentCount(source) * getConstituentCount(target) < 4) {
52582
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
52583
+ }
52584
+ else if (source.flags & 3145728 || target.flags & 3145728) {
52585
+ result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags);
52558
52586
  }
52559
52587
  if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
52560
52588
  if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
@@ -52934,19 +52962,19 @@ var ts;
52934
52962
  var maybeStart = maybeCount;
52935
52963
  maybeKeys[maybeCount] = id;
52936
52964
  maybeCount++;
52965
+ var saveExpandingFlags = expandingFlags;
52937
52966
  if (recursionFlags & 1) {
52938
52967
  sourceStack[sourceDepth] = source;
52939
52968
  sourceDepth++;
52969
+ if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, sourceDepth))
52970
+ expandingFlags |= 1;
52940
52971
  }
52941
52972
  if (recursionFlags & 2) {
52942
52973
  targetStack[targetDepth] = target;
52943
52974
  targetDepth++;
52975
+ if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, targetDepth))
52976
+ expandingFlags |= 2;
52944
52977
  }
52945
- var saveExpandingFlags = expandingFlags;
52946
- if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, sourceDepth))
52947
- expandingFlags |= 1;
52948
- if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, targetDepth))
52949
- expandingFlags |= 2;
52950
52978
  var originalHandler;
52951
52979
  var propagatingVarianceFlags = 0;
52952
52980
  if (outofbandVarianceMarkerHandler) {
@@ -52970,13 +52998,13 @@ var ts;
52970
52998
  if (outofbandVarianceMarkerHandler) {
52971
52999
  outofbandVarianceMarkerHandler = originalHandler;
52972
53000
  }
52973
- expandingFlags = saveExpandingFlags;
52974
53001
  if (recursionFlags & 1) {
52975
53002
  sourceDepth--;
52976
53003
  }
52977
53004
  if (recursionFlags & 2) {
52978
53005
  targetDepth--;
52979
53006
  }
53007
+ expandingFlags = saveExpandingFlags;
52980
53008
  if (result) {
52981
53009
  if (result === -1 || (sourceDepth === 0 && targetDepth === 0)) {
52982
53010
  if (result === -1 || result === 3) {
@@ -53231,8 +53259,7 @@ var ts;
53231
53259
  }
53232
53260
  instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
53233
53261
  }
53234
- var result_9 = inferTypesFromTemplateLiteralType(source, target);
53235
- if (result_9 && ts.every(result_9, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); })) {
53262
+ if (isTypeMatchedByTemplateLiteralType(source, target)) {
53236
53263
  return -1;
53237
53264
  }
53238
53265
  }
@@ -53392,9 +53419,9 @@ var ts;
53392
53419
  if (source.flags & (524288 | 2097152) && target.flags & 1048576) {
53393
53420
  var objectOnlyTarget = extractTypesOfKind(target, 524288 | 2097152 | 33554432);
53394
53421
  if (objectOnlyTarget.flags & 1048576) {
53395
- var result_10 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
53396
- if (result_10) {
53397
- return result_10;
53422
+ var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
53423
+ if (result_9) {
53424
+ return result_9;
53398
53425
  }
53399
53426
  }
53400
53427
  }
@@ -53441,13 +53468,13 @@ var ts;
53441
53468
  var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
53442
53469
  getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
53443
53470
  if (modifiersRelated) {
53444
- var result_11;
53471
+ var result_10;
53445
53472
  var targetConstraint = getConstraintTypeFromMappedType(target);
53446
53473
  var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
53447
- if (result_11 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors)) {
53474
+ if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors)) {
53448
53475
  var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
53449
53476
  if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
53450
- return result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3, reportErrors);
53477
+ return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3, reportErrors);
53451
53478
  }
53452
53479
  }
53453
53480
  }
@@ -55281,6 +55308,10 @@ var ts;
55281
55308
  inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
55282
55309
  undefined;
55283
55310
  }
55311
+ function isTypeMatchedByTemplateLiteralType(source, target) {
55312
+ var inferences = inferTypesFromTemplateLiteralType(source, target);
55313
+ return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
55314
+ }
55284
55315
  function getStringLikeTypeForType(type) {
55285
55316
  return type.flags & (1 | 402653316) ? type : getTemplateLiteralType(["", ""], [type]);
55286
55317
  }
@@ -56034,8 +56065,10 @@ var ts;
56034
56065
  function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
56035
56066
  switch (node.kind) {
56036
56067
  case 79:
56037
- var symbol = getResolvedSymbol(node);
56038
- return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
56068
+ if (!ts.isThisInTypeQuery(node)) {
56069
+ var symbol = getResolvedSymbol(node);
56070
+ return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
56071
+ }
56039
56072
  case 108:
56040
56073
  return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
56041
56074
  case 229:
@@ -56634,7 +56667,7 @@ var ts;
56634
56667
  mapType(type, mapper);
56635
56668
  }
56636
56669
  function getConstituentCount(type) {
56637
- return type.flags & 3145728 ? type.types.length : 1;
56670
+ return type.flags & 1048576 ? type.types.length : 1;
56638
56671
  }
56639
56672
  function extractTypesOfKind(type, kind) {
56640
56673
  return filterType(type, function (t) { return (t.flags & kind) !== 0; });
@@ -57920,7 +57953,7 @@ var ts;
57920
57953
  return parent.kind === 205 ||
57921
57954
  parent.kind === 207 && parent.expression === node ||
57922
57955
  parent.kind === 206 && parent.expression === node &&
57923
- !(isGenericTypeWithoutNullableConstraint(type) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
57956
+ !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
57924
57957
  }
57925
57958
  function isGenericTypeWithUnionConstraint(type) {
57926
57959
  return !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
@@ -62621,11 +62654,33 @@ var ts;
62621
62654
  if (moduleSymbol) {
62622
62655
  var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true, false);
62623
62656
  if (esModuleSymbol) {
62624
- return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
62657
+ return createPromiseReturnType(node, getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) ||
62658
+ getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
62625
62659
  }
62626
62660
  }
62627
62661
  return createPromiseReturnType(node, anyType);
62628
62662
  }
62663
+ function createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol) {
62664
+ var memberTable = ts.createSymbolTable();
62665
+ var newSymbol = createSymbol(2097152, "default");
62666
+ newSymbol.parent = originalSymbol;
62667
+ newSymbol.nameType = getStringLiteralType("default");
62668
+ newSymbol.target = resolveSymbol(symbol);
62669
+ memberTable.set("default", newSymbol);
62670
+ return createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
62671
+ }
62672
+ function getTypeWithSyntheticDefaultOnly(type, symbol, originalSymbol, moduleSpecifier) {
62673
+ var hasDefaultOnly = isOnlyImportedAsDefault(moduleSpecifier);
62674
+ if (hasDefaultOnly && type && !isErrorType(type)) {
62675
+ var synthType = type;
62676
+ if (!synthType.defaultOnlyType) {
62677
+ var type_4 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
62678
+ synthType.defaultOnlyType = type_4;
62679
+ }
62680
+ return synthType.defaultOnlyType;
62681
+ }
62682
+ return undefined;
62683
+ }
62629
62684
  function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
62630
62685
  var _a;
62631
62686
  if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
@@ -62634,14 +62689,8 @@ var ts;
62634
62689
  var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
62635
62690
  var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false, moduleSpecifier);
62636
62691
  if (hasSyntheticDefault) {
62637
- var memberTable = ts.createSymbolTable();
62638
- var newSymbol = createSymbol(2097152, "default");
62639
- newSymbol.parent = originalSymbol;
62640
- newSymbol.nameType = getStringLiteralType("default");
62641
- newSymbol.target = resolveSymbol(symbol);
62642
- memberTable.set("default", newSymbol);
62643
62692
  var anonymousSymbol = createSymbol(2048, "__type");
62644
- var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
62693
+ var defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
62645
62694
  anonymousSymbol.type = defaultContainingObject;
62646
62695
  synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
62647
62696
  }
@@ -63288,11 +63337,11 @@ var ts;
63288
63337
  var operandType = getTypeOfExpression(node.expression.expression);
63289
63338
  var witnesses = getSwitchClauseTypeOfWitnesses(node, false);
63290
63339
  var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true);
63291
- var type_4 = getBaseConstraintOfType(operandType) || operandType;
63292
- if (type_4.flags & 3) {
63340
+ var type_5 = getBaseConstraintOfType(operandType) || operandType;
63341
+ if (type_5.flags & 3) {
63293
63342
  return (556800 & notEqualFacts_1) === 556800;
63294
63343
  }
63295
- return !!(filterType(type_4, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072);
63344
+ return !!(filterType(type_5, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072);
63296
63345
  }
63297
63346
  var type = getTypeOfExpression(node.expression);
63298
63347
  if (!isLiteralType(type)) {
@@ -66049,12 +66098,12 @@ var ts;
66049
66098
  case 264:
66050
66099
  case 267:
66051
66100
  case 266:
66052
- var result_12 = 0;
66101
+ var result_11 = 0;
66053
66102
  var target = resolveAlias(getSymbolOfNode(d));
66054
66103
  ts.forEach(target.declarations, function (d) {
66055
- result_12 |= getDeclarationSpaces(d);
66104
+ result_11 |= getDeclarationSpaces(d);
66056
66105
  });
66057
- return result_12;
66106
+ return result_11;
66058
66107
  case 253:
66059
66108
  case 202:
66060
66109
  case 255:
@@ -79294,8 +79343,8 @@ var ts;
79294
79343
  function convertJsxChildrenToChildrenPropAssignment(children) {
79295
79344
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
79296
79345
  if (ts.length(nonWhitespaceChildren) === 1) {
79297
- var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
79298
- return result_13 && factory.createPropertyAssignment("children", result_13);
79346
+ var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
79347
+ return result_12 && factory.createPropertyAssignment("children", result_12);
79299
79348
  }
79300
79349
  var result = ts.mapDefined(children, transformJsxChildToExpression);
79301
79350
  return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
@@ -93799,15 +93848,15 @@ var ts;
93799
93848
  }
93800
93849
  var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
93801
93850
  if (oldSourceFile !== file && file.resolvedModules) {
93802
- var result_14 = [];
93851
+ var result_13 = [];
93803
93852
  var i = 0;
93804
93853
  for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
93805
93854
  var moduleName = moduleNames_1[_i];
93806
93855
  var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
93807
93856
  i++;
93808
- result_14.push(resolvedModule);
93857
+ result_13.push(resolvedModule);
93809
93858
  }
93810
- return result_14;
93859
+ return result_13;
93811
93860
  }
93812
93861
  var unknownModuleNames;
93813
93862
  var result;
@@ -95308,7 +95357,9 @@ var ts;
95308
95357
  }
95309
95358
  }
95310
95359
  if (options.resolveJsonModule) {
95311
- if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs) {
95360
+ if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
95361
+ ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 &&
95362
+ ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
95312
95363
  createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
95313
95364
  }
95314
95365
  else if (!ts.hasJsonModuleEmitEnabled(options)) {
@@ -98137,9 +98188,9 @@ var ts;
98137
98188
  var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
98138
98189
  var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
98139
98190
  if (!preferSymlinks) {
98140
- var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
98141
- if (result_15)
98142
- return result_15;
98191
+ var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
98192
+ if (result_14)
98193
+ return result_14;
98143
98194
  }
98144
98195
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
98145
98196
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -98158,10 +98209,10 @@ var ts;
98158
98209
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
98159
98210
  var symlinkDirectory = symlinkDirectories_1[_i];
98160
98211
  var option = ts.resolvePath(symlinkDirectory, relative);
98161
- var result_16 = cb(option, target === referenceRedirect);
98212
+ var result_15 = cb(option, target === referenceRedirect);
98162
98213
  shouldFilterIgnoredPaths = true;
98163
- if (result_16)
98164
- return result_16;
98214
+ if (result_15)
98215
+ return result_15;
98165
98216
  }
98166
98217
  });
98167
98218
  });