typescript 4.7.0-dev.20220330 → 4.7.0-dev.20220402

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.
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "Biblioteca a la que se hace referencia mediante \"{0}\" desde el archivo \"{1}\"",
880
880
  "Line_break_not_permitted_here_1142": "No se permite el salto de línea aquí.",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "No se permite usar un terminador de línea antes de una flecha.",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "Lista de sufijos de nombre de archivo para buscar al resolver un módulo.",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "Lista de carpetas de donde se deben incluir las definiciones de tipos.",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "Lista de carpetas raíz cuyo contenido combinado representa la estructura del proyecto en tiempo de ejecución.",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "Cargando \"{0}\" del directorio raíz \"{1}\", ubicación candidata: \"{2}\"",
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "Bibliothèque référencée via '{0}' à partir du fichier '{1}'",
880
880
  "Line_break_not_permitted_here_1142": "Saut de ligne non autorisé ici.",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "Marque de fin de ligne non autorisée devant une flèche.",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "Liste des suffixes de nom de fichier à rechercher lors de la résolution d’un module.",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "Liste des dossiers à partir desquels inclure les définitions de type.",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "Liste des dossiers racines dont le contenu combiné représente la structure du projet au moment de l'exécution.",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "Chargement de '{0}' à partir du répertoire racine '{1}', emplacement candidat '{2}'.",
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "Libreria a cui viene fatto riferimento tramite '{0}' dal file '{1}'",
880
880
  "Line_break_not_permitted_here_1142": "L'interruzione di riga non è consentita in questo punto.",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "Il terminatore di riga non è consentito prima di arrow.",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "Elenco dei suffissi dei nomi di file da cercare durante la risoluzione di un modulo.",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "Elenco di cartelle da cui includere le definizioni di tipo.",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "Elenco delle cartelle radice il cui contenuto combinato rappresenta la struttura del progetto in fase di esecuzione.",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "Verrà eseguito il caricamento di '{0}' dalla directory radice '{1}'. Percorso candidato: '{2}'.",
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "ファイル '{1}' から '{0}' を介してライブラリが参照されました",
880
880
  "Line_break_not_permitted_here_1142": "ここで改行することはできません。",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "行の終端記号をアローの前で使用することはできません。",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "モジュールを解決するときに検索するファイル名サフィックスのリスト。",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "含める型定義の元のフォルダーの一覧。",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "結合されたコンテンツがランタイムでのプロジェクトの構成を表すルート フォルダーの一覧。",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "ルート ディレクトリ '{1}' から '{0}' を読み込んでいます。候補の場所は '{2}' です。",
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "'{1}' 파일에서 '{0}'을(를) 통해 라이브러리가 참조되었습니다.",
880
880
  "Line_break_not_permitted_here_1142": "여기서는 줄 바꿈이 허용되지 않습니다.",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "줄 마침 표시는 화살표 앞에 사용할 수 없습니다.",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "모듈을 확인할 때 검색할 파일 이름 접미사 목록입니다.",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "포함할 형식 정의가 있는 폴더의 목록입니다.",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "런타임에 프로젝트의 구조를 나타내는 결합된 콘텐츠가 있는 루트 폴더의 목록입니다.",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "루트 디렉터리 '{1}'에서 '{0}'을(를) 로드하고 있습니다. 후보 위치: '{2}'.",
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "Biblioteka jest przywoływana za pośrednictwem elementu „{0}” z pliku „{1}”",
880
880
  "Line_break_not_permitted_here_1142": "Podział wiersza nie jest tutaj dozwolony.",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "Terminator wiersza nie jest dozwolony przed strzałką.",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "Lista sufiksów nazw plików do przeszukania podczas rozpoznawania modułu.",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "Lista folderów, z których mają być uwzględnione definicje typów.",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "Lista folderów głównych, których połączona zawartość reprezentuje strukturę projektu w czasie wykonywania.",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "Ładowanie elementu „{0}” z katalogu głównego „{1}”, lokalizacja kandydata: „{2}”.",
package/lib/protocol.d.ts CHANGED
@@ -1723,6 +1723,10 @@ declare namespace ts.server.protocol {
1723
1723
  * Human-readable description of the `source`.
1724
1724
  */
1725
1725
  sourceDisplay?: SymbolDisplayPart[];
1726
+ /**
1727
+ * Additional details for the label.
1728
+ */
1729
+ labelDetails?: CompletionEntryLabelDetails;
1726
1730
  /**
1727
1731
  * If true, this completion should be highlighted as recommended. There will only be one of these.
1728
1732
  * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
@@ -1751,6 +1755,20 @@ declare namespace ts.server.protocol {
1751
1755
  */
1752
1756
  data?: unknown;
1753
1757
  }
1758
+ interface CompletionEntryLabelDetails {
1759
+ /**
1760
+ * An optional string which is rendered less prominently directly after
1761
+ * {@link CompletionEntry.name name}, without any spacing. Should be
1762
+ * used for function signatures or type annotations.
1763
+ */
1764
+ detail?: string;
1765
+ /**
1766
+ * An optional string which is rendered less prominently after
1767
+ * {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified
1768
+ * names or file path.
1769
+ */
1770
+ description?: string;
1771
+ }
1754
1772
  /**
1755
1773
  * Additional completion entry details, available on demand
1756
1774
  */
@@ -2651,6 +2669,11 @@ declare namespace ts.server.protocol {
2651
2669
  * in addition to `const objectLiteral: T = { foo }`.
2652
2670
  */
2653
2671
  readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
2672
+ /**
2673
+ * Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
2674
+ * If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
2675
+ */
2676
+ readonly useLabelDetailsInCompletionEntries?: boolean;
2654
2677
  readonly allowIncompleteCompletions?: boolean;
2655
2678
  readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
2656
2679
  /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "Biblioteca referenciada via '{0}' do arquivo '{1}'",
880
880
  "Line_break_not_permitted_here_1142": "Quebra de linha não permitida aqui.",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "Terminador de linha não permitido antes de seta.",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "Lista de sufixos de nome de arquivo a serem pesquisadas ao resolver um módulo.",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "Lista de pastas das quais são incluídas as definições de tipo.",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "Listas das pastas raiz cujo conteúdo combinado representa a estrutura do projeto no tempo de execução.",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "Carregando '{0}' do diretório raiz '{1}', local candidato '{2}'.",
@@ -879,6 +879,7 @@
879
879
  "Library_referenced_via_0_from_file_1_1405": "Библиотека, на которую осуществляется ссылка с помощью \"{0}\" из файла \"{1}\"",
880
880
  "Line_break_not_permitted_here_1142": "Здесь запрещено использовать разрыв строки.",
881
881
  "Line_terminator_not_permitted_before_arrow_1200": "Перед стрелкой запрещен символ завершения строки.",
882
+ "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": "Список суффиксов имен файлов для поиска при разрешении модуля.",
882
883
  "List_of_folders_to_include_type_definitions_from_6161": "Список папок, определения типов из которых будут включены.",
883
884
  "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "Список корневых папок, объединенное содержимое которых представляет структуру проекта во время выполнения.",
884
885
  "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "Загружается \"{0}\" из корневого каталога \"{1}\"; расположение кандидата: \"{2}\".",
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.7";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220330";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220402";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -6680,6 +6680,7 @@ var ts;
6680
6680
  An_expanded_version_of_this_information_showing_all_possible_compiler_options: diag(6928, ts.DiagnosticCategory.Message, "An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928", "An expanded version of this information, showing all possible compiler options"),
6681
6681
  Compiles_the_current_project_with_additional_settings: diag(6929, ts.DiagnosticCategory.Message, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."),
6682
6682
  true_for_ES2022_and_above_including_ESNext: diag(6930, ts.DiagnosticCategory.Message, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."),
6683
+ List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, ts.DiagnosticCategory.Error, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."),
6683
6684
  Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."),
6684
6685
  Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."),
6685
6686
  Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."),
@@ -32051,6 +32052,18 @@ var ts;
32051
32052
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
32052
32053
  defaultValueDescription: false,
32053
32054
  },
32055
+ {
32056
+ name: "moduleSuffixes",
32057
+ type: "list",
32058
+ element: {
32059
+ name: "suffix",
32060
+ type: "string",
32061
+ },
32062
+ listPreserveFalsyValues: true,
32063
+ affectsModuleResolution: true,
32064
+ category: ts.Diagnostics.Modules,
32065
+ description: ts.Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module,
32066
+ },
32054
32067
  {
32055
32068
  name: "sourceRoot",
32056
32069
  type: "string",
@@ -33806,7 +33819,7 @@ var ts;
33806
33819
  if (option.type === "list") {
33807
33820
  var listOption_1 = option;
33808
33821
  if (listOption_1.element.isFilePath || !ts.isString(listOption_1.element.type)) {
33809
- return ts.filter(ts.map(value, function (v) { return normalizeOptionValue(listOption_1.element, basePath, v); }), function (v) { return !!v; });
33822
+ return ts.filter(ts.map(value, function (v) { return normalizeOptionValue(listOption_1.element, basePath, v); }), function (v) { return listOption_1.listPreserveFalsyValues ? true : !!v; });
33810
33823
  }
33811
33824
  return value;
33812
33825
  }
@@ -33847,7 +33860,7 @@ var ts;
33847
33860
  }
33848
33861
  }
33849
33862
  function convertJsonOptionOfListType(option, values, basePath, errors) {
33850
- return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; });
33863
+ return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return option.listPreserveFalsyValues ? true : !!v; });
33851
33864
  }
33852
33865
  var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/;
33853
33866
  var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
@@ -35180,6 +35193,15 @@ var ts;
35180
35193
  }
35181
35194
  }
35182
35195
  function tryFile(fileName, onlyRecordFailures, state) {
35196
+ var _a, _b;
35197
+ if (!((_a = state.compilerOptions.moduleSuffixes) === null || _a === void 0 ? void 0 : _a.length)) {
35198
+ return tryFileLookup(fileName, onlyRecordFailures, state);
35199
+ }
35200
+ var ext = (_b = ts.tryGetExtensionFromPath(fileName)) !== null && _b !== void 0 ? _b : "";
35201
+ var fileNameNoExtension = ext ? ts.removeExtension(fileName, ext) : fileName;
35202
+ return ts.forEach(state.compilerOptions.moduleSuffixes, function (suffix) { return tryFileLookup(fileNameNoExtension + suffix + ext, onlyRecordFailures, state); });
35203
+ }
35204
+ function tryFileLookup(fileName, onlyRecordFailures, state) {
35183
35205
  if (!onlyRecordFailures) {
35184
35206
  if (state.host.fileExists(fileName)) {
35185
35207
  if (state.traceEnabled) {
@@ -42909,7 +42931,13 @@ var ts;
42909
42931
  if (!ts.nodeIsSynthesized(node) && ts.getParseTreeNode(node) === node) {
42910
42932
  return node;
42911
42933
  }
42912
- return ts.setTextRange(ts.factory.cloneNode(ts.visitEachChild(node, deepCloneOrReuseNode, ts.nullTransformationContext)), node);
42934
+ return ts.setTextRange(ts.factory.cloneNode(ts.visitEachChild(node, deepCloneOrReuseNode, ts.nullTransformationContext, deepCloneOrReuseNodes)), node);
42935
+ }
42936
+ function deepCloneOrReuseNodes(nodes, visitor, test, start, count) {
42937
+ if (nodes && nodes.length === 0) {
42938
+ return ts.setTextRange(ts.factory.createNodeArray(undefined, nodes.hasTrailingComma), nodes);
42939
+ }
42940
+ return ts.visitNodes(nodes, visitor, test, start, count);
42913
42941
  }
42914
42942
  }
42915
42943
  function createTypeNodeFromObjectType(type) {
@@ -59154,7 +59182,7 @@ var ts;
59154
59182
  if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
59155
59183
  var contextualSignature = getContextualSignature(func);
59156
59184
  if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
59157
- var restType = getTypeOfSymbol(contextualSignature.parameters[0]);
59185
+ var restType = getReducedApparentType(getTypeOfSymbol(contextualSignature.parameters[0]));
59158
59186
  if (restType.flags & 1048576 && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
59159
59187
  var narrowedType = getFlowTypeOfReference(func, restType, restType, undefined, location.flowNode);
59160
59188
  var index = func.parameters.indexOf(declaration) - (ts.getThisParameter(func) ? 1 : 0);
@@ -60235,7 +60263,10 @@ var ts;
60235
60263
  return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
60236
60264
  }
60237
60265
  if (inferenceContext.returnMapper) {
60238
- return instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
60266
+ var type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
60267
+ return type.flags & 1048576 && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ?
60268
+ filterType(type, function (t) { return t !== regularFalseType && t !== regularTrueType; }) :
60269
+ type;
60239
60270
  }
60240
60271
  }
60241
60272
  }
@@ -91381,6 +91412,7 @@ var ts;
91381
91412
  writeLine();
91382
91413
  decreaseIndent();
91383
91414
  }
91415
+ emitList(node, node.members, 2);
91384
91416
  writePunctuation("}");
91385
91417
  }
91386
91418
  function emitLiteralType(node) {