Merge pull request #49007 from microsoft/bump-4.7-rc

Sync and bump release 4.7 to RC
This commit is contained in:
Daniel Rosenwasser
2022-05-06 17:21:01 -07:00
committed by GitHub
1698 changed files with 298579 additions and 267050 deletions
@@ -9,10 +9,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use node version 12
uses: actions/setup-node@v1
- name: Use node version 14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Configure Git, Run Tests, Update Baselines, Apply Fixes
+3 -3
View File
@@ -16,14 +16,14 @@ jobs:
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Use node version ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Remove existing TypeScript
+1
View File
@@ -11,6 +11,7 @@ jobs:
# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript'
steps:
- name: Checkout repository
@@ -14,6 +14,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript'
steps:
- name: Configure git
+3 -3
View File
@@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Use node version 12.x
uses: actions/setup-node@v1
- name: Use node version 14.x
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 14.x
- uses: actions/checkout@v2
with:
fetch-depth: 5
+4 -3
View File
@@ -11,13 +11,14 @@ on:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript'
steps:
- uses: actions/checkout@v2
- name: Use node version 12
uses: actions/setup-node@v1
- name: Use node version 14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Setup and publish nightly
run: |
@@ -11,10 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use node version 12
uses: actions/setup-node@v1
- name: Use node version 14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14
- name: Remove existing TypeScript
run: |
npm uninstall typescript --no-save
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
with:
fetch-depth: 5
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 14
+3 -3
View File
@@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Use node version 12.x
uses: actions/setup-node@v1
- name: Use node version 14.x
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 14.x
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.branch_name }}
+3 -3
View File
@@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Use node version 12.x
uses: actions/setup-node@v1
- name: Use node version 14.x
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 14.x
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
+27 -5
View File
@@ -8,16 +8,38 @@ on:
- cron: '0 8 * * *'
repository_dispatch:
types: run-twoslash-repros
issues:
types:
- labeled
workflow_dispatch:
inputs:
bisect_issue:
description: Triggers a bisect request on the given issue number instead of updating repros on all issues
required: false
type: string
jobs:
build:
run:
if: ${{ github.repository == 'microsoft/TypeScript' && !github.event.label && !github.event.inputs.bisect_issue }}
runs-on: ubuntu-latest
steps:
- name: Use node
uses: actions/setup-node@v1
- run: |
npm init -y
npm install --save typescript@next
uses: actions/setup-node@v3
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
with:
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
bisect:
if: ${{ github.event.label.name == 'Bisect Repro' || github.event.inputs.bisect_issue }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
with:
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
bisect: ${{ github.event.issue.number || github.event.inputs.bisect_issue }}
+3 -3
View File
@@ -9,10 +9,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use node version 12
uses: actions/setup-node@v1
- name: Use node version 14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Configure Git and Update LKG
+3 -2
View File
@@ -10,12 +10,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Configure git and update package-lock.json
+1
View File
@@ -169,6 +169,7 @@ TypeScript is authored by:
- Gabriel Isenberg
- Gabriela Araujo Britto
- Gabriela Britto
- Gao Sheng
- gb714us
- Gilad Peleg
- Godfrey Chan
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Přidat void k objektu Promise vyřešenému bez hodnoty",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Přidat void ke všem objektům Promise vyřešeným bez hodnoty",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Přidání souboru tsconfig.json vám pomůže uspořádat projekty, které obsahují jak soubory TypeScript, tak soubory JavaScript. Další informace najdete na adrese https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Všechny deklarace {0} musí mít identická omezení.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Všechny deklarace {0} musí mít stejné modifikátory.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Všechny deklarace {0} musí mít stejné parametry typu.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Všechny deklarace abstraktní metody musí jít po sobě.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Duplicitní signatura indexu pro typ {0}.",
"Duplicate_label_0_1114": "Duplicitní popisek {0}",
"Duplicate_property_0_2718": "Duplicitní vlastnost {0}.",
"Dynamic_import_cannot_have_type_arguments_1326": "Dynamický import nemůže mít argumenty typu.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Specifikátor dynamického importu musí být typu string, ale tady má typ {0}.",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Dynamické importy se podporují jen v případě, že příznak --module je nastavený na es2020, es2022, esnext, commonjs, amd, system, umd, node12 nebo nodenext.",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Dynamické importy můžou jako argumenty přijímat jenom specifikátor modulu a volitelný kontrolní výraz.",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Očekával se tento počet argumentů: {0}, ale byl přijat tento počet: {1}. Nezapomněli jste zahrnout void do argumentu typu pro objekt Promise?",
"Expected_0_type_arguments_but_got_1_2558": "Očekávaly se argumenty typu {0}, ale předaly se argumenty typu {1}.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Očekávané argumenty typu {0}; zadejte je se značkou @extends.",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "Očekával se 1 argument, ale bylo jich 0. New Promise() potřebuje pomocný parametr JSDoc k vytvoření resolve, který se dá volat bez argumentů.",
"Expected_at_least_0_arguments_but_got_1_2555": "Očekával se aspoň tento počet argumentů: {0}. Počet předaných argumentů: {1}",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "Očekávala se odpovídající ukončující značka JSX pro {0}.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Pro fragment JSX se očekávala odpovídající uzavírací značka.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Tato syntaxe vyžaduje importovanou pomocnou rutinu s názvem {1}, která v {0} neexistuje. Zvažte možnost upgradovat verzi {0}.",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Tato syntaxe vyžaduje importovanou pomocnou rutinu s názvem {1} a parametry {2}, která není kompatibilní s tou v {0}. Zvažte upgrade verze {0}.",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Tento parametr typu pravděpodobně potřebuje omezení „extends object“.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "Toto použití importu není platné. Volání import() se dají zapsat, ale musí mít závorky a nemůžou mít typové argumenty.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Výrazy await nejvyšší úrovně se povolují jen v případě, že možnost module je nastavená na es2022, esnext, system nebo nodenext a možnost target je nastavená na es2017 nebo vyšší.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklarace nejvyšší úrovně v souborech .d.ts musí začínat modifikátorem declare, nebo export.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Smyčky for await nejvyšší úrovně se povolují jen v případě, že možnost module je nastavená na es2022, esnext, system nebo nodenext a možnost target je nastavená na es2017 nebo vyšší.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "Typ {0} nepředstavuje platný návratový typ asynchronní funkce v ES5/ES3, protože neodkazuje na hodnotu konstruktoru kompatibilní s příslibem.",
"Type_0_is_not_an_array_type_2461": "Typ {0} není typ pole.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "Typ {0} není typem pole nebo řetězce.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "Typ {0} není typem pole ani typem řetězce. Pokud chcete povolit iteraci iterátorů, použijte možnost kompilátoru --downlevelIteration.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Typ {0} není typem pole nebo řetězce, nebo nemá metodu [Symbol.iterator](), která vrací iterátor.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Typ {0} není typem pole, nebo nemá metodu [Symbol.iterator](), která vrací iterátor.",
"Type_0_is_not_assignable_to_type_1_2322": "Typ {0} nejde přiřadit typu {1}.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "Seznam deklarací proměnných nemůže být prázdný.",
"Variable_declaration_not_allowed_at_this_location_1440": "Deklarace proměnné není v tomto umístění povolená.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Element variadic na pozici {0} ve zdroji neodpovídá elementu na pozici {1} v cíli.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Poznámky Variance se podporují pouze u aliasů typů pro typy objektů, funkcí, konstruktorů a mapování.",
"Version_0_6029": "Verze {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Další informace o tomto souboru si můžete přečíst na https://aka.ms/tsconfig",
"WATCH_OPTIONS_6918": "MOŽNOSTI SLEDOVÁNÍ",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "\"Void\" zu ohne Wert aufgelöstem Promise hinzufügen",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "\"Void\" allen ohne Wert aufgelösten Promises hinzufügen",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Das Hinzufügen einer \"tsconfig.json\"-Datei erleichtert die Organisation von Projekten, die sowohl TypeScript- als auch JavaScript-Dateien enthalten. Weitere Informationen finden Sie unter https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Alle Deklarationen von \"{0}\" müssen identische Modifizierer aufweisen.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Alle Deklarationen von \"{0}\" müssen identische Modifizierer aufweisen.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Alle Deklarationen von \"{0}\" müssen identische Typparameter aufweisen.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Alle Deklarationen einer abstrakten Methode müssen aufeinanderfolgend sein.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Doppelte Indexsignatur für Typ \"{0}\".",
"Duplicate_label_0_1114": "Doppelte Bezeichnung \"{0}\".",
"Duplicate_property_0_2718": "Doppelte Eigenschaft: {0}",
"Dynamic_import_cannot_have_type_arguments_1326": "Der dynamische Import kann keine Typargumente aufweisen.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Der Spezifizierer des dynamischen Imports muss den Typ \"string\" aufweisen, hier ist er jedoch vom Typ \"{0}\".",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Dynamische Importe werden nur unterstützt, wenn das \"--module\"-Kennzeichen auf \"es2020\", \"es2022\", \"esnext\", \"commonjs\", \"amd\", \"system\", \"umd\", \"node12\" oder \"nodenext\" festgelegt ist.",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Dynamische Importe können nur einen Modulspezifizierer und eine optionale Assertion als Argumente akzeptieren.",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Es wurden {0} Argumente erwartet, aber {1} erhalten. Sollte \"void\" in Ihr Typargument in \"Promise\" eingeschlossen werden?",
"Expected_0_type_arguments_but_got_1_2558": "{0} Typenargumente wurden erwartet, empfangen wurden aber {1}.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} Typargumente erwartet; geben Sie diese mit einem @extends-Tag an.",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "1 Argument erwartet, aber 0 erhalten. „new Promise()“ benötigt einen JSDoc-Hinweis, um einen „resolve“ zu erzeugen, der ohne Argumente aufgerufen werden kann.",
"Expected_at_least_0_arguments_but_got_1_2555": "Mindestens {0} Argumente wurden erwartet, empfangen wurden aber {1}.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "Das entsprechende schließende JSX-Tag wurde für \"{0}\" erwartet.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Für das JSX-Fragment wurde das entsprechende schließende Tag erwartet.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Diese Syntax erfordert ein importiertes Hilfsprogramm namens \"{1}\", das in \"{0}\" nicht vorhanden ist. Erwägen Sie ein Upgrade Ihrer Version von \"{0}\".",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Diese Syntax erfordert ein importiertes Hilfsprogramm mit dem Namen \"{1}\" mit {2} Parametern, die nicht mit der in \"{0}\" kompatibel ist. Erwägen Sie ein Upgrade Ihrer Version von \"{0}\".",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Dieser Typparameter benötigt wahrscheinlich eine „extends object“-Einschränkung.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "Diese Verwendung von „import“ ist ungültig. „import()“-Aufrufe können geschrieben werden, müssen jedoch Klammern aufweisen und dürfen keine Typargumente aufweisen.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "„Await“-Ausdrücke der obersten Ebene sind nur zulässig, wenn die Option \"module\" auf \"es2022\", \"esnext\", \"system\" oder \"nodenext\" festgelegt ist und die Option \"target\" auf \"es2017\" oder höher festgelegt ist.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklarationen der obersten Ebene in .d.ts-Dateien müssen entweder mit einem declare- oder einem export-Modifizierer beginnen.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "„For Await“-Schleifen der obersten Ebene sind nur zulässig, wenn die „module“-Option auf \"es2022\", \"esnext\", \"system\" oder \"nodenext\" festgelegt ist und die Option \"target\" auf \"es2017\" oder höher festgelegt ist.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "Der Typ \"{0}\" ist in ES5/ES3 kein gültiger Rückgabetyp einer asynchronen Funktion, weil er nicht auf einen Promise-kompatiblen Konstruktorwert verweist.",
"Type_0_is_not_an_array_type_2461": "Der Typ \"{0}\" ist kein Arraytyp.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "Der Typ \"{0}\" ist kein Array- oder Zeichenfolgentyp.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "Der Typ \"{0}\" ist kein Arraytyp oder Zeichenfolgentyp. Verwenden Sie die Compileroption \"--downlevelIteration\", um das Durchlaufen von Iteratoren zuzulassen.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Typ \"{0}\" ist kein Array-Typ oder Zeichenfolgentyp oder weist keine \"[Symbol.iterator]()\"-Methode auf, die einen Iterator zurückgibt.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Typ \"{0}\" ist kein Array-Typ oder weist keine \"[Symbol.iterator]()\"-Methode auf, die einen Iterator zurückgibt.",
"Type_0_is_not_assignable_to_type_1_2322": "Der Typ \"{0}\" kann dem Typ \"{1}\" nicht zugewiesen werden.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "Die Variablendeklarationsliste darf nicht leer sein.",
"Variable_declaration_not_allowed_at_this_location_1440": "Variablendeklaration ist an dieser Stelle nicht zulässig.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Das variadic-Element an Position {0} in der Quelle stimmt nicht mit dem Element an Position {1} im Ziel überein.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Abweichungsanmerkungen werden nur in Typaliasnamen für Objekt-, Funktions-, Konstruktor- und zugeordnete Typen unterstützt.",
"Version_0_6029": "Version {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Besuchen Sie https://aka.ms/tsconfig, um mehr über diese Datei zu erfahren.",
"WATCH_OPTIONS_6918": "ÜBERWACHUNGSOPTIONEN",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Agregar \"void\" a la instancia de Promise resuelta sin un valor",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Agregar \"void\" a todas las instancias de Promise resueltas sin un valor",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Agregar un archivo tsconfig.json ayuda a organizar los proyectos que contienen archivos TypeScript y JavaScript. Más información en https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Todas las declaraciones de \"{0}\" deben tener delimitaciones idénticas.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Todas las declaraciones de '{0}' deben tener modificadores idénticos.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Todas las declaraciones de '{0}' deben tener parámetros de tipo idénticos.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Todas las declaraciones de un método abstracto deben ser consecutivas.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Signatura de índice duplicada para el tipo \"{0}\".",
"Duplicate_label_0_1114": "Etiqueta \"{0}\" duplicada.",
"Duplicate_property_0_2718": "Propiedad \"{0}\" duplicada.",
"Dynamic_import_cannot_have_type_arguments_1326": "La importación dinámica no puede tener argumentos de tipo.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "El especificador de la importación dinámica debe ser de tipo \"string\", pero aquí tiene el tipo \"{0}\".",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Las importaciones dinámicas solo se admiten cuando la marca \"--módulo\" está establecida en \"es2020\", \"es2022\", \"esnext\", \"commonjs\", \"amd\", \"system\", \"umd\", \"node12\" o \"nodenext\".",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Las importaciones dinámicas solo pueden aceptar un especificador de módulo y una aserción opcional como argumentos",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Se esperaban {0} argumentos, pero se obtuvo un total de {1}. ¿Olvidó incluir \"void\" en el argumento de tipo para \"Promise\"?",
"Expected_0_type_arguments_but_got_1_2558": "Se esperaban {0} argumentos de tipo, pero se obtuvieron {1}.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Se esperaban argumentos de tipo {0}; proporciónelos con una etiqueta \"@extends\".",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "Se esperaba 1 argumento, pero se obtuvo 0. \"new Promise()\" necesita una pista de JSDoc para producir un \"resolve\" que pueda llamarse sin argumentos.",
"Expected_at_least_0_arguments_but_got_1_2555": "Se esperaban al menos {0} argumentos, pero se obtuvieron {1}.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "Se esperaba la etiqueta de cierre JSX correspondiente de '{0}'.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Se esperaba la etiqueta de cierre correspondiente para el fragmento de JSX.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Esta sintaxis requiere una aplicación auxiliar importada denominada \"{1}\", que no existe en \"{0}\". Considere la posibilidad de actualizar la versión de \"{0}\".",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Esta sintaxis requiere un asistente importado denominado \"{1}\" con parámetros de {2}, que no es compatible con el de \"{0}\". Pruebe a actualizar la versión de \"{0}\".",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Puede que este parámetro de tipo necesite una restricción “extends object”.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "Este uso de \"import\" no es válido. Se pueden escribir llamadas \"import()\", pero deben tener paréntesis y no pueden tener argumentos de tipo.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Las expresiones \"await\" de nivel superior solo se permiten cuando la opción \"módulo\" está establecida en \"es2022\", \"esnext\", \"system\" o \"nodenext\", y la opción \"destino\" está establecida en \"es2017\" o superior.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Las declaraciones de nivel superior de los archivos .d.ts deben comenzar con un modificador \"declare\" o \"export\".",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Los bucles \"for await\" de nivel superior solo se permiten cuando la opción \"módulo\" está establecida en \"es2022\", \"esnext\", \"system\" o \"nodenext\", y la opción \"destino\" está establecida en \"es2017\" o superior.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "El tipo '{0}' no es un tipo de valor devuelto válido para una función asincrónica en ES5/ES3, porque no hace referencia a un valor de constructor compatible con promesas.",
"Type_0_is_not_an_array_type_2461": "'{0}' no es un tipo de matriz.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "'{0}' no es un tipo de matriz o un tipo de cadena.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "\"{0}\" no es un tipo de matriz o de cadena. Use la opción del compilador \"--downlevelIteration\" para permitir la iteración de los iteradores.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "El tipo \"{0}\" no es un tipo de matriz o un tipo de cadena o no tiene un método \"[Symbol.iterator]()\" que devuelve un iterador.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "El tipo \"{0}\" no es un tipo de matriz o no tiene un método \"[Symbol.iterator]()\" que devuelve un iterador.",
"Type_0_is_not_assignable_to_type_1_2322": "El tipo '{0}' no se puede asignar al tipo '{1}'.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "La lista de declaraciones de variable no puede estar vacía.",
"Variable_declaration_not_allowed_at_this_location_1440": "No se permite una declaración de variable en esta ubicación.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "El elemento variádico en la posición {0} del origen no coincide con el elemento en la posición {1} del destino.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Las anotaciones de varianza solo se admiten en alias de tipo para los tipos objeto, función, constructor y asignado.",
"Version_0_6029": "Versión {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Visite https://aka.ms/tsconfig para obtener más información acerca de este archivo",
"WATCH_OPTIONS_6918": "OPCIONES DE INSPECCIÓN",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Ajouter 'void' à un Promise résolu sans valeur",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Ajouter 'void' à toutes les promesses résolues sans valeur",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "L'ajout d'un fichier tsconfig.json permet d'organiser les projets qui contiennent des fichiers TypeScript et JavaScript. En savoir plus sur https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Toutes les déclarations de « {0} » doivent avoir des contraintes identiques.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Toutes les déclarations de '{0}' doivent avoir des modificateurs identiques.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Toutes les déclarations de '{0}' doivent avoir des paramètres de type identiques.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Toutes les déclarations d'une méthode abstraite doivent être consécutives.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Doublon de signature dindex pour le type « {0} ».",
"Duplicate_label_0_1114": "Étiquette '{0}' en double.",
"Duplicate_property_0_2718": "Propriété dupliquée '{0}'.",
"Dynamic_import_cannot_have_type_arguments_1326": "L'importation dynamique ne peut pas avoir d'arguments de type.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Le spécificateur de l'importation dynamique doit être de type 'string', mais ici il est de type '{0}'.",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Les importations dynamiques sont prises en charge uniquement lorsque lindicateur « --module » est défini sur « es2020 », « es2022 », « esnext », « commonjs », « amd », « system », « umd », « node12 » ou « nodenext ».",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Les importations dynamiques peuvent accepter uniquement un spécificateur de module et une assertion facultative en tant quarguments.",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} arguments attendus, mais {1} reçus. Avez-vous oublié d'inclure 'void' dans votre argument de type pour 'Promise' ?",
"Expected_0_type_arguments_but_got_1_2558": "{0} arguments de type attendus, mais {1} reçus.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Arguments de type {0} attendus ; indiquez-les avec la balise '@extends'.",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "1 argument attendu, mais 0 obtenu. 'new Promise()' a besoin dun indicateur JSDoc pour produire un 'resolve' qui peut être appelé sans arguments.",
"Expected_at_least_0_arguments_but_got_1_2555": "Au moins {0} arguments attendus, mais {1} reçus.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "Balise de fermeture JSX correspondante attendue pour '{0}'.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Balise de fermeture correspondante attendue pour le fragment JSX.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Cette syntaxe nécessite une assistance importée nommée '{1}' mais qui n'existe pas dans '{0}'. Effectuez une mise à niveau de votre version de '{0}'.",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Cette syntaxe nécessite un composant d'assistance importé nommé '{1}' avec {2} paramètres, ce qui n'est pas compatible avec celui qui se trouve dans '{0}'. Effectuez une mise à niveau de votre version de '{0}'.",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Ce paramètre de type nécessite probablement une contrainte 'extends object'.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "Cette utilisation de « import » nest pas valide. Les appels « import() » peuvent être écrits, mais ils doivent avoir des parenthèses et ne peuvent pas avoir darguments de type.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Les expressions « await » de niveau supérieur sont autorisées uniquement lorsque loption « module » a la valeur « es2022 », « esnext », « system » ou « nodenext », et que loption « target » a la valeur « es2017 » ou une valeur supérieure.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Les déclarations de niveau supérieur dans les fichiers .d.ts doivent commencer par un modificateur 'declare' ou 'export'.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Les boucles « for await » de niveau supérieur sont autorisées uniquement lorsque loption « module » a la valeur « es2022 », « esnext », « system » ou « nodenext », et que loption « target » est définie sur « es2017 » ou une version ultérieure.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "Le type '{0}' n'est pas un type de retour de fonction async valide en ES5/ES3, car il ne référence pas une valeur de constructeur compatible avec une promesse.",
"Type_0_is_not_an_array_type_2461": "Le type '{0}' n'est pas un type de tableau.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "Le type '{0}' n'est pas un type de tableau ou un type de chaîne.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "Le type '{0}' nest pas un type de tableau ou un type string. Utilisez l'option du compilateur '--downlevelIteration' pour autoriser l'itération des itérateurs.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Le type '{0}' n'est pas un type tableau ou un type chaîne, ou n'a pas de méthode '[Symbol.iterator]()' qui retourne un itérateur.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Le type '{0}' n'est pas un type tableau ou n'a pas de méthode '[Symbol.iterator]()' qui retourne un itérateur.",
"Type_0_is_not_assignable_to_type_1_2322": "Impossible d'assigner le type '{0}' au type '{1}'.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "La liste des déclarations de variable ne peut pas être vide.",
"Variable_declaration_not_allowed_at_this_location_1440": "Déclaration de variable non autorisée à cet emplacement.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "L'élément variadique situé à la position {0} dans la source ne correspond pas à l'élément situé à la position {1} dans la cible.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Les annotations de variance sont uniquement prises en charge dans les alias de type pour les types objet, fonction, constructeur et mappé.",
"Version_0_6029": "Version {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Visitez https://aka.ms/tsconfig pour en savoir plus sur ce fichier",
"WATCH_OPTIONS_6918": "OPTIONS DOBSERVATION",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Aggiungere 'void' all'elemento Promise risolto senza un valore",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Aggiungere 'void' a tutti gli elementi Promise risolti senza un valore",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Aggiungere un file tsconfig.json per organizzare più facilmente progetti che contengono sia file TypeScript che JavaScript. Per altre informazioni, vedere https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Tutte le dichiarazioni di '{0}' devono avere vincoli identici.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Tutte le dichiarazioni di '{0}' devono contenere modificatori identici.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Tutte le dichiarazioni di '{0}' devono contenere parametri di tipo identici.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Tutte le dichiarazioni di un metodo astratto devono essere consecutive.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Firma dell'indice duplicata per il tipo '{0}'.",
"Duplicate_label_0_1114": "Etichetta '{0}' duplicata.",
"Duplicate_property_0_2718": "La proprietà '{0}' è duplicata.",
"Dynamic_import_cannot_have_type_arguments_1326": "Nell'importazione dinamica non possono essere presenti argomenti tipo.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "L'identificatore dell'importazione dinamica deve essere di tipo 'string', ma il tipo specificato qui è '{0}'.",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Le importazioni dinamiche sono supportate solo quando il flag '--module' è impostato su 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12' o 'nodenext'.",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Le importazioni dinamiche possono accettare come argomenti solo un identificatore di modulo e un'asserzione facoltativa",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Sono previsti {0} argomenti, ma ne sono stati ottenuti {1}. Si è dimenticato di includere 'void' nell'argomento di tipo per 'Promise'?",
"Expected_0_type_arguments_but_got_1_2558": "Sono previsti {0} argomenti tipo, ma ne sono stati ottenuti {1}.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Sono previsti {0} argomenti tipo. Per specificarli, usare un tag '@extends'.",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "Previsto 1 argomento, ma ottenuto 0. 'new Promise()' richiede un hint JSDoc per produrre un elemento 'resolve' che possa essere chiamato senza argomenti.",
"Expected_at_least_0_arguments_but_got_1_2555": "Sono previsti almeno {0} argomenti, ma ne sono stati ottenuti {1}.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "È previsto il tag di chiusura JSX corrispondente per '{0}'.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "È previsto il tag di chiusura corrispondente per il frammento JSX.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Con questa sintassi è richiesto un helper importato denominato '{1}', che non esiste in '{0}'. Provare ad aggiornare la versione di '{0}'.",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Con questa sintassi è richiesto un helper importato denominato '{1}' con {2} parametri, che non è compatibile con quello presente in '{0}'. Provare ad aggiornare la versione di '{0}'.",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Questo parametro di tipo richiede probabilmente un vincolo 'extends object'.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "Questo uso di 'import' non è valido. le chiamate 'import()' possono essere scritte, ma devono avere parentesi e non possono avere argomenti di tipo.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Le espressioni 'await' di primo livello sono consentite solo quando l'opzione 'module' è impostata su 'es2022', 'esnext', 'system' o 'nodenext' e l'opzione 'target' è impostata su 'es2017' o versione successiva.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Le dichiarazioni di primo livello nei file con estensione d.ts devono iniziare con un modificatore 'declare' o 'export'.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "I cicli 'for await' di primo livello sono consentiti solo quando l'opzione 'module' è impostata su 'es2022', 'esnext', 'system' o 'nodenext' e l'opzione 'target' è impostata su 'es2017' o versione successiva.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "Il tipo '{0}' non è un tipo restituito di funzione asincrona valido in ES5/ES3 perché non fa riferimento a un valore di costruttore compatibile con Promise.",
"Type_0_is_not_an_array_type_2461": "Il tipo '{0}' non è un tipo matrice.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "Il tipo '{0}' non è un tipo matrice o stringa.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "Il tipo '{0}' non è un tipo matrice o stringa. Usare l'opzione del compilatore '--downlevelIteration' per consentire l'iterazione degli iteratori.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Il tipo '{0}' non è un tipo matrice o stringa oppure non contiene un metodo '[Symbol.iterator]()' che restituisce un iteratore.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Il tipo '{0}' non è un tipo matrice oppure non contiene un metodo '[Symbol.iterator]()' che restituisce un iteratore.",
"Type_0_is_not_assignable_to_type_1_2322": "Il tipo '{0}' non è assegnabile al tipo '{1}'.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "L'elenco delle dichiarazioni di variabile non può essere vuoto.",
"Variable_declaration_not_allowed_at_this_location_1440": "Dichiarazione di variabile non consentita in questa posizione.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "L'elemento variadic alla posizione {0} nell'origine non corrisponde all'elemento alla posizione {1} nella destinazione.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Le annotazioni di varianza sono supportate solo negli alias di tipo per oggetti, funzioni, costruttori e tipi mappati.",
"Version_0_6029": "Versione {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Per altre informazioni su questo file, visitare https://aka.ms/tsconfig",
"WATCH_OPTIONS_6918": "OPZIONI DELL'ESPRESSIONE DI CONTROLLO",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "値なしで解決された Promise に 'void' を追加します",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "値なしで解決されたすべての Promise に 'void' を追加します",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "tsconfig.json ファイルを追加すると、TypeScript ファイルと JavaScript ファイルの両方を含むプロジェクトを整理できます。詳細については、https://aka.ms/tsconfig をご覧ください。",
"All_declarations_of_0_must_have_identical_constraints_2838": "'{0}' のすべての宣言には、同一の制約が必要です。",
"All_declarations_of_0_must_have_identical_modifiers_2687": "'{0}' のすべての宣言には、同一の修飾子が必要です。",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "'{0}' のすべての宣言には、同一の型パラメーターがある必要があります。",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "抽象メソッドの宣言はすべて連続している必要があります。",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "型 '{0}' のインデックス シグネチャが重複しています。",
"Duplicate_label_0_1114": "ラベル '{0}' が重複しています。",
"Duplicate_property_0_2718": "プロパティ '{0}' が重複しています。",
"Dynamic_import_cannot_have_type_arguments_1326": "動的インポートに型引数を指定することはできません。",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "動的インポートの指定子の型は 'string' である必要がありますが、ここでは型 '{0}' が指定されています。",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "動的インポートは、'--module' フラグが 'es2022'、'es2020'、'esnext'、'commonjs'、'amd'、'system'、'umd'、'node12'、'nodenext' に設定されている場合にのみサポートされます。",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "動的インポートでは、引数として、モジュール指定子とオプションのアサーションのみを受け取ることができます",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} 引数が必要ですが、{1} が指定されました。'Promise' の型引数に 'void' を含めましたか?",
"Expected_0_type_arguments_but_got_1_2558": "{0} 個の型引数が必要ですが、{1} 個が指定されました。",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} 型の引数が必要です。'@extends' タグで指定してください。",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "1 個の引数が必要ですが、0 個しかありませんでした。'new Promise()' では、引数なしで呼び出すことができる 'resolve' を生成するための JSDoc ヒントが必要です。",
"Expected_at_least_0_arguments_but_got_1_2555": "最低でも {0} 個の引数が必要ですが、{1} 個指定されました。",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "'{0}' の対応する JSX 終了タグが必要です。",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "JSX フラグメントの対応する終了タグが必要です。",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "この構文には、'{1}' という名前のインポートされたヘルパーが必要ですが、'{0}' には存在しません。'{0}' のバージョンのアップグレードを検討してください。",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "この構文には、{2} パラメーターを持つ '{1}' という名前のインポートされたヘルパーが必要ですが、'{0}' にあるものと互換性がありません。'{0}' のバージョンをアップグレードすることをご検討ください。",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "この型パラメーターには、`extends object` 制約が必要な可能性があります。",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "この 'import' の使用は無効です。'import()' 呼び出しは書き込むことができますが、かっこが必要であり、型引数を指定することはできません。",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "トップレベルの 'await' 式は、'module' オプションが 'es2022'、'esnext'、'system'、または 'nodenext' に設定されていて、'target' オプションが 'es2017' 以上に設定されている場合にのみ使用できます。",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts ファイルのトップレベルの宣言は、'declare' または 'export' 修飾子で始める必要があります。",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "トップレベルの 'for await' ループは、'module' オプションが 'es2022'、'esnext'、'system'、または 'nodenext' に設定されていて、'target' オプションが 'es2017' 以上に設定されている場合にのみ使用できます。",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "型 '{0}' は Promise と互換性のあるコンストラクター値を参照しないため、ES5/ES3 において有効な非同期関数の戻り値の型ではありません。",
"Type_0_is_not_an_array_type_2461": "型 '{0}' は配列型ではありません。",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "型 '{0}' は配列型でも文字列型でもありません。",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "型 '{0}' は配列型でも文字列型でもありません。反復子の反復を許可するには、コンパイラ オプション '--downlevelIteration' を使用します。",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "型 '{0}' は、配列型でも文字列型でもないか、反復子を返す '[Symbol.iterator]()' メソッドを持っていません。",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "型 '{0}' は、配列型ではないか、反復子を返す '[Symbol.iterator]()' メソッドを持っていません。",
"Type_0_is_not_assignable_to_type_1_2322": "型 '{0}' を型 '{1}' に割り当てることはできません。",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "変数宣言リストを空にすることはできません。",
"Variable_declaration_not_allowed_at_this_location_1440": "変数の宣言はこの場所では許可されていません。",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "ソースの位置 {0} にある可変個引数要素は、ターゲットの位置 {1} にある要素と一致しません。",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "分散注釈は、オブジェクト、関数、コンストラクター、およびマップされた型の型エイリアスでのみサポートされています。",
"Version_0_6029": "バージョン {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "このファイルの詳細については、https://aka.ms/tsconfig をご覧ください",
"WATCH_OPTIONS_6918": "ウォッチ オプション",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "값 없이 확인된 Promise에 'void' 추가",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "값 없이 확인된 모든 Promise에 'void' 추가",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "tsconfig.json 파일을 추가하면 TypeScript 파일과 JavaScript 파일이 둘 다 포함된 프로젝트를 정리하는 데 도움이 됩니다. 자세한 내용은 https://aka.ms/tsconfig를 참조하세요.",
"All_declarations_of_0_must_have_identical_constraints_2838": "'{0}'의 모든 선언에는 동일한 제약 조건이 있어야 합니다.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "'{0}'의 모든 선언에는 동일한 한정자가 있어야 합니다.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "'{0}'의 모든 선언에는 동일한 형식 매개 변수가 있어야 합니다.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "추상 메서드의 모든 선언은 연속적이어야 합니다.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "'{0}' 형식에 대한 인덱스 시그니처가 중복되었습니다.",
"Duplicate_label_0_1114": "중복된 레이블 '{0}'입니다.",
"Duplicate_property_0_2718": "중복 속성 '{0}'입니다.",
"Dynamic_import_cannot_have_type_arguments_1326": "동적 가져오기에는 형식 인수를 사용할 수 없습니다.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "동적 가져오기의 지정자는 'string' 형식이어야 하지만 여기에서 형식은 '{0}'입니다.",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "동적 가져오기는 '--module' 플래그가 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12' 또는 'nodenext'로 설정된 경우에만 지원됩니다.",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "동적 가져오기는 모듈 지정자와 선택적 어설션만 인수로 수락합니다.",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0}개 인수가 필요한데 {1}개를 가져왔습니다. 'void'를 'Promise'의 형식 인수에 포함하는 것을 잊으셨습니까?",
"Expected_0_type_arguments_but_got_1_2558": "{0}개의 형식 인수가 필요한데 {1}개를 가져왔습니다.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "'@extends' 태그로 제공하는 예상되는 {0} 형식 인수입니다.",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "1개의 인수가 필요하지만 0이 있습니다. 'new Promise()'는 인수 없이 호출할 수 있는 'resolve'를 생성하기 위해 JSDoc 힌트가 필요합니다.",
"Expected_at_least_0_arguments_but_got_1_2555": "최소 {0}개의 인수가 필요한데 {1}개를 가져왔습니다.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "'{0}'에 해당하는 JSX 닫는 태그가 필요합니다.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "JSX 조각에 닫는 태그가 필요합니다.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "이 구문에는 '{0}'에 없는 '{1}'(이)라는 가져온 도우미가 필요합니다. '{0}'의 버전을 업그레이드하는 것이 좋습니다.",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "이 구문에는 {2} 매개 변수가 포함된 '{1}'(이)라는 가져온 도우미가 필요하지만, 이 도우미는 '{0}'에 있는 도우미와 호환되지 않습니다. '{0}' 버전을 업그레이드하는 것이 좋습니다.",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "이 형식 매개 변수에는 `extends object` 제약 조건이 필요할 수 있습니다.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "이 '가져오기' 사용은 유효하지 않습니다. 'import()' 호출을 작성할 수 있지만 괄호가 있어야 하며 유형 인수를 가질 수 없습니다.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "최상위 'await' 식은 'module' 옵션이 'es2022', 'esnext', 'system' 또는 'nodenext'로 설정되고 'target' 옵션이 'es2017' 이상으로 설정된 경우에만 허용됩니다.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 파일의 최상위 수준 선언은 'declare' 또는 'export' 한정자로 시작해야 합니다.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "최상위 'for await' 루프는 'module' 옵션이 'es2022', 'esnext', 'system' 또는 'nodenext'로 설정되고 'target' 옵션이 'es2017' 이상으로 설정된 경우에만 허용됩니다.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "'{0}' 형식은 Promise 호환 생성자 값을 참조하지 않으므로 ES5/ES3에서 유효한 비동기 함수 반환 형식이 아닙니다.",
"Type_0_is_not_an_array_type_2461": "'{0}' 형식은 배열 형식이 아닙니다.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "'{0}' 형식은 배열 형식 또는 문자열 형식이 아닙니다.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "'{0}' 형식이 배열 형식 또는 문자열 형식이 아닙니다. 컴파일러 옵션 '-downlevelIteration'을 사용하여 반복기의 반복을 허용하세요.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "'{0}' 형식은 배열 형식 또는 문자열 형식이 아니거나, 반복기를 반환하는 '[Symbol.iterator]()' 메서드가 없습니다.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "'{0}' 형식은 배열 형식이 아니거나 반복기를 반환하는 '[Symbol.iterator]()' 메서드가 없습니다.",
"Type_0_is_not_assignable_to_type_1_2322": "'{0}' 형식은 '{1}' 형식에 할당할 수 없습니다.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "변수 선언 목록은 비워 둘 수 없습니다.",
"Variable_declaration_not_allowed_at_this_location_1440": "이 위치에서는 변수 선언을 사용할 수 없습니다.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "소스의 {0} 위치에 있는 가변 인자 요소가 대상의 {1} 위치에 있는 요소와 일치하지 않습니다.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "차이 주석은 개체, 함수, 생성자 및 매핑된 형식의 형식 별칭에서만 지원됩니다.",
"Version_0_6029": "버전 {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "이 파일에 대해 자세히 알아보려면 https://aka.ms/tsconfig을 방문하세요.",
"WATCH_OPTIONS_6918": "조사식 옵션",
+4 -4
View File
@@ -693,6 +693,7 @@ interface DataView {
* Gets the BigInt64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
@@ -700,6 +701,7 @@ interface DataView {
* Gets the BigUint64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
@@ -707,8 +709,7 @@ interface DataView {
* Stores a BigInt64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
@@ -716,8 +717,7 @@ interface DataView {
* Stores a BigUint64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
}
+1
View File
@@ -21,5 +21,6 @@ and limitations under the License.
/// <reference lib="es2021" />
/// <reference lib="es2022.array" />
/// <reference lib="es2022.error" />
/// <reference lib="es2022.intl" />
/// <reference lib="es2022.object" />
/// <reference lib="es2022.string" />
+111
View File
@@ -0,0 +1,111 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
declare namespace Intl {
/**
* An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
*/
interface SegmenterOptions {
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
localeMatcher?: "best fit" | "lookup" | undefined;
/** The type of input to be split */
granularity?: "grapheme" | "word" | "sentence" | undefined;
}
interface Segmenter {
/**
* Returns `Segments` object containing the segments of the input string, using the segmenter's locale and granularity.
*
* @param input - The text to be segmented as a `string`.
*
* @returns A new iterable Segments object containing the segments of the input string, using the segmenter's locale and granularity.
*/
segment(input: string): Segments;
resolvedOptions(): ResolvedSegmenterOptions;
}
interface ResolvedSegmenterOptions {
locale: string;
granularity: "grapheme" | "word" | "sentence";
}
interface Segments {
/**
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
*
* @param codeUnitIndex - A number specifying the index of the code unit in the original input string. If the value is omitted, it defaults to `0`.
*/
containing(codeUnitIndex?: number): SegmentData;
/** Returns an iterator to iterate over the segments. */
[Symbol.iterator](): IterableIterator<SegmentData>;
}
interface SegmentData {
/** A string containing the segment extracted from the original input string. */
segment: string;
/** The code unit index in the original input string at which the segment begins. */
index: number;
/** The complete input string that was segmented. */
input: string;
/**
* A boolean value only if granularity is "word"; otherwise, undefined.
* If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false.
*/
isWordLike?: boolean;
}
const Segmenter: {
prototype: Segmenter;
/**
* Creates a new `Intl.Segmenter` object.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
* with some or all options of `SegmenterOptions`.
*
* @returns [Intl.Segmenter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segments) object.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
*/
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter;
/**
* Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf#parameters).
* with some or all possible options.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf)
*/
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
};
}
+14 -14
View File
@@ -72,13 +72,13 @@ declare function decodeURIComponent(encodedURIComponent: string): string;
/**
* Encodes a text string as a valid Uniform Resource Identifier (URI)
* @param uri A value representing an encoded URI.
* @param uri A value representing an unencoded URI.
*/
declare function encodeURI(uri: string): string;
/**
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
* @param uriComponent A value representing an unencoded URI component.
*/
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
@@ -1689,6 +1689,7 @@ interface DataView {
* Gets the Float32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getFloat32(byteOffset: number, littleEndian?: boolean): number;
@@ -1696,6 +1697,7 @@ interface DataView {
* Gets the Float64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getFloat64(byteOffset: number, littleEndian?: boolean): number;
@@ -1710,12 +1712,14 @@ interface DataView {
* Gets the Int16 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getInt16(byteOffset: number, littleEndian?: boolean): number;
/**
* Gets the Int32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getInt32(byteOffset: number, littleEndian?: boolean): number;
@@ -1730,6 +1734,7 @@ interface DataView {
* Gets the Uint16 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getUint16(byteOffset: number, littleEndian?: boolean): number;
@@ -1737,6 +1742,7 @@ interface DataView {
* Gets the Uint32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getUint32(byteOffset: number, littleEndian?: boolean): number;
@@ -1744,8 +1750,7 @@ interface DataView {
* Stores an Float32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1753,8 +1758,7 @@ interface DataView {
* Stores an Float64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1769,8 +1773,7 @@ interface DataView {
* Stores an Int16 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1778,8 +1781,7 @@ interface DataView {
* Stores an Int32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1794,8 +1796,7 @@ interface DataView {
* Stores an Uint16 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1803,8 +1804,7 @@ interface DataView {
* Stores an Uint32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
}
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Dodaj argument „void” do obiektu Promise rozwiązanego bez wartości",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Dodaj argument „void” do wszystkich obiektów Promise rozwiązanych bez wartości",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Dodanie pliku tsconfig.json pomoże w organizowaniu projektów, które zawierają pliki TypeScript i JavaScript. Dowiedz się więcej: https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Wszystkie deklaracje elementu „{0}” muszą mieć identyczne ograniczenia.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Wszystkie deklaracje elementu „{0}” muszą mieć identyczne modyfikatory.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Wszystkie deklaracje „{0}” muszą mieć identyczne parametry typu.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Wszystkie deklaracje metody abstrakcyjnej muszą występować obok siebie.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Zduplikowana sygnatura indeksu dla typu „{0}”.",
"Duplicate_label_0_1114": "Zduplikowana etykieta „{0}”.",
"Duplicate_property_0_2718": "Zduplikowana właściwość „{0}”.",
"Dynamic_import_cannot_have_type_arguments_1326": "Dynamiczny import nie może mieć argumentów typu.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Specyfikator dynamicznego importowania musi być typu „string”, ale określono typ „{0}”.",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Dynamiczne importy są obsługiwane tylko wtedy, gdy flaga „--module” jest ustawiona na „es2020”, „es2022”, „esnext”, „commonjs”, „amd”, „system”, „umd”, „node12” lub „nodenext”.",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Importy dynamiczne akceptują jako argumenty tylko specyfikator modułu i asercję opcjonalną",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Oczekiwano {0} argumentów, ale otrzymano {1}. Czy zapomniano dołączyć wartość „void” w argumencie typu obiektu „Promise”?",
"Expected_0_type_arguments_but_got_1_2558": "Oczekiwane argumenty typu: {0}, uzyskano: {1}.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Oczekiwano argumentów typu {0}; podaj je z tagiem „@extends”.",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "Oczekiwano 1 argumentu, ale otrzymano 0. Element „new Promise()” wymaga wskazówki JSDoc, aby utworzyć element „resolve”, który można wywołać bez argumentów.",
"Expected_at_least_0_arguments_but_got_1_2555": "Oczekiwane argumenty: co najmniej {0}, uzyskano: {1}.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "Oczekiwano odpowiadającego tagu zamykającego kodu JSX dla elementu „{0}”.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Oczekiwano odpowiedniego tagu zamykającego dla fragmentu kodu JSX.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Ta składnia wymaga zaimportowanego pomocnika o nazwie „{1}”, który nie istnieje w elemencie „{0}”. Rozważ uaktualnienie wersji „{0}”.",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Ta składnia wymaga zaimportowanego pomocnika o nazwie „{1}” z parametrami {2}, który nie jest zgodny z tym w elemencie „{0}”. Rozważ uaktualnienie wersji elementu „{0}”.",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Ten parametr typu prawdopodobnie wymaga ograniczenia „extends object”.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "To użycie elementu „import” jest nieprawidłowe. Wywołania „import()” mogą być zapisywane, ale muszą mieć nawiasy i nie mogą mieć argumentów typu.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Wyrażenia „await” najwyższego poziomu są dozwolone tylko wtedy, gdy opcja „module” jest ustawiona na wartość „es2022”, „esnext”, „system” lub „nodenext”, a opcja „target” jest ustawiona na wartość „es2017” lub wyższą.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklaracje najwyższego poziomu w plikach .d.ts muszą rozpoczynać się od modyfikatora „declare” lub „export”.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Pętle najwyższego poziomu „for await” są dozwolone tylko wtedy, gdy opcja „module” jest ustawiona na wartość „es2022”, „esnext”, „system” lub „nodenext”, a opcja „target” jest ustawiona na wartość „es2017” lub wyższą.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "Typ „{0}” nie jest prawidłowym zwracanym typem funkcji asynchronicznej w wersji ES5/ES3, ponieważ nie odwołuje się do wartości konstruktora zgodnej z elementem Promise.",
"Type_0_is_not_an_array_type_2461": "Typ „{0}” nie jest typem tablicowym.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "Typ „{0}” nie jest typem tablicowym ani typem ciągu.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "Typ „{0}” nie jest typem tablicy ani typem ciągu. Użyj opcji kompilatora „--downlevelIteration”, aby zezwolić na iterowanie iteratorów.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Typ „{0}” nie jest typem tablicy ani ciągu lub nie ma metody „[Symbol.iterator]()” zwracającej iterator.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Typ „{0}” nie jest typem tablicy lub nie ma metody „[Symbol.iterator]()” zwracającej iterator.",
"Type_0_is_not_assignable_to_type_1_2322": "Typu „{0}” nie można przypisać do typu „{1}”.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "Lista deklaracji zmiennych nie może być pusta.",
"Variable_declaration_not_allowed_at_this_location_1440": "Deklaracja zmiennej jest niedozwolona w tej lokalizacji.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Element ze zmienną liczbą argumentów na pozycji {0} w źródle nie jest zgodny z elementem na pozycji {1} w lokalizacji docelowej.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Adnotacje wariancji są obsługiwane tylko w aliasach typów obiektów, funkcji, konstruktorów i mapowanych typów.",
"Version_0_6029": "Wersja {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Odwiedź https://aka.ms/tsconfig, aby dowiedzieć się więcej o tym pliku",
"WATCH_OPTIONS_6918": "OPCJE OBSERWACJI",
+5
View File
@@ -42,6 +42,7 @@ declare namespace ts.server.protocol {
Rename = "rename",
Saveto = "saveto",
SignatureHelp = "signatureHelp",
FindSourceDefinition = "findSourceDefinition",
Status = "status",
TypeDefinition = "typeDefinition",
ProjectInfo = "projectInfo",
@@ -661,6 +662,9 @@ declare namespace ts.server.protocol {
interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
readonly command: CommandTypes.DefinitionAndBoundSpan;
}
interface FindSourceDefinitionRequest extends FileLocationRequest {
readonly command: CommandTypes.FindSourceDefinition;
}
interface DefinitionAndBoundSpanResponse extends Response {
readonly body: DefinitionInfoAndBoundSpan;
}
@@ -1821,6 +1825,7 @@ declare namespace ts.server.protocol {
body?: CompletionInfo;
}
interface CompletionInfo {
readonly flags?: number;
readonly isGlobalCompletion: boolean;
readonly isMemberCompletion: boolean;
readonly isNewIdentifierLocation: boolean;
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Adicionar 'void' ao Promise resolvido sem um valor",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Adicionar 'void' a todos os Promises resolvidos sem um valor",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Adicionar um arquivo tsconfig.json ajudará a organizar projetos que contêm arquivos TypeScript e JavaScript. Saiba mais em https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Todas as declarações de '{0}' devem ter restrições idênticas.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Todas as declarações de '{0}' devem ter modificadores idênticos.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Todas as declarações de '{0}' devem ter parâmetros de tipo idênticos.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Todas as declarações de um método abstrato devem ser consecutivas.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Assinatura de índice duplicada para o tipo '{0}'.",
"Duplicate_label_0_1114": "Rótulo '{0}' duplicado.",
"Duplicate_property_0_2718": "Propriedade '{0}' duplicada.",
"Dynamic_import_cannot_have_type_arguments_1326": "A importação dinâmica não pode ter argumentos de tipo.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "O especificador da importação dinâmica deve ser do tipo 'string', mas aqui tem o tipo '{0}'.",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Importações dinâmicas são suportadas apenas quando o sinalizador '--module' é definido como 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', ou 'nodenext'.",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "As importações dinâmicas somente podem aceitar um especificador de módulo e uma asserção opcional como argumentos",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} argumentos eram esperados, mas foram obtidos {1}. Você esqueceu de incluir 'void' no argumento de tipo para 'Promise'?",
"Expected_0_type_arguments_but_got_1_2558": "{0} argumentos de tipo eram esperados, mas {1} foram obtidos.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Espera-se {0} argumentos de tipo; forneça esses recursos com uma marca \"@extends\".",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "Esperava 1 argumento, mas obteve 0. 'new Promise()' precisa de uma dica JSDoc para produzir um 'resolver' que pode ser chamado sem argumentos.",
"Expected_at_least_0_arguments_but_got_1_2555": "Pelo menos {0} argumentos eram esperados, mas {1} foram obtidos.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "Marca de fechamento de JSX correspondente esperada para '{0}'.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Marca de fechamento correspondente esperada para fragmento JSX.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Esta sintaxe requer um auxiliar importado chamado '{1}' que não existe em '{0}'. Considere atualizar sua versão do '{0}'.",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Esta sintaxe exige um auxiliar importado nomeado como '{1}' com parâmetros {2}, o que não é compatível com o que está em '{0}'. Considere atualizar sua versão do '{0}'.",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Esse parâmetro de tipo provavelmente precisa de uma restrição `extends object.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "Este uso de 'importar' é inválido. Chamadas 'import()' podem ser escritas, mas devem ter parênteses e não podem ter argumentos de tipo.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Expressões de nível superior 'await' são permitidas apenas quando a opção 'module' está definida como 'es2022', 'esnext', 'system' ou 'nodenext' e a opção 'target' está definida como 'es2017 ou superior.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "As declarações de nível superior em arquivos .d.ts devem começar com um modificador 'declare' ou 'export'.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Loops de nível superior 'for await' são permitidos apenas quando a opção 'module' está definida como 'es2022', 'esnext', 'system' ou 'nodenext' e a opção 'target' está definida como 'es2017' ou superior.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "O tipo '{0}' não é um tipo de retorno de função assíncrona válido no ES5/ES3, pois não se refere ao valor construtor compatível com a Promessa.",
"Type_0_is_not_an_array_type_2461": "O tipo '{0}' não é um tipo de matriz.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "O tipo '{0}' não é um tipo de matriz ou de cadeia de caracteres.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "O tipo '{0}' não é um tipo de matriz nem um tipo de cadeia de caracteres. Use a opção do compilador '--downlevelIteration' para permitir a iteração dos iteradores.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "O tipo '{0}' não é um tipo de matriz de um tipo de cadeia ou não tem um método '[Symbol.iterator]()' que retorna um iterador.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "O tipo '{0}' não é um tipo de matriz ou não tem um método '[Symbol.iterator]()' que retorna um iterador.",
"Type_0_is_not_assignable_to_type_1_2322": "O tipo '{0}' não pode ser atribuído ao tipo '{1}'.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "A lista de declaração de variável não pode estar vazia.",
"Variable_declaration_not_allowed_at_this_location_1440": "A declaração de variável não é permitida neste local.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "O elemento variádico na posição {0} na fonte não corresponde ao elemento na posição {1} no destino.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Só há suporte para anotações de variação em aliases do tipo para objetos, funções, construtores e tipos mapeados.",
"Version_0_6029": "Versão {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Visite https://aka.ms/tsconfig para ler mais sobre este arquivo",
"WATCH_OPTIONS_6918": "OPÇÕES DE INSPEÇÃO",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Добавить \"void\" в Promise (обещание), разрешенное без значения",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Добавить \"void\" во все Promise (обещания), разрешенные без значения",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Добавление файла tsconfig.json поможет организовать проекты, содержащие файлы TypeScript и JavaScript. Дополнительные сведения: https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Все объявления \"{0}\" должны иметь одинаковые ограничения.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Все объявления \"{0}\" должны иметь одинаковые модификаторы.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Все объявления \"{0}\" должны иметь одинаковые параметры типа.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Все объявления абстрактных методов должны быть последовательными.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "Повторяющаяся сигнатура индекса для типа \"{0}\".",
"Duplicate_label_0_1114": "Повторяющаяся метка \"{0}\".",
"Duplicate_property_0_2718": "Повторяющееся свойство \"{0}\".",
"Dynamic_import_cannot_have_type_arguments_1326": "При динамическом импорте не могут использоваться аргументы типов.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Описатель динамического импорта должен иметь тип \"string\", но имеет тип \"{0}\".",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Динамический импорт поддерживаются только в том случае, если флагу \"--module\" присвоено значение \"es2020\", \"es2022\", \"esnext\", \"commonjs\", \"amd\", \"system\", \"umd\", \"node12\" или \"nodenext\".",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Динамические импорты могут принять спецификатор модуля и необязательное утверждение в качестве аргументов",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Ожидаемое число аргументов — {0}, фактическое — {1}. Возможно, вы забыли указать void в аргументе типа в Promise?",
"Expected_0_type_arguments_but_got_1_2558": "Ожидались аргументы типа {0}, получены: {1}.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Ожидается аргументов типа: {0}. Укажите их с тегом \"@extends\".",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "Ожидался 1 аргумент, получено 0. Для \"new Promise()\" требуется указание JSDoc, чтобы создать \"resolve\" с возможностью вызова без аргументов.",
"Expected_at_least_0_arguments_but_got_1_2555": "Ожидалось аргументов не меньше: {0}, получено: {1}.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "Ожидался соответствующий закрывающий тег JSX для \"{0}\".",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Ожидался соответствующий закрывающий тег фрагмента JSX.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Для этого синтаксиса требуется импортированный вспомогательный объект с именем \"{1}\", который не существует в \"{0}\". Рекомендуется обновить версию \"{0}\".",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Для этого синтаксиса требуется импортированный вспомогательный объект с именем \"{1}\" и параметрами ({2}), который не совместим с объектом в \"{0}\". Попробуйте обновить версию \"{0}\".",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Возможно, для этого параметра типа требуется ограничение \"extends object\".",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "Недопустимое использование \"import\". Можно записывать вызовы \"import()\", но у них должны быть скобки и не должно быть аргументов типа.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Выражения \"await\" верхнего уровня допускаются, только если параметру \"module\" присвоено значение \"es2022\", \"esnext\", \"system\" или \"nodenext\", а параметру \"target\" присвоено значение \"es2017\" или выше.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Объявления верхнего уровня в файлах .d.ts должны начинаться с модификатора \"declare\" или \"export\".",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Циклы \"for await\" верхнего уровня допускаются, только если параметру \"module\" присвоено значение \"es2022\", \"esnext\", \"system\" или \"nodenext\", а параметру \"target\" присвоено значение \"es2017\" или выше.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "Тип \"{0}\" не является допустимым типом возвращаемого значения асинхронной функции в ES5/ES3, так как он не ссылается на значение конструктора, совместимое с Promise.",
"Type_0_is_not_an_array_type_2461": "Тип \"{0}\" не является типом массива.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "Тип \"{0}\" не является типом массива или типом строки.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "Тип \"{0}\" не является типом строки или массива. Используйте параметр компилятора \"--downlevelIteration\", чтобы разрешить итерацию итераторов.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "{0} не является типом массива или строки или в нем нет метода [Symbol.iterator](), который возвращает итератор.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "{0} не является типом массива или в нем нет метода [Symbol.iterator](), который возвращает итератор.",
"Type_0_is_not_assignable_to_type_1_2322": "Тип \"{0}\" не может быть назначен для типа \"{1}\".",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "Список объявлений переменной не может быть пустым.",
"Variable_declaration_not_allowed_at_this_location_1440": "Объявление переменной в этом расположении запрещено.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Элемент с переменным числом аргументов в позиции {0} в источнике не соответствует элементу в позиции {1} в целевом объекте.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Заметки вариантности поддерживаются только в псевдонимах типов для объектов, функций, конструкторов и сопоставленных типов.",
"Version_0_6029": "Версия {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Дополнительные сведения об этом файле: https://aka.ms/tsconfig.",
"WATCH_OPTIONS_6918": "ПАРАМЕТРЫ ПРОСМОТРА",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "Değer olmadan çözümlenen Promise'e 'void' ekle",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "Değer olmadan çözümlenen tüm Promise'lere 'void' ekle",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Bir tsconfig.json dosyası eklemek, hem TypeScript hem de JavaScript dosyaları içeren projeleri düzenlemenize yardımcı olur. Daha fazla bilgi edinmek için bkz. https://aka.ms/tsconfig.",
"All_declarations_of_0_must_have_identical_constraints_2838": "Tüm '{0}' bildirimleri, aynı kısıtlamalara sahip olmalıdır.",
"All_declarations_of_0_must_have_identical_modifiers_2687": "Tüm '{0}' bildirimleri aynı değiştiricilere sahip olmalıdır.",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "Tüm '{0}' bildirimleri özdeş tür parametrelerine sahip olmalıdır.",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Soyut metoda ait tüm bildirimler ardışık olmalıdır.",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "'{0}' türü için yinelenen dizin imzası var.",
"Duplicate_label_0_1114": "'{0}' etiketi yineleniyor.",
"Duplicate_property_0_2718": "'{0}' özelliğini yineleyin.",
"Dynamic_import_cannot_have_type_arguments_1326": "Dinamik içeri aktarma, tür bağımsız değişkenleri içeremez.",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Dinamik içeri aktarmanın tanımlayıcısı 'string' türünde olmalıdır, ancak buradaki tür: '{0}'.",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Dinamik içeri aktarmalar yalnızca '--module' bayrağı 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12' veya 'nodenext' olarak ayarlandığında desteklenir.",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Dinamik içeri aktarmalar, bağımsız değişken olarak yalnızca bir modül tanımlayıcısı ve isteğe bağlı bir onay kabul edebilir",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} bağımsız değişken bekleniyordu ancak {1} bağımsız değişken alındı. Tür bağımsız değişkeninizdeki 'void' operatörünü 'Promise'e eklemeyi mi unuttunuz?",
"Expected_0_type_arguments_but_got_1_2558": "{0} tür bağımsız değişkeni bekleniyordu ancak {1} alındı.",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} tür bağımsız değişkeni bekleniyordu; bunları bir '@extends' etiketiyle sağlayın.",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "1 bağımsız değişken bekleniyordu ancak 0 bağımsız değişken var. Bağımsız değişkenler olmadan çağrılabilen bir 'resolve' oluşturmak için 'new Promise()' çağrısında bir JSDoc ipucu bulunması gerekir.",
"Expected_at_least_0_arguments_but_got_1_2555": "En az {0} bağımsız değişken bekleniyordu ancak {1} alındı.",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "'{0}' için ilgili JSX kapanış etiketi bekleniyor.",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "JSX parçasına karşılık gelen kapanış etiketi bekleniyordu.",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Bu söz dizimi, '{0}' içinde bulunmayan '{1}' adlı içeri aktarılmış bir yardımcı gerektirir. '{0}' sürümünüzü yükseltmeyi deneyin.",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Bu söz dizimi, '{0}' içindeki yardımcı ile uyumlu olmayan, {2} parametreye sahip '{1}' adlı içeri aktarılan yardımcıyı gerektiriyor. '{0}' sürümünüzü yükseltmeyi düşünün.",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Bu tür parametresi için bir `nesneyi genişletir` kısıtlaması gerekiyor olabilir.",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "'import' çağrısının bu kullanımı geçersiz. 'import()' çağrıları yazılabilir ancak ayraç içermeleri gerekir ve tür bağımsız değişkenleri içeremezler.",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Üst düzey 'await' ifadelerine yalnızca 'module' seçeneği 'es2022', 'esnext', 'system' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üzeri olarak ayarlandığında izin verilir.",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts dosyalarındaki üst düzey bildirimler bir 'declare' veya 'export' değiştiricisi ile başlamalıdır.",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Üst düzey 'for await' döngülerine yalnızca 'module' seçeneği 'es2022', 'esnext', 'system' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üzeri olarak ayarlandığında izin verilir.",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "ES5/ES3 içindeki '{0}' türü, Promise ile uyumlu bir oluşturucu değerine başvurmadığından geçerli bir zaman uyumsuz işlev dönüş türü değil.",
"Type_0_is_not_an_array_type_2461": "'{0}' türü bir dizi türü değil.",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "'{0}' türü, bir dizi türü veya dize türü değil.",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "'{0}' türü bir dizi türü veya bir dize türü değil. Yineleyicilerin yinelenmesine izin vermek için '--downlevelIteration' derleyici seçeneğini kullanın.",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "'{0}' türü, bir dizi türü veya dize türü değil ya da bir yineleyici döndüren '[Symbol.iterator]()' metoduna sahip değil.",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "'{0}' türü, bir dizi türü değil ya da bir yineleyici döndüren '[Symbol.iterator]()' metoduna sahip değil.",
"Type_0_is_not_assignable_to_type_1_2322": "'{0}' türü, '{1}' türüne atanamaz.",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "Değişken bildirim listesi boş olamaz.",
"Variable_declaration_not_allowed_at_this_location_1440": "Bu konumda değişken bildirimine izin verilmiyor.",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Kaynaktaki {0} konumunda bulunan değişen sayıda bağımsız değişken içeren öğe, hedefteki {1} konumunda bulunan öğeyle eşleşmiyor.",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Varyans ek açıklamaları yalnızca nesne, işlev, oluşturucu ve eşlenen türler için tür diğer adlarında desteklenir.",
"Version_0_6029": "Sürüm {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Bu dosya hakkında daha fazla bilgi için https://aka.ms/tsconfig sayfasını ziyaret edin",
"WATCH_OPTIONS_6918": "İZLEME SEÇENEKLERİ",
+1120 -756
View File
File diff suppressed because it is too large Load Diff
+20324 -19468
View File
File diff suppressed because it is too large Load Diff
+29 -10
View File
@@ -2063,7 +2063,7 @@ declare namespace ts {
hasNoDefaultLib: boolean;
languageVersion: ScriptTarget;
/**
* When `module` is `Node12` or `NodeNext`, this field controls whether the
* When `module` is `Node16` or `NodeNext`, this field controls whether the
* source file in question is an ESNext-output-format file, or a CommonJS-output-format
* module. This is derived by the module resolver as it looks up the file, since
* it is derived from either the file extension of the module, or the containing
@@ -2172,7 +2172,9 @@ declare namespace ts {
export type ResolvedConfigFileName = string & {
_isResolvedConfigFileName: never;
};
export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void;
export interface WriteFileCallbackData {
}
export type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void;
export class OperationCanceledException {
}
export interface CancellationToken {
@@ -2394,7 +2396,6 @@ declare namespace ts {
UseAliasDefinedOutsideCurrentScope = 16384,
UseSingleQuotesForStringLiteralType = 268435456,
NoTypeReduction = 536870912,
NoUndefinedOptionalParameterType = 1073741824,
AllowThisInObjectLiteral = 32768,
AllowQualifiedNameInPlaceOfIdentifier = 65536,
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
@@ -2892,7 +2893,7 @@ declare namespace ts {
export enum ModuleResolutionKind {
Classic = 1,
NodeJs = 2,
Node12 = 3,
Node16 = 3,
NodeNext = 99
}
export enum ModuleDetectionKind {
@@ -2901,7 +2902,7 @@ declare namespace ts {
*/
Legacy = 1,
/**
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
*/
Auto = 2,
/**
@@ -3073,7 +3074,7 @@ declare namespace ts {
ES2020 = 6,
ES2022 = 7,
ESNext = 99,
Node12 = 100,
Node16 = 100,
NodeNext = 199
}
export enum JsxEmit {
@@ -4817,7 +4818,7 @@ declare namespace ts {
/**
* Controls the format the file is detected as - this can be derived from only the path
* and files on disk, but needs to be done with a module resolution cache in scope to be performant.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
*/
impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
/**
@@ -6434,7 +6435,18 @@ declare namespace ts {
argumentIndex: number;
argumentCount: number;
}
enum CompletionInfoFlags {
None = 0,
MayIncludeAutoImports = 1,
IsImportStatementCompletion = 2,
IsContinuation = 4,
ResolvedModuleSpecifiers = 8,
ResolvedModuleSpecifiersBeyondLimit = 16,
MayIncludeMethodSnippets = 32
}
interface CompletionInfo {
/** For performance telemetry. */
flags?: CompletionInfoFlags;
/** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
isGlobalCompletion: boolean;
isMemberCompletion: boolean;
@@ -6810,7 +6822,7 @@ declare namespace ts {
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. A minimal
* resolution cache is needed to fully define a source file's shape when
* the compilation settings include `module: node12`+, so providing a cache host
* the compilation settings include `module: node16`+, so providing a cache host
* object should be preferred. A common host is a language service `ConfiguredProject`.
* @param scriptSnapshot Text of the file. Only used if the file was not found
* in the registry and a new one was created.
@@ -6829,7 +6841,7 @@ declare namespace ts {
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. A minimal
* resolution cache is needed to fully define a source file's shape when
* the compilation settings include `module: node12`+, so providing a cache host
* the compilation settings include `module: node16`+, so providing a cache host
* object should be preferred. A common host is a language service `ConfiguredProject`.
* @param scriptSnapshot Text of the file.
* @param version Current version of the file.
@@ -7039,6 +7051,7 @@ declare namespace ts.server.protocol {
Rename = "rename",
Saveto = "saveto",
SignatureHelp = "signatureHelp",
FindSourceDefinition = "findSourceDefinition",
Status = "status",
TypeDefinition = "typeDefinition",
ProjectInfo = "projectInfo",
@@ -7658,6 +7671,9 @@ declare namespace ts.server.protocol {
interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
readonly command: CommandTypes.DefinitionAndBoundSpan;
}
interface FindSourceDefinitionRequest extends FileLocationRequest {
readonly command: CommandTypes.FindSourceDefinition;
}
interface DefinitionAndBoundSpanResponse extends Response {
readonly body: DefinitionInfoAndBoundSpan;
}
@@ -8818,6 +8834,7 @@ declare namespace ts.server.protocol {
body?: CompletionInfo;
}
interface CompletionInfo {
readonly flags?: number;
readonly isGlobalCompletion: boolean;
readonly isMemberCompletion: boolean;
readonly isNewIdentifierLocation: boolean;
@@ -9906,7 +9923,8 @@ declare namespace ts.server {
Inferred = 0,
Configured = 1,
External = 2,
AutoImportProvider = 3
AutoImportProvider = 3,
Auxiliary = 4
}
function allRootFilesAreJsOrDts(project: Project): boolean;
function allFilesAreJsOrDts(project: Project): boolean;
@@ -10641,6 +10659,7 @@ declare namespace ts.server {
private getDefinition;
private mapDefinitionInfoLocations;
private getDefinitionAndBoundSpan;
private findSourceDefinition;
private getEmitOutput;
private mapJSDocTagInfo;
private mapDisplayParts;
+20292 -19436
View File
File diff suppressed because it is too large Load Diff
+21 -9
View File
@@ -2063,7 +2063,7 @@ declare namespace ts {
hasNoDefaultLib: boolean;
languageVersion: ScriptTarget;
/**
* When `module` is `Node12` or `NodeNext`, this field controls whether the
* When `module` is `Node16` or `NodeNext`, this field controls whether the
* source file in question is an ESNext-output-format file, or a CommonJS-output-format
* module. This is derived by the module resolver as it looks up the file, since
* it is derived from either the file extension of the module, or the containing
@@ -2172,7 +2172,9 @@ declare namespace ts {
export type ResolvedConfigFileName = string & {
_isResolvedConfigFileName: never;
};
export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void;
export interface WriteFileCallbackData {
}
export type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void;
export class OperationCanceledException {
}
export interface CancellationToken {
@@ -2394,7 +2396,6 @@ declare namespace ts {
UseAliasDefinedOutsideCurrentScope = 16384,
UseSingleQuotesForStringLiteralType = 268435456,
NoTypeReduction = 536870912,
NoUndefinedOptionalParameterType = 1073741824,
AllowThisInObjectLiteral = 32768,
AllowQualifiedNameInPlaceOfIdentifier = 65536,
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
@@ -2892,7 +2893,7 @@ declare namespace ts {
export enum ModuleResolutionKind {
Classic = 1,
NodeJs = 2,
Node12 = 3,
Node16 = 3,
NodeNext = 99
}
export enum ModuleDetectionKind {
@@ -2901,7 +2902,7 @@ declare namespace ts {
*/
Legacy = 1,
/**
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
*/
Auto = 2,
/**
@@ -3073,7 +3074,7 @@ declare namespace ts {
ES2020 = 6,
ES2022 = 7,
ESNext = 99,
Node12 = 100,
Node16 = 100,
NodeNext = 199
}
export enum JsxEmit {
@@ -4817,7 +4818,7 @@ declare namespace ts {
/**
* Controls the format the file is detected as - this can be derived from only the path
* and files on disk, but needs to be done with a module resolution cache in scope to be performant.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
*/
impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
/**
@@ -6434,7 +6435,18 @@ declare namespace ts {
argumentIndex: number;
argumentCount: number;
}
enum CompletionInfoFlags {
None = 0,
MayIncludeAutoImports = 1,
IsImportStatementCompletion = 2,
IsContinuation = 4,
ResolvedModuleSpecifiers = 8,
ResolvedModuleSpecifiersBeyondLimit = 16,
MayIncludeMethodSnippets = 32
}
interface CompletionInfo {
/** For performance telemetry. */
flags?: CompletionInfoFlags;
/** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
isGlobalCompletion: boolean;
isMemberCompletion: boolean;
@@ -6810,7 +6822,7 @@ declare namespace ts {
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. A minimal
* resolution cache is needed to fully define a source file's shape when
* the compilation settings include `module: node12`+, so providing a cache host
* the compilation settings include `module: node16`+, so providing a cache host
* object should be preferred. A common host is a language service `ConfiguredProject`.
* @param scriptSnapshot Text of the file. Only used if the file was not found
* in the registry and a new one was created.
@@ -6829,7 +6841,7 @@ declare namespace ts {
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. A minimal
* resolution cache is needed to fully define a source file's shape when
* the compilation settings include `module: node12`+, so providing a cache host
* the compilation settings include `module: node16`+, so providing a cache host
* object should be preferred. A common host is a language service `ConfiguredProject`.
* @param scriptSnapshot Text of the file.
* @param version Current version of the file.
+19860 -19228
View File
File diff suppressed because it is too large Load Diff
+21 -9
View File
@@ -2063,7 +2063,7 @@ declare namespace ts {
hasNoDefaultLib: boolean;
languageVersion: ScriptTarget;
/**
* When `module` is `Node12` or `NodeNext`, this field controls whether the
* When `module` is `Node16` or `NodeNext`, this field controls whether the
* source file in question is an ESNext-output-format file, or a CommonJS-output-format
* module. This is derived by the module resolver as it looks up the file, since
* it is derived from either the file extension of the module, or the containing
@@ -2172,7 +2172,9 @@ declare namespace ts {
export type ResolvedConfigFileName = string & {
_isResolvedConfigFileName: never;
};
export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void;
export interface WriteFileCallbackData {
}
export type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void;
export class OperationCanceledException {
}
export interface CancellationToken {
@@ -2394,7 +2396,6 @@ declare namespace ts {
UseAliasDefinedOutsideCurrentScope = 16384,
UseSingleQuotesForStringLiteralType = 268435456,
NoTypeReduction = 536870912,
NoUndefinedOptionalParameterType = 1073741824,
AllowThisInObjectLiteral = 32768,
AllowQualifiedNameInPlaceOfIdentifier = 65536,
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
@@ -2892,7 +2893,7 @@ declare namespace ts {
export enum ModuleResolutionKind {
Classic = 1,
NodeJs = 2,
Node12 = 3,
Node16 = 3,
NodeNext = 99
}
export enum ModuleDetectionKind {
@@ -2901,7 +2902,7 @@ declare namespace ts {
*/
Legacy = 1,
/**
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
*/
Auto = 2,
/**
@@ -3073,7 +3074,7 @@ declare namespace ts {
ES2020 = 6,
ES2022 = 7,
ESNext = 99,
Node12 = 100,
Node16 = 100,
NodeNext = 199
}
export enum JsxEmit {
@@ -4817,7 +4818,7 @@ declare namespace ts {
/**
* Controls the format the file is detected as - this can be derived from only the path
* and files on disk, but needs to be done with a module resolution cache in scope to be performant.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
*/
impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
/**
@@ -6434,7 +6435,18 @@ declare namespace ts {
argumentIndex: number;
argumentCount: number;
}
enum CompletionInfoFlags {
None = 0,
MayIncludeAutoImports = 1,
IsImportStatementCompletion = 2,
IsContinuation = 4,
ResolvedModuleSpecifiers = 8,
ResolvedModuleSpecifiersBeyondLimit = 16,
MayIncludeMethodSnippets = 32
}
interface CompletionInfo {
/** For performance telemetry. */
flags?: CompletionInfoFlags;
/** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
isGlobalCompletion: boolean;
isMemberCompletion: boolean;
@@ -6810,7 +6822,7 @@ declare namespace ts {
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. A minimal
* resolution cache is needed to fully define a source file's shape when
* the compilation settings include `module: node12`+, so providing a cache host
* the compilation settings include `module: node16`+, so providing a cache host
* object should be preferred. A common host is a language service `ConfiguredProject`.
* @param scriptSnapshot Text of the file. Only used if the file was not found
* in the registry and a new one was created.
@@ -6829,7 +6841,7 @@ declare namespace ts {
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. A minimal
* resolution cache is needed to fully define a source file's shape when
* the compilation settings include `module: node12`+, so providing a cache host
* the compilation settings include `module: node16`+, so providing a cache host
* object should be preferred. A common host is a language service `ConfiguredProject`.
* @param scriptSnapshot Text of the file.
* @param version Current version of the file.
+19860 -19228
View File
File diff suppressed because it is too large Load Diff
+14873 -14453
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "将 \"void\" 添加到已解析但没有值的承诺",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "将 \"void\" 添加到所有已解析但没有值的承诺",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "添加 tsconfig.json 文件有助于组织包含 TypeScript 和 JavaScript 文件的项目。有关详细信息,请访问 https://aka.ms/tsconfig。",
"All_declarations_of_0_must_have_identical_constraints_2838": "\"{0}\" 的所有声明必须具有相同的限制。",
"All_declarations_of_0_must_have_identical_modifiers_2687": "“{0}”的所有声明必须具有相同的修饰符。",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "“{0}”的所有声明都必须具有相同的类型参数。",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "抽象方法的所有声明必须是连续的。",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "类型“{0}”的索引签名重复。",
"Duplicate_label_0_1114": "标签“{0}”重复。",
"Duplicate_property_0_2718": "重复的属性 \"{0}\"。",
"Dynamic_import_cannot_have_type_arguments_1326": "动态导入不能含有类型参数。",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "动态导入的说明符类型必须是 \"string\",但此处类型是 \"{0}\"。",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "仅当 '--module' 标志设置为 'es2020'、'es2022'、'esnext'、 'commonjs'、'amd'、'system'、'umd'、'node12' 或 'nodenext' 时,才支持动态导入。",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "动态导入只能接受模块说明符和可选断言作为参数",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "应为 {0} 个参数,但得到的却是 {1} 个。你是否忘了将类型参数中的 \"void\" 包含到 \"Promise\"?",
"Expected_0_type_arguments_but_got_1_2558": "应有 {0} 个类型参数,但获得 {1} 个。",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "应为 {0} 类型参数;请为这些参数添加 \"@extends\" 标记。",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "应为 1 个参数,但得到 0。“new Promise()” 需要 JSDoc 提示才能生成可在没有参数的情况下调用的 “resolve”。",
"Expected_at_least_0_arguments_but_got_1_2555": "应有至少 {0} 个参数,但获得 {1} 个。",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "“{0}”预期的相应 JSX 结束标记。",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "预期的 JSX 片段的相应结束标记。",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "此语法需要名为 \"{1}\" 的导入帮助器,\"{0}\" 中不存在该帮助器。请考虑升级 \"{0}\" 的版本。",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "此语法需要一个名为 \"{1}\" 且包含 {2} 参数的导入帮助程序,该帮助程序与 \"{0}\" 中的相应帮助程序不兼容。请考虑升级 \"{0}\" 的版本。",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "此类型参数可能需要 \"extends object\" 约束。",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "“import” 的这种用法无效。可以写入 “import()” 调用,但它们必须具有括号,并且不能带有类型参数。",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "仅当 'module' 选项设置为 'es2022'、'esnext'、'system' 或 'nodenext',且 'target' 选项设置为 'es2017' 或更高版本时,才允许顶级 'await' 表达式。",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 文件中的顶级声明必须以 \"declare\" 或 \"export\" 修饰符开头。",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "仅当 'module' 选项设置为 'es2022'、'esnext'、'system' 或 'nodenext',且 'target' 选项设置为 'es2017' 或更高版本时,才允许顶级 'for await' 循环。",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "类型“{0}”不是 ES5/ES3 中的有效异步函数返回类型,因为其未引用与 Promise 相符的构造函数值。",
"Type_0_is_not_an_array_type_2461": "类型“{0}”不是数组类型。",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "类型“{0}”不是数组类型或字符串类型。",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "类型“{0}”不是数组类型或字符串类型。请使用编译器选项 \"--downlevelIteration\" 允许迭代器进行迭代。",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "类型“{0}”不是数组类型或字符串类型,或者没有返回迭代器的 \"[Symbol.iterator]()\" 方法。",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "类型“{0}”不是数组类型,或者没有返回迭代器的 \"[Symbol.iterator]()\" 方法。",
"Type_0_is_not_assignable_to_type_1_2322": "不能将类型“{0}”分配给类型“{1}”。",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "变量声明列表不能为空。",
"Variable_declaration_not_allowed_at_this_location_1440": "此位置不允许使用变量声明。",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "源中位置 {0} 的可变元素与目标中位置 {1} 的元素不匹配。",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "仅对象、函数、构造函数、映射类型的类型别名支持方差注释。",
"Version_0_6029": "版本 {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "请访问 https://aka.ms/tsconfig,了解有关此文件的详细信息",
"WATCH_OPTIONS_6918": "监视选项",
+4 -2
View File
@@ -161,6 +161,7 @@
"Add_void_to_Promise_resolved_without_a_value_95143": "為已經解析但不具值的 Promise 新增 'void'",
"Add_void_to_all_Promises_resolved_without_a_value_95144": "為已經解析但不具值的所有 Promise 新增 'void'",
"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "新增 tsconfig.json 檔案有助於組織同時包含 TypeScript 及 JavaScript 檔案的專案。若要深入了解,請前往 https://aka.ms/tsconfig。",
"All_declarations_of_0_must_have_identical_constraints_2838": "'{0}' 的所有宣告都必須有相同的限制式。",
"All_declarations_of_0_must_have_identical_modifiers_2687": "'{0}' 的所有宣告都必須有相同修飾元。",
"All_declarations_of_0_must_have_identical_type_parameters_2428": "'{0}' 的所有宣告都必須具有相同的類型參數。",
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "抽象方法的所有宣告必須連續。",
@@ -573,7 +574,6 @@
"Duplicate_index_signature_for_type_0_2374": "類型 '{0}' 的索引簽章重複。",
"Duplicate_label_0_1114": "標籤 '{0}' 重複。",
"Duplicate_property_0_2718": "屬性 '{0}' 重複。",
"Dynamic_import_cannot_have_type_arguments_1326": "動態匯入不可有型別引數。",
"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "動態匯入的指定名稱必須屬於類型 'string',但這裡的類型為 '{0}'。",
"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "只有在 '--module' 旗標設定為 'es2020'、'es2022'、'esnext'、'commonjs'、'amd'、'system'、'umd'、'node12' 或 'nodenext',才支援動態匯入。",
"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "動態匯入只能接受模組指定名稱和選擇性判斷提示來做為引數",
@@ -642,6 +642,7 @@
"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "應為 {0} 個引數,但現有 {1} 個。是否忘記將型別引數中的 'void' 納入 'Promise' 中?",
"Expected_0_type_arguments_but_got_1_2558": "應有 {0} 個型別引數,但得到 {1} 個。",
"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "必須是 {0} 型別引數; 請提供有 '@ extends' 標記的這類引數。",
"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": "需要 1 個引數,但得到 0。'new Promise()' 需要 JSDoc 提示,才能產生可以呼叫而不含引數的 'resolve'。",
"Expected_at_least_0_arguments_but_got_1_2555": "至少應有 {0} 個引數,但得到 {1} 個。",
"Expected_corresponding_JSX_closing_tag_for_0_17002": "'{0}' 需要對應的 JSX 結尾標記。",
"Expected_corresponding_closing_tag_for_JSX_fragment_17015": "JSX 片段必須有對應的結尾標記。",
@@ -1483,6 +1484,7 @@
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "此語法需要名為 '{1}' 的已匯入協助程式,但其不存在於 '{0}' 中。請考慮升級您的 '{0}' 版本。",
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "此語法需要名為 '{1}' 且具有 {2} 參數的匯入協助程式,其與 '{0}' 中的參數不相容。請考慮升級 '{0}' 的版本。",
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "此類型參數可能需要 'extends object' 限制式。",
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "此 'import' 的使用方式無效。'import()' 呼叫可以寫入,但必須有括弧,而且不能有類型引數。",
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "只有在 'module' 選項設定為 'es2022'、'esnext'、'system' 或 'nodenext',而且 'target' 選項設定為 'es2017' 或更高版本時,才允許最上層的 'await' 運算式。",
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 檔案中的最上層宣告必須以 'declare' 或 'export' 修飾元開頭。",
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "只有在 'module' 選項設為 'es2022'、'esnext'、'system' 或 'nodenext',而且 'target' 選項設為 'es2017' 或更高版本時,才允許最上層的 'for await' 迴圈。",
@@ -1509,7 +1511,6 @@
"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055": "類型 '{0}' 不是 ES5/ES3 中的有效非同步函式傳回型別,因為它不是指與 Promise 相容的建構函式值。",
"Type_0_is_not_an_array_type_2461": "類型 '{0}' 不是陣列類型。",
"Type_0_is_not_an_array_type_or_a_string_type_2495": "類型 '{0}' 不是陣列類型或字串類型。",
"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569": "類型 '{0}' 不是陣列類型或字串類型。請使用編譯器選項 '-downlevelIteration' 允許逐一查看迭代器。",
"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "類型 '{0}' 不是陣列類型或字串類型,或沒有會傳回迭代器的 '[Symbol.iterator]()' 方法。",
"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "類型 '{0}' 不是陣列類型,或沒有會傳回迭代器的 '[Symbol.iterator]()' 方法。",
"Type_0_is_not_assignable_to_type_1_2322": "類型 '{0}' 不可指派給類型 '{1}'。",
@@ -1633,6 +1634,7 @@
"Variable_declaration_list_cannot_be_empty_1123": "變數宣告清單不得為空白。",
"Variable_declaration_not_allowed_at_this_location_1440": "此位置不允許變數宣告。",
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "來源中位於 {0} 的可變元素與目標中位於 {1} 的元素不相符。",
"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "只有物件、函式、建構函式和對應類型的類型別名才支援差異註釋。",
"Version_0_6029": "版本 {0}",
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "瀏覽 https://aka.ms/tsconfig 以閱讀此檔案的詳細資訊",
"WATCH_OPTIONS_6918": "監看式選項",
+169 -50
View File
@@ -392,9 +392,9 @@
}
},
"@types/chai": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz",
"integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz",
"integrity": "sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==",
"dev": true
},
"@types/convert-source-map": {
@@ -626,9 +626,9 @@
}
},
"@types/mocha": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz",
"integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==",
"version": "9.1.1",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz",
"integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==",
"dev": true
},
"@types/ms": {
@@ -638,9 +638,9 @@
"dev": true
},
"@types/node": {
"version": "17.0.23",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz",
"integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==",
"version": "17.0.31",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz",
"integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==",
"dev": true
},
"@types/node-fetch": {
@@ -2987,6 +2987,22 @@
"dev": true,
"requires": {
"glob": "^7.1.3"
},
"dependencies": {
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
}
}
@@ -3135,17 +3151,37 @@
"dev": true
},
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/glob/-/glob-8.0.1.tgz",
"integrity": "sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"minimatch": "^5.0.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"dependencies": {
"brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0"
}
},
"minimatch": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
"integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
"dev": true,
"requires": {
"brace-expansion": "^2.0.1"
}
}
}
},
"glob-parent": {
@@ -3185,6 +3221,22 @@
"remove-trailing-separator": "^1.0.1",
"to-absolute-glob": "^2.0.0",
"unique-stream": "^2.0.2"
},
"dependencies": {
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
},
"glob-watcher": {
@@ -3249,6 +3301,22 @@
"ignore": "^5.1.1",
"merge2": "^1.2.3",
"slash": "^3.0.0"
},
"dependencies": {
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
},
"glogg": {
@@ -3266,12 +3334,6 @@
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true
},
"growl": {
"version": "1.10.5",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
"gulp": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz",
@@ -3382,6 +3444,22 @@
"glob": "^7.0.3",
"kew": "^0.7.0",
"plugin-error": "^0.1.2"
},
"dependencies": {
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
},
"gulp-rename": {
@@ -4244,32 +4322,30 @@
"dev": true
},
"mocha": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz",
"integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==",
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz",
"integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==",
"dev": true,
"requires": {
"@ungap/promise-all-settled": "1.1.2",
"ansi-colors": "4.1.1",
"browser-stdout": "1.3.1",
"chokidar": "3.5.3",
"debug": "4.3.3",
"debug": "4.3.4",
"diff": "5.0.0",
"escape-string-regexp": "4.0.0",
"find-up": "5.0.0",
"glob": "7.2.0",
"growl": "1.10.5",
"he": "1.2.0",
"js-yaml": "4.1.0",
"log-symbols": "4.1.0",
"minimatch": "4.2.1",
"minimatch": "5.0.1",
"ms": "2.1.3",
"nanoid": "3.3.1",
"nanoid": "3.3.3",
"serialize-javascript": "6.0.0",
"strip-json-comments": "3.1.1",
"supports-color": "8.1.1",
"which": "2.0.2",
"workerpool": "6.2.0",
"workerpool": "6.2.1",
"yargs": "16.2.0",
"yargs-parser": "20.2.4",
"yargs-unparser": "2.0.0"
@@ -4346,9 +4422,9 @@
}
},
"debug": {
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
"integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
@@ -4412,6 +4488,31 @@
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true
},
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"dependencies": {
"minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
}
}
},
"glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
@@ -4461,12 +4562,23 @@
}
},
"minimatch": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz",
"integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
"integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
"brace-expansion": "^2.0.1"
},
"dependencies": {
"brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0"
}
}
}
},
"p-limit": {
@@ -4542,15 +4654,6 @@
"is-number": "^7.0.0"
}
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -4617,9 +4720,9 @@
"optional": true
},
"nanoid": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz",
"integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==",
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
"integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
"dev": true
},
"nanomatch": {
@@ -5426,6 +5529,22 @@
"dev": true,
"requires": {
"glob": "^7.1.3"
},
"dependencies": {
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
},
"run-parallel": {
@@ -6560,9 +6679,9 @@
"dev": true
},
"workerpool": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz",
"integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
"integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
"dev": true
},
"wrap-ansi": {
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "4.7.0-beta",
"version": "4.7.1-rc",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
+3 -1
View File
@@ -122,7 +122,9 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
try {
setNodeEnvToDevelopment();
const { exitCode } = await exec("node", args, { cancelToken });
const { exitCode } = await exec(process.execPath, args, {
cancelToken,
});
if (exitCode !== 0) {
errorStatus = exitCode;
error = new Error(`Process exited with status code ${errorStatus}.`);
+1 -1
View File
@@ -1818,6 +1818,7 @@ namespace ts {
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.MappedType:
case SyntaxKind.IndexSignature:
return ContainerFlags.IsContainer | ContainerFlags.HasLocals;
case SyntaxKind.SourceFile:
@@ -1838,7 +1839,6 @@ namespace ts {
case SyntaxKind.JSDocFunctionType:
case SyntaxKind.FunctionType:
case SyntaxKind.ConstructSignature:
case SyntaxKind.IndexSignature:
case SyntaxKind.ConstructorType:
case SyntaxKind.ClassStaticBlockDeclaration:
return ContainerFlags.IsContainer | ContainerFlags.IsControlFlowContainer | ContainerFlags.HasLocals | ContainerFlags.IsFunctionLike;
+224 -122
View File
@@ -161,6 +161,8 @@ namespace ts {
* true if program has been emitted
*/
programEmitComplete?: true;
/** Stores list of files that change signature during emit - test only */
filesChangingSignature?: Set<Path>;
}
function hasSameKeys(map1: ReadonlyCollection<string> | undefined, map2: ReadonlyCollection<string> | undefined): boolean {
@@ -348,7 +350,7 @@ namespace ts {
* This is to allow the callers to be able to actually remove affected file only when the operation is complete
* eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
*/
function getNextAffectedFile(state: BuilderProgramState, cancellationToken: CancellationToken | undefined, computeHash: BuilderState.ComputeHash): SourceFile | Program | undefined {
function getNextAffectedFile(state: BuilderProgramState, cancellationToken: CancellationToken | undefined, computeHash: BuilderState.ComputeHash, host: BuilderProgramHost): SourceFile | Program | undefined {
while (true) {
const { affectedFiles } = state;
if (affectedFiles) {
@@ -359,7 +361,7 @@ namespace ts {
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
// Set the next affected file as seen and remove the cached semantic diagnostics
state.affectedFilesIndex = affectedFilesIndex;
handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash);
handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
return affectedFile;
}
affectedFilesIndex++;
@@ -372,6 +374,7 @@ namespace ts {
BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures!);
state.currentAffectedFilesSignatures!.clear();
BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
state.currentAffectedFilesExportedModulesMap?.clear();
state.affectedFiles = undefined;
}
@@ -403,6 +406,12 @@ namespace ts {
}
}
function clearAffectedFilesPendingEmit(state: BuilderProgramState) {
state.affectedFilesPendingEmit = undefined;
state.affectedFilesPendingEmitKind = undefined;
state.affectedFilesPendingEmitIndex = undefined;
}
/**
* Returns next file to be emitted from files that retrieved semantic diagnostics but did not emit yet
*/
@@ -422,32 +431,40 @@ namespace ts {
}
}
}
state.affectedFilesPendingEmit = undefined;
state.affectedFilesPendingEmitKind = undefined;
state.affectedFilesPendingEmitIndex = undefined;
clearAffectedFilesPendingEmit(state);
}
return undefined;
}
function removeDiagnosticsOfLibraryFiles(state: BuilderProgramState) {
if (!state.cleanedDiagnosticsOfLibFiles) {
state.cleanedDiagnosticsOfLibFiles = true;
const program = Debug.checkDefined(state.program);
const options = program.getCompilerOptions();
forEach(program.getSourceFiles(), f =>
program.isSourceFileDefaultLibrary(f) &&
!skipTypeChecking(f, options, program) &&
removeSemanticDiagnosticsOf(state, f.resolvedPath)
);
}
}
/**
* Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file
* This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
*/
function handleDtsMayChangeOfAffectedFile(state: BuilderProgramState, affectedFile: SourceFile, cancellationToken: CancellationToken | undefined, computeHash: BuilderState.ComputeHash) {
function handleDtsMayChangeOfAffectedFile(
state: BuilderProgramState,
affectedFile: SourceFile,
cancellationToken: CancellationToken | undefined,
computeHash: BuilderState.ComputeHash,
host: BuilderProgramHost,
) {
removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
// If affected files is everything except default library, then nothing more to do
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
if (!state.cleanedDiagnosticsOfLibFiles) {
state.cleanedDiagnosticsOfLibFiles = true;
const program = Debug.checkDefined(state.program);
const options = program.getCompilerOptions();
forEach(program.getSourceFiles(), f =>
program.isSourceFileDefaultLibrary(f) &&
!skipTypeChecking(f, options, program) &&
removeSemanticDiagnosticsOf(state, f.resolvedPath)
);
}
removeDiagnosticsOfLibraryFiles(state);
// When a change affects the global scope, all files are considered to be affected without updating their signature
// That means when affected file is handled, its signature can be out of date
// To avoid this, ensure that we update the signature for any affected file in this scenario.
@@ -462,20 +479,22 @@ namespace ts {
);
return;
}
else {
Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || state.currentAffectedFilesSignatures?.has(affectedFile.resolvedPath), `Signature not updated for affected file: ${affectedFile.fileName}`);
}
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, (state, path) => handleDtsMayChangeOf(state, path, cancellationToken, computeHash));
}
Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || state.currentAffectedFilesSignatures?.has(affectedFile.resolvedPath), `Signature not updated for affected file: ${affectedFile.fileName}`);
if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) return;
handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
}
/**
* Handle the dts may change, so they need to be added to pending emit if dts emit is enabled,
* Also we need to make sure signature is updated for these files
*/
function handleDtsMayChangeOf(state: BuilderProgramState, path: Path, cancellationToken: CancellationToken | undefined, computeHash: BuilderState.ComputeHash): void {
function handleDtsMayChangeOf(
state: BuilderProgramState,
path: Path,
cancellationToken: CancellationToken | undefined,
computeHash: BuilderState.ComputeHash,
host: BuilderProgramHost
): void {
removeSemanticDiagnosticsOf(state, path);
if (!state.changedFilesSet.has(path)) {
@@ -495,7 +514,7 @@ namespace ts {
cancellationToken,
computeHash,
state.currentAffectedFilesExportedModulesMap,
/* useFileVersionAsSignature */ true
!host.disableUseFileVersionAsSignature
);
// If not dts emit, nothing more to do
if (getEmitDeclarations(state.compilerOptions)) {
@@ -524,16 +543,61 @@ namespace ts {
return newSignature !== oldSignature;
}
function forEachKeyOfExportedModulesMap<T>(
state: BuilderProgramState,
filePath: Path,
fn: (exportedFromPath: Path) => T | undefined,
): T | undefined {
// Go through exported modules from cache first
let keys = state.currentAffectedFilesExportedModulesMap!.getKeys(filePath);
const result = keys && forEachKey(keys, fn);
if (result) return result;
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
keys = state.exportedModulesMap!.getKeys(filePath);
return keys && forEachKey(keys, exportedFromPath =>
// If the cache had an updated value, skip
!state.currentAffectedFilesExportedModulesMap!.hasKey(exportedFromPath) &&
!state.currentAffectedFilesExportedModulesMap!.deletedKeys()?.has(exportedFromPath) ?
fn(exportedFromPath) :
undefined
);
}
function handleDtsMayChangeOfGlobalScope(
state: BuilderProgramState,
filePath: Path,
cancellationToken: CancellationToken | undefined,
computeHash: BuilderState.ComputeHash,
host: BuilderProgramHost,
): boolean {
if (!state.fileInfos.get(filePath)?.affectsGlobalScope) return false;
// Every file needs to be handled
BuilderState.getAllFilesExcludingDefaultLibraryFile(state, state.program!, /*firstSourceFile*/ undefined)
.forEach(file => handleDtsMayChangeOf(
state,
file.resolvedPath,
cancellationToken,
computeHash,
host,
));
removeDiagnosticsOfLibraryFiles(state);
return true;
}
/**
* Iterate on referencing modules that export entities from affected file
* Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
*/
function forEachReferencingModulesOfExportOfAffectedFile(state: BuilderProgramState, affectedFile: SourceFile, fn: (state: BuilderProgramState, filePath: Path) => void) {
function handleDtsMayChangeOfReferencingExportOfAffectedFile(
state: BuilderProgramState,
affectedFile: SourceFile,
cancellationToken: CancellationToken | undefined,
computeHash: BuilderState.ComputeHash,
host: BuilderProgramHost
) {
// If there was change in signature (dts output) for the changed file,
// then only we need to handle pending file emit
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) {
return;
}
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) return;
if (!isChangedSignature(state, affectedFile.resolvedPath)) return;
// Since isolated modules dont change js files, files affected by change in signature is itself
@@ -546,7 +610,8 @@ namespace ts {
const currentPath = queue.pop()!;
if (!seenFileNamesMap.has(currentPath)) {
seenFileNamesMap.set(currentPath, true);
fn(state, currentPath);
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, host)) return;
handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, host);
if (isChangedSignature(state, currentPath)) {
const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath)!;
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
@@ -556,65 +621,69 @@ namespace ts {
}
Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
const seenFileAndExportsOfFile = new Set<string>();
// Go through exported modules from cache first
// If exported modules has path, all files referencing file exported from are affected
state.currentAffectedFilesExportedModulesMap.getKeys(affectedFile.resolvedPath)?.forEach(exportedFromPath =>
forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn)
);
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
state.exportedModulesMap.getKeys(affectedFile.resolvedPath)?.forEach(exportedFromPath =>
// If the cache had an updated value, skip
!state.currentAffectedFilesExportedModulesMap!.hasKey(exportedFromPath) &&
!state.currentAffectedFilesExportedModulesMap!.deletedKeys()?.has(exportedFromPath) &&
forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn)
);
forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, exportedFromPath => {
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host)) return true;
const references = state.referencedMap!.getKeys(exportedFromPath);
return references && forEachKey(references, filePath =>
handleDtsMayChangeOfFileAndExportsOfFile(
state,
filePath,
seenFileAndExportsOfFile,
cancellationToken,
computeHash,
host,
)
);
});
}
/**
* Iterate on files referencing referencedPath
* handle dts and semantic diagnostics on file and iterate on anything that exports this file
* return true when all work is done and we can exit handling dts emit and semantic diagnostics
*/
function forEachFilesReferencingPath(state: BuilderProgramState, referencedPath: Path, seenFileAndExportsOfFile: Set<string>, fn: (state: BuilderProgramState, filePath: Path) => void): void {
state.referencedMap!.getKeys(referencedPath)?.forEach(filePath =>
forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn)
);
}
/**
* fn on file and iterate on anything that exports this file
*/
function forEachFileAndExportsOfFile(state: BuilderProgramState, filePath: Path, seenFileAndExportsOfFile: Set<string>, fn: (state: BuilderProgramState, filePath: Path) => void): void {
if (!tryAddToSet(seenFileAndExportsOfFile, filePath)) {
return;
}
fn(state, filePath);
function handleDtsMayChangeOfFileAndExportsOfFile(
state: BuilderProgramState,
filePath: Path,
seenFileAndExportsOfFile: Set<string>,
cancellationToken: CancellationToken | undefined,
computeHash: BuilderState.ComputeHash,
host: BuilderProgramHost,
): boolean | undefined {
if (!tryAddToSet(seenFileAndExportsOfFile, filePath)) return undefined;
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host)) return true;
handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
// Go through exported modules from cache first
// If exported modules has path, all files referencing file exported from are affected
state.currentAffectedFilesExportedModulesMap.getKeys(filePath)?.forEach(exportedFromPath =>
forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn)
);
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
state.exportedModulesMap!.getKeys(filePath)?.forEach(exportedFromPath =>
// If the cache had an updated value, skip
!state.currentAffectedFilesExportedModulesMap!.hasKey(exportedFromPath) &&
!state.currentAffectedFilesExportedModulesMap!.deletedKeys()?.has(exportedFromPath) &&
forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn)
// If exported modules has path, all files referencing file exported from are affected
forEachKeyOfExportedModulesMap(state, filePath, exportedFromPath =>
handleDtsMayChangeOfFileAndExportsOfFile(
state,
exportedFromPath,
seenFileAndExportsOfFile,
cancellationToken,
computeHash,
host,
)
);
// Remove diagnostics of files that import this file (without going to exports of referencing files)
state.referencedMap!.getKeys(filePath)?.forEach(referencingFilePath =>
!seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
fn(state, referencingFilePath) // Dont add to seen since this is not yet done with the export removal
handleDtsMayChangeOf( // Dont add to seen since this is not yet done with the export removal
state,
referencingFilePath,
cancellationToken,
computeHash,
host,
)
);
return undefined;
}
/**
* This is called after completing operation on the next affected file.
* The operations here are postponed to ensure that cancellation during the iteration is handled correctly
@@ -751,13 +820,18 @@ namespace ts {
const signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
const actualSignature = signature ?? value.signature;
return value.version === actualSignature ?
value.affectsGlobalScope ?
{ version: value.version, signature: undefined, affectsGlobalScope: true, impliedFormat: value.impliedFormat } :
value.affectsGlobalScope || value.impliedFormat ?
// If file version is same as signature, dont serialize signature
{ version: value.version, signature: undefined, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
// If file info only contains version and signature and both are same we can just write string
value.version :
actualSignature !== undefined ?
actualSignature !== undefined ? // If signature is not same as version, encode signature in the fileInfo
signature === undefined ?
// If we havent computed signature, use fileInfo as is
value :
// Serialize fileInfo with new updated signature
{ version: value.version, signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
// Signature of the FileInfo is undefined, serialize it as false
{ version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
});
@@ -1039,7 +1113,7 @@ namespace ts {
* in that order would be used to write the files
*/
function emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult> {
let affected = getNextAffectedFile(state, cancellationToken, computeHash);
let affected = getNextAffectedFile(state, cancellationToken, computeHash, host);
let emitKind = BuilderFileEmit.Full;
let isPendingEmitFile = false;
if (!affected) {
@@ -1078,7 +1152,9 @@ namespace ts {
// Otherwise just affected file
Debug.checkDefined(state.program).emit(
affected === state.program ? undefined : affected as SourceFile,
writeFile || maybeBind(host, host.writeFile),
affected !== state.program && getEmitDeclarations(state.compilerOptions) && !customTransformers ?
getWriteFileUpdatingSignatureCallback(writeFile) :
writeFile || maybeBind(host, host.writeFile),
cancellationToken,
emitOnlyDtsFiles || emitKind === BuilderFileEmit.DtsOnly,
customTransformers
@@ -1089,6 +1165,34 @@ namespace ts {
);
}
function getWriteFileUpdatingSignatureCallback(writeFile: WriteFileCallback | undefined): WriteFileCallback {
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
if (isDeclarationFileName(fileName)) {
Debug.assert(sourceFiles?.length === 1);
const file = sourceFiles[0];
const info = state.fileInfos.get(file.resolvedPath)!;
const signature = state.currentAffectedFilesSignatures?.get(file.resolvedPath) || info.signature;
if (signature === file.version) {
const newSignature = (computeHash || generateDjb2Hash)(data?.sourceMapUrlPos !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
if (newSignature !== file.version) { // Update it
if (host.storeFilesChangingSignatureDuringEmit) (state.filesChangingSignature ||= new Set()).add(file.resolvedPath);
if (state.exportedModulesMap) BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap ||= BuilderState.createManyToManyPathMap());
if (state.affectedFiles && state.affectedFilesIndex! < state.affectedFiles.length) {
state.currentAffectedFilesSignatures!.set(file.resolvedPath, newSignature);
}
else {
info.signature = newSignature;
if (state.exportedModulesMap) BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
}
}
}
}
if (writeFile) writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
else if (host.writeFile) host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
else state.program!.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
};
}
/**
* Emits the JavaScript and declaration files.
* When targetSource file is specified, emits the files corresponding to that source file,
@@ -1101,59 +1205,57 @@ namespace ts {
* in that order would be used to write the files
*/
function emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult {
let restorePendingEmitOnHandlingNoEmitSuccess = false;
let savedAffectedFilesPendingEmit;
let savedAffectedFilesPendingEmitKind;
let savedAffectedFilesPendingEmitIndex;
// Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors
// This ensures pending files to emit is updated in tsbuildinfo
// Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit)
if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram &&
!targetSourceFile &&
!outFile(state.compilerOptions) &&
!state.compilerOptions.noEmit &&
state.compilerOptions.noEmitOnError) {
restorePendingEmitOnHandlingNoEmitSuccess = true;
savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new Map(state.affectedFilesPendingEmitKind);
savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
}
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
}
const result = handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
if (result) return result;
if (restorePendingEmitOnHandlingNoEmitSuccess) {
state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit;
state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind;
state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex;
}
// Emit only affected files if using builder for emit
if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
// Emit and report any errors we ran into.
let sourceMaps: SourceMapEmitResult[] = [];
let emitSkipped = false;
let diagnostics: Diagnostic[] | undefined;
let emittedFiles: string[] = [];
if (!targetSourceFile) {
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
// Emit and report any errors we ran into.
let sourceMaps: SourceMapEmitResult[] = [];
let emitSkipped = false;
let diagnostics: Diagnostic[] | undefined;
let emittedFiles: string[] = [];
let affectedEmitResult: AffectedFileResult<EmitResult>;
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
sourceMaps = addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
let affectedEmitResult: AffectedFileResult<EmitResult>;
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
sourceMaps = addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
}
return {
emitSkipped,
diagnostics: diagnostics || emptyArray,
emittedFiles,
sourceMaps
};
}
// In non Emit builder, clear affected files pending emit
else if (state.affectedFilesPendingEmitKind?.size) {
Debug.assert(kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram);
// State can clear affected files pending emit if
if (!emitOnlyDtsFiles // If we are doing complete emit, affected files pending emit can be cleared
// If every file pending emit is pending on only dts emit
|| every(state.affectedFilesPendingEmit, (path, index) =>
index < state.affectedFilesPendingEmitIndex! ||
state.affectedFilesPendingEmitKind!.get(path) === BuilderFileEmit.DtsOnly)) {
clearAffectedFilesPendingEmit(state);
}
}
return {
emitSkipped,
diagnostics: diagnostics || emptyArray,
emittedFiles,
sourceMaps
};
}
return Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
return Debug.checkDefined(state.program).emit(
targetSourceFile,
!outFile(state.compilerOptions) && getEmitDeclarations(state.compilerOptions) && !customTransformers ?
getWriteFileUpdatingSignatureCallback(writeFile) :
writeFile || maybeBind(host, host.writeFile),
cancellationToken,
emitOnlyDtsFiles,
customTransformers
);
}
/**
@@ -1162,7 +1264,7 @@ namespace ts {
*/
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]> {
while (true) {
const affected = getNextAffectedFile(state, cancellationToken, computeHash);
const affected = getNextAffectedFile(state, cancellationToken, computeHash, host);
if (!affected) {
// Done
return undefined;
+5
View File
@@ -20,6 +20,11 @@ namespace ts {
*/
/*@internal*/
disableUseFileVersionAsSignature?: boolean;
/**
* Store the list of files that update signature during the emit
*/
/*@internal*/
storeFilesChangingSignatureDuringEmit?: boolean;
}
/**
+12 -40
View File
@@ -48,11 +48,6 @@ namespace ts {
*/
readonly exportedModulesMap: BuilderState.ManyToManyPathMap | undefined;
previousCache?: {
id: number,
version: number,
};
/**
* true if file version is used as signature
* This helps in delaying the calculation of the d.ts hash as version for the file till reasonable time
@@ -81,12 +76,11 @@ namespace ts {
export interface FileInfo {
readonly version: string;
signature: string | undefined;
affectsGlobalScope: boolean | undefined;
affectsGlobalScope: true | undefined;
impliedFormat: number | undefined;
}
export interface ReadonlyManyToManyPathMap {
readonly id: number;
clone(): ManyToManyPathMap;
forEach(action: (v: ReadonlySet<Path>, k: Path) => void): void;
getKeys(v: Path): ReadonlySet<Path> | undefined;
@@ -103,18 +97,14 @@ namespace ts {
}
export interface ManyToManyPathMap extends ReadonlyManyToManyPathMap {
version(): number; // Incremented each time the contents are changed
deleteKey(k: Path): boolean;
set(k: Path, v: ReadonlySet<Path>): void;
clear(): void;
}
let manyToManyPathMapCount = 0;
export function createManyToManyPathMap(): ManyToManyPathMap {
function create(forward: ESMap<Path, ReadonlySet<Path>>, reverse: ESMap<Path, Set<Path>>, deleted: Set<Path> | undefined): ManyToManyPathMap {
let version = 0;
const map: ManyToManyPathMap = {
id: manyToManyPathMapCount++,
version: () => version,
clone: () => create(new Map(forward), new Map(reverse), deleted && new Set(deleted)),
forEach: fn => forward.forEach(fn),
getKeys: v => reverse.get(v),
@@ -133,35 +123,33 @@ namespace ts {
set.forEach(v => deleteFromMultimap(reverse, v, k));
forward.delete(k);
version++;
return true;
},
set: (k, vSet) => {
let changed = !!deleted?.delete(k);
deleted?.delete(k);
const existingVSet = forward.get(k);
forward.set(k, vSet);
existingVSet?.forEach(v => {
if (!vSet.has(v)) {
changed = true;
deleteFromMultimap(reverse, v, k);
}
});
vSet.forEach(v => {
if (!existingVSet?.has(v)) {
changed = true;
addToMultimap(reverse, v, k);
}
});
if (changed) {
version++;
}
return map;
},
clear: () => {
forward.clear();
reverse.clear();
deleted?.clear();
}
};
return map;
@@ -179,11 +167,11 @@ namespace ts {
set.add(v);
}
function deleteFromMultimap<K, V>(map: ESMap<K, Set<V>>, k: K, v: V, removeEmpty = true): boolean {
function deleteFromMultimap<K, V>(map: ESMap<K, Set<V>>, k: K, v: V): boolean {
const set = map.get(k);
if (set?.delete(v)) {
if (removeEmpty && !set.size) {
if (!set.size) {
map.delete(k);
}
return true;
@@ -434,7 +422,7 @@ namespace ts {
);
const firstDts = firstOrUndefined(emitOutput.outputFiles);
if (firstDts) {
Debug.assert(fileExtensionIsOneOf(firstDts.name, [Extension.Dts, Extension.Dmts, Extension.Dcts]), "File extension for signature expected to be dts", () => `Found: ${getAnyExtensionFromPath(firstDts.name)} for ${firstDts.name}:: All output files: ${JSON.stringify(emitOutput.outputFiles.map(f => f.name))}`);
Debug.assert(isDeclarationFileName(firstDts.name), "File extension for signature expected to be dts", () => `Found: ${getAnyExtensionFromPath(firstDts.name)} for ${firstDts.name}:: All output files: ${JSON.stringify(emitOutput.outputFiles.map(f => f.name))}`);
latestSignature = (computeHash || generateDjb2Hash)(firstDts.text);
if (exportedModulesMapCache && latestSignature !== prevSignature) {
updateExportedModules(sourceFile, emitOutput.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
@@ -462,7 +450,7 @@ namespace ts {
/**
* Coverts the declaration emit result into exported modules map
*/
function updateExportedModules(sourceFile: SourceFile, exportedModulesFromDeclarationEmit: ExportedModulesFromDeclarationEmit | undefined, exportedModulesMapCache: ManyToManyPathMap) {
export function updateExportedModules(sourceFile: SourceFile, exportedModulesFromDeclarationEmit: ExportedModulesFromDeclarationEmit | undefined, exportedModulesMapCache: ManyToManyPathMap) {
if (!exportedModulesFromDeclarationEmit) {
exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
return;
@@ -494,22 +482,6 @@ namespace ts {
export function updateExportedFilesMapFromCache(state: BuilderState, exportedModulesMapCache: ManyToManyPathMap | undefined) {
if (exportedModulesMapCache) {
Debug.assert(!!state.exportedModulesMap);
const cacheId = exportedModulesMapCache.id;
const cacheVersion = exportedModulesMapCache.version();
if (state.previousCache) {
if (state.previousCache.id === cacheId && state.previousCache.version === cacheVersion) {
// If this is the same cache at the same version as last time this BuilderState
// was updated, there's no need to update again
return;
}
state.previousCache.id = cacheId;
state.previousCache.version = cacheVersion;
}
else {
state.previousCache = { id: cacheId, version: cacheVersion };
}
exportedModulesMapCache.deletedKeys()?.forEach(path => state.exportedModulesMap!.deleteKey(path));
exportedModulesMapCache.forEach((exportedModules, path) => state.exportedModulesMap!.set(path, exportedModules));
}
+249 -113
View File
@@ -833,6 +833,7 @@ namespace ts {
const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType;
const numberOrBigIntType = getUnionType([numberType, bigintType]);
const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]) as UnionType;
const numericStringType = getTemplateLiteralType(["", ""], [numberType]); // The `${number}` type
const restrictiveMapper: TypeMapper = makeFunctionTypeMapper(t => t.flags & TypeFlags.TypeParameter ? getRestrictiveTypeParameter(t as TypeParameter) : t);
const permissiveMapper: TypeMapper = makeFunctionTypeMapper(t => t.flags & TypeFlags.TypeParameter ? wildcardType : t);
@@ -1047,7 +1048,7 @@ namespace ts {
const builtinGlobals = createSymbolTable();
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
// Extensions suggested for path imports when module resolution is node12 or higher.
// Extensions suggested for path imports when module resolution is node16 or higher.
// The first element of each tuple is the extension a file has.
// The second element of each tuple is the extension that should be used in a path import.
// e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
@@ -3116,27 +3117,27 @@ namespace ts {
function resolveAlias(symbol: Symbol): Symbol {
Debug.assert((symbol.flags & SymbolFlags.Alias) !== 0, "Should only get Alias here.");
const links = getSymbolLinks(symbol);
if (!links.target) {
links.target = resolvingSymbol;
if (!links.aliasTarget) {
links.aliasTarget = resolvingSymbol;
const node = getDeclarationOfAliasSymbol(symbol);
if (!node) return Debug.fail();
const target = getTargetOfAliasDeclaration(node);
if (links.target === resolvingSymbol) {
links.target = target || unknownSymbol;
if (links.aliasTarget === resolvingSymbol) {
links.aliasTarget = target || unknownSymbol;
}
else {
error(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
}
}
else if (links.target === resolvingSymbol) {
links.target = unknownSymbol;
else if (links.aliasTarget === resolvingSymbol) {
links.aliasTarget = unknownSymbol;
}
return links.target;
return links.aliasTarget;
}
function tryResolveAlias(symbol: Symbol): Symbol | undefined {
const links = getSymbolLinks(symbol);
if (links.target !== resolvingSymbol) {
if (links.aliasTarget !== resolvingSymbol) {
return resolveAlias(symbol);
}
@@ -3527,7 +3528,7 @@ namespace ts {
if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);
}
if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) {
if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) {
const isSyncImport = (currentSourceFile.impliedNodeFormat === ModuleKind.CommonJS && !findAncestor(location, isImportCall)) || !!findAncestor(location, isImportEqualsDeclaration);
const overrideClauseHost = findAncestor(location, l => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)) as ImportTypeNode | ImportDeclaration | ExportDeclaration | undefined;
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? overrideClauseHost.assertions?.assertClause : overrideClauseHost?.assertClause;
@@ -3536,9 +3537,6 @@ namespace ts {
if (isSyncImport && sourceFile.impliedNodeFormat === ModuleKind.ESNext && !getResolutionModeOverrideForClause(overrideClause)) {
error(errorNode, 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);
}
if (mode === ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === Extension.Json) {
error(errorNode, Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
}
}
// merged symbol is module declaration symbol combined with all augmentations
return getMergedSymbol(sourceFile.symbol);
@@ -3595,7 +3593,7 @@ namespace ts {
const tsExtension = tryExtractTSExtension(moduleReference);
const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference);
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
const resolutionIsNode12OrNext = moduleResolutionKind === ModuleResolutionKind.Node12 ||
const resolutionIsNode16OrNext = moduleResolutionKind === ModuleResolutionKind.Node16 ||
moduleResolutionKind === ModuleResolutionKind.NodeNext;
if (tsExtension) {
const diag = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
@@ -3616,16 +3614,16 @@ namespace ts {
hasJsonModuleEmitEnabled(compilerOptions)) {
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
}
else if (mode === ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
else if (mode === ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
const suggestedExt = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))?.[1];
if (suggestedExt) {
error(errorNode,
Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0,
Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,
moduleReference + suggestedExt);
}
else {
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
}
}
else {
@@ -4109,7 +4107,7 @@ namespace ts {
function getExportSymbolOfValueSymbolIfExported(symbol: Symbol): Symbol;
function getExportSymbolOfValueSymbolIfExported(symbol: Symbol | undefined): Symbol | undefined;
function getExportSymbolOfValueSymbolIfExported(symbol: Symbol | undefined): Symbol | undefined {
return getMergedSymbol(symbol && (symbol.flags & SymbolFlags.ExportValue) !== 0 ? symbol.exportSymbol : symbol);
return getMergedSymbol(symbol && (symbol.flags & SymbolFlags.ExportValue) !== 0 && symbol.exportSymbol || symbol);
}
function symbolIsValue(symbol: Symbol): boolean {
@@ -5102,13 +5100,49 @@ namespace ts {
function conditionalTypeToTypeNode(type: ConditionalType) {
const checkTypeNode = typeToTypeNodeHelper(type.checkType, context);
context.approximateLength += 15;
if (context.flags & NodeBuilderFlags.GenerateNamesForShadowedTypeParams && type.root.isDistributive && !(type.checkType.flags & TypeFlags.TypeParameter)) {
const newParam = createTypeParameter(createSymbol(SymbolFlags.TypeParameter, "T" as __String));
const name = typeParameterToName(newParam, context);
const newTypeVariable = factory.createTypeReferenceNode(name);
context.approximateLength += 37; // 15 each for two added conditionals, 7 for an added infer type
const newMapper = prependTypeMapping(type.root.checkType, newParam, type.combinedMapper || type.mapper);
const saveInferTypeParameters = context.inferTypeParameters;
context.inferTypeParameters = type.root.inferTypeParameters;
const extendsTypeNode = typeToTypeNodeHelper(instantiateType(type.root.extendsType, newMapper), context);
context.inferTypeParameters = saveInferTypeParameters;
const trueTypeNode = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type.root.node.trueType), newMapper));
const falseTypeNode = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type.root.node.falseType), newMapper));
// outermost conditional makes `T` a type parameter, allowing the inner conditionals to be distributive
// second conditional makes `T` have `T & checkType` substitution, so it is correctly usable as the checkType
// inner conditional runs the check the user provided on the check type (distributively) and returns the result
// checkType extends infer T ? T extends checkType ? T extends extendsType<T> ? trueType<T> : falseType<T> : never : never;
// this is potentially simplifiable to
// checkType extends infer T ? T extends checkType & extendsType<T> ? trueType<T> : falseType<T> : never;
// but that may confuse users who read the output more.
// On the other hand,
// checkType extends infer T extends checkType ? T extends extendsType<T> ? trueType<T> : falseType<T> : never;
// may also work with `infer ... extends ...` in, but would produce declarations only compatible with the latest TS.
return factory.createConditionalTypeNode(
checkTypeNode,
factory.createInferTypeNode(factory.createTypeParameterDeclaration(/*modifiers*/ undefined, factory.cloneNode(newTypeVariable.typeName) as Identifier)),
factory.createConditionalTypeNode(
factory.createTypeReferenceNode(factory.cloneNode(name)),
typeToTypeNodeHelper(type.checkType, context),
factory.createConditionalTypeNode(newTypeVariable, extendsTypeNode, trueTypeNode, falseTypeNode),
factory.createKeywordTypeNode(SyntaxKind.NeverKeyword)
),
factory.createKeywordTypeNode(SyntaxKind.NeverKeyword)
);
}
const saveInferTypeParameters = context.inferTypeParameters;
context.inferTypeParameters = type.root.inferTypeParameters;
const extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context);
context.inferTypeParameters = saveInferTypeParameters;
const trueTypeNode = typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(type));
const falseTypeNode = typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(type));
context.approximateLength += 15;
return factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
}
@@ -5879,9 +5913,6 @@ namespace ts {
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
parameterType = getOptionalType(parameterType);
}
if ((context.flags & NodeBuilderFlags.NoUndefinedOptionalParameterType) && parameterDeclaration && !isJSDocParameterTag(parameterDeclaration) && isOptionalUninitializedParameter(parameterDeclaration)) {
parameterType = getTypeWithFacts(parameterType, TypeFacts.NEUndefined);
}
const parameterTypeNode = serializeTypeForDeclaration(context, parameterType, parameterSymbol, context.enclosingDeclaration, privateSymbolVisitor, bundledImports);
const modifiers = !(context.flags & NodeBuilderFlags.OmitParameterModifiers) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(factory.cloneNode) : undefined;
@@ -6157,7 +6188,7 @@ namespace ts {
const targetFile = getSourceFileOfModule(chain[0]);
let specifier: string | undefined;
let assertion: ImportTypeAssertionContainer | undefined;
if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) {
if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) {
// An `import` type directed at an esm format file is only going to resolve in esm mode - set the esm mode assertion
if (targetFile?.impliedNodeFormat === ModuleKind.ESNext && targetFile.impliedNodeFormat !== contextFile?.impliedNodeFormat) {
specifier = getSpecifierForModuleSymbol(chain[0], context, ModuleKind.ESNext);
@@ -6174,7 +6205,7 @@ namespace ts {
}
if (!(context.flags & NodeBuilderFlags.AllowNodeModulesRelativePaths) && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
const oldSpecifier = specifier;
if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) {
if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) {
// We might be able to write a portable import type using a mode override; try specifier generation again, but with a different mode set
const swappedMode = contextFile?.impliedNodeFormat === ModuleKind.ESNext ? ModuleKind.CommonJS : ModuleKind.ESNext;
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
@@ -6508,7 +6539,7 @@ namespace ts {
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
// try to reuse the existing annotation
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation)!;
if (getTypeFromTypeNode(existing) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
const result = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled);
if (result) {
return result;
@@ -6526,6 +6557,17 @@ namespace ts {
return result;
}
function typeNodeIsEquivalentToType(typeNode: TypeNode, annotatedDeclaration: Declaration, type: Type) {
const typeFromTypeNode = getTypeFromTypeNode(typeNode);
if (typeFromTypeNode === type) {
return true;
}
if (isParameter(annotatedDeclaration) && annotatedDeclaration.questionToken) {
return getTypeWithFacts(type, TypeFacts.NEUndefined) === typeFromTypeNode;
}
return false;
}
function serializeReturnTypeForSignature(context: NodeBuilderContext, type: Type, signature: Signature, includePrivateSymbol?: (s: Symbol) => void, bundled?: boolean) {
if (!isErrorType(type) && context.enclosingDeclaration) {
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
@@ -9162,7 +9204,7 @@ namespace ts {
}
}
const sourceTypes = some(constructorTypes, t => !!(t.flags & ~TypeFlags.Nullable)) ? constructorTypes : types; // TODO: GH#18217
type = getUnionType(sourceTypes!, UnionReduction.Subtype);
type = getUnionType(sourceTypes!);
}
}
const widened = getWidenedType(addOptionality(type, /*isProperty*/ false, definedInMethod && !definedInConstructor));
@@ -11462,7 +11504,7 @@ namespace ts {
if (symbol === globalThisSymbol) {
const varsOnly = new Map<string, Symbol>() as SymbolTable;
members.forEach(p => {
if (!(p.flags & SymbolFlags.BlockScoped)) {
if (!(p.flags & SymbolFlags.BlockScoped) && !(p.flags & SymbolFlags.ValueModule && p.declarations?.length && every(p.declarations, isAmbientModule))) {
varsOnly.set(p.escapedName, p);
}
});
@@ -12063,7 +12105,7 @@ namespace ts {
if (type.resolvedBaseConstraint) {
return type.resolvedBaseConstraint;
}
const stack: Type[] = [];
const stack: object[] = [];
return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type);
function getImmediateBaseConstraint(t: Type): Type {
@@ -12078,8 +12120,9 @@ namespace ts {
// levels of nesting, we are presumably exploring a repeating pattern with a long cycle that hasn't
// yet triggered the deeply nested limiter. We have no test cases that actually get to 50 levels of
// nesting, so it is effectively just a safety stop.
if (stack.length < 10 || stack.length < 50 && !isDeeplyNestedType(t, stack, stack.length)) {
stack.push(t);
const identity = getRecursionIdentity(t);
if (stack.length < 10 || stack.length < 50 && !contains(stack, identity)) {
stack.push(identity);
result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false));
stack.pop();
}
@@ -12228,7 +12271,7 @@ namespace ts {
const typeVariable = getHomomorphicTypeVariable(type);
if (typeVariable && !type.declaration.nameType) {
const constraint = getConstraintOfTypeParameter(typeVariable);
if (constraint && (isArrayType(constraint) || isTupleType(constraint))) {
if (constraint && isArrayOrTupleType(constraint)) {
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
}
}
@@ -12609,10 +12652,10 @@ namespace ts {
function isApplicableIndexType(source: Type, target: Type): boolean {
// A 'string' index signature applies to types assignable to 'string' or 'number', and a 'number' index
// signature applies to types assignable to 'number' and numeric string literal types.
// signature applies to types assignable to 'number', `${number}` and numeric string literal types.
return isTypeAssignableTo(source, target) ||
target === stringType && isTypeAssignableTo(source, numberType) ||
target === numberType && !!(source.flags & TypeFlags.StringLiteral) && isNumericLiteralName((source as StringLiteralType).value);
target === numberType && (source === numericStringType || !!(source.flags & TypeFlags.StringLiteral) && isNumericLiteralName((source as StringLiteralType).value));
}
function getIndexInfosOfStructuredType(type: Type): readonly IndexInfo[] {
@@ -13733,6 +13776,20 @@ namespace ts {
constraints = append(constraints, constraint);
}
}
// Given a homomorphic mapped type { [K in keyof T]: XXX }, where T is constrained to an array or tuple type, in the
// template type XXX, K has an added constraint of number | `${number}`.
else if (type.flags & TypeFlags.TypeParameter && parent.kind === SyntaxKind.MappedType && node === (parent as MappedTypeNode).type) {
const mappedType = getTypeFromTypeNode(parent as TypeNode) as MappedType;
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
const typeParameter = getHomomorphicTypeVariable(mappedType);
if (typeParameter) {
const constraint = getConstraintOfTypeParameter(typeParameter);
if (constraint && everyType(constraint, isArrayOrTupleType)) {
constraints = append(constraints, getUnionType([numberType, numericStringType]));
}
}
}
}
node = parent;
}
return constraints ? getSubstitutionType(type, getIntersectionType(append(constraints, type))) : type;
@@ -14772,7 +14829,7 @@ namespace ts {
i--;
const t = types[i];
const remove =
t.flags & TypeFlags.String && includes & TypeFlags.StringLiteral ||
t.flags & TypeFlags.String && includes & (TypeFlags.StringLiteral | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) ||
t.flags & TypeFlags.Number && includes & TypeFlags.NumberLiteral ||
t.flags & TypeFlags.BigInt && includes & TypeFlags.BigIntLiteral ||
t.flags & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol;
@@ -14933,7 +14990,7 @@ namespace ts {
if (!strictNullChecks && includes & TypeFlags.Nullable) {
return includes & TypeFlags.Undefined ? undefinedType : nullType;
}
if (includes & TypeFlags.String && includes & TypeFlags.StringLiteral ||
if (includes & TypeFlags.String && includes & (TypeFlags.StringLiteral | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) ||
includes & TypeFlags.Number && includes & TypeFlags.NumberLiteral ||
includes & TypeFlags.BigInt && includes & TypeFlags.BigIntLiteral ||
includes & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol) {
@@ -15692,11 +15749,14 @@ namespace ts {
return type[cache] = elementType;
}
}
// If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper
// that substitutes the index type for P. For example, for an index access { [P in K]: Box<T[P]> }[X], we
// construct the type Box<T[X]>.
if (isGenericMappedType(objectType) && !objectType.declaration.nameType) {
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), t => getSimplifiedType(t, writing));
// If the object type is a mapped type { [P in K]: E }, where K is generic, or { [P in K as N]: E }, where
// K is generic and N is assignable to P, instantiate E using a mapper that substitutes the index type for P.
// For example, for an index access { [P in K]: Box<T[P]> }[X], we construct the type Box<T[X]>.
if (isGenericMappedType(objectType)) {
const nameType = getNameTypeFromMappedType(objectType);
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), t => getSimplifiedType(t, writing));
}
}
return type[cache] = type;
}
@@ -16948,7 +17008,7 @@ namespace ts {
if (!type.declaration.nameType) {
let constraint;
if (isArrayType(t) || t.flags & TypeFlags.Any && findResolutionCycleStartIndex(typeVariable, TypeSystemPropertyName.ImmediateBaseConstraint) < 0 &&
(constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, or(isArrayType, isTupleType))) {
(constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
}
if (isGenericTupleType(t)) {
@@ -18517,7 +18577,7 @@ namespace ts {
}
return false;
}
return isTupleType(target) || isArrayType(target);
return isArrayOrTupleType(target);
}
if (isReadonlyArrayType(source) && isMutableArrayOrTuple(target)) {
if (reportErrors) {
@@ -18652,7 +18712,7 @@ namespace ts {
// recursive intersections that are structurally similar but not exactly identical. See #37854.
if (result && !inPropertyCheck && (
target.flags & TypeFlags.Intersection && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && !some((source as IntersectionType).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) {
isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && !some((source as IntersectionType).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) {
inPropertyCheck = true;
result &= recursiveTypeRelatedTo(source, target, reportErrors, IntersectionState.PropertyCheck, recursionFlags);
inPropertyCheck = false;
@@ -18709,9 +18769,6 @@ namespace ts {
return;
}
reportRelationError(headMessage, source, target);
if (strictNullChecks && source.flags & TypeFlags.TypeVariable && source.symbol?.declarations?.[0] && !getConstraintOfType(source as TypeVariable) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) {
associateRelatedInfo(createDiagnosticForNode(source.symbol.declarations[0], Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint));
}
}
function traceUnionsOrIntersectionsTooLarge(source: Type, target: Type): void {
@@ -19502,7 +19559,7 @@ namespace ts {
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
if (!(sourceFlags & TypeFlags.IndexedAccess && targetFlags & TypeFlags.IndexedAccess)) {
const constraint = getConstraintOfType(source as TypeVariable);
if (!strictNullChecks && (!constraint || (sourceFlags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any))) {
if (!constraint || (sourceFlags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive), RecursionFlags.Both)) {
resetErrorInfo(saveErrorInfo);
@@ -19510,12 +19567,12 @@ namespace ts {
}
}
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
else if (constraint && (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState))) {
else if (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
else if (constraint && (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, RecursionFlags.Source, reportErrors && !(targetFlags & sourceFlags & TypeFlags.TypeParameter), /*headMessage*/ undefined, intersectionState))) {
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, RecursionFlags.Source, reportErrors && !(targetFlags & sourceFlags & TypeFlags.TypeParameter), /*headMessage*/ undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
@@ -19660,7 +19717,7 @@ namespace ts {
return varianceResult;
}
}
else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
else if (isReadonlyArrayType(target) ? isArrayOrTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
if (relation !== identityRelation) {
return isRelatedTo(getIndexTypeOfType(source, numberType) || anyType, getIndexTypeOfType(target, numberType) || anyType, RecursionFlags.Both, reportErrors);
}
@@ -20045,7 +20102,7 @@ namespace ts {
}
let result = Ternary.True;
if (isTupleType(target)) {
if (isArrayType(source) || isTupleType(source)) {
if (isArrayOrTupleType(source)) {
if (!target.target.readonly && (isReadonlyArrayType(source) || isTupleType(source) && source.target.readonly)) {
return Ternary.False;
}
@@ -21050,6 +21107,10 @@ namespace ts {
return !!(getObjectFlags(type) & ObjectFlags.Reference) && (type as TypeReference).target === globalReadonlyArrayType;
}
function isArrayOrTupleType(type: Type): type is TypeReference {
return isArrayType(type) || isTupleType(type);
}
function isMutableArrayOrTuple(type: Type): boolean {
return isArrayType(type) && !isReadonlyArrayType(type) || isTupleType(type) && !type.target.readonly;
}
@@ -21550,7 +21611,7 @@ namespace ts {
else if (type.flags & TypeFlags.Intersection) {
result = getIntersectionType(sameMap((type as IntersectionType).types, getWidenedType));
}
else if (isArrayType(type) || isTupleType(type)) {
else if (isArrayOrTupleType(type)) {
result = createTypeReference(type.target, sameMap(getTypeArguments(type), getWidenedType));
}
if (result && context === undefined) {
@@ -21587,7 +21648,7 @@ namespace ts {
}
}
}
if (isArrayType(type) || isTupleType(type)) {
if (isArrayOrTupleType(type)) {
for (const t of getTypeArguments(type)) {
if (reportWideningErrorsInType(t)) {
errorReported = true;
@@ -22666,7 +22727,7 @@ namespace ts {
}
// Infer from the members of source and target only if the two types are possibly related
if (!typesDefinitelyUnrelated(source, target)) {
if (isArrayType(source) || isTupleType(source)) {
if (isArrayOrTupleType(source)) {
if (isTupleType(target)) {
const sourceArity = getTypeReferenceArity(source);
const targetArity = getTypeReferenceArity(target);
@@ -25464,7 +25525,7 @@ namespace ts {
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
const parent = declaration.parent.parent;
if (parent.kind === SyntaxKind.VariableDeclaration && getCombinedNodeFlags(declaration) & NodeFlags.Const || parent.kind === SyntaxKind.Parameter) {
const links = getNodeLinks(location);
const links = getNodeLinks(parent);
if (!(links.flags & NodeCheckFlags.InCheckIdentifier)) {
links.flags |= NodeCheckFlags.InCheckIdentifier;
const parentType = getTypeForBindingElementParent(parent, CheckMode.Normal);
@@ -27938,6 +27999,7 @@ namespace ts {
}
}
else {
error(attributeDecl.expression, Diagnostics.Spread_types_may_only_be_created_from_object_types);
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
}
}
@@ -28898,10 +28960,17 @@ namespace ts {
prop = getPropertyOfType(apparentType, right.escapedText);
}
// In `Foo.Bar.Baz`, 'Foo' is not referenced if 'Bar' is a const enum or a module containing only const enums.
// `Foo` is also not referenced in `enum FooCopy { Bar = Foo.Bar }`, because the enum member value gets inlined
// here even if `Foo` is not a const enum.
//
// The exceptions are:
// 1. if 'isolatedModules' is enabled, because the const enum value will not be inlined, and
// 2. if 'preserveConstEnums' is enabled and the expression is itself an export, e.g. `export = Foo.Bar.Baz`.
if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && isConstEnumOrConstEnumOnlyModule(prop)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
if (isIdentifier(left) && parentSymbol && (
compilerOptions.isolatedModules ||
!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & SymbolFlags.EnumMember && node.parent.kind === SyntaxKind.EnumMember)) ||
shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node)
)) {
markAliasReferenced(parentSymbol, node);
}
@@ -30338,9 +30407,15 @@ namespace ts {
const parameterRange = hasRestParameter ? min
: min < max ? min + "-" + max
: min;
const error = hasRestParameter ? Diagnostics.Expected_at_least_0_arguments_but_got_1
: parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node) ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
: Diagnostics.Expected_0_arguments_but_got_1;
const isVoidPromiseError = !hasRestParameter && parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node);
if (isVoidPromiseError && isInJSFile(node)) {
return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments);
}
const error = hasRestParameter
? Diagnostics.Expected_at_least_0_arguments_but_got_1
: isVoidPromiseError
? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
: Diagnostics.Expected_0_arguments_but_got_1;
if (min < args.length && args.length < max) {
// between min and max, but with no matching overload
return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove);
@@ -30445,6 +30520,7 @@ namespace ts {
// decorators are applied to a declaration by the emitter, and not to an expression.
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
let argCheckMode = !isDecorator && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? CheckMode.SkipContextSensitive : CheckMode.Normal;
argCheckMode |= checkMode & CheckMode.IsForStringLiteralArgumentCompletions;
// The following variables are captured and modified by calls to chooseOverload.
// If overload resolution or type argument inference fails, we want to report the
@@ -30670,7 +30746,7 @@ namespace ts {
// If one or more context sensitive arguments were excluded, we start including
// them now (and keeping do so for any subsequent candidates) and perform a second
// round of type inference and applicability checking for this particular candidate.
argCheckMode = CheckMode.Normal;
argCheckMode = checkMode & CheckMode.IsForStringLiteralArgumentCompletions;
if (inferenceContext) {
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
@@ -31712,7 +31788,7 @@ namespace ts {
const newSymbol = createSymbol(SymbolFlags.Alias, InternalSymbolName.Default);
newSymbol.parent = originalSymbol;
newSymbol.nameType = getStringLiteralType("default");
newSymbol.target = resolveSymbol(symbol);
newSymbol.aliasTarget = resolveSymbol(symbol);
memberTable.set(InternalSymbolName.Default, newSymbol);
return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray);
}
@@ -31978,13 +32054,13 @@ namespace ts {
}
function checkImportMetaProperty(node: MetaProperty) {
if (moduleKind === ModuleKind.Node12 || moduleKind === ModuleKind.NodeNext) {
if (moduleKind === ModuleKind.Node16 || moduleKind === ModuleKind.NodeNext) {
if (getSourceFileOfNode(node).impliedNodeFormat !== ModuleKind.ESNext) {
error(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
}
}
else if (moduleKind < ModuleKind.ES2020 && moduleKind !== ModuleKind.System) {
error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);
error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
}
const file = getSourceFileOfNode(node);
Debug.assert(!!(file.flags & NodeFlags.PossiblyContainsImportMeta), "Containing file is missing import meta node flag.");
@@ -33014,16 +33090,37 @@ namespace ts {
if (!hasParseDiagnostics(sourceFile)) {
let span: TextSpan | undefined;
if (!isEffectiveExternalModule(sourceFile, compilerOptions)) {
if (!span) span = getSpanOfTokenAtPosition(sourceFile, node.pos);
span ??= getSpanOfTokenAtPosition(sourceFile, node.pos);
const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length,
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);
diagnostics.add(diagnostic);
}
if ((moduleKind !== ModuleKind.ES2022 && moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.System && !(moduleKind === ModuleKind.NodeNext && getSourceFileOfNode(node).impliedNodeFormat === ModuleKind.ESNext)) || languageVersion < ScriptTarget.ES2017) {
span = getSpanOfTokenAtPosition(sourceFile, node.pos);
const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length,
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);
diagnostics.add(diagnostic);
switch (moduleKind) {
case ModuleKind.Node16:
case ModuleKind.NodeNext:
if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) {
span ??= getSpanOfTokenAtPosition(sourceFile, node.pos);
diagnostics.add(
createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)
);
break;
}
// fallthrough
case ModuleKind.ES2022:
case ModuleKind.ESNext:
case ModuleKind.System:
if (languageVersion >= ScriptTarget.ES2017) {
break;
}
// fallthrough
default:
span ??= getSpanOfTokenAtPosition(sourceFile, node.pos);
diagnostics.add(
createFileDiagnostic(sourceFile, span.start, span.length,
Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher
)
);
break;
}
}
}
@@ -34793,19 +34890,29 @@ namespace ts {
if (constraintType && defaultType) {
checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, Diagnostics.Type_0_does_not_satisfy_the_constraint_1);
}
if (node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.ClassDeclaration || node.parent.kind === SyntaxKind.TypeAliasDeclaration) {
checkNodeDeferred(node);
addLazyDiagnostic(() => checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0));
}
function checkTypeParameterDeferred(node: TypeParameterDeclaration) {
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node));
const modifiers = getVarianceModifiers(typeParameter);
if (modifiers === ModifierFlags.In || modifiers === ModifierFlags.Out) {
if (modifiers) {
const symbol = getSymbolOfNode(node.parent);
const source = createMarkerType(symbol, typeParameter, modifiers === ModifierFlags.Out ? markerSubType : markerSuperType);
const target = createMarkerType(symbol, typeParameter, modifiers === ModifierFlags.Out ? markerSuperType : markerSubType);
const saveVarianceTypeParameter = typeParameter;
varianceTypeParameter = typeParameter;
checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
varianceTypeParameter = saveVarianceTypeParameter;
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (ObjectFlags.Anonymous | ObjectFlags.Mapped))) {
error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
}
else if (modifiers === ModifierFlags.In || modifiers === ModifierFlags.Out) {
const source = createMarkerType(symbol, typeParameter, modifiers === ModifierFlags.Out ? markerSubType : markerSuperType);
const target = createMarkerType(symbol, typeParameter, modifiers === ModifierFlags.Out ? markerSuperType : markerSubType);
const saveVarianceTypeParameter = typeParameter;
varianceTypeParameter = typeParameter;
checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
varianceTypeParameter = saveVarianceTypeParameter;
}
}
}
addLazyDiagnostic(() => checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0));
}
function checkParameter(node: ParameterDeclaration) {
@@ -35350,7 +35457,7 @@ namespace ts {
superCallStatement = statement;
break;
}
if (!isPrologueDirective(statement) && nodeImmediatelyReferencesSuperOrThis(statement)) {
if (nodeImmediatelyReferencesSuperOrThis(statement)) {
break;
}
}
@@ -35717,8 +35824,8 @@ namespace ts {
if (node.assertions) {
const override = getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
if (override) {
if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node12 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) {
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext);
if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) {
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
}
}
}
@@ -37336,7 +37443,7 @@ namespace ts {
function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier | undefined) {
// No need to check for require or exports for ES6 modules and later
if (moduleKind >= ModuleKind.ES2015 && !(moduleKind >= ModuleKind.Node12 && getSourceFileOfNode(node).impliedNodeFormat === ModuleKind.CommonJS)) {
if (moduleKind >= ModuleKind.ES2015 && !(moduleKind >= ModuleKind.Node16 && getSourceFileOfNode(node).impliedNodeFormat === ModuleKind.CommonJS)) {
return;
}
@@ -38158,7 +38265,7 @@ namespace ts {
return (use & IterationUse.PossiblyOutOfBounds) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
function getIterationDiagnosticDetails(allowsStrings: boolean, downlevelIteration: boolean | undefined): [DiagnosticMessage, boolean] {
function getIterationDiagnosticDetails(allowsStrings: boolean, downlevelIteration: boolean | undefined): [error: DiagnosticMessage, maybeMissingAwait: boolean] {
if (downlevelIteration) {
return allowsStrings
? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]
@@ -38168,7 +38275,7 @@ namespace ts {
const yieldType = getIterationTypeOfIterable(use, IterationTypeKind.Yield, inputType, /*errorNode*/ undefined);
if (yieldType) {
return [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false];
return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false];
}
if (isES2015OrLaterIterable(inputType.symbol?.escapedName)) {
@@ -40166,7 +40273,7 @@ namespace ts {
function isConstantMemberAccess(node: Expression): node is AccessExpression {
const type = getTypeOfExpression(node);
if(type === errorType) {
if (type === errorType) {
return false;
}
@@ -40611,8 +40718,12 @@ namespace ts {
const validForTypeAssertions = isExclusivelyTypeOnlyImportOrExport(declaration);
const override = getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
if (validForTypeAssertions && override) {
if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node12 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) {
return grammarErrorOnNode(declaration.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext);
if (!isNightly()) {
grammarErrorOnNode(declaration.assertClause, Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
}
if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) {
return grammarErrorOnNode(declaration.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
}
return; // Other grammar checks do not apply to type-only imports with resolution mode assertions
}
@@ -41304,6 +41415,9 @@ namespace ts {
case SyntaxKind.ClassExpression:
checkClassExpressionDeferred(node as ClassExpression);
break;
case SyntaxKind.TypeParameter:
checkTypeParameterDeferred(node as TypeParameterDeclaration);
break;
case SyntaxKind.JsxSelfClosingElement:
checkJsxSelfClosingElementDeferred(node as JsxSelfClosingElement);
break;
@@ -41803,7 +41917,7 @@ namespace ts {
const symbol = getIntrinsicTagSymbol(name.parent as JsxOpeningLikeElement);
return symbol === unknownSymbol ? undefined : symbol;
}
const result = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ !isJSDoc, getHostSignatureFromJSDoc(name));
const result = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /* dontResolveAlias */ true, getHostSignatureFromJSDoc(name));
if (!result && isJSDoc) {
const container = findAncestor(name, or(isClassLike, isInterfaceDeclaration));
if (container) {
@@ -41914,15 +42028,20 @@ namespace ts {
return propertyDeclaration;
}
}
else if (isMetaProperty(parent)) {
const parentType = getTypeOfNode(parent);
const propertyDeclaration = getPropertyOfType(parentType, (node as Identifier).escapedText);
if (propertyDeclaration) {
return propertyDeclaration;
}
if (parent.keywordToken === SyntaxKind.NewKeyword) {
else if (isMetaProperty(parent) && parent.name === node) {
if (parent.keywordToken === SyntaxKind.NewKeyword && idText(node as Identifier) === "target") {
// `target` in `new.target`
return checkNewTargetMetaProperty(parent).symbol;
}
// The `meta` in `import.meta` could be given `getTypeOfNode(parent).symbol` (the `ImportMeta` interface symbol), but
// we have a fake expression type made for other reasons already, whose transient `meta`
// member should more exactly be the kind of (declarationless) symbol we want.
// (See #44364 and #45031 for relevant implementation PRs)
if (parent.keywordToken === SyntaxKind.ImportKeyword && idText(node as Identifier) === "meta") {
return getGlobalImportMetaExpressionType().members!.get("meta" as __String);
}
// no other meta properties are valid syntax, thus no others should have symbols
return undefined;
}
}
@@ -42083,7 +42202,7 @@ namespace ts {
if (isDeclaration(node)) {
// In this case, we call getSymbolOfNode instead of getSymbolAtLocation because it is a declaration
const symbol = getSymbolOfNode(node);
return getTypeOfSymbol(symbol);
return symbol ? getTypeOfSymbol(symbol) : errorType;
}
if (isDeclarationNameOrImportPropertyName(node)) {
@@ -42230,11 +42349,11 @@ namespace ts {
const { leftSpread, rightSpread, syntheticOrigin } = symbol as TransientSymbol;
return leftSpread ? [leftSpread, rightSpread!]
: syntheticOrigin ? [syntheticOrigin]
: singleElementArray(tryGetAliasTarget(symbol));
: singleElementArray(tryGetTarget(symbol));
}
return undefined;
}
function tryGetAliasTarget(symbol: Symbol): Symbol | undefined {
function tryGetTarget(symbol: Symbol): Symbol | undefined {
let target: Symbol | undefined;
let next: Symbol | undefined = symbol;
while (next = getSymbolLinks(next).target) {
@@ -42486,7 +42605,7 @@ namespace ts {
if (links?.referenced) {
return true;
}
const target = getSymbolLinks(symbol!).target; // TODO: GH#18217
const target = getSymbolLinks(symbol!).aliasTarget; // TODO: GH#18217
if (target && getEffectiveModifierFlags(node) & ModifierFlags.Export &&
target.flags & SymbolFlags.Value &&
(shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
@@ -42538,12 +42657,6 @@ namespace ts {
hasSyntacticModifier(parameter, ModifierFlags.ParameterPropertyModifier);
}
function isOptionalUninitializedParameter(parameter: ParameterDeclaration) {
return !!strictNullChecks &&
isOptionalParameter(parameter) &&
!parameter.initializer;
}
function isExpandoFunctionDeclaration(node: Declaration): boolean {
const declaration = getParseTreeNode(node, isFunctionDeclaration);
if (!declaration) {
@@ -43507,8 +43620,7 @@ namespace ts {
case SyntaxKind.OutKeyword:
const inOutFlag = modifier.kind === SyntaxKind.InKeyword ? ModifierFlags.In : ModifierFlags.Out;
const inOutText = modifier.kind === SyntaxKind.InKeyword ? "in" : "out";
if (node.kind !== SyntaxKind.TypeParameter || (node.parent.kind !== SyntaxKind.InterfaceDeclaration &&
node.parent.kind !== SyntaxKind.ClassDeclaration && node.parent.kind !== SyntaxKind.TypeAliasDeclaration)) {
if (node.kind !== SyntaxKind.TypeParameter || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
}
if (flags & inOutFlag) {
@@ -43808,6 +43920,9 @@ namespace ts {
}
function checkGrammarExpressionWithTypeArguments(node: ExpressionWithTypeArguments | TypeQueryNode) {
if (isExpressionWithTypeArguments(node) && isImportKeyword(node.expression) && node.typeArguments) {
return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
}
return checkGrammarTypeArguments(node, node.typeArguments);
}
@@ -44080,9 +44195,30 @@ namespace ts {
diagnostics.add(createDiagnosticForNode(forInOrOfStatement.awaitModifier,
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));
}
if ((moduleKind !== ModuleKind.ES2022 && moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.System && !(moduleKind === ModuleKind.NodeNext && getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ModuleKind.ESNext)) || languageVersion < ScriptTarget.ES2017) {
diagnostics.add(createDiagnosticForNode(forInOrOfStatement.awaitModifier,
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));
switch (moduleKind) {
case ModuleKind.Node16:
case ModuleKind.NodeNext:
if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) {
diagnostics.add(
createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)
);
break;
}
// fallthrough
case ModuleKind.ES2022:
case ModuleKind.ESNext:
case ModuleKind.System:
if (languageVersion >= ScriptTarget.ES2017) {
break;
}
// fallthrough
default:
diagnostics.add(
createDiagnosticForNode(forInOrOfStatement.awaitModifier,
Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher
)
);
break;
}
}
}
@@ -44854,11 +44990,11 @@ namespace ts {
function checkGrammarImportCallExpression(node: ImportCall): boolean {
if (moduleKind === ModuleKind.ES2015) {
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
}
if (node.typeArguments) {
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_have_type_arguments);
return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
}
const nodeArguments = node.arguments;
@@ -44868,7 +45004,7 @@ namespace ts {
if (nodeArguments.length > 1) {
const assertionArgument = nodeArguments[1];
return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext);
return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
}
}
+4 -3
View File
@@ -81,6 +81,7 @@ namespace ts {
["es2021.intl", "lib.es2021.intl.d.ts"],
["es2022.array", "lib.es2022.array.d.ts"],
["es2022.error", "lib.es2022.error.d.ts"],
["es2022.intl", "lib.es2022.intl.d.ts"],
["es2022.object", "lib.es2022.object.d.ts"],
["es2022.string", "lib.es2022.string.d.ts"],
["esnext.array", "lib.es2022.array.d.ts"],
@@ -423,7 +424,7 @@ namespace ts {
es2020: ModuleKind.ES2020,
es2022: ModuleKind.ES2022,
esnext: ModuleKind.ESNext,
node12: ModuleKind.Node12,
node16: ModuleKind.Node16,
nodenext: ModuleKind.NodeNext,
})),
affectsModuleResolution: true,
@@ -781,7 +782,7 @@ namespace ts {
type: new Map(getEntries({
node: ModuleResolutionKind.NodeJs,
classic: ModuleResolutionKind.Classic,
node12: ModuleResolutionKind.Node12,
node16: ModuleResolutionKind.Node16,
nodenext: ModuleResolutionKind.NodeNext,
})),
affectsModuleResolution: true,
@@ -1263,7 +1264,7 @@ namespace ts {
affectsModuleResolution: true,
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
category: Diagnostics.Language_and_Environment,
defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules,
defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
}
];
+1 -1
View File
@@ -5,7 +5,7 @@ namespace ts {
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version = `${versionMajorMinor}.0-beta`;
export const version = `${versionMajorMinor}.1-rc`;
/**
* Type of objects whose values are all of the same type.
+34 -20
View File
@@ -900,6 +900,10 @@
"category": "Error",
"code": 1308
},
"The current file is a CommonJS module and cannot use 'await' at the top level.": {
"category": "Error",
"code": 1309
},
"Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern.": {
"category": "Error",
"code": 1312
@@ -944,11 +948,11 @@
"category": "Error",
"code": 1322
},
"Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'.": {
"Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'.": {
"category": "Error",
"code": 1323
},
"Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'.": {
"Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'.": {
"category": "Error",
"code": 1324
},
@@ -956,7 +960,7 @@
"category": "Error",
"code": 1325
},
"Dynamic import cannot have type arguments.": {
"This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.": {
"category": "Error",
"code": 1326
},
@@ -1016,7 +1020,7 @@
"category": "Error",
"code": 1342
},
"The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'.": {
"The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.": {
"category": "Error",
"code": 1343
},
@@ -1140,7 +1144,7 @@
"category": "Message",
"code": 1377
},
"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.": {
"Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.": {
"category": "Error",
"code": 1378
},
@@ -1348,7 +1352,7 @@
"category": "Error",
"code": 1431
},
"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.": {
"Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.": {
"category": "Error",
"code": 1432
},
@@ -1420,7 +1424,7 @@
"category": "Error",
"code": 1451
},
"Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`.": {
"Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`.": {
"category": "Error",
"code": 1452
},
@@ -1465,7 +1469,7 @@
"category": "Message",
"code": 1475
},
"\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node12+) as modules.": {
"\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.": {
"category": "Message",
"code": 1476
},
@@ -1506,9 +1510,14 @@
"category": "Error",
"code": 2207
},
"This type parameter probably needs an `extends object` constraint.": {
"The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate.": {
"category": "Error",
"code": 2208
"code": 2209
},
"The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate.": {
"category": "Error",
"code": 2210
},
"Duplicate identifier '{0}'.": {
@@ -2511,10 +2520,7 @@
"category": "Error",
"code": 2568
},
"Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.": {
"category": "Error",
"code": 2569
},
"Could not find name '{0}'. Did you mean '{1}'?": {
"category": "Error",
"code": 2570
@@ -2743,6 +2749,10 @@
"category": "Error",
"code": 2636
},
"Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.": {
"category": "Error",
"code": 2637
},
"Cannot augment module '{0}' with value exports because it resolves to a non-module entity.": {
"category": "Error",
@@ -3365,6 +3375,10 @@
"category": "Error",
"code": 2809
},
"Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.": {
"category": "Error",
"code": 2810
},
"Initializer for property '{0}'": {
"category": "Error",
"code": 2811
@@ -3417,11 +3431,11 @@
"category": "Error",
"code": 2833
},
"Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path.": {
"Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.": {
"category": "Error",
"code": 2834
},
"Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?": {
"Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?": {
"category": "Error",
"code": 2835
},
@@ -3866,6 +3880,10 @@
"category": "Error",
"code": 4124
},
"Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.": {
"category": "Error",
"code": 4125
},
"The current host does not support the '{0}' option.": {
"category": "Error",
@@ -6105,10 +6123,6 @@
"category": "Error",
"code": 7061
},
"JSON imports are experimental in ES module mode imports.": {
"category": "Error",
"code": 7062
},
"You cannot rename this element.": {
"category": "Error",
+64 -59
View File
@@ -167,7 +167,7 @@ namespace ts {
}
function getOwnOutputFileNames(configFile: ParsedCommandLine, inputFileName: string, ignoreCase: boolean, addOutput: ReturnType<typeof createAddOutput>["addOutput"], getCommonSourceDirectory?: () => string) {
if (fileExtensionIs(inputFileName, Extension.Dts)) return;
if (isDeclarationFileName(inputFileName)) return;
const js = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
addOutput(js);
if (fileExtensionIs(inputFileName, Extension.Json)) return;
@@ -219,7 +219,7 @@ namespace ts {
export function getCommonSourceDirectoryOfConfig({ options, fileNames }: ParsedCommandLine, ignoreCase: boolean): string {
return getCommonSourceDirectory(
options,
() => filter(fileNames, file => !(options.noEmitForJsFiles && fileExtensionIsOneOf(file, supportedJSExtensionsFlat)) && !fileExtensionIs(file, Extension.Dts)),
() => filter(fileNames, file => !(options.noEmitForJsFiles && fileExtensionIsOneOf(file, supportedJSExtensionsFlat)) && !isDeclarationFileName(file)),
getDirectoryPath(normalizeSlashes(Debug.checkDefined(options.configFilePath))),
createGetCanonicalFileName(!ignoreCase)
);
@@ -263,7 +263,7 @@ namespace ts {
const getCommonSourceDirectory = memoize(() => getCommonSourceDirectoryOfConfig(configFile, ignoreCase));
for (const inputFileName of configFile.fileNames) {
if (fileExtensionIs(inputFileName, Extension.Dts)) continue;
if (isDeclarationFileName(inputFileName)) continue;
const jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
if (jsFilePath) return jsFilePath;
if (fileExtensionIs(inputFileName, Extension.Json)) continue;
@@ -531,6 +531,7 @@ namespace ts {
printer.writeFile(sourceFile!, writer, sourceMapGenerator);
}
let sourceMapUrlPos;
if (sourceMapGenerator) {
if (sourceMapDataList) {
sourceMapDataList.push({
@@ -548,6 +549,7 @@ namespace ts {
if (sourceMappingURL) {
if (!writer.isAtStartOfLine()) writer.rawWrite(newLine);
sourceMapUrlPos = writer.getTextPos();
writer.writeComment(`//# ${"sourceMappingURL"}=${sourceMappingURL}`); // Tools can sometimes see this line as a source mapping url comment
}
@@ -562,7 +564,7 @@ namespace ts {
}
// Write the output file
writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles);
writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos });
// Reset state
writer.clear();
@@ -1170,7 +1172,7 @@ namespace ts {
}
function getCurrentLineMap() {
return currentLineMap || (currentLineMap = getLineStarts(currentSourceFile!));
return currentLineMap || (currentLineMap = getLineStarts(Debug.checkDefined(currentSourceFile)));
}
function emit(node: Node, parenthesizerRule?: (node: Node) => Node): void;
@@ -1815,7 +1817,7 @@ namespace ts {
const numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1;
for (let i = 0; i < numNodes; i++) {
const currentNode = bundle ? i < numPrepends ? bundle.prepends[i] : bundle.sourceFiles[i - numPrepends] : node;
const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? undefined : currentSourceFile!;
const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? undefined : currentSourceFile;
const shouldSkip = printerOptions.noEmitHelpers || (!!sourceFile && hasRecordedExternalHelpers(sourceFile));
const shouldBundle = (isSourceFile(currentNode) || isUnparsedSource(currentNode)) && !isOwnFileEmit;
const helpers = isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode);
@@ -2465,7 +2467,7 @@ namespace ts {
}
const preferNewLine = node.multiLine ? ListFormat.PreferNewLine : ListFormat.None;
const allowTrailingComma = currentSourceFile!.languageVersion >= ScriptTarget.ES5 && !isJsonSourceFile(currentSourceFile!) ? ListFormat.AllowTrailingComma : ListFormat.None;
const allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= ScriptTarget.ES5 && !isJsonSourceFile(currentSourceFile) ? ListFormat.AllowTrailingComma : ListFormat.None;
emitList(node, node.properties, ListFormat.ObjectLiteralExpressionProperties | allowTrailingComma | preferNewLine);
if (indentedFlag) {
@@ -2880,7 +2882,7 @@ namespace ts {
emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement);
// Emit semicolon in non json files
// or if json file that created synthesized expression(eg.define expression statement when --out and amd code generation)
if (!isJsonSourceFile(currentSourceFile!) || nodeIsSynthesized(node.expression)) {
if (!currentSourceFile || !isJsonSourceFile(currentSourceFile) || nodeIsSynthesized(node.expression)) {
writeTrailingSemicolon();
}
}
@@ -3207,7 +3209,7 @@ namespace ts {
return false;
}
if (!nodeIsSynthesized(body) && !rangeIsOnSingleLine(body, currentSourceFile!)) {
if (!nodeIsSynthesized(body) && currentSourceFile && !rangeIsOnSingleLine(body, currentSourceFile)) {
return false;
}
@@ -3238,12 +3240,7 @@ namespace ts {
? emitBlockFunctionBodyOnSingleLine
: emitBlockFunctionBodyWorker;
if (emitBodyWithDetachedComments) {
emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody);
}
else {
emitBlockFunctionBody(body);
}
emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody);
decreaseIndent();
writeToken(SyntaxKind.CloseBraceToken, body.statements.end, writePunctuation, body);
@@ -3701,9 +3698,10 @@ namespace ts {
statements.length === 1 &&
(
// treat synthesized nodes as located on the same line for emit purposes
!currentSourceFile ||
nodeIsSynthesized(parentNode) ||
nodeIsSynthesized(statements[0]) ||
rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile!)
rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)
);
let format = ListFormat.CaseOrDefaultClauseStatements;
@@ -3958,16 +3956,14 @@ namespace ts {
function emitSourceFile(node: SourceFile) {
writeLine();
const statements = node.statements;
if (emitBodyWithDetachedComments) {
// Emit detached comment if there are no prologue directives or if the first node is synthesized.
// The synthesized node will have no leading comment so some comments may be missed.
const shouldEmitDetachedComment = statements.length === 0 ||
!isPrologueDirective(statements[0]) ||
nodeIsSynthesized(statements[0]);
if (shouldEmitDetachedComment) {
emitBodyWithDetachedComments(node, statements, emitSourceFileWorker);
return;
}
// Emit detached comment if there are no prologue directives or if the first node is synthesized.
// The synthesized node will have no leading comment so some comments may be missed.
const shouldEmitDetachedComment = statements.length === 0 ||
!isPrologueDirective(statements[0]) ||
nodeIsSynthesized(statements[0]);
if (shouldEmitDetachedComment) {
emitBodyWithDetachedComments(node, statements, emitSourceFileWorker);
return;
}
emitSourceFileWorker(node);
}
@@ -4369,7 +4365,7 @@ namespace ts {
if (isEmpty) {
// Write a line terminator if the parent node was multi-line
if (format & ListFormat.MultiLine && !(preserveSourceNewlines && (!parentNode || rangeIsOnSingleLine(parentNode, currentSourceFile!)))) {
if (format & ListFormat.MultiLine && !(preserveSourceNewlines && (!parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile)))) {
writeLine();
}
else if (format & ListFormat.SpaceBetweenBraces && !(format & ListFormat.NoSpaceIfEmpty)) {
@@ -4673,7 +4669,7 @@ namespace ts {
const firstChild = children[0];
if (firstChild === undefined) {
return !parentNode || rangeIsOnSingleLine(parentNode, currentSourceFile!) ? 0 : 1;
return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;
}
if (firstChild.pos === nextListElementPos) {
// If this child starts at the beginning of a list item in a parent list, its leading
@@ -4697,7 +4693,7 @@ namespace ts {
// JsxText will be written with its leading whitespace, so don't add more manually.
return 0;
}
if (parentNode &&
if (currentSourceFile && parentNode &&
!positionIsSynthesized(parentNode.pos) &&
!nodeIsSynthesized(firstChild) &&
(!firstChild.parent || getOriginalNode(firstChild.parent) === getOriginalNode(parentNode))
@@ -4710,7 +4706,7 @@ namespace ts {
currentSourceFile!,
includeComments));
}
return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile!) ? 0 : 1;
return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1;
}
if (synthesizedNodeStartsOnNewLine(firstChild, format)) {
return 1;
@@ -4728,7 +4724,7 @@ namespace ts {
// JsxText will be written with its leading whitespace, so don't add more manually.
return 0;
}
else if (!nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) {
else if (currentSourceFile && !nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) {
if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) {
return getEffectiveLines(
includeComments => getLinesBetweenRangeEndAndRangeStart(
@@ -4743,7 +4739,7 @@ namespace ts {
// expensive than checking with `preserveSourceNewlines` as above, but the goal is not to preserve the
// effective source lines between two sibling nodes.
else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) {
return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile!) ? 0 : 1;
return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1;
}
// If the two nodes are not comparable, add a line terminator based on the format that can indicate
// whether new lines are preferred or not.
@@ -4767,9 +4763,9 @@ namespace ts {
const lastChild = lastOrUndefined(children);
if (lastChild === undefined) {
return !parentNode || rangeIsOnSingleLine(parentNode, currentSourceFile!) ? 0 : 1;
return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;
}
if (parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) {
if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) {
if (preserveSourceNewlines) {
const end = isNodeArray(children) && !positionIsSynthesized(children.end) ? children.end : lastChild.end;
return getEffectiveLines(
@@ -4779,7 +4775,7 @@ namespace ts {
currentSourceFile!,
includeComments));
}
return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile!) ? 0 : 1;
return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1;
}
if (synthesizedNodeStartsOnNewLine(lastChild, format)) {
return 1;
@@ -4857,7 +4853,7 @@ namespace ts {
return 1;
}
if (!nodeIsSynthesized(parent) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) {
if (currentSourceFile && !nodeIsSynthesized(parent) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) {
if (preserveSourceNewlines) {
return getEffectiveLines(
includeComments => getLinesBetweenRangeEndAndRangeStart(
@@ -4866,7 +4862,7 @@ namespace ts {
currentSourceFile!,
includeComments));
}
return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile!) ? 0 : 1;
return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1;
}
return 0;
@@ -4874,7 +4870,7 @@ namespace ts {
function isEmptyBlock(block: BlockLike) {
return block.statements.length === 0
&& rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile!);
&& (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile));
}
function skipSynthesizedParentheses(node: Node) {
@@ -4885,21 +4881,27 @@ namespace ts {
return node;
}
function getTextOfNode(node: Node, includeTrivia?: boolean): string {
function getTextOfNode(node: Identifier | PrivateIdentifier | LiteralExpression, includeTrivia?: boolean): string {
if (isGeneratedIdentifier(node)) {
return generateName(node);
}
else if ((isIdentifier(node) || isPrivateIdentifier(node)) && (nodeIsSynthesized(node) || !node.parent || !currentSourceFile || (node.parent && currentSourceFile && getSourceFileOfNode(node) !== getOriginalNode(currentSourceFile)))) {
return idText(node);
if (isStringLiteral(node) && node.textSourceNode) {
return getTextOfNode(node.textSourceNode, includeTrivia);
}
else if (node.kind === SyntaxKind.StringLiteral && (node as StringLiteral).textSourceNode) {
return getTextOfNode((node as StringLiteral).textSourceNode!, includeTrivia);
const sourceFile = currentSourceFile; // const needed for control flow
const canUseSourceFile = !!sourceFile && !!node.parent && !nodeIsSynthesized(node);
if (isMemberName(node)) {
if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) {
return idText(node);
}
}
else if (isLiteralExpression(node) && (nodeIsSynthesized(node) || !node.parent)) {
return node.text;
else {
Debug.assertNode(node, isLiteralExpression); // not strictly necessary
if (!canUseSourceFile) {
return node.text;
}
}
return getSourceTextOfNodeFromSourceFile(currentSourceFile!, node, includeTrivia);
return getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia);
}
function getLiteralTextOfNode(node: LiteralLikeNode, neverAsciiEscape: boolean | undefined, jsxAttributeEscape: boolean): string {
@@ -4921,7 +4923,7 @@ namespace ts {
| (printerOptions.terminateUnterminatedLiterals ? GetLiteralTextFlags.TerminateUnterminatedLiterals : 0)
| (printerOptions.target && printerOptions.target === ScriptTarget.ESNext ? GetLiteralTextFlags.AllowNumericSeparator : 0);
return getLiteralText(node, currentSourceFile!, flags);
return getLiteralText(node, currentSourceFile, flags);
}
/**
@@ -5244,7 +5246,7 @@ namespace ts {
switch (node.kind) {
case SyntaxKind.Identifier:
return makeUniqueName(
getTextOfNode(node),
getTextOfNode(node as Identifier),
isUniqueName,
!!(flags! & GeneratedIdentifierFlags.Optimistic),
!!(flags! & GeneratedIdentifierFlags.ReservedInNestedScopes)
@@ -5546,7 +5548,7 @@ namespace ts {
}
function emitLeadingComment(commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) {
if (!shouldWriteComment(currentSourceFile!.text, commentPos)) return;
if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return;
if (!hasWrittenComment) {
emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos);
hasWrittenComment = true;
@@ -5554,7 +5556,7 @@ namespace ts {
// Leading comments are emitted at /*leading comment1 */space/*leading comment*/space
emitPos(commentPos);
writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
if (hasTrailingNewLine) {
@@ -5578,14 +5580,14 @@ namespace ts {
}
function emitTrailingComment(commentPos: number, commentEnd: number, _kind: SyntaxKind, hasTrailingNewLine: boolean) {
if (!shouldWriteComment(currentSourceFile!.text, commentPos)) return;
if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return;
// trailing comments are emitted at space/*trailing comment1 */space/*trailing comment2*/
if (!writer.isAtStartOfLine()) {
writer.writeSpace(" ");
}
emitPos(commentPos);
writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
if (hasTrailingNewLine) {
@@ -5603,10 +5605,11 @@ namespace ts {
}
function emitTrailingCommentOfPositionNoNewline(commentPos: number, commentEnd: number, kind: SyntaxKind) {
if (!currentSourceFile) return;
// trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space
emitPos(commentPos);
writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
if (kind === SyntaxKind.SingleLineCommentTrivia) {
@@ -5615,10 +5618,11 @@ namespace ts {
}
function emitTrailingCommentOfPosition(commentPos: number, commentEnd: number, _kind: SyntaxKind, hasTrailingNewLine: boolean) {
if(!currentSourceFile) return;
// trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space
emitPos(commentPos);
writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
if (hasTrailingNewLine) {
@@ -5653,6 +5657,7 @@ namespace ts {
}
function forEachLeadingCommentWithoutDetachedComments(cb: (commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) => void) {
if (!currentSourceFile) return;
// get the leading comments from detachedPos
const pos = last(detachedCommentsInfo!).detachedCommentEndPos;
if (detachedCommentsInfo!.length - 1) {
@@ -5662,11 +5667,11 @@ namespace ts {
detachedCommentsInfo = undefined;
}
forEachLeadingCommentRange(currentSourceFile!.text, pos, cb, /*state*/ pos);
forEachLeadingCommentRange(currentSourceFile.text, pos, cb, /*state*/ pos);
}
function emitDetachedCommentsAndUpdateCommentsInfo(range: TextRange) {
const currentDetachedCommentInfo = emitDetachedComments(currentSourceFile!.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled);
const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled);
if (currentDetachedCommentInfo) {
if (detachedCommentsInfo) {
detachedCommentsInfo.push(currentDetachedCommentInfo);
@@ -5678,7 +5683,7 @@ namespace ts {
}
function emitComment(text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) {
if (!shouldWriteComment(currentSourceFile!.text, commentPos)) return;
if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return;
emitPos(commentPos);
writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
@@ -5690,7 +5695,7 @@ namespace ts {
* @return true if the comment is a triple-slash comment else false
*/
function isTripleSlashComment(commentPos: number, commentEnd: number) {
return isRecognizedTripleSlashComment(currentSourceFile!.text, commentPos, commentEnd);
return !!currentSourceFile && isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd);
}
// Source Maps
+1 -1
View File
@@ -5275,7 +5275,7 @@ namespace ts {
hasNoDefaultLib: boolean,
libReferences: readonly FileReference[]
) {
const node = baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile) as Mutable<SourceFile>;
const node = (source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile)) as Mutable<SourceFile>;
for (const p in source) {
if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p)) continue;
(node as any)[p] = (source as any)[p];
+214 -35
View File
@@ -69,7 +69,8 @@ namespace ts {
JavaScript, /** '.js' or '.jsx' */
Json, /** '.json' */
TSConfig, /** '.json' with `tsconfig` used instead of `index` */
DtsOnly /** Only '.d.ts' */
DtsOnly, /** Only '.d.ts' */
TsOnly, /** '.[cm]tsx?' but not .d.ts variants */
}
interface PathAndPackageId {
@@ -85,14 +86,15 @@ namespace ts {
return { fileName: resolved.path, packageId: resolved.packageId };
}
function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, isExternalLibraryImport: boolean | undefined, failedLookupLocations: string[], resultFromCache: ResolvedModuleWithFailedLookupLocations | undefined): ResolvedModuleWithFailedLookupLocations {
function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, isExternalLibraryImport: boolean | undefined, failedLookupLocations: string[], diagnostics: Diagnostic[], resultFromCache: ResolvedModuleWithFailedLookupLocations | undefined): ResolvedModuleWithFailedLookupLocations {
if (resultFromCache) {
resultFromCache.failedLookupLocations.push(...failedLookupLocations);
return resultFromCache;
}
return {
resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId },
failedLookupLocations
failedLookupLocations,
resolutionDiagnostics: diagnostics
};
}
@@ -106,6 +108,8 @@ namespace ts {
packageJsonInfoCache: PackageJsonInfoCache | undefined;
features: NodeResolutionFeatures;
conditions: string[];
requestContainingDirectory: string | undefined;
reportDiagnostic: DiagnosticReporter;
}
/** Just the fields that we use for module resolution. */
@@ -347,13 +351,24 @@ namespace ts {
// set in a non-modal module resolution setting here. Do note that our behavior is not particularly well defined when these mode-overriding imports
// are present in a non-modal project; while in theory we'd like to either ignore the mode or provide faithful modern resolution, depending on what we feel is best,
// in practice, not every cache has the options available to intelligently make the choice to ignore the mode request, and it's unclear how modern "faithful modern
// resolution" should be (`node12`? `nodenext`?). As such, witnessing a mode-overriding triple-slash reference in a non-modal module resolution
// resolution" should be (`node16`? `nodenext`?). As such, witnessing a mode-overriding triple-slash reference in a non-modal module resolution
// context should _probably_ be an error - and that should likely be handled by the `Program` (which is what we do).
if (resolutionMode === ModuleKind.ESNext && (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext)) {
if (resolutionMode === ModuleKind.ESNext && (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext)) {
features |= NodeResolutionFeatures.EsmMode;
}
const conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
const moduleResolutionState: ModuleResolutionState = { compilerOptions: options, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache, features, conditions };
const diagnostics: Diagnostic[] = [];
const moduleResolutionState: ModuleResolutionState = {
compilerOptions: options,
host,
traceEnabled,
failedLookupLocations,
packageJsonInfoCache: cache,
features,
conditions,
requestContainingDirectory: containingDirectory,
reportDiagnostic: diag => void diagnostics.push(diag),
};
let resolved = primaryLookup();
let primary = true;
if (!resolved) {
@@ -373,7 +388,7 @@ namespace ts {
isExternalLibraryImport: pathContainsNodeModules(fileName),
};
}
result = { resolvedTypeReferenceDirective, failedLookupLocations };
result = { resolvedTypeReferenceDirective, failedLookupLocations, resolutionDiagnostics: diagnostics };
perFolderCache?.set(typeReferenceDirectiveName, /*mode*/ resolutionMode, result);
if (traceEnabled) traceResult(result);
return result;
@@ -443,7 +458,7 @@ namespace ts {
}
function getDefaultNodeResolutionFeatures(options: CompilerOptions) {
return getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
return getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default :
getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
NodeResolutionFeatures.None;
}
@@ -467,6 +482,8 @@ namespace ts {
packageJsonInfoCache: cache?.getPackageJsonInfoCache(),
conditions: emptyArray,
features: NodeResolutionFeatures.None,
requestContainingDirectory: containingDirectory,
reportDiagnostic: noop
};
return forEachAncestorDirectory(containingDirectory, ancestorDirectory => {
@@ -949,8 +966,8 @@ namespace ts {
case ModuleKind.CommonJS:
moduleResolution = ModuleResolutionKind.NodeJs;
break;
case ModuleKind.Node12:
moduleResolution = ModuleResolutionKind.Node12;
case ModuleKind.Node16:
moduleResolution = ModuleResolutionKind.Node16;
break;
case ModuleKind.NodeNext:
moduleResolution = ModuleResolutionKind.NodeNext;
@@ -971,8 +988,8 @@ namespace ts {
perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/);
switch (moduleResolution) {
case ModuleResolutionKind.Node12:
result = node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
case ModuleResolutionKind.Node16:
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
break;
case ModuleResolutionKind.NodeNext:
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
@@ -1230,22 +1247,22 @@ namespace ts {
// respecting the `.exports` member of packages' package.json files and its (conditional) mappings of export names
Exports = 1 << 3,
// allowing `*` in the LHS of an export to be followed by more content, eg `"./whatever/*.js"`
// not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
// not supported in node 12 - https://github.com/nodejs/Release/issues/690
ExportsPatternTrailers = 1 << 4,
AllFeatures = Imports | SelfName | Exports | ExportsPatternTrailers,
Node12Default = Imports | SelfName | Exports,
Node16Default = Imports | SelfName | Exports | ExportsPatternTrailers,
NodeNextDefault = AllFeatures,
EsmMode = 1 << 5,
}
function node12ModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions,
function node16ModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions,
host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference,
resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations {
return nodeNextModuleNameResolverWorker(
NodeResolutionFeatures.Node12Default,
NodeResolutionFeatures.Node16Default,
moduleName,
containingFile,
compilerOptions,
@@ -1290,15 +1307,33 @@ namespace ts {
export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
/* @internal */ export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, lookupConfig?: boolean): ResolvedModuleWithFailedLookupLocations; // eslint-disable-line @typescript-eslint/unified-signatures
export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, lookupConfig?: boolean): ResolvedModuleWithFailedLookupLocations {
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, lookupConfig ? tsconfigExtensions : (compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions), redirectedReference);
let extensions;
if (lookupConfig) {
extensions = tsconfigExtensions;
}
else if (compilerOptions.noDtsResolution) {
extensions = [Extensions.TsOnly];
if (compilerOptions.allowJs) extensions.push(Extensions.JavaScript);
if (compilerOptions.resolveJsonModule) extensions.push(Extensions.Json);
}
else {
extensions = compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions;
}
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference);
}
function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleName: string, containingDirectory: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache | undefined, extensions: Extensions[], redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations {
const traceEnabled = isTraceEnabled(compilerOptions, host);
const failedLookupLocations: string[] = [];
// conditions are only used by the node12/nodenext resolver - there's no priority order in the list,
// conditions are only used by the node16/nodenext resolver - there's no priority order in the list,
//it's essentially a set (priority is determined by object insertion order in the object we look at).
const conditions = features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"];
if (compilerOptions.noDtsResolution) {
conditions.pop();
}
const diagnostics: Diagnostic[] = [];
const state: ModuleResolutionState = {
compilerOptions,
host,
@@ -1306,11 +1341,13 @@ namespace ts {
failedLookupLocations,
packageJsonInfoCache: cache,
features,
conditions: features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"]
conditions,
requestContainingDirectory: containingDirectory,
reportDiagnostic: diag => void diagnostics.push(diag),
};
const result = forEach(extensions, ext => tryResolve(ext));
return createResolvedModuleWithFailedLookupLocations(result?.value?.resolved, result?.value?.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);
return createResolvedModuleWithFailedLookupLocations(result?.value?.resolved, result?.value?.isExternalLibraryImport, failedLookupLocations, diagnostics, state.resultFromCache);
function tryResolve(extensions: Extensions): SearchResult<{ resolved: Resolved, isExternalLibraryImport: boolean }> {
const loader: ResolutionKindSpecificLoader = (extensions, candidate, onlyRecordFailures, state) => nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true);
@@ -1498,9 +1535,9 @@ namespace ts {
}
function loadJSOrExactTSFileName(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined {
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && fileExtensionIsOneOf(candidate, [Extension.Dts, Extension.Dcts, Extension.Dmts])) {
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && fileExtensionIsOneOf(candidate, supportedTSExtensionsFlat)) {
const result = tryFile(candidate, onlyRecordFailures, state);
return result !== undefined ? { path: candidate, ext: forEach([Extension.Dts, Extension.Dcts, Extension.Dmts], e => fileExtensionIs(candidate, e) ? e : undefined)! } : undefined;
return result !== undefined ? { path: candidate, ext: tryExtractTSExtension(candidate) as Extension } : undefined;
}
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
@@ -1533,20 +1570,22 @@ namespace ts {
default: return tryExtension(Extension.Dts);
}
case Extensions.TypeScript:
case Extensions.TsOnly:
const useDts = extensions === Extensions.TypeScript;
switch (originalExtension) {
case Extension.Mjs:
case Extension.Mts:
case Extension.Dmts:
return tryExtension(Extension.Mts) || tryExtension(Extension.Dmts);
return tryExtension(Extension.Mts) || (useDts ? tryExtension(Extension.Dmts) : undefined);
case Extension.Cjs:
case Extension.Cts:
case Extension.Dcts:
return tryExtension(Extension.Cts) || tryExtension(Extension.Dcts);
return tryExtension(Extension.Cts) || (useDts ? tryExtension(Extension.Dcts) : undefined);
case Extension.Json:
candidate += Extension.Json;
return tryExtension(Extension.Dts);
return useDts ? tryExtension(Extension.Dts) : undefined;
default:
return tryExtension(Extension.Ts) || tryExtension(Extension.Tsx) || tryExtension(Extension.Dts);
return tryExtension(Extension.Ts) || tryExtension(Extension.Tsx) || (useDts ? tryExtension(Extension.Dts) : undefined);
}
case Extensions.JavaScript:
switch (originalExtension) {
@@ -1635,6 +1674,8 @@ namespace ts {
packageJsonInfoCache: cache?.getPackageJsonInfoCache(),
conditions: ["node", "require", "types"],
features,
requestContainingDirectory: packageJsonInfo.packageDirectory,
reportDiagnostic: noop
};
const requireResolution = loadNodeModuleFromDirectoryWorker(
extensions,
@@ -1744,6 +1785,8 @@ namespace ts {
packageJsonInfoCache: PackageJsonInfoCache | undefined;
features: number;
conditions: never[];
requestContainingDirectory: string | undefined;
reportDiagnostic: DiagnosticReporter
} = {
host,
compilerOptions: options,
@@ -1752,6 +1795,8 @@ namespace ts {
packageJsonInfoCache,
features: 0,
conditions: [],
requestContainingDirectory: undefined,
reportDiagnostic: noop
};
const parts = getPathComponents(fileName);
parts.pop();
@@ -1813,6 +1858,7 @@ namespace ts {
switch (extensions) {
case Extensions.JavaScript:
case Extensions.Json:
case Extensions.TsOnly:
packageFile = readPackageJsonMainField(jsonContent, candidate, state);
break;
case Extensions.TypeScript:
@@ -1893,14 +1939,16 @@ namespace ts {
function extensionIsOk(extensions: Extensions, extension: Extension): boolean {
switch (extensions) {
case Extensions.JavaScript:
return extension === Extension.Js || extension === Extension.Jsx;
return extension === Extension.Js || extension === Extension.Jsx || extension === Extension.Mjs || extension === Extension.Cjs;
case Extensions.TSConfig:
case Extensions.Json:
return extension === Extension.Json;
case Extensions.TypeScript:
return extension === Extension.Ts || extension === Extension.Tsx || extension === Extension.Dts;
return extension === Extension.Ts || extension === Extension.Tsx || extension === Extension.Mts || extension === Extension.Cts || extension === Extension.Dts || extension === Extension.Dmts || extension === Extension.Dcts;
case Extensions.TsOnly:
return extension === Extension.Ts || extension === Extension.Tsx || extension === Extension.Mts || extension === Extension.Cts;
case Extensions.DtsOnly:
return extension === Extension.Dts;
return extension === Extension.Dts || extension === Extension.Dmts || extension === Extension.Dcts;
}
}
@@ -2089,8 +2137,9 @@ namespace ts {
}
return toSearchResult(/*value*/ undefined);
}
const finalPath = getNormalizedAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath, state.host.getCurrentDirectory?.());
const finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath);
const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
if (inputLink) return inputLink;
return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, /*onlyRecordFailures*/ false, state)));
}
else if (typeof target === "object" && target !== null) { // eslint-disable-line no-null/no-null
@@ -2131,6 +2180,134 @@ namespace ts {
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
}
return toSearchResult(/*value*/ undefined);
function toAbsolutePath(path: string): string;
function toAbsolutePath(path: string | undefined): string | undefined;
function toAbsolutePath(path: string | undefined): string | undefined {
if (path === undefined) return path;
return hostGetCanonicalFileName({ useCaseSensitiveFileNames })(getNormalizedAbsolutePath(path, state.host.getCurrentDirectory?.()));
}
function combineDirectoryPath(root: string, dir: string) {
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
}
function useCaseSensitiveFileNames() {
return !state.host.useCaseSensitiveFileNames ? true :
typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames :
state.host.useCaseSensitiveFileNames();
}
function tryLoadInputFileForPath(finalPath: string, entry: string, packagePath: string, isImports: boolean) {
// Replace any references to outputs for files in the program with the input files to support package self-names used with outDir
// PROBLEM: We don't know how to calculate the output paths yet, because the "common source directory" we use as the base of the file structure
// we reproduce into the output directory is based on the set of input files, which we're still in the process of traversing and resolving!
// _Given that_, we have to guess what the base of the output directory is (obviously the user wrote the export map, so has some idea what it is!).
// We are going to probe _so many_ possible paths. We limit where we'll do this to try to reduce the possibilities of false positive lookups.
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
&& finalPath.indexOf("/node_modules/") === -1
&& (state.compilerOptions.configFile ? startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)
) {
// So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
// Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
// `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
const commonSourceDirGuesses: string[] = [];
// A `rootDir` compiler option strongly indicates the root location
// A `composite` project is using project references and has it's common src dir set to `.`, so it shouldn't need to check any other locations
if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) {
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], state.host.getCurrentDirectory?.() || "", getCanonicalFileName));
commonSourceDirGuesses.push(commonDir);
}
else if (state.requestContainingDirectory) {
// However without either of those set we're in the dark. Let's say you have
//
// ./tools/index.ts
// ./src/index.ts
// ./dist/index.js
// ./package.json <-- references ./dist/index.js
// ./tsconfig.json <-- loads ./src/index.ts
//
// How do we know `./src` is the common src dir, and not `./tools`, given only the `./dist` out dir and `./dist/index.js` filename?
// Answer: We... don't. We know we're looking for an `index.ts` input file, but we have _no clue_ which subfolder it's supposed to be loaded from
// without more context.
// But we do have more context! Just a tiny bit more! We're resolving an import _for some other input file_! And that input file, too
// must be inside the common source directory! So we propagate that tidbit of info all the way to here via state.requestContainingDirectory
const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts"));
// And we can try every folder above the common folder for the request folder and the config/package base directory
// This technically can be wrong - we may load ./src/index.ts when ./src/sub/index.ts was right because we don't
// know if only `./src/sub` files were loaded by the program; but this has the best chance to be right of just about anything
// else we have. And, given that we're about to load `./src/index.ts` because we choose it as likely correct, there will then
// be a file outside of `./src/sub` in the program (the file we resolved to), making us de-facto right. So this fallback lookup
// logic may influence what files are pulled in by self-names, which in turn influences the output path shape, but it's all
// internally consistent so the paths should be stable so long as we prefer the "most general" (meaning: top-most-level directory) possible results first.
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [requestingFile, toAbsolutePath(packagePath)], state.host.getCurrentDirectory?.() || "", getCanonicalFileName));
commonSourceDirGuesses.push(commonDir);
let fragment = ensureTrailingDirectorySeparator(commonDir);
while (fragment && fragment.length > 1) {
const parts = getPathComponents(fragment);
parts.pop(); // remove a directory
const commonDir = getPathFromPathComponents(parts);
commonSourceDirGuesses.unshift(commonDir);
fragment = ensureTrailingDirectorySeparator(commonDir);
}
}
if (commonSourceDirGuesses.length > 1) {
state.reportDiagnostic(createCompilerDiagnostic(
isImports
? Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate
: Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,
entry === "" ? "." : entry, // replace empty string with `.` - the reverse of the operation done when entries are built - so main entrypoint errors don't look weird
packagePath
));
}
for (const commonSourceDirGuess of commonSourceDirGuesses) {
const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
for (const candidateDir of candidateDirectories) {
if (startsWith(finalPath, candidateDir)) {
// The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
const pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
const jsAndDtsExtensions = [Extension.Mjs, Extension.Cjs, Extension.Js, Extension.Json, Extension.Dmts, Extension.Dcts, Extension.Dts];
for (const ext of jsAndDtsExtensions) {
if (fileExtensionIs(possibleInputBase, ext)) {
const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase);
for (const possibleExt of inputExts) {
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
if ((extensions === Extensions.TypeScript && hasJSFileExtension(possibleInputWithInputExtension)) ||
(extensions === Extensions.JavaScript && hasTSFileExtension(possibleInputWithInputExtension))) {
continue;
}
if (state.host.fileExists(possibleInputWithInputExtension)) {
return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, /*onlyRecordFailures*/ false, state)));
}
}
}
}
}
}
}
}
return undefined;
function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess: string) {
// Config file ouput paths are processed to be relative to the host's current directory, while
// otherwise the paths are resolved relative to the common source dir the compiler puts together
const currentDir = state.compilerOptions.configFile ? state.host.getCurrentDirectory?.() || "" : commonSourceDirGuess;
const candidateDirectories = [];
if (state.compilerOptions.declarationDir) {
candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir)));
}
if (state.compilerOptions.outDir && state.compilerOptions.outDir !== state.compilerOptions.declarationDir) {
candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.outDir)));
}
return candidateDirectories;
}
}
}
}
@@ -2351,12 +2528,13 @@ namespace ts {
export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations {
const traceEnabled = isTraceEnabled(compilerOptions, host);
const failedLookupLocations: string[] = [];
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [] };
const containingDirectory = getDirectoryPath(containingFile);
const diagnostics: Diagnostic[] = [];
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [], requestContainingDirectory: containingDirectory, reportDiagnostic: diag => void diagnostics.push(diag) };
const resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript);
// No originalPath because classic resolution doesn't resolve realPath
return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache);
return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, diagnostics, state.resultFromCache);
function tryResolve(extensions: Extensions): SearchResult<Resolved> {
const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state);
@@ -2401,9 +2579,10 @@ namespace ts {
trace(host, Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache);
}
const failedLookupLocations: string[] = [];
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache, features: NodeResolutionFeatures.None, conditions: [] };
const diagnostics: Diagnostic[] = [];
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache, features: NodeResolutionFeatures.None, conditions: [], requestContainingDirectory: undefined, reportDiagnostic: diag => void diagnostics.push(diag) };
const resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false, /*cache*/ undefined, /*redirectedReference*/ undefined);
return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache);
return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, diagnostics, state.resultFromCache);
}
/**
+26 -25
View File
@@ -41,7 +41,7 @@ namespace ts.moduleSpecifiers {
}
function isFormatRequiringExtensions(compilerOptions: CompilerOptions, importingSourceFileName: Path, host: ModuleSpecifierResolutionHost) {
if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node12
if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16
&& getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) {
return false;
}
@@ -105,7 +105,7 @@ namespace ts.moduleSpecifiers {
const info = getInfo(importingSourceFile.path, host);
const modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options);
return firstDefined(modulePaths,
modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ true, options.overrideImportMode));
modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, preferences, /*packageNameOnly*/ true, options.overrideImportMode));
}
function getModuleSpecifierWorker(
@@ -120,7 +120,7 @@ namespace ts.moduleSpecifiers {
): string {
const info = getInfo(importingSourceFileName, host);
const modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
return firstDefined(modulePaths, modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode)) ||
return firstDefined(modulePaths, modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, /*packageNameOnly*/ undefined, options.overrideImportMode)) ||
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
}
@@ -248,7 +248,7 @@ namespace ts.moduleSpecifiers {
let pathsSpecifiers: string[] | undefined;
let relativeSpecifiers: string[] | undefined;
for (const modulePath of modulePaths) {
const specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode);
const specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, /*packageNameOnly*/ undefined, options.overrideImportMode);
nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier);
if (specifier && modulePath.isRedirect) {
// If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar",
@@ -666,7 +666,7 @@ namespace ts.moduleSpecifiers {
: removeFileExtension(relativePath);
}
function tryGetModuleNameAsNodeModule({ path, isRedirect }: ModulePath, { getCanonicalFileName, sourceDirectory }: Info, importingSourceFile: SourceFile , host: ModuleSpecifierResolutionHost, options: CompilerOptions, packageNameOnly?: boolean, overrideMode?: ModuleKind.ESNext | ModuleKind.CommonJS): string | undefined {
function tryGetModuleNameAsNodeModule({ path, isRedirect }: ModulePath, { getCanonicalFileName, sourceDirectory }: Info, importingSourceFile: SourceFile , host: ModuleSpecifierResolutionHost, options: CompilerOptions, userPreferences: UserPreferences, packageNameOnly?: boolean, overrideMode?: ModuleKind.ESNext | ModuleKind.CommonJS): string | undefined {
if (!host.fileExists || !host.readFile) {
return undefined;
}
@@ -680,8 +680,9 @@ namespace ts.moduleSpecifiers {
let moduleSpecifier = path;
let isPackageRootPath = false;
if (!packageNameOnly) {
const preferences = getPreferences(host, userPreferences, options, importingSourceFile);
let packageRootIndex = parts.packageRootIndex;
let moduleFileNameForExtensionless: string | undefined;
let moduleFileName: string | undefined;
while (true) {
// If the module could be imported by a directory name, use that directory's name
const { moduleFileToTry, packageRootPath, blockedByExports, verbatimFromExports } = tryDirectoryWithPackageJson(packageRootIndex);
@@ -698,12 +699,12 @@ namespace ts.moduleSpecifiers {
isPackageRootPath = true;
break;
}
if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry;
if (!moduleFileName) moduleFileName = moduleFileToTry;
// try with next level of directory
packageRootIndex = path.indexOf(directorySeparator, packageRootIndex + 1);
if (packageRootIndex === -1) {
moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless);
moduleSpecifier = removeExtensionAndIndexPostFix(moduleFileName, preferences.ending, options, host);
break;
}
}
@@ -734,7 +735,7 @@ namespace ts.moduleSpecifiers {
const cachedPackageJson = host.getPackageJsonInfoCache?.()?.getPackageJsonInfo(packageJsonPath);
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
const packageJsonContent = cachedPackageJson?.packageJsonContent || JSON.parse(host.readFile!(packageJsonPath)!);
if (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext) {
if (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext) {
// `conditions` *could* be made to go against `importingSourceFile.impliedNodeFormat` if something wanted to generate
// an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
// usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex`
@@ -768,7 +769,7 @@ namespace ts.moduleSpecifiers {
}
}
// If the file is the main module, it can be imported by the package name
const mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main;
const mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js";
if (isString(mainFileRelative)) {
const mainExportFile = toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
if (removeFileExtension(mainExportFile) === removeFileExtension(getCanonicalFileName(moduleFileToTry))) {
@@ -776,20 +777,14 @@ namespace ts.moduleSpecifiers {
}
}
}
return { moduleFileToTry };
}
function getExtensionlessFileName(path: string): string {
// We still have a file name - remove the extension
const fullModulePathWithoutExtension = removeFileExtension(path);
// If the file is /index, it can be imported by its directory name
// IFF there is not _also_ a file by the same name
if (getCanonicalFileName(fullModulePathWithoutExtension.substring(parts.fileNameIndex)) === "/index" && !tryGetAnyFileFromPath(host, fullModulePathWithoutExtension.substring(0, parts.fileNameIndex))) {
return fullModulePathWithoutExtension.substring(0, parts.fileNameIndex);
else {
// No package.json exists; an index.js will still resolve as the package name
const fileName = getCanonicalFileName(moduleFileToTry.substring(parts.packageRootIndex + 1));
if (fileName === "index.d.ts" || fileName === "index.js" || fileName === "index.ts" || fileName === "index.tsx") {
return { moduleFileToTry, packageRootPath };
}
}
return fullModulePathWithoutExtension;
return { moduleFileToTry };
}
}
@@ -812,13 +807,19 @@ namespace ts.moduleSpecifiers {
});
}
function removeExtensionAndIndexPostFix(fileName: string, ending: Ending, options: CompilerOptions): string {
function removeExtensionAndIndexPostFix(fileName: string, ending: Ending, options: CompilerOptions, host?: ModuleSpecifierResolutionHost): string {
if (fileExtensionIsOneOf(fileName, [Extension.Json, Extension.Mjs, Extension.Cjs])) return fileName;
const noExtension = removeFileExtension(fileName);
if (fileExtensionIsOneOf(fileName, [Extension.Dmts, Extension.Mts, Extension.Dcts, Extension.Cts])) return noExtension + getJSExtensionForFile(fileName, options);
switch (ending) {
case Ending.Minimal:
return removeSuffix(noExtension, "/index");
const withoutIndex = removeSuffix(noExtension, "/index");
if (host && withoutIndex !== noExtension && tryGetAnyFileFromPath(host, withoutIndex)) {
// Can't remove index if there's a file by the same name as the directory.
// Probably more callers should pass `host` so we can determine this?
return noExtension;
}
return withoutIndex;
case Ending.Index:
return noExtension;
case Ending.JsExtension:
+49 -88
View File
@@ -683,7 +683,7 @@ namespace ts {
/**
* Controls the format the file is detected as - this can be derived from only the path
* and files on disk, but needs to be done with a module resolution cache in scope to be performant.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`.
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
*/
impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
/**
@@ -944,7 +944,7 @@ namespace ts {
initializeState("", content, languageVersion, /*syntaxCursor*/ undefined, ScriptKind.JS);
// Prime the scanner.
nextToken();
const entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ false);
const entityName = parseEntityName(/*allowReservedWords*/ true);
const isInvalid = token() === SyntaxKind.EndOfFileToken && !parseDiagnostics.length;
clearState();
return isInvalid ? entityName : undefined;
@@ -2745,6 +2745,7 @@ namespace ts {
const startPos = scanner.getStartPos();
const result = parseListElement(kind, parseElement);
if (!result) {
parsingContext = saveParsingContext;
return undefined;
}
list.push(result as NonNullable<T>);
@@ -2829,7 +2830,7 @@ namespace ts {
return createMissingList<T>();
}
function parseEntityName(allowReservedWords: boolean, allowPrivateIdentifiers: boolean, diagnosticMessage?: DiagnosticMessage): EntityName {
function parseEntityName(allowReservedWords: boolean, diagnosticMessage?: DiagnosticMessage): EntityName {
const pos = getNodePos();
let entity: EntityName = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
let dotPos = getNodePos();
@@ -2843,7 +2844,7 @@ namespace ts {
entity = finishNode(
factory.createQualifiedName(
entity,
parseRightSideOfDot(allowReservedWords, allowPrivateIdentifiers) as Identifier
parseRightSideOfDot(allowReservedWords, /* allowPrivateIdentifiers */ false) as Identifier
),
pos
);
@@ -3028,7 +3029,7 @@ namespace ts {
// TYPES
function parseEntityNameOfTypeReference() {
return parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ false, Diagnostics.Type_expected);
return parseEntityName(/*allowReservedWords*/ true, Diagnostics.Type_expected);
}
function parseTypeArgumentsOfTypeReference() {
@@ -3188,8 +3189,9 @@ namespace ts {
function parseTypeQuery(): TypeQueryNode {
const pos = getNodePos();
parseExpected(SyntaxKind.TypeOfKeyword);
const entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ true);
const typeArguments = tryParseTypeArguments();
const entityName = parseEntityName(/*allowReservedWords*/ true);
// Make sure we perform ASI to prevent parsing the next line's type arguments as part of an instantiation expression.
const typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined;
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
}
@@ -4289,10 +4291,10 @@ namespace ts {
}
const pos = getNodePos();
let expr = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
let expr = parseAssignmentExpressionOrHigher();
let operatorToken: BinaryOperatorToken;
while ((operatorToken = parseOptionalToken(SyntaxKind.CommaToken))) {
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false), pos);
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);
}
if (saveDecoratorContext) {
@@ -4302,10 +4304,10 @@ namespace ts {
}
function parseInitializer(): Expression | undefined {
return parseOptional(SyntaxKind.EqualsToken) ? parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false) : undefined;
return parseOptional(SyntaxKind.EqualsToken) ? parseAssignmentExpressionOrHigher() : undefined;
}
function parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction: boolean): Expression {
function parseAssignmentExpressionOrHigher(): Expression {
// AssignmentExpression[in,yield]:
// 1) ConditionalExpression[?in,?yield]
// 2) LeftHandSideExpression = AssignmentExpression[?in,?yield]
@@ -4333,7 +4335,7 @@ namespace ts {
// If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is
// not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done
// with AssignmentExpression if we see one.
const arrowExpression = tryParseParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(disallowReturnTypeInArrowFunction);
const arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
if (arrowExpression) {
return arrowExpression;
}
@@ -4354,7 +4356,7 @@ namespace ts {
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
// identifier and the current token is an arrow.
if (expr.kind === SyntaxKind.Identifier && token() === SyntaxKind.EqualsGreaterThanToken) {
return parseSimpleArrowFunctionExpression(pos, expr as Identifier, disallowReturnTypeInArrowFunction, /*asyncModifier*/ undefined);
return parseSimpleArrowFunctionExpression(pos, expr as Identifier, /*asyncModifier*/ undefined);
}
// Now see if we might be in cases '2' or '3'.
@@ -4364,7 +4366,7 @@ namespace ts {
// Note: we call reScanGreaterToken so that we get an appropriately merged token
// for cases like `> > =` becoming `>>=`
if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) {
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction), pos);
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
}
// It wasn't an assignment or a lambda. This is a conditional expression:
@@ -4418,7 +4420,7 @@ namespace ts {
return finishNode(
factory.createYieldExpression(
parseOptionalToken(SyntaxKind.AsteriskToken),
parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false)
parseAssignmentExpressionOrHigher()
),
pos
);
@@ -4430,7 +4432,7 @@ namespace ts {
}
}
function parseSimpleArrowFunctionExpression(pos: number, identifier: Identifier, disallowReturnTypeInArrowFunction: boolean, asyncModifier?: NodeArray<Modifier> | undefined): ArrowFunction {
function parseSimpleArrowFunctionExpression(pos: number, identifier: Identifier, asyncModifier?: NodeArray<Modifier> | undefined): ArrowFunction {
Debug.assert(token() === SyntaxKind.EqualsGreaterThanToken, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
const parameter = factory.createParameterDeclaration(
/*decorators*/ undefined,
@@ -4445,12 +4447,12 @@ namespace ts {
const parameters = createNodeArray<ParameterDeclaration>([parameter], parameter.pos, parameter.end);
const equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken);
const body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier, disallowReturnTypeInArrowFunction);
const body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
const node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body);
return addJSDocComment(finishNode(node, pos));
}
function tryParseParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction: boolean): Expression | undefined {
function tryParseParenthesizedArrowFunctionExpression(): Expression | undefined {
const triState = isParenthesizedArrowFunctionExpression();
if (triState === Tristate.False) {
// It's definitely not a parenthesized arrow function expression.
@@ -4462,8 +4464,8 @@ namespace ts {
// it out, but don't allow any ambiguity, and return 'undefined' if this could be an
// expression instead.
return triState === Tristate.True ?
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true, /*disallowReturnTypeInArrowFunction*/ false) :
tryParse(() => parsePossibleParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction));
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) :
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
}
// True -> We definitely expect a parenthesized arrow function here.
@@ -4609,13 +4611,13 @@ namespace ts {
}
}
function parsePossibleParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction: boolean): ArrowFunction | undefined {
function parsePossibleParenthesizedArrowFunctionExpression(): ArrowFunction | undefined {
const tokenPos = scanner.getTokenPos();
if (notParenthesizedArrow?.has(tokenPos)) {
return undefined;
}
const result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false, disallowReturnTypeInArrowFunction);
const result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false);
if (!result) {
(notParenthesizedArrow || (notParenthesizedArrow = new Set())).add(tokenPos);
}
@@ -4623,14 +4625,14 @@ namespace ts {
return result;
}
function tryParseAsyncSimpleArrowFunctionExpression(disallowReturnTypeInArrowFunction: boolean): ArrowFunction | undefined {
function tryParseAsyncSimpleArrowFunctionExpression(): ArrowFunction | undefined {
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
if (token() === SyntaxKind.AsyncKeyword) {
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) {
const pos = getNodePos();
const asyncModifier = parseModifiersForArrowFunction();
const expr = parseBinaryExpressionOrHigher(OperatorPrecedence.Lowest);
return parseSimpleArrowFunctionExpression(pos, expr as Identifier, disallowReturnTypeInArrowFunction, asyncModifier);
return parseSimpleArrowFunctionExpression(pos, expr as Identifier, asyncModifier);
}
}
return undefined;
@@ -4657,7 +4659,7 @@ namespace ts {
return Tristate.False;
}
function parseParenthesizedArrowFunctionExpression(allowAmbiguity: boolean, disallowReturnTypeInArrowFunction: boolean): ArrowFunction | undefined {
function parseParenthesizedArrowFunctionExpression(allowAmbiguity: boolean): ArrowFunction | undefined {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiersForArrowFunction();
@@ -4694,24 +4696,6 @@ namespace ts {
}
}
// Given:
// x ? y => ({ y }) : z => ({ z })
// We try to parse the body of the first arrow function by looking at:
// ({ y }) : z => ({ z })
// This is a valid arrow function with "z" as the return type.
//
// But, if we're in the true side of a conditional expression, this colon
// terminates the expression, so we cannot allow a return type if we aren't
// certain whether or not the preceding text was parsed as a parameter list.
//
// For example,
// a() ? (b: number, c?: string): void => d() : e
// is determined by isParenthesizedArrowFunctionExpression to unambiguously
// be an arrow expression, so we allow a return type.
if (disallowReturnTypeInArrowFunction && token() === SyntaxKind.ColonToken) {
return undefined;
}
const type = parseReturnType(SyntaxKind.ColonToken, /*isType*/ false);
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
return undefined;
@@ -4744,14 +4728,14 @@ namespace ts {
const lastToken = token();
const equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken);
const body = (lastToken === SyntaxKind.EqualsGreaterThanToken || lastToken === SyntaxKind.OpenBraceToken)
? parseArrowFunctionExpressionBody(some(modifiers, isAsyncModifier), disallowReturnTypeInArrowFunction)
? parseArrowFunctionExpressionBody(some(modifiers, isAsyncModifier))
: parseIdentifier();
const node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseArrowFunctionExpressionBody(isAsync: boolean, disallowReturnTypeInArrowFunction: boolean): Block | Expression {
function parseArrowFunctionExpressionBody(isAsync: boolean): Block | Expression {
if (token() === SyntaxKind.OpenBraceToken) {
return parseFunctionBlock(isAsync ? SignatureFlags.Await : SignatureFlags.None);
}
@@ -4781,8 +4765,8 @@ namespace ts {
const savedTopLevel = topLevel;
topLevel = false;
const node = isAsync
? doInAwaitContext(() => parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction))
: doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction));
? doInAwaitContext(parseAssignmentExpressionOrHigher)
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
topLevel = savedTopLevel;
return node;
}
@@ -4801,10 +4785,10 @@ namespace ts {
factory.createConditionalExpression(
leftOperand,
questionToken,
doOutsideOfContext(disallowInAndDecoratorContext, () => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ true)),
doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher),
colonToken = parseExpectedToken(SyntaxKind.ColonToken),
nodeIsPresent(colonToken)
? parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ true)
? parseAssignmentExpressionOrHigher()
: createMissingNode(SyntaxKind.Identifier, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, tokenToString(SyntaxKind.ColonToken))
),
pos
@@ -5735,34 +5719,10 @@ namespace ts {
case SyntaxKind.OpenParenToken: // foo<x>(
case SyntaxKind.NoSubstitutionTemplateLiteral: // foo<T> `...`
case SyntaxKind.TemplateHead: // foo<T> `...${100}...`
// These tokens can't follow in a call expression, nor can they start an
// expression. So, consider the type argument list part of an instantiation
// expression.
// falls through
case SyntaxKind.CommaToken: // foo<x>,
case SyntaxKind.DotToken: // foo<x>.
case SyntaxKind.QuestionDotToken: // foo<x>?.
case SyntaxKind.CloseParenToken: // foo<x>)
case SyntaxKind.CloseBracketToken: // foo<x>]
case SyntaxKind.ColonToken: // foo<x>:
case SyntaxKind.SemicolonToken: // foo<x>;
case SyntaxKind.QuestionToken: // foo<x>?
case SyntaxKind.EqualsEqualsToken: // foo<x> ==
case SyntaxKind.EqualsEqualsEqualsToken: // foo<x> ===
case SyntaxKind.ExclamationEqualsToken: // foo<x> !=
case SyntaxKind.ExclamationEqualsEqualsToken: // foo<x> !==
case SyntaxKind.AmpersandAmpersandToken: // foo<x> &&
case SyntaxKind.BarBarToken: // foo<x> ||
case SyntaxKind.QuestionQuestionToken: // foo<x> ??
case SyntaxKind.CaretToken: // foo<x> ^
case SyntaxKind.AmpersandToken: // foo<x> &
case SyntaxKind.BarToken: // foo<x> |
case SyntaxKind.CloseBraceToken: // foo<x> }
case SyntaxKind.EndOfFileToken: // foo<x>
return true;
}
// Treat anything else as an expression.
return false;
// Consider something a type argument list only if the following token can't start an expression.
return !isStartOfExpression();
}
function parsePrimaryExpression(): PrimaryExpression {
@@ -5826,14 +5786,14 @@ namespace ts {
function parseSpreadElement(): Expression {
const pos = getNodePos();
parseExpected(SyntaxKind.DotDotDotToken);
const expression = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
const expression = parseAssignmentExpressionOrHigher();
return finishNode(factory.createSpreadElement(expression), pos);
}
function parseArgumentOrArrayLiteralElement(): Expression {
return token() === SyntaxKind.DotDotDotToken ? parseSpreadElement() :
token() === SyntaxKind.CommaToken ? finishNode(factory.createOmittedExpression(), getNodePos()) :
parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression(): Expression {
@@ -5855,7 +5815,7 @@ namespace ts {
const hasJSDoc = hasPrecedingJSDocComment();
if (parseOptionalToken(SyntaxKind.DotDotDotToken)) {
const expression = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
const expression = parseAssignmentExpressionOrHigher();
return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);
}
@@ -5890,7 +5850,7 @@ namespace ts {
const isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== SyntaxKind.ColonToken);
if (isShorthandPropertyAssignment) {
const equalsToken = parseOptionalToken(SyntaxKind.EqualsToken);
const objectAssignmentInitializer = equalsToken ? allowInAnd(() => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false)) : undefined;
const objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
node = factory.createShorthandPropertyAssignment(name as Identifier, objectAssignmentInitializer);
// Save equals token for error reporting.
// TODO(rbuckton): Consider manufacturing this when we need to report an error as it is otherwise not useful.
@@ -5898,7 +5858,7 @@ namespace ts {
}
else {
parseExpected(SyntaxKind.ColonToken);
const initializer = allowInAnd(() => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false));
const initializer = allowInAnd(parseAssignmentExpressionOrHigher);
node = factory.createPropertyAssignment(name, initializer);
}
// Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
@@ -6098,7 +6058,7 @@ namespace ts {
let node: IterationStatement;
if (awaitToken ? parseExpected(SyntaxKind.OfKeyword) : parseOptional(SyntaxKind.OfKeyword)) {
const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false));
const expression = allowInAnd(parseAssignmentExpressionOrHigher);
parseExpected(SyntaxKind.CloseParenToken);
node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
}
@@ -7440,7 +7400,7 @@ namespace ts {
const pos = getNodePos();
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(SyntaxKind.StringLiteral) as StringLiteral;
parseExpected(SyntaxKind.ColonToken);
const value = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
const value = parseAssignmentExpressionOrHigher();
return finishNode(factory.createAssertEntry(name, value), pos);
}
@@ -7511,7 +7471,7 @@ namespace ts {
function parseModuleReference() {
return isExternalModuleReference()
? parseExternalModuleReference()
: parseEntityName(/*allowReservedWords*/ false, /*allowPrivateIdentifiers*/ false);
: parseEntityName(/*allowReservedWords*/ false);
}
function parseExternalModuleReference() {
@@ -7706,7 +7666,7 @@ namespace ts {
else {
parseExpected(SyntaxKind.DefaultKeyword);
}
const expression = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
const expression = parseAssignmentExpressionOrHigher();
parseSemicolon();
setAwaitContext(savedAwaitContext);
const node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
@@ -7784,7 +7744,7 @@ namespace ts {
const pos = getNodePos();
const hasBrace = parseOptional(SyntaxKind.OpenBraceToken);
const p2 = getNodePos();
let entityName: EntityName | JSDocMemberName = parseEntityName(/* allowReservedWords*/ false, /*allowPrivateIdentifiers*/ false);
let entityName: EntityName | JSDocMemberName = parseEntityName(/* allowReservedWords*/ false);
while (token() === SyntaxKind.PrivateIdentifier) {
reScanHashToken(); // rescan #id as # id
nextTokenJSDoc(); // then skip the #
@@ -8247,7 +8207,7 @@ namespace ts {
// parseEntityName logs an error for non-identifier, so create a MissingNode ourselves to avoid the error
const p2 = getNodePos();
let name: EntityName | JSDocMemberName | undefined = tokenIsIdentifierOrKeyword(token())
? parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ false)
? parseEntityName(/*allowReservedWords*/ true)
: undefined;
if (name) {
while (token() === SyntaxKind.PrivateIdentifier) {
@@ -8602,7 +8562,8 @@ namespace ts {
if (!comment) {
comment = parseTrailingTagComments(start, getNodePos(), indent, indentText);
}
return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start);
const end = comment !== undefined ? getNodePos() : typeExpression.end;
return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start, end);
}
function escapedTextsEqual(a: EntityName, b: EntityName): boolean {
@@ -9413,7 +9374,7 @@ namespace ts {
/** @internal */
export function isDeclarationFileName(fileName: string): boolean {
return fileExtensionIsOneOf(fileName, [Extension.Dts, Extension.Dmts, Extension.Dcts]);
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions);
}
/*@internal*/
+57 -16
View File
@@ -262,7 +262,7 @@ namespace ts {
return newValue;
};
if (originalWriteFile) {
host.writeFile = (fileName, data, writeByteOrderMark, onError, sourceFiles) => {
host.writeFile = (fileName, data, ...rest) => {
const key = toPath(fileName);
fileExistsCache.delete(key);
@@ -277,7 +277,7 @@ namespace ts {
sourceFileCache.delete(key);
}
}
originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles);
originalWriteFile.call(host, fileName, data, ...rest);
};
}
@@ -593,7 +593,7 @@ namespace ts {
}
/* @internal */
export function getResolutionModeOverrideForClause(clause: AssertClause | undefined, grammarErrorOnNode?: (node: Node, diagnostic: DiagnosticMessage) => boolean) {
export function getResolutionModeOverrideForClause(clause: AssertClause | undefined, grammarErrorOnNode?: (node: Node, diagnostic: DiagnosticMessage) => void) {
if (!clause) return undefined;
if (length(clause.elements) !== 1) {
grammarErrorOnNode?.(clause, Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require);
@@ -858,7 +858,7 @@ namespace ts {
*/
export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleKind.ESNext | ModuleKind.CommonJS | undefined {
switch (getEmitModuleResolutionKind(options)) {
case ModuleResolutionKind.Node12:
case ModuleResolutionKind.Node16:
case ModuleResolutionKind.NodeNext:
return fileExtensionIsOneOf(fileName, [Extension.Dmts, Extension.Mts, Extension.Mjs]) ? ModuleKind.ESNext :
fileExtensionIsOneOf(fileName, [Extension.Dcts, Extension.Cts, Extension.Cjs]) ? ModuleKind.CommonJS :
@@ -913,7 +913,6 @@ namespace ts {
Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
@@ -1186,7 +1185,7 @@ namespace ts {
else if (getEmitModuleKind(parsedRef.commandLine.options) === ModuleKind.None) {
const getCommonSourceDirectory = memoize(() => getCommonSourceDirectoryOfConfig(parsedRef.commandLine, !host.useCaseSensitiveFileNames()));
for (const fileName of parsedRef.commandLine.fileNames) {
if (!fileExtensionIs(fileName, Extension.Dts) && !fileExtensionIs(fileName, Extension.Json)) {
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, Extension.Json)) {
processProjectReferenceFile(getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory), { kind: FileIncludeKind.OutputFromProjectReference, index });
}
}
@@ -1210,7 +1209,7 @@ namespace ts {
const containingFilename = combinePaths(containingDirectory, inferredTypesContainingFile);
const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
for (let i = 0; i < typeReferences.length; i++) {
// under node12/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode
// under node16/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode
processTypeReferenceDirective(typeReferences[i], /*mode*/ undefined, resolutions[i], { kind: FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: resolutions[i]?.packageId });
}
tracing?.pop();
@@ -1340,6 +1339,7 @@ namespace ts {
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
getFileIncludeReasons: () => fileReasons,
structureIsReused,
writeFile,
};
onProgramCreateComplete();
@@ -1364,6 +1364,36 @@ namespace ts {
return program;
function addResolutionDiagnostics(list: Diagnostic[] | undefined) {
if (!list) return;
for (const elem of list) {
programDiagnostics.add(elem);
}
}
function pullDiagnosticsFromCache(names: string[] | readonly FileReference[], containingFile: SourceFile) {
if (!moduleResolutionCache) return;
const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
const containingFileMode = !isString(containingFile) ? containingFile.impliedNodeFormat : undefined;
const containingDir = getDirectoryPath(containingFileName);
const redirectedReference = getRedirectReferenceForResolution(containingFile);
let i = 0;
for (const n of names) {
// mimics logic done in the resolution cache, should be resilient to upgrading it to use `FileReference`s for non-type-reference modal lookups to make it rely on the index in the list less
const mode = typeof n === "string" ? getModeForResolutionAtIndex(containingFile, i) : getModeForFileReference(n, containingFileMode);
const name = typeof n === "string" ? n : n.fileName;
i++;
// only nonrelative names hit the cache, and, at least as of right now, only nonrelative names can issue diagnostics
// (Since diagnostics are only issued via import or export map lookup)
// This may totally change if/when the issue of output paths not mapping to input files is fixed in a broader context
// When it is, how we extract diagnostics from the module name resolver will have the be refined - the current cache
// APIs wrapping the underlying resolver make it almost impossible to smuggle the diagnostics out in a generalized way
if (isExternalModuleNameRelative(name)) continue;
const diags = moduleResolutionCache.getOrCreateCacheForModuleName(name, mode, redirectedReference).get(containingDir)?.resolutionDiagnostics;
addResolutionDiagnostics(diags);
}
}
function resolveModuleNamesWorker(moduleNames: string[], containingFile: SourceFile, reusedNames: string[] | undefined): readonly ResolvedModuleFull[] {
if (!moduleNames.length) return emptyArray;
const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
@@ -1374,6 +1404,7 @@ namespace ts {
performance.mark("afterResolveModule");
performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule");
tracing?.pop();
pullDiagnosticsFromCache(moduleNames, containingFile);
return result;
}
@@ -1393,7 +1424,7 @@ namespace ts {
function getRedirectReferenceForResolution(file: SourceFile) {
const redirect = getResolvedProjectReferenceToRedirect(file.originalFileName);
if (redirect || !fileExtensionIsOneOf(file.originalFileName, [Extension.Dts, Extension.Dcts, Extension.Dmts])) return redirect;
if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect;
// The originalFileName could not be actual source file name if file found was d.ts from referecned project
// So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case
@@ -1894,8 +1925,7 @@ namespace ts {
getProjectReferenceRedirect,
isSourceOfProjectReferenceRedirect,
getSymlinkCache,
writeFile: writeFileCallback || (
(fileName, data, writeByteOrderMark, onError, sourceFiles) => host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles)),
writeFile: writeFileCallback || writeFile,
isEmitBlocked,
readFile: f => host.readFile(f),
fileExists: f => {
@@ -1914,6 +1944,17 @@ namespace ts {
};
}
function writeFile(
fileName: string,
text: string,
writeByteOrderMark: boolean,
onError?: (message: string) => void,
sourceFiles?: readonly SourceFile[],
data?: WriteFileCallbackData
) {
host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
}
function emitBuildInfo(writeFileCallback?: WriteFileCallback): EmitResult {
Debug.assert(!outFile(options));
tracing?.push(tracing.Phase.Emit, "emitBuildInfo", {}, /*separateBeginAndEnd*/ true);
@@ -2969,7 +3010,7 @@ namespace ts {
function getProjectReferenceRedirectProject(fileName: string) {
// Ignore dts or any json files
if (!resolvedProjectReferences || !resolvedProjectReferences.length || fileExtensionIs(fileName, Extension.Dts) || fileExtensionIs(fileName, Extension.Json)) {
if (!resolvedProjectReferences || !resolvedProjectReferences.length || isDeclarationFileName(fileName) || fileExtensionIs(fileName, Extension.Json)) {
return undefined;
}
@@ -3025,7 +3066,7 @@ namespace ts {
else {
const getCommonSourceDirectory = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
forEach(resolvedRef.commandLine.fileNames, fileName => {
if (!fileExtensionIs(fileName, Extension.Dts) && !fileExtensionIs(fileName, Extension.Json)) {
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, Extension.Json)) {
const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory);
mapFromToProjectReferenceRedirectSource!.set(toPath(outputDts), fileName);
}
@@ -3074,8 +3115,8 @@ namespace ts {
const fileName = toFileNameLowerCase(ref.fileName);
setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
const mode = ref.resolutionMode || file.impliedNodeFormat;
if (mode && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node12 && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeNext) {
programDiagnostics.add(createDiagnosticForRange(file, ref, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext));
if (mode && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeNext) {
programDiagnostics.add(createDiagnosticForRange(file, ref, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext));
}
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: FileIncludeKind.TypeReferenceDirective, file: file.path, index, });
}
@@ -3504,7 +3545,7 @@ namespace ts {
if (options.resolveJsonModule) {
if (getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeJs &&
getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node12 &&
getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node16 &&
getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeNext) {
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
}
@@ -3947,7 +3988,7 @@ namespace ts {
return containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
}
if (fileExtensionIsOneOf(filePath, supportedJSExtensionsFlat) || fileExtensionIs(filePath, Extension.Dts)) {
if (fileExtensionIsOneOf(filePath, supportedJSExtensionsFlat) || isDeclarationFileName(filePath)) {
// Otherwise just check if sourceFile with the name exists
const filePathWithoutExtension = removeFileExtension(filePath);
return !!getSourceFileByPath((filePathWithoutExtension + Extension.Ts) as Path) ||
+4 -2
View File
@@ -1210,11 +1210,13 @@ namespace ts {
base64decode?(input: string): string;
base64encode?(input: string): string;
/*@internal*/ bufferFrom?(input: string, encoding?: string): Buffer;
/*@internal*/ require?(baseDir: string, moduleName: string): RequireResult;
/*@internal*/ defaultWatchFileKind?(): WatchFileKind | undefined;
// For testing
/*@internal*/ now?(): Date;
/*@internal*/ disableUseFileVersionAsSignature?: boolean;
/*@internal*/ require?(baseDir: string, moduleName: string): RequireResult;
/*@internal*/ defaultWatchFileKind?(): WatchFileKind | undefined;
/*@internal*/ storeFilesChangingSignatureDuringEmit?: boolean;
}
export interface FileWatcher {
+1 -1
View File
@@ -9,7 +9,7 @@ namespace ts {
return transformECMAScriptModule;
case ModuleKind.System:
return transformSystemModule;
case ModuleKind.Node12:
case ModuleKind.Node16:
case ModuleKind.NodeNext:
return transformNodeModule;
default:
+16 -14
View File
@@ -1294,7 +1294,7 @@ namespace ts {
resumeLexicalEnvironment();
const needsSyntheticConstructor = !constructor && isDerivedClass;
let indexOfFirstStatementAfterSuper = 0;
let indexOfFirstStatementAfterSuperAndPrologue = 0;
let prologueStatementCount = 0;
let superStatementIndex = -1;
let statements: Statement[] = [];
@@ -1305,13 +1305,16 @@ namespace ts {
// If there was a super call, visit existing statements up to and including it
if (superStatementIndex >= 0) {
indexOfFirstStatementAfterSuper = superStatementIndex + 1;
indexOfFirstStatementAfterSuperAndPrologue = superStatementIndex + 1;
statements = [
...statements.slice(0, prologueStatementCount),
...visitNodes(constructor.body.statements, visitor, isStatement, prologueStatementCount, indexOfFirstStatementAfterSuper - prologueStatementCount),
...visitNodes(constructor.body.statements, visitor, isStatement, prologueStatementCount, indexOfFirstStatementAfterSuperAndPrologue - prologueStatementCount),
...statements.slice(prologueStatementCount),
];
}
else if (prologueStatementCount >= 0) {
indexOfFirstStatementAfterSuperAndPrologue = prologueStatementCount;
}
}
if (needsSyntheticConstructor) {
@@ -1354,26 +1357,25 @@ namespace ts {
}
}
if (parameterPropertyDeclarationCount > 0) {
const parameterProperties = visitNodes(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper, parameterPropertyDeclarationCount);
const parameterProperties = visitNodes(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount);
// If there was a super() call found, add parameter properties immediately after it
if (superStatementIndex >= 0) {
addRange(statements, parameterProperties);
}
// If a synthetic super() call was added, add them just after it
else if (needsSyntheticConstructor) {
else {
// Add add parameter properties to the top of the constructor after the prologue
let superAndPrologueStatementCount = prologueStatementCount;
// If a synthetic super() call was added, need to account for that
if (needsSyntheticConstructor) superAndPrologueStatementCount++;
statements = [
statements[0],
...statements.slice(0, superAndPrologueStatementCount),
...parameterProperties,
...statements.slice(1),
...statements.slice(superAndPrologueStatementCount),
];
}
// Since there wasn't a super() call, add them to the top of the constructor
else {
statements = [...parameterProperties, ...statements];
}
indexOfFirstStatementAfterSuper += parameterPropertyDeclarationCount;
indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount;
}
}
}
@@ -1385,7 +1387,7 @@ namespace ts {
// Add existing statements after the initial prologues and super call
if (constructor) {
addRange(statements, visitNodes(constructor.body!.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuper + prologueStatementCount));
addRange(statements, visitNodes(constructor.body!.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuperAndPrologue));
}
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
+22 -5
View File
@@ -733,7 +733,7 @@ namespace ts {
decl.modifiers,
decl.importClause,
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
);
}
// The `importClause` visibility corresponds to the default's visibility.
@@ -745,7 +745,7 @@ namespace ts {
decl.importClause.isTypeOnly,
visibleDefaultBinding,
/*namedBindings*/ undefined,
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
}
if (decl.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {
// Namespace import (optionally with visible default)
@@ -755,7 +755,7 @@ namespace ts {
decl.importClause.isTypeOnly,
visibleDefaultBinding,
namedBindings,
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined) : undefined;
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)) : undefined;
}
// Named imports (optionally with visible default)
const bindingList = mapDefined(decl.importClause.namedBindings.elements, b => resolver.isDeclarationVisible(b) ? b : undefined);
@@ -771,7 +771,7 @@ namespace ts {
bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined,
),
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
);
}
// Augmentation of export depends on import
@@ -782,12 +782,23 @@ namespace ts {
decl.modifiers,
/*importClause*/ undefined,
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
);
}
// Nothing visible
}
function getResolutionModeOverrideForClauseInNightly(assertClause: AssertClause | undefined) {
const mode = getResolutionModeOverrideForClause(assertClause);
if (mode !== undefined) {
if (!isNightly()) {
context.addDiagnostic(createDiagnosticForNode(assertClause!, Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
}
return assertClause;
}
return undefined;
}
function transformAndReplaceLatePaintedStatements(statements: NodeArray<Statement>): NodeArray<Statement> {
// This is a `while` loop because `handleSymbolAccessibilityError` can see additional import aliases marked as visible during
// error handling which must now be included in the output and themselves checked for errors.
@@ -1140,6 +1151,9 @@ namespace ts {
const varDecl = factory.createVariableDeclaration(newId, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined);
errorFallbackNode = undefined;
const statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(SyntaxKind.DeclareKeyword)] : [], factory.createVariableDeclarationList([varDecl], NodeFlags.Const));
preserveJsDoc(statement, input);
removeAllComments(input);
return [statement, factory.updateExportAssignment(input, input.decorators, input.modifiers, newId)];
}
}
@@ -1163,6 +1177,9 @@ namespace ts {
}
function transformTopLevelDeclaration(input: LateVisibilityPaintedStatement) {
if (lateMarkedStatements) {
while (orderedRemoveItem(lateMarkedStatements, input));
}
if (shouldStripInternal(input)) return;
switch (input.kind) {
case SyntaxKind.ImportEqualsDeclaration: {
+1 -1
View File
@@ -1146,7 +1146,7 @@ namespace ts {
[
...existingPrologue,
...prologue,
...(superStatementIndex <= existingPrologue.length ? emptyArray : visitNodes(constructor.body.statements, visitor, isStatement, existingPrologue.length, superStatementIndex)),
...(superStatementIndex <= existingPrologue.length ? emptyArray : visitNodes(constructor.body.statements, visitor, isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length)),
...statements
]
),
+11 -7
View File
@@ -1938,14 +1938,14 @@ namespace ts {
resumeLexicalEnvironment();
const indexAfterLastPrologueStatement = factory.copyPrologue(body.statements, statements, /*ensureUseStrict*/ false, visitor);
const superStatementIndex = findSuperStatementIndex(body.statements, indexAfterLastPrologueStatement);
const prologueStatementCount = factory.copyPrologue(body.statements, statements, /*ensureUseStrict*/ false, visitor);
const superStatementIndex = findSuperStatementIndex(body.statements, prologueStatementCount);
// If there was a super call, visit existing statements up to and including it
if (superStatementIndex >= 0) {
addRange(
statements,
visitNodes(body.statements, visitor, isStatement, indexAfterLastPrologueStatement, superStatementIndex + 1 - indexAfterLastPrologueStatement),
visitNodes(body.statements, visitor, isStatement, prologueStatementCount, superStatementIndex + 1 - prologueStatementCount),
);
}
@@ -1967,13 +1967,17 @@ namespace ts {
if (superStatementIndex >= 0) {
addRange(statements, parameterPropertyAssignments);
}
// Since there was no super() call, parameter properties are the first statements in the constructor
// Since there was no super() call, parameter properties are the first statements in the constructor after any prologue statements
else {
statements = addRange(parameterPropertyAssignments, statements);
statements = [
...statements.slice(0, prologueStatementCount),
...parameterPropertyAssignments,
...statements.slice(prologueStatementCount),
];
}
// Add remaining statements from the body, skipping the super() call if it was found
addRange(statements, visitNodes(body.statements, visitor, isStatement, superStatementIndex + 1));
// Add remaining statements from the body, skipping the super() call if it was found and any (already added) prologue statements
addRange(statements, visitNodes(body.statements, visitor, isStatement, superStatementIndex + 1 + prologueStatementCount));
// End the lexical environment.
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
+4 -8
View File
@@ -72,10 +72,6 @@ namespace ts {
return date2 > date1 ? date2 : date1;
}
function isDeclarationFile(fileName: string) {
return fileExtensionIs(fileName, Extension.Dts);
}
export type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
export interface ReportFileInError {
@@ -972,7 +968,7 @@ namespace ts {
const emittedOutputs = new Map<Path, string>();
outputFiles.forEach(({ name, text, writeByteOrderMark }) => {
let priorChangeTime: Date | undefined;
if (!anyDtsChanged && isDeclarationFile(name)) {
if (!anyDtsChanged && isDeclarationFileName(name)) {
// Check for unchanged .d.ts files
if (host.fileExists(name) && state.readFileWithCache(name) === text) {
priorChangeTime = host.getModifiedTime(name);
@@ -1421,7 +1417,7 @@ namespace ts {
// In addition to file timestamps, we also keep track of when a .d.ts file
// had its file touched but not had its contents changed - this allows us
// to skip a downstream typecheck
if (isDeclarationFile(output)) {
if (isDeclarationFileName(output)) {
const outputModifiedTime = getModifiedTime(host, output);
newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
}
@@ -1589,7 +1585,7 @@ namespace ts {
reportStatus(state, verboseMessage, proj.options.configFilePath!);
}
if (isDeclarationFile(file)) {
if (isDeclarationFileName(file)) {
priorNewestUpdateTime = newer(priorNewestUpdateTime, getModifiedTime(host, file));
}
@@ -1900,7 +1896,7 @@ namespace ts {
{
createNewValue: (path, _input) => state.watchFile(
path,
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, ConfigFileProgramReloadLevel.Full),
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, ConfigFileProgramReloadLevel.None),
PollingInterval.High,
parsed?.watchOptions,
WatchType.PackageJson,
+31 -15
View File
@@ -3615,7 +3615,7 @@ namespace ts {
languageVersion: ScriptTarget;
/**
* When `module` is `Node12` or `NodeNext`, this field controls whether the
* When `module` is `Node16` or `NodeNext`, this field controls whether the
* source file in question is an ESNext-output-format file, or a CommonJS-output-format
* module. This is derived by the module resolver as it looks up the file, since
* it is derived from either the file extension of the module, or the containing
@@ -3856,12 +3856,16 @@ namespace ts {
*/
export type ResolvedConfigFileName = string & { _isResolvedConfigFileName: never };
export interface WriteFileCallbackData {
/*@internal*/ sourceMapUrlPos?: number;
}
export type WriteFileCallback = (
fileName: string,
data: string,
text: string,
writeByteOrderMark: boolean,
onError?: (message: string) => void,
sourceFiles?: readonly SourceFile[],
data?: WriteFileCallbackData,
) => void;
export class OperationCanceledException { }
@@ -4067,6 +4071,8 @@ namespace ts {
* This implementation handles file exists to be true if file is source of project reference redirect when program is created using useSourceOfProjectReferenceRedirect
*/
/*@internal*/ fileExists(fileName: string): boolean;
/** Call compilerHost.writeFile on host program was created with */
/*@internal*/ writeFile: WriteFileCallback;
}
/*@internal*/
@@ -4490,7 +4496,6 @@ namespace ts {
UseAliasDefinedOutsideCurrentScope = 1 << 14, // Allow non-visible aliases
UseSingleQuotesForStringLiteralType = 1 << 28, // Use single quotes for string literal type
NoTypeReduction = 1 << 29, // Don't call getReducedType
NoUndefinedOptionalParameterType = 1 << 30, // Do not add undefined to optional parameter type
// Error handling
AllowThisInObjectLiteral = 1 << 15,
@@ -4669,8 +4674,10 @@ namespace ts {
export type AnyImportOrRequire = AnyImportSyntax | VariableDeclarationInitializedTo<RequireOrImportCall>;
/* @internal */
export type AnyImportOrRequireStatement = AnyImportSyntax | RequireVariableStatement;
export type AnyImportOrBareOrAccessedRequire = AnyImportSyntax | VariableDeclarationInitializedTo<RequireOrImportCall | AccessExpression>;
/* @internal */
export type AnyImportOrRequireStatement = AnyImportSyntax | RequireVariableStatement;
/* @internal */
export type AnyImportOrReExport = AnyImportSyntax | ExportDeclaration;
@@ -4943,7 +4950,8 @@ namespace ts {
/* @internal */
export interface SymbolLinks {
immediateTarget?: Symbol; // Immediate target of an alias. May be another alias. Do not access directly, use `checker.getImmediateAliasedSymbol` instead.
target?: Symbol; // Resolved (non-alias) target of an alias
aliasTarget?: Symbol, // Resolved (non-alias) target of an alias
target?: Symbol; // Original version of an instantiated symbol
type?: Type; // Type of value symbol
writeType?: Type; // Type of value symbol in write contexts
nameType?: Type; // Type associated with a late-bound symbol
@@ -6041,11 +6049,12 @@ namespace ts {
Classic = 1,
NodeJs = 2,
// Starting with node12, node's module resolver has significant departures from traditional cjs resolution
// to better support ecmascript modules and their use within node - more features are still being added, so
// we can expect it to change over time, and as such, offer both a `NodeNext` moving resolution target, and a `Node12`
// version-anchored resolution target
Node12 = 3,
NodeNext = 99, // Not simply `Node12` so that compiled code linked against TS can use the `Next` value reliably (same as with `ModuleKind`)
// to better support ecmascript modules and their use within node - however more features are still being added.
// TypeScript's Node ESM support was introduced after Node 12 went end-of-life, and Node 14 is the earliest stable
// version that supports both pattern trailers - *but*, Node 16 is the first version that also supports ECMASCript 2022.
// In turn, we offer both a `NodeNext` moving resolution target, and a `Node16` version-anchored resolution target
Node16 = 3,
NodeNext = 99, // Not simply `Node16` so that compiled code linked against TS can use the `Next` value reliably (same as with `ModuleKind`)
}
export enum ModuleDetectionKind {
@@ -6054,7 +6063,7 @@ namespace ts {
*/
Legacy = 1,
/**
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
*/
Auto = 2,
/**
@@ -6178,6 +6187,8 @@ namespace ts {
assumeChangesOnlyAffectDirectDependencies?: boolean;
noLib?: boolean;
noResolve?: boolean;
/*@internal*/
noDtsResolution?: boolean;
noUncheckedIndexedAccess?: boolean;
out?: string;
outDir?: string;
@@ -6271,8 +6282,8 @@ namespace ts {
ES2022 = 7,
ESNext = 99,
// Node12+ is an amalgam of commonjs (albeit updated) and es2020+, and represents a distinct module system from es2020/esnext
Node12 = 100,
// Node16+ is an amalgam of commonjs (albeit updated) and es2022+, and represents a distinct module system from es2020/esnext
Node16 = 100,
NodeNext = 199,
}
@@ -6706,6 +6717,8 @@ namespace ts {
readonly resolvedModule: ResolvedModuleFull | undefined;
/* @internal */
readonly failedLookupLocations: string[];
/* @internal */
readonly resolutionDiagnostics: Diagnostic[]
}
export interface ResolvedTypeReferenceDirective {
@@ -6727,6 +6740,8 @@ namespace ts {
export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
readonly failedLookupLocations: string[];
/* @internal */
resolutionDiagnostics: Diagnostic[]
}
/* @internal */
@@ -6778,6 +6793,7 @@ namespace ts {
// For testing:
/*@internal*/ disableUseFileVersionAsSignature?: boolean;
/*@internal*/ storeFilesChangingSignatureDuringEmit?: boolean;
}
/** true if --out otherwise source file name */
@@ -8459,7 +8475,7 @@ namespace ts {
export interface ResolvedModuleSpecifierInfo {
modulePaths: readonly ModulePath[] | undefined;
moduleSpecifiers: readonly string[] | undefined;
isAutoImportable: boolean | undefined;
isBlockedByPackageJsonDependencies: boolean | undefined;
}
/* @internal */
@@ -8471,7 +8487,7 @@ namespace ts {
export interface ModuleSpecifierCache {
get(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions): Readonly<ResolvedModuleSpecifierInfo> | undefined;
set(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, modulePaths: readonly ModulePath[], moduleSpecifiers: readonly string[]): void;
setIsAutoImportable(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, isAutoImportable: boolean): void;
setBlockedByPackageJsonDependencies(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, isBlockedByPackageJsonDependencies: boolean): void;
setModulePaths(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, modulePaths: readonly ModulePath[]): void;
clear(): void;
count(): number;
+108 -32
View File
@@ -656,10 +656,10 @@ namespace ts {
AllowNumericSeparator = 1 << 3
}
export function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile, flags: GetLiteralTextFlags) {
export function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile | undefined, flags: GetLiteralTextFlags) {
// If we don't need to downlevel and we can reach the original source text using
// the node's parent reference, then simply get the text as it was originally written.
if (canUseOriginalText(node, flags)) {
if (sourceFile && canUseOriginalText(node, flags)) {
return getSourceTextOfNodeFromSourceFile(sourceFile, node);
}
@@ -808,7 +808,7 @@ namespace ts {
}
function isCommonJSContainingModuleKind(kind: ModuleKind) {
return kind === ModuleKind.CommonJS || kind === ModuleKind.Node12 || kind === ModuleKind.NodeNext;
return kind === ModuleKind.CommonJS || kind === ModuleKind.Node16 || kind === ModuleKind.NodeNext;
}
export function isEffectiveExternalModule(node: SourceFile, compilerOptions: CompilerOptions) {
@@ -933,6 +933,10 @@ namespace ts {
}
}
export function isAnyImportOrBareOrAccessedRequire(node: Node): node is AnyImportOrBareOrAccessedRequire {
return isAnyImportSyntax(node) || isVariableDeclarationInitializedToBareOrAccessedRequire(node);
}
export function isLateVisibilityPaintedStatement(node: Node): node is LateVisibilityPaintedStatement {
switch (node.kind) {
case SyntaxKind.ImportDeclaration:
@@ -2338,18 +2342,13 @@ namespace ts {
if (isPropertyNameLiteral(name) && isPropertyNameLiteral(initializer)) {
return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer);
}
if (isIdentifier(name) && isLiteralLikeAccess(initializer) &&
if (isMemberName(name) && isLiteralLikeAccess(initializer) &&
(initializer.expression.kind === SyntaxKind.ThisKeyword ||
isIdentifier(initializer.expression) &&
(initializer.expression.escapedText === "window" ||
initializer.expression.escapedText === "self" ||
initializer.expression.escapedText === "global"))) {
const nameOrArgument = getNameOrArgument(initializer);
if (isPrivateIdentifier(nameOrArgument)) {
Debug.fail("Unexpected PrivateIdentifier in name expression with literal-like access.");
}
return isSameEntityName(name, nameOrArgument);
return isSameEntityName(name, getNameOrArgument(initializer));
}
if (isLiteralLikeAccess(name) && isLiteralLikeAccess(initializer)) {
return getElementOrPropertyAccessName(name) === getElementOrPropertyAccessName(initializer)
@@ -2563,14 +2562,14 @@ namespace ts {
return decl.kind === SyntaxKind.FunctionDeclaration || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
}
export function tryGetModuleSpecifierFromDeclaration(node: AnyImportOrRequire): string | undefined {
export function tryGetModuleSpecifierFromDeclaration(node: AnyImportOrBareOrAccessedRequire): StringLiteralLike | undefined {
switch (node.kind) {
case SyntaxKind.VariableDeclaration:
return node.initializer.arguments[0].text;
return findAncestor(node.initializer, (node): node is RequireOrImportCall => isRequireCall(node, /*requireStringLiteralLikeArgument*/ true))?.arguments[0];
case SyntaxKind.ImportDeclaration:
return tryCast(node.moduleSpecifier, isStringLiteralLike)?.text;
return tryCast(node.moduleSpecifier, isStringLiteralLike);
case SyntaxKind.ImportEqualsDeclaration:
return tryCast(tryCast(node.moduleReference, isExternalModuleReference)?.expression, isStringLiteralLike)?.text;
return tryCast(tryCast(node.moduleReference, isExternalModuleReference)?.expression, isStringLiteralLike);
default:
Debug.assertNever(node);
}
@@ -3117,7 +3116,10 @@ namespace ts {
return (parent as BindingElement | ImportSpecifier).propertyName === node;
case SyntaxKind.ExportSpecifier:
case SyntaxKind.JsxAttribute:
// Any name in an export specifier or JSX Attribute
case SyntaxKind.JsxSelfClosingElement:
case SyntaxKind.JsxOpeningElement:
case SyntaxKind.JsxClosingElement:
// Any name in an export specifier or JSX Attribute or Jsx Element
return true;
}
return false;
@@ -3133,21 +3135,31 @@ namespace ts {
// export = <EntityNameExpression>
// export default <EntityNameExpression>
// module.exports = <EntityNameExpression>
// {<Identifier>}
// {name: <EntityNameExpression>}
// module.exports.x = <EntityNameExpression>
// const x = require("...")
// const { x } = require("...")
// const x = require("...").y
// const { x } = require("...").y
export function isAliasSymbolDeclaration(node: Node): boolean {
return node.kind === SyntaxKind.ImportEqualsDeclaration ||
if (node.kind === SyntaxKind.ImportEqualsDeclaration ||
node.kind === SyntaxKind.NamespaceExportDeclaration ||
node.kind === SyntaxKind.ImportClause && !!(node as ImportClause).name ||
node.kind === SyntaxKind.NamespaceImport ||
node.kind === SyntaxKind.NamespaceExport ||
node.kind === SyntaxKind.ImportSpecifier ||
node.kind === SyntaxKind.ExportSpecifier ||
node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(node as ExportAssignment) ||
node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(node as ExportAssignment)
) {
return true;
}
return isInJSFile(node) && (
isBinaryExpression(node) && getAssignmentDeclarationKind(node) === AssignmentDeclarationKind.ModuleExports && exportAssignmentIsAlias(node) ||
isPropertyAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === SyntaxKind.EqualsToken && isAliasableExpression(node.parent.right) ||
node.kind === SyntaxKind.ShorthandPropertyAssignment ||
node.kind === SyntaxKind.PropertyAssignment && isAliasableExpression((node as PropertyAssignment).initializer);
isPropertyAccessExpression(node)
&& isBinaryExpression(node.parent)
&& node.parent.left === node
&& node.parent.operatorToken.kind === SyntaxKind.EqualsToken
&& isAliasableExpression(node.parent.right));
}
export function getAliasDeclarationFromName(node: EntityName): Declaration | undefined {
@@ -3158,6 +3170,7 @@ namespace ts {
case SyntaxKind.ExportSpecifier:
case SyntaxKind.ExportAssignment:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.NamespaceExport:
return node.parent as Declaration;
case SyntaxKind.QualifiedName:
do {
@@ -4108,6 +4121,10 @@ namespace ts {
return indentStrings[1].length;
}
export function isNightly() {
return stringContains(version, "-dev") || stringContains(version, "-insiders");
}
export function createTextWriter(newLine: string): EmitTextWriter {
let output: string;
let indent: number;
@@ -4374,6 +4391,16 @@ namespace ts {
Extension.Dts;
}
/**
* This function is an inverse of `getDeclarationEmitExtensionForPath`.
*/
export function getPossibleOriginalInputExtensionForExtension(path: string) {
return fileExtensionIsOneOf(path, [Extension.Dmts, Extension.Mjs, Extension.Mts]) ? [Extension.Mts, Extension.Mjs] :
fileExtensionIsOneOf(path, [Extension.Dcts, Extension.Cjs, Extension.Cts]) ? [Extension.Cts, Extension.Cjs]:
fileExtensionIsOneOf(path, [`.json.d.ts`]) ? [Extension.Json] :
[Extension.Tsx, Extension.Ts, Extension.Jsx, Extension.Js];
}
export function outFile(options: CompilerOptions) {
return options.outFile || options.out;
}
@@ -4446,10 +4473,10 @@ namespace ts {
return combinePaths(newDirPath, sourceFilePath);
}
export function writeFile(host: { writeFile: WriteFileCallback; }, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean, sourceFiles?: readonly SourceFile[]) {
host.writeFile(fileName, data, writeByteOrderMark, hostErrorMessage => {
export function writeFile(host: { writeFile: WriteFileCallback; }, diagnostics: DiagnosticCollection, fileName: string, text: string, writeByteOrderMark: boolean, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) {
host.writeFile(fileName, text, writeByteOrderMark, hostErrorMessage => {
diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage));
}, sourceFiles);
}, sourceFiles, data);
}
function ensureDirectoriesExist(
@@ -5144,6 +5171,11 @@ namespace ts {
(node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent as PropertyAccessExpression).name === node);
}
export function isRightSideOfAccessExpression(node: Node) {
return isPropertyAccessExpression(node.parent) && node.parent.name === node
|| isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
}
export function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node: Node) {
return isQualifiedName(node.parent) && node.parent.right === node
|| isPropertyAccessExpression(node.parent) && node.parent.name === node
@@ -5831,6 +5863,45 @@ namespace ts {
return expr;
}
export function forEachNameInAccessChainWalkingLeft<T>(name: MemberName | StringLiteralLike, action: (name: MemberName | StringLiteralLike) => T | undefined): T | undefined {
if (isAccessExpression(name.parent) && isRightSideOfAccessExpression(name)) {
return walkAccessExpression(name.parent);
}
function walkAccessExpression(access: AccessExpression): T | undefined {
if (access.kind === SyntaxKind.PropertyAccessExpression) {
const res = action(access.name);
if (res !== undefined) {
return res;
}
}
else if (access.kind === SyntaxKind.ElementAccessExpression) {
if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) {
const res = action(access.argumentExpression);
if (res !== undefined) {
return res;
}
}
else {
// Chain interrupted by non-static-name access 'x[expr()].y.z'
return undefined;
}
}
if (isAccessExpression(access.expression)) {
return walkAccessExpression(access.expression);
}
if (isIdentifier(access.expression)) {
// End of chain at Identifier 'x.y.z'
return action(access.expression);
}
// End of chain at non-Identifier 'x().y.z'
return undefined;
}
}
export function getLeftmostExpression(node: Expression, stopAtCallExpressions: boolean) {
while (true) {
switch (node.kind) {
@@ -6262,7 +6333,7 @@ namespace ts {
file.externalModuleIndicator = isFileProbablyExternalModule(file);
};
case ModuleDetectionKind.Auto:
// If module is nodenext or node12, all esm format files are modules
// If module is nodenext or node16, all esm format files are modules
// If jsx is react-jsx or react-jsxdev then jsx tags force module-ness
// otherwise, the presence of import or export statments (or import.meta) implies module-ness
const checks: ((file: SourceFile) => Node | true | undefined)[] = [isFileProbablyExternalModule];
@@ -6270,7 +6341,7 @@ namespace ts {
checks.push(isFileModuleFromUsingJSXTag);
}
const moduleKind = getEmitModuleKind(options);
if (moduleKind === ModuleKind.Node12 || moduleKind === ModuleKind.NodeNext) {
if (moduleKind === ModuleKind.Node16 || moduleKind === ModuleKind.NodeNext) {
checks.push(isFileForcedToBeModuleByFormat);
}
const combined = or(...checks);
@@ -6281,7 +6352,7 @@ namespace ts {
export function getEmitScriptTarget(compilerOptions: {module?: CompilerOptions["module"], target?: CompilerOptions["target"]}) {
return compilerOptions.target ||
(compilerOptions.module === ModuleKind.Node12 && ScriptTarget.ES2020) ||
(compilerOptions.module === ModuleKind.Node16 && ScriptTarget.ES2022) ||
(compilerOptions.module === ModuleKind.NodeNext && ScriptTarget.ESNext) ||
ScriptTarget.ES3;
}
@@ -6299,8 +6370,8 @@ namespace ts {
case ModuleKind.CommonJS:
moduleResolution = ModuleResolutionKind.NodeJs;
break;
case ModuleKind.Node12:
moduleResolution = ModuleResolutionKind.Node12;
case ModuleKind.Node16:
moduleResolution = ModuleResolutionKind.Node16;
break;
case ModuleKind.NodeNext:
moduleResolution = ModuleResolutionKind.NodeNext;
@@ -6325,7 +6396,7 @@ namespace ts {
case ModuleKind.ES2020:
case ModuleKind.ES2022:
case ModuleKind.ESNext:
case ModuleKind.Node12:
case ModuleKind.Node16:
case ModuleKind.NodeNext:
return true;
default:
@@ -6350,7 +6421,7 @@ namespace ts {
return compilerOptions.esModuleInterop;
}
switch (getEmitModuleKind(compilerOptions)) {
case ModuleKind.Node12:
case ModuleKind.Node16:
case ModuleKind.NodeNext:
return true;
}
@@ -6918,6 +6989,7 @@ namespace ts {
export const supportedJSExtensionsFlat: readonly Extension[] = flatten(supportedJSExtensions);
const allSupportedExtensions: readonly Extension[][] = [[Extension.Ts, Extension.Tsx, Extension.Dts, Extension.Js, Extension.Jsx], [Extension.Cts, Extension.Dcts, Extension.Cjs], [Extension.Mts, Extension.Dmts, Extension.Mjs]];
const allSupportedExtensionsWithJson: readonly Extension[][] = [...allSupportedExtensions, [Extension.Json]];
export const supportedDeclarationExtensions: readonly Extension[] = [Extension.Dts, Extension.Dcts, Extension.Dmts];
export function getSupportedExtensions(options?: CompilerOptions): readonly Extension[][];
export function getSupportedExtensions(options?: CompilerOptions, extraFileExtensions?: readonly FileExtensionInfo[]): readonly string[][];
@@ -7659,4 +7731,8 @@ namespace ts {
return state > States.NodeModules ? { topLevelNodeModulesIndex, topLevelPackageNameIndex, packageRootIndex, fileNameIndex } : undefined;
}
export function getParameterTypeNode(parameter: ParameterDeclaration | JSDocParameterTag) {
return parameter.kind === SyntaxKind.JSDocParameterTag ? parameter.typeExpression?.type : parameter.type;
}
}
+2
View File
@@ -573,6 +573,7 @@ namespace ts {
createHash: maybeBind(host, host.createHash),
readDirectory: maybeBind(host, host.readDirectory),
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
};
function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, onError: (message: string) => void) {
@@ -637,6 +638,7 @@ namespace ts {
createHash: maybeBind(system, system.createHash),
createProgram: createProgram || createEmitAndSemanticDiagnosticsBuilderProgram as any as CreateProgram<T>,
disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
};
}
+2
View File
@@ -20,6 +20,7 @@ namespace ts {
const host = createCompilerHostWorker(options, /*setParentNodes*/ undefined, system);
host.createHash = maybeBind(system, system.createHash);
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
setGetSourceFileAsHashVersioned(host, system);
changeCompilerHostLikeToUseCache(host, fileName => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName));
return host;
@@ -114,6 +115,7 @@ namespace ts {
writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void;
// For testing
disableUseFileVersionAsSignature?: boolean;
storeFilesChangingSignatureDuringEmit?: boolean;
}
export interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
+1 -1
View File
@@ -495,7 +495,7 @@ namespace ts {
if (outFile(options) || options.outDir) return false;
// File if emitted next to input needs to be ignored
if (fileExtensionIs(fileOrDirectoryPath, Extension.Dts)) {
if (isDeclarationFileName(fileOrDirectoryPath)) {
// If its declaration directory: its not ignored if not excluded by config
if (options.declarationDir) return false;
}
+5 -5
View File
@@ -1092,7 +1092,7 @@ namespace ts {
}
return factory.createYieldExpression(asteriskToken, expression);
} as {
(expression?: Expression): YieldExpression;
(expression?: Expression | undefined): YieldExpression;
(asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
}, factoryDeprecation);
@@ -1125,7 +1125,7 @@ namespace ts {
name: PropertyName | string,
questionToken: QuestionToken | undefined,
type: TypeNode | undefined,
initializer?: Expression
initializer?: Expression | undefined
): PropertySignature {
const node = factory.createPropertySignature(modifiers, name, questionToken, type);
node.initializer = initializer;
@@ -1187,7 +1187,7 @@ namespace ts {
arguments.length >= 1 && arguments.length <= 3 ? factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, exclamationTokenOrType as TypeNode | undefined, typeOrInitializer as Expression | undefined) :
Debug.fail("Argument count mismatch");
} as {
(name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration;
(name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration;
(name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
}, factoryDeprecation);
@@ -1212,7 +1212,7 @@ namespace ts {
}, factoryDeprecation);
/** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */
export const createExportDeclaration = Debug.deprecate(function createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, isTypeOnly = false) {
export const createExportDeclaration = Debug.deprecate(function createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly = false) {
return factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier);
}, factoryDeprecation);
@@ -1228,7 +1228,7 @@ namespace ts {
}, factoryDeprecation);
/** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
export const createJSDocParamTag = Debug.deprecate(function createJSDocParamTag(name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, comment?: string): JSDocParameterTag {
export const createJSDocParamTag = Debug.deprecate(function createJSDocParamTag(name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined): JSDocParameterTag {
return factory.createJSDocParameterTag(/*tagName*/ undefined, name, isBracketed, typeExpression, /*isNameFirst*/ false, comment ? factory.createNodeArray([factory.createJSDocText(comment)]) : undefined);
}, factoryDeprecation);
+1 -1
View File
@@ -649,7 +649,7 @@ namespace ts {
return false;
}
export type ExecuteCommandLineCallbacks = (program: Program | EmitAndSemanticDiagnosticsBuilderProgram | ParsedCommandLine) => void;
export type ExecuteCommandLineCallbacks = (program: Program | BuilderProgram | ParsedCommandLine) => void;
export function executeCommandLine(
system: System,
cb: ExecuteCommandLineCallbacks,
+34 -3
View File
@@ -38,6 +38,7 @@ namespace ts.server {
private lineMaps = new Map<string, number[]>();
private messages: string[] = [];
private lastRenameEntry: RenameEntry | undefined;
private preferences: UserPreferences | undefined;
constructor(private host: SessionClientHost) {
}
@@ -124,6 +125,7 @@ namespace ts.server {
/*@internal*/
configure(preferences: UserPreferences) {
this.preferences = preferences;
const args: protocol.ConfigureRequestArguments = { preferences };
const request = this.processRequest(CommandNames.Configure, args);
this.processResponse(request, /*expectEmptyBody*/ true);
@@ -298,7 +300,7 @@ namespace ts.server {
getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan {
const args: protocol.FileLocationRequestArgs = this.createFileLocationRequestArgs(fileName, position);
const request = this.processRequest<protocol.DefinitionRequest>(CommandNames.DefinitionAndBoundSpan, args);
const request = this.processRequest<protocol.DefinitionAndBoundSpanRequest>(CommandNames.DefinitionAndBoundSpan, args);
const response = this.processResponse<protocol.DefinitionInfoAndBoundSpanResponse>(request);
const body = Debug.checkDefined(response.body); // TODO: GH#18217
@@ -332,6 +334,23 @@ namespace ts.server {
}));
}
getSourceDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfo[] {
const args: protocol.FileLocationRequestArgs = this.createFileLocationRequestArgs(fileName, position);
const request = this.processRequest<protocol.FindSourceDefinitionRequest>(CommandNames.FindSourceDefinition, args);
const response = this.processResponse<protocol.DefinitionResponse>(request);
const body = Debug.checkDefined(response.body); // TODO: GH#18217
return body.map(entry => ({
containerKind: ScriptElementKind.unknown,
containerName: "",
fileName: entry.file,
textSpan: this.decodeSpan(entry),
kind: ScriptElementKind.unknown,
name: "",
unverified: entry.unverified,
}));
}
getImplementationAtPosition(fileName: string, position: number): ImplementationLocation[] {
const args = this.createFileLocationRequestArgs(fileName, position);
@@ -471,13 +490,25 @@ namespace ts.server {
return notImplemented();
}
findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] {
findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): RenameLocation[] {
if (!this.lastRenameEntry ||
this.lastRenameEntry.inputs.fileName !== fileName ||
this.lastRenameEntry.inputs.position !== position ||
this.lastRenameEntry.inputs.findInStrings !== findInStrings ||
this.lastRenameEntry.inputs.findInComments !== findInComments) {
this.getRenameInfo(fileName, position, { allowRenameOfImportPath: true }, findInStrings, findInComments);
if (providePrefixAndSuffixTextForRename !== undefined) {
// User preferences have to be set through the `Configure` command
this.configure({ providePrefixAndSuffixTextForRename });
// Options argument is not used, so don't pass in options
this.getRenameInfo(fileName, position, /*options*/{}, findInStrings, findInComments);
// Restore previous user preferences
if (this.preferences) {
this.configure(this.preferences);
}
}
else {
this.getRenameInfo(fileName, position, /*options*/{}, findInStrings, findInComments);
}
}
return this.lastRenameEntry!.locations;
+1 -1
View File
@@ -249,7 +249,7 @@ namespace compiler {
}
// establish defaults (aligns with old harness)
if (compilerOptions.target === undefined && compilerOptions.module !== ts.ModuleKind.Node12 && compilerOptions.module !== ts.ModuleKind.NodeNext) compilerOptions.target = ts.ScriptTarget.ES3;
if (compilerOptions.target === undefined && compilerOptions.module !== ts.ModuleKind.Node16 && compilerOptions.module !== ts.ModuleKind.NodeNext) compilerOptions.target = ts.ScriptTarget.ES3;
if (compilerOptions.newLine === undefined) compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed;
if (compilerOptions.skipDefaultLibCheck === undefined) compilerOptions.skipDefaultLibCheck = true;
if (compilerOptions.noErrorTruncation === undefined) compilerOptions.noErrorTruncation = true;
+11 -10
View File
@@ -511,18 +511,19 @@ ${indentText}${text}`;
buildInfo.version = ts.version;
return ts.getBuildInfoText(buildInfo);
};
return patchHostForBuildInfoWrite(sys, version);
}
export function patchHostForBuildInfoWrite<T extends ts.System>(sys: T, version: string) {
const originalWrite = sys.write;
sys.write = msg => originalWrite.call(sys, msg.replace(ts.version, version));
if (sys.writeFile) {
const originalWriteFile = sys.writeFile;
sys.writeFile = (fileName: string, content: string, writeByteOrderMark: boolean) => {
if (!ts.isBuildInfoFile(fileName)) return originalWriteFile.call(sys, fileName, content, writeByteOrderMark);
const buildInfo = ts.getBuildInfo(content);
buildInfo.version = version;
originalWriteFile.call(sys, fileName, ts.getBuildInfoText(buildInfo), writeByteOrderMark);
};
}
const originalWriteFile = sys.writeFile;
sys.writeFile = (fileName: string, content: string, writeByteOrderMark: boolean) => {
if (!ts.isBuildInfoFile(fileName)) return originalWriteFile.call(sys, fileName, content, writeByteOrderMark);
const buildInfo = ts.getBuildInfo(content);
buildInfo.version = version;
originalWriteFile.call(sys, fileName, ts.getBuildInfoText(buildInfo), writeByteOrderMark);
};
return sys;
}
+23 -11
View File
@@ -697,6 +697,13 @@ namespace FourSlash {
this.verifyGoToX(arg0, endMarkerNames, () => this.getGoToDefinitionAndBoundSpan());
}
public verifyGoToSourceDefinition(startMarkerNames: ArrayOrSingle<string>, end?: ArrayOrSingle<string | { marker: string, unverified?: boolean }> | { file: string, unverified?: boolean }) {
if (this.testType !== FourSlashTestType.Server) {
this.raiseError("goToSourceDefinition may only be used in fourslash/server tests.");
}
this.verifyGoToX(startMarkerNames, end, () => (this.languageService as ts.server.SessionClient).getSourceDefinitionAndBoundSpan(this.activeFile.fileName, this.currentCaretPosition)!);
}
private getGoToDefinition(): readonly ts.DefinitionInfo[] {
return this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition)!;
}
@@ -764,7 +771,9 @@ namespace FourSlash {
}
if (endMarkers.length !== definitions.length) {
this.raiseError(`${testName} failed - expected to find ${endMarkers.length} definitions but got ${definitions.length}`);
const markers = definitions.map(d => ({ text: "HERE", fileName: d.fileName, position: d.textSpan.start }));
const actual = this.renderMarkers(markers);
this.raiseError(`${testName} failed - expected to find ${endMarkers.length} definitions but got ${definitions.length}\n\n${actual}`);
}
ts.zipWith(endMarkers, definitions, (endMarkerOrFileResult, definition, i) => {
@@ -774,17 +783,8 @@ namespace FourSlash {
ts.Debug.assert(typeof expectedFileName === "string");
const expectedPosition = marker?.position || 0;
if (ts.comparePaths(expectedFileName, definition.fileName, /*ignoreCase*/ true) !== ts.Comparison.EqualTo || expectedPosition !== definition.textSpan.start) {
const filesToDisplay = ts.deduplicate([expectedFileName, definition.fileName], ts.equateValues);
const markers = [{ text: "EXPECTED", fileName: expectedFileName, position: expectedPosition }, { text: "ACTUAL", fileName: definition.fileName, position: definition.textSpan.start }];
const text = filesToDisplay.map(fileName => {
const markersToRender = markers.filter(m => m.fileName === fileName).sort((a, b) => b.position - a.position);
let fileContent = this.tryGetFileContent(fileName) || "";
for (const marker of markersToRender) {
fileContent = fileContent.slice(0, marker.position) + `\x1b[1;4m/*${marker.text}*/\x1b[0;31m` + fileContent.slice(marker.position);
}
return `// @Filename: ${fileName}\n${fileContent}`;
}).join("\n\n");
const text = this.renderMarkers(markers);
this.raiseError(`${testName} failed for definition ${markerName || expectedFileName} (${i}): expected ${expectedFileName} at ${expectedPosition}, got ${definition.fileName} at ${definition.textSpan.start}\n\n${text}\n`);
}
if (definition.unverified && (typeof endMarkerOrFileResult === "string" || !endMarkerOrFileResult.unverified)) {
@@ -798,6 +798,18 @@ namespace FourSlash {
});
}
private renderMarkers(markers: { text: string, fileName: string, position: number }[]) {
const filesToDisplay = ts.deduplicate(markers.map(m => m.fileName), ts.equateValues);
return filesToDisplay.map(fileName => {
const markersToRender = markers.filter(m => m.fileName === fileName).sort((a, b) => b.position - a.position);
let fileContent = this.tryGetFileContent(fileName) || "";
for (const marker of markersToRender) {
fileContent = fileContent.slice(0, marker.position) + `\x1b[1;4m/*${marker.text}*/\x1b[0;31m` + fileContent.slice(marker.position);
}
return `// @Filename: ${fileName}\n${fileContent}`;
}).join("\n\n");
}
private verifyDefinitionTextSpan(defs: ts.DefinitionInfoAndBoundSpan, startMarkerName: string) {
const range = this.testData.ranges.find(range => this.markerName(range.marker!) === startMarkerName);
+4
View File
@@ -324,6 +324,10 @@ namespace FourSlashInterface {
this.state.verifyGoToType(arg0, endMarkerName);
}
public goToSourceDefinition(startMarkerNames: ArrayOrSingle<string>, end: { file: string } | ArrayOrSingle<string>) {
this.state.verifyGoToSourceDefinition(startMarkerNames, end);
}
public goToDefinitionForMarkers(...markerNames: string[]) {
this.state.verifyGoToDefinitionForMarkers(markerNames);
}
+1 -1
View File
@@ -282,7 +282,7 @@ namespace Harness.SourceMapRecorder {
const sourceMapData = sourceMapDataList[i];
let prevSourceFile: ts.SourceFile | undefined;
let currentFile: documents.TextDocument;
if (ts.endsWith(sourceMapData.sourceMap.file, ts.Extension.Dts)) {
if (ts.isDeclarationFileName(sourceMapData.sourceMap.file)) {
if (sourceMapDataList.length > jsFiles.length) {
currentFile = declarationFiles[Math.floor(i / 2)]; // When both kinds of source map are present, they alternate js/dts
}
+33 -25
View File
@@ -115,31 +115,39 @@ namespace Harness {
// let type = this.checker.getTypeAtLocation(node);
let type = ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) ? this.checker.getTypeAtLocation(node.parent) : undefined;
if (!type || type.flags & ts.TypeFlags.Any) type = this.checker.getTypeAtLocation(node);
const typeString =
// Distinguish `errorType`s from `any`s; but only if the file has no errors.
// Additionally,
// * the LHS of a qualified name
// * a binding pattern name
// * labels
// * the "global" in "declare global"
// * the "target" in "new.target"
// * names in import statements
// * type-only names in export statements
// * and intrinsic jsx tag names
// return `error`s via `getTypeAtLocation`
// But this is generally expected, so we don't call those out, either
(!this.hadErrorBaseline &&
type.flags & ts.TypeFlags.Any &&
!ts.isBindingElement(node.parent) &&
!ts.isPropertyAccessOrQualifiedName(node.parent) &&
!ts.isLabelName(node) &&
!(ts.isModuleDeclaration(node.parent) && ts.isGlobalScopeAugmentation(node.parent)) &&
!ts.isMetaProperty(node.parent) &&
!this.isImportStatementName(node) &&
!this.isExportStatementName(node) &&
!this.isIntrinsicJsxTag(node)) ?
(type as ts.IntrinsicType).intrinsicName :
this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.AllowUniqueESSymbolType);
// Distinguish `errorType`s from `any`s; but only if the file has no errors.
// Additionally,
// * the LHS of a qualified name
// * a binding pattern name
// * labels
// * the "global" in "declare global"
// * the "target" in "new.target"
// * names in import statements
// * type-only names in export statements
// * and intrinsic jsx tag names
// return `error`s via `getTypeAtLocation`
// But this is generally expected, so we don't call those out, either
let typeString: string;
if (!this.hadErrorBaseline &&
type.flags & ts.TypeFlags.Any &&
!ts.isBindingElement(node.parent) &&
!ts.isPropertyAccessOrQualifiedName(node.parent) &&
!ts.isLabelName(node) &&
!(ts.isModuleDeclaration(node.parent) && ts.isGlobalScopeAugmentation(node.parent)) &&
!ts.isMetaProperty(node.parent) &&
!this.isImportStatementName(node) &&
!this.isExportStatementName(node) &&
!this.isIntrinsicJsxTag(node)) {
typeString = (type as ts.IntrinsicType).intrinsicName;
}
else {
typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.AllowUniqueESSymbolType);
if (ts.isIdentifier(node) && ts.isTypeAliasDeclaration(node.parent) && node.parent.name === node && typeString === ts.idText(node)) {
// for a complex type alias `type T = ...`, showing "T : T" isn't very helpful for type tests. When the type produced is the same as
// the name of the type alias, recreate the type string without reusing the alias name
typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.AllowUniqueESSymbolType | ts.TypeFormatFlags.InTypeAlias);
}
}
return {
line: lineAndCharacter.line,
syntaxKind: node.kind,
+25 -14
View File
@@ -55,12 +55,12 @@ namespace vfs {
} = {};
private _cwd: string; // current working directory
private _time: number | Date | (() => number | Date);
private _time: number;
private _shadowRoot: FileSystem | undefined;
private _dirStack: string[] | undefined;
constructor(ignoreCase: boolean, options: FileSystemOptions = {}) {
const { time = -1, files, meta } = options;
const { time = ts.TestFSWithWatch.timeIncrements, files, meta } = options;
this.ignoreCase = ignoreCase;
this.stringComparer = this.ignoreCase ? vpath.compareCaseInsensitive : vpath.compareCaseSensitive;
this._time = time;
@@ -167,16 +167,15 @@ namespace vfs {
*
* @link http://pubs.opengroup.org/onlinepubs/9699919799/functions/time.html
*/
public time(value?: number | Date | (() => number | Date)): number {
if (value !== undefined && this.isReadonly) throw createIOError("EPERM");
let result = this._time;
if (typeof result === "function") result = result();
if (typeof result === "object") result = result.getTime();
if (result === -1) result = Date.now();
public time(value?: number): number {
if (value !== undefined) {
if (this.isReadonly) throw createIOError("EPERM");
this._time = value;
}
return result;
else if (!this.isReadonly) {
this._time += ts.TestFSWithWatch.timeIncrements;
}
return this._time;
}
/**
@@ -809,7 +808,11 @@ namespace vfs {
const baseBuffer = base._getBuffer(baseNode);
// no difference if both buffers are the same reference
if (changedBuffer === baseBuffer) return false;
if (changedBuffer === baseBuffer) {
if (!options.includeChangedFileWithSameContent || changedNode.mtimeMs === baseNode.mtimeMs) return false;
container[basename] = new SameFileWithModifiedTime(changedBuffer);
return true;
}
// no difference if both buffers are identical
if (Buffer.compare(changedBuffer, baseBuffer) === 0) {
@@ -839,7 +842,7 @@ namespace vfs {
container[basename] = new Symlink(node.symlink);
}
else {
container[basename] = new File(node.buffer || "");
container[basename] = new File(changed._getBuffer(node));
}
return true;
}
@@ -1168,9 +1171,8 @@ namespace vfs {
}
export interface FileSystemOptions {
// Sets the initial timestamp for new files and directories, or the function used
// to calculate timestamps.
time?: number | Date | (() => number | Date);
// Sets the initial timestamp for new files and directories
time?: number;
// A set of file system entries to initially add to the file system.
files?: FileSet;
@@ -1391,6 +1393,12 @@ namespace vfs {
}
}
export class SameFileWithModifiedTime extends File {
constructor(data: Buffer | string, metaAndEncoding?: { encoding?: string, meta?: Record<string, any> }) {
super(data, metaAndEncoding);
}
}
/** Extended options for a hard link in a `FileSet` */
export class Link {
public readonly path: string;
@@ -1579,6 +1587,9 @@ namespace vfs {
else if (entry instanceof Directory) {
text += formatPatchWorker(file, entry.files);
}
else if (entry instanceof SameFileWithModifiedTime) {
text += `//// [${file}] file changed its modified time\r\n`;
}
else if (entry instanceof SameFileContentFile) {
text += `//// [${file}] file written with same contents\r\n`;
}
+2 -1
View File
@@ -360,7 +360,7 @@ interface Array<T> { length: number; [n: number]: T; }`
DynamicPolling = "RecursiveDirectoryUsingDynamicPriorityPolling"
}
const timeIncrements = 1000;
export const timeIncrements = 1000;
export interface TestServerHostOptions {
useCaseSensitiveFileNames: boolean;
executingFilePath: string;
@@ -396,6 +396,7 @@ interface Array<T> { length: number; [n: number]: T; }`
private readonly currentDirectory: string;
public require: ((initialPath: string, moduleName: string) => RequireResult) | undefined;
public defaultWatchFileKind?: () => WatchFileKind | undefined;
public storeFilesChangingSignatureDuringEmit = true;
watchFile: HostWatchFile;
watchDirectory: HostWatchDirectory;
constructor(
+1 -1
View File
@@ -108,7 +108,7 @@ namespace vpath {
}
export function isDeclaration(path: string) {
return ts.fileExtensionIsOneOf(path, [ts.Extension.Dmts, ts.Extension.Dcts, ts.Extension.Dts]);
return ts.isDeclarationFileName(path);
}
export function isSourceMap(path: string) {
+4 -4
View File
@@ -673,6 +673,7 @@ interface DataView {
* Gets the BigInt64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
@@ -680,6 +681,7 @@ interface DataView {
* Gets the BigUint64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
@@ -687,8 +689,7 @@ interface DataView {
* Stores a BigInt64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
@@ -696,8 +697,7 @@ interface DataView {
* Stores a BigUint64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
}
+1
View File
@@ -1,5 +1,6 @@
/// <reference lib="es2021" />
/// <reference lib="es2022.array" />
/// <reference lib="es2022.error" />
/// <reference lib="es2022.intl" />
/// <reference lib="es2022.object" />
/// <reference lib="es2022.string" />
+91
View File
@@ -0,0 +1,91 @@
declare namespace Intl {
/**
* An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
*/
interface SegmenterOptions {
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
localeMatcher?: "best fit" | "lookup" | undefined;
/** The type of input to be split */
granularity?: "grapheme" | "word" | "sentence" | undefined;
}
interface Segmenter {
/**
* Returns `Segments` object containing the segments of the input string, using the segmenter's locale and granularity.
*
* @param input - The text to be segmented as a `string`.
*
* @returns A new iterable Segments object containing the segments of the input string, using the segmenter's locale and granularity.
*/
segment(input: string): Segments;
resolvedOptions(): ResolvedSegmenterOptions;
}
interface ResolvedSegmenterOptions {
locale: string;
granularity: "grapheme" | "word" | "sentence";
}
interface Segments {
/**
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
*
* @param codeUnitIndex - A number specifying the index of the code unit in the original input string. If the value is omitted, it defaults to `0`.
*/
containing(codeUnitIndex?: number): SegmentData;
/** Returns an iterator to iterate over the segments. */
[Symbol.iterator](): IterableIterator<SegmentData>;
}
interface SegmentData {
/** A string containing the segment extracted from the original input string. */
segment: string;
/** The code unit index in the original input string at which the segment begins. */
index: number;
/** The complete input string that was segmented. */
input: string;
/**
* A boolean value only if granularity is "word"; otherwise, undefined.
* If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false.
*/
isWordLike?: boolean;
}
const Segmenter: {
prototype: Segmenter;
/**
* Creates a new `Intl.Segmenter` object.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
* with some or all options of `SegmenterOptions`.
*
* @returns [Intl.Segmenter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segments) object.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
*/
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter;
/**
* Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf#parameters).
* with some or all possible options.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf)
*/
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
};
}
+14 -14
View File
@@ -52,13 +52,13 @@ declare function decodeURIComponent(encodedURIComponent: string): string;
/**
* Encodes a text string as a valid Uniform Resource Identifier (URI)
* @param uri A value representing an encoded URI.
* @param uri A value representing an unencoded URI.
*/
declare function encodeURI(uri: string): string;
/**
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
* @param uriComponent A value representing an unencoded URI component.
*/
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
@@ -1669,6 +1669,7 @@ interface DataView {
* Gets the Float32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getFloat32(byteOffset: number, littleEndian?: boolean): number;
@@ -1676,6 +1677,7 @@ interface DataView {
* Gets the Float64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getFloat64(byteOffset: number, littleEndian?: boolean): number;
@@ -1690,12 +1692,14 @@ interface DataView {
* Gets the Int16 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getInt16(byteOffset: number, littleEndian?: boolean): number;
/**
* Gets the Int32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getInt32(byteOffset: number, littleEndian?: boolean): number;
@@ -1710,6 +1714,7 @@ interface DataView {
* Gets the Uint16 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getUint16(byteOffset: number, littleEndian?: boolean): number;
@@ -1717,6 +1722,7 @@ interface DataView {
* Gets the Uint32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getUint32(byteOffset: number, littleEndian?: boolean): number;
@@ -1724,8 +1730,7 @@ interface DataView {
* Stores an Float32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1733,8 +1738,7 @@ interface DataView {
* Stores an Float64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1749,8 +1753,7 @@ interface DataView {
* Stores an Int16 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1758,8 +1761,7 @@ interface DataView {
* Stores an Int32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1774,8 +1776,7 @@ interface DataView {
* Stores an Uint16 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
@@ -1783,8 +1784,7 @@ interface DataView {
* Stores an Uint32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
}
+1
View File
@@ -57,6 +57,7 @@
"es2021.intl",
"es2022.array",
"es2022.error",
"es2022.intl",
"es2022.object",
"es2022.string",
"esnext.intl",
@@ -1512,6 +1512,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["{0}" 的所有声明必须具有相同的限制。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5340,18 +5349,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[动态导入不能含有类型参数。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5988,6 +5985,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[应为 1 个参数,但得到 0。“new Promise()” 需要 JSDoc 提示才能生成可在没有参数的情况下调用的 “resolve”。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13731,6 +13737,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[“import” 的这种用法无效。可以写入 “import()” 调用,但它们必须具有括号,并且不能带有类型参数。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13968,15 +13983,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型“{0}”不是数组类型或字符串类型。请使用编译器选项 "--downlevelIteration" 允许迭代器进行迭代。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15093,6 +15099,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[仅对象、函数、构造函数、映射类型的类型别名支持方差注释。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1512,6 +1512,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 的所有宣告都必須有相同的限制式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5340,18 +5349,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[動態匯入不可有型別引數。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5988,6 +5985,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[需要 1 個引數,但得到 0。'new Promise()' 需要 JSDoc 提示,才能產生可以呼叫而不含引數的 'resolve'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13731,6 +13737,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[此 'import' 的使用方式無效。'import()' 呼叫可以寫入,但必須有括弧,而且不能有類型引數。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13968,15 +13983,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 不是陣列類型或字串類型。請使用編譯器選項 '-downlevelIteration' 允許逐一查看迭代器。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15093,6 +15099,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[只有物件、函式、建構函式和對應類型的類型別名才支援差異註釋。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1521,6 +1521,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Všechny deklarace {0} musí mít identická omezení.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5349,18 +5358,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dynamický import nemůže mít argumenty typu.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5997,6 +5994,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Očekával se 1 argument, ale bylo jich 0. New Promise() potřebuje pomocný parametr JSDoc k vytvoření resolve, který se dá volat bez argumentů.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13740,6 +13746,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Toto použití importu není platné. Volání import() se dají zapsat, ale musí mít závorky a nemůžou mít typové argumenty.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13977,15 +13992,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typ {0} není typem pole ani typem řetězce. Pokud chcete povolit iteraci iterátorů, použijte možnost kompilátoru --downlevelIteration.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15102,6 +15108,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Poznámky Variance se podporují pouze u aliasů typů pro typy objektů, funkcí, konstruktorů a mapování.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1509,6 +1509,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Alle Deklarationen von "{0}" müssen identische Modifizierer aufweisen.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5337,18 +5346,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Der dynamische Import kann keine Typargumente aufweisen.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5985,6 +5982,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 Argument erwartet, aber 0 erhalten. „new Promise()“ benötigt einen JSDoc-Hinweis, um einen „resolve“ zu erzeugen, der ohne Argumente aufgerufen werden kann.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13725,6 +13731,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Diese Verwendung von „import“ ist ungültig. „import()“-Aufrufe können geschrieben werden, müssen jedoch Klammern aufweisen und dürfen keine Typargumente aufweisen.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13962,15 +13977,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Der Typ "{0}" ist kein Arraytyp oder Zeichenfolgentyp. Verwenden Sie die Compileroption "--downlevelIteration", um das Durchlaufen von Iteratoren zuzulassen.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15087,6 +15093,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Abweichungsanmerkungen werden nur in Typaliasnamen für Objekt-, Funktions-, Konstruktor- und zugeordnete Typen unterstützt.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1524,6 +1524,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Todas las declaraciones de "{0}" deben tener delimitaciones idénticas.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5352,18 +5361,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La importación dinámica no puede tener argumentos de tipo.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -6000,6 +5997,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Se esperaba 1 argumento, pero se obtuvo 0. "new Promise()" necesita una pista de JSDoc para producir un "resolve" que pueda llamarse sin argumentos.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13743,6 +13749,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Este uso de "import" no es válido. Se pueden escribir llamadas "import()", pero deben tener paréntesis y no pueden tener argumentos de tipo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13980,15 +13995,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["{0}" no es un tipo de matriz o de cadena. Use la opción del compilador "--downlevelIteration" para permitir la iteración de los iteradores.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15105,6 +15111,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Las anotaciones de varianza solo se admiten en alias de tipo para los tipos objeto, función, constructor y asignado.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1524,6 +1524,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Toutes les déclarations de « {0} » doivent avoir des contraintes identiques.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5352,18 +5361,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[L'importation dynamique ne peut pas avoir d'arguments de type.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -6000,6 +5997,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 argument attendu, mais 0 obtenu. 'new Promise()' a besoin dun indicateur JSDoc pour produire un 'resolve' qui peut être appelé sans arguments.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13743,6 +13749,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cette utilisation de « import » nest pas valide. Les appels « import() » peuvent être écrits, mais ils doivent avoir des parenthèses et ne peuvent pas avoir darguments de type.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13980,15 +13995,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' nest pas un type de tableau ou un type string. Utilisez l'option du compilateur '--downlevelIteration' pour autoriser l'itération des itérateurs.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15105,6 +15111,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les annotations de variance sont uniquement prises en charge dans les alias de type pour les types objet, fonction, constructeur et mappé.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1512,6 +1512,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tutte le dichiarazioni di '{0}' devono avere vincoli identici.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5340,18 +5349,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nell'importazione dinamica non possono essere presenti argomenti tipo.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5988,6 +5985,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Previsto 1 argomento, ma ottenuto 0. 'new Promise()' richiede un hint JSDoc per produrre un elemento 'resolve' che possa essere chiamato senza argomenti.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13731,6 +13737,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Questo uso di 'import' non è valido. le chiamate 'import()' possono essere scritte, ma devono avere parentesi e non possono avere argomenti di tipo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13968,15 +13983,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Il tipo '{0}' non è un tipo matrice o stringa. Usare l'opzione del compilatore '--downlevelIteration' per consentire l'iterazione degli iteratori.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15093,6 +15099,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le annotazioni di varianza sono supportate solo negli alias di tipo per oggetti, funzioni, costruttori e tipi mappati.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1512,6 +1512,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' のすべての宣言には、同一の制約が必要です。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5340,18 +5349,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[動的インポートに型引数を指定することはできません。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5988,6 +5985,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 個の引数が必要ですが、0 個しかありませんでした。'new Promise()' では、引数なしで呼び出すことができる 'resolve' を生成するための JSDoc ヒントが必要です。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13731,6 +13737,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[この 'import' の使用は無効です。'import()' 呼び出しは書き込むことができますが、かっこが必要であり、型引数を指定することはできません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13968,15 +13983,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[型 '{0}' は配列型でも文字列型でもありません。反復子の反復を許可するには、コンパイラ オプション '--downlevelIteration' を使用します。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15093,6 +15099,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[分散注釈は、オブジェクト、関数、コンストラクター、およびマップされた型の型エイリアスでのみサポートされています。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1512,6 +1512,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}'의 모든 선언에는 동일한 제약 조건이 있어야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5340,18 +5349,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[동적 가져오기에는 형식 인수를 사용할 수 없습니다.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5988,6 +5985,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1개의 인수가 필요하지만 0이 있습니다. 'new Promise()'는 인수 없이 호출할 수 있는 'resolve'를 생성하기 위해 JSDoc 힌트가 필요합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13731,6 +13737,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[이 '가져오기' 사용은 유효하지 않습니다. 'import()' 호출을 작성할 수 있지만 괄호가 있어야 하며 유형 인수를 가질 수 없습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13968,15 +13983,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 형식이 배열 형식 또는 문자열 형식이 아닙니다. 컴파일러 옵션 '-downlevelIteration'을 사용하여 반복기의 반복을 허용하세요.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15093,6 +15099,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[차이 주석은 개체, 함수, 생성자 및 매핑된 형식의 형식 별칭에서만 지원됩니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1502,6 +1502,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Wszystkie deklaracje elementu „{0}” muszą mieć identyczne ograniczenia.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5330,18 +5339,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dynamiczny import nie może mieć argumentów typu.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5978,6 +5975,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Oczekiwano 1 argumentu, ale otrzymano 0. Element „new Promise()” wymaga wskazówki JSDoc, aby utworzyć element „resolve”, który można wywołać bez argumentów.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13718,6 +13724,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[To użycie elementu „import” jest nieprawidłowe. Wywołania „import()” mogą być zapisywane, ale muszą mieć nawiasy i nie mogą mieć argumentów typu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13955,15 +13970,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typ „{0}” nie jest typem tablicy ani typem ciągu. Użyj opcji kompilatora „--downlevelIteration”, aby zezwolić na iterowanie iteratorów.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15080,6 +15086,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Adnotacje wariancji są obsługiwane tylko w aliasach typów obiektów, funkcji, konstruktorów i mapowanych typów.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1505,6 +1505,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Todas as declarações de '{0}' devem ter restrições idênticas.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5333,18 +5342,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[A importação dinâmica não pode ter argumentos de tipo.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5981,6 +5978,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Esperava 1 argumento, mas obteve 0. 'new Promise()' precisa de uma dica JSDoc para produzir um 'resolver' que pode ser chamado sem argumentos.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13721,6 +13727,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Este uso de 'importar' é inválido. Chamadas 'import()' podem ser escritas, mas devem ter parênteses e não podem ter argumentos de tipo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13958,15 +13973,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O tipo '{0}' não é um tipo de matriz nem um tipo de cadeia de caracteres. Use a opção do compilador '--downlevelIteration' para permitir a iteração dos iteradores.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15083,6 +15089,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Só há suporte para anotações de variação em aliases do tipo para objetos, funções, construtores e tipos mapeados.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1511,6 +1511,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Все объявления "{0}" должны иметь одинаковые ограничения.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5339,18 +5348,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[При динамическом импорте не могут использоваться аргументы типов.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5987,6 +5984,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ожидался 1 аргумент, получено 0. Для "new Promise()" требуется указание JSDoc, чтобы создать "resolve" с возможностью вызова без аргументов.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13730,6 +13736,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Недопустимое использование "import". Можно записывать вызовы "import()", но у них должны быть скобки и не должно быть аргументов типа.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13967,15 +13982,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Тип "{0}" не является типом строки или массива. Используйте параметр компилятора "--downlevelIteration", чтобы разрешить итерацию итераторов.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15092,6 +15098,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Заметки вариантности поддерживаются только в псевдонимах типов для объектов, функций, конструкторов и сопоставленных типов.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>
@@ -1505,6 +1505,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_constraints_2838" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical constraints.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm '{0}' bildirimleri, aynı kısıtlamalara sahip olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";All_declarations_of_0_must_have_identical_modifiers_2687" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[All declarations of '{0}' must have identical modifiers.]]></Val>
@@ -5333,18 +5342,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_cannot_have_type_arguments_1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dinamik içeri aktarma, tür bağımsız değişkenleri içeremez.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Dynamic import cannot have type arguments]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
@@ -5981,6 +5978,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 bağımsız değişken bekleniyordu ancak 0 bağımsız değişken var. Bağımsız değişkenler olmadan çağrılabilen bir 'resolve' oluşturmak için 'new Promise()' çağrısında bir JSDoc ipucu bulunması gerekir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Expected_at_least_0_arguments_but_got_1_2555" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
@@ -13724,6 +13730,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['import' çağrısının bu kullanımı geçersiz. 'import()' çağrıları yazılabilir ancak ayraç içermeleri gerekir ve tür bağımsız değişkenleri içeremezler.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[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.]]></Val>
@@ -13961,15 +13976,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' türü bir dizi türü veya bir dize türü değil. Yineleyicilerin yinelenmesine izin vermek için '--downlevelIteration' derleyici seçeneğini kullanın.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -15086,6 +15092,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Varyans ek açıklamaları yalnızca nesne, işlev, oluşturucu ve eşlenen türler için tür diğer adlarında desteklenir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Version_0_6029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Version {0}]]></Val>

Some files were not shown because too many files have changed in this diff Show More