Merge branch 'master' of github.com:Microsoft/TypeScript

This commit is contained in:
Markus Johnsson
2018-06-19 11:18:20 +02:00
1192 changed files with 190746 additions and 183999 deletions
+3
View File
@@ -23,6 +23,8 @@ tests/services/browser/typescriptServices.js
src/harness/*.js
src/compiler/diagnosticInformationMap.generated.ts
src/compiler/diagnosticMessages.generated.json
src/parser/diagnosticInformationMap.generated.ts
src/parser/diagnosticMessages.generated.json
rwc-report.html
*.swp
build.json
@@ -44,6 +46,7 @@ scripts/configurePrerelease.js
scripts/open-user-pr.js
scripts/processDiagnosticMessages.d.ts
scripts/processDiagnosticMessages.js
scripts/produceLKG.js
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
scripts/generateLocalizedDiagnosticMessages.js
scripts/*.js.map
+570 -963
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -61,29 +61,29 @@ Change to the TypeScript directory:
cd TypeScript
```
Install Gulp tools and dev dependencies:
Install Jake tools and dev dependencies:
```bash
npm install -g gulp
npm install -g jake
npm install
```
Use one of the following to build and test:
```
gulp local # Build the compiler into built/local
gulp clean # Delete the built compiler
gulp LKG # Replace the last known good with the built one.
jake local # Build the compiler into built/local
jake clean # Delete the built compiler
jake LKG # Replace the last known good with the built one.
# Bootstrapping step to be executed when the built compiler reaches a stable state.
gulp tests # Build the test infrastructure using the built compiler.
gulp runtests # Run tests using the built compiler and test infrastructure.
jake tests # Build the test infrastructure using the built compiler.
jake runtests # Run tests using the built compiler and test infrastructure.
# You can override the host or specify a test for this command.
# Use host=<hostName> or tests=<testPath>.
gulp runtests-browser # Runs the tests using the built run.js file. Syntax is gulp runtests. Optional
jake runtests-browser # Runs the tests using the built run.js file. Syntax is jake runtests. Optional
parameters 'host=', 'tests=[regex], reporter=[list|spec|json|<more>]'.
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
gulp lint # Runs tslint on the TypeScript source.
gulp help # List the above commands.
jake baseline-accept # This replaces the baseline test results with the results obtained from jake runtests.
jake lint # Runs tslint on the TypeScript source.
jake help # List the above commands.
```
+1 -1
View File
@@ -1 +1 @@
* text eol=lf
* text eol=lf
+2
View File
@@ -13,6 +13,7 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
"use strict";
var fs = require("fs");
function pipeExists(name) {
@@ -69,3 +70,4 @@ function createCancellationToken(args) {
}
}
module.exports = createCancellationToken;
//# sourceMappingURL=cancellationToken.js.map
+3
View File
@@ -208,6 +208,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Soubor tsconfig.json nejde najít v zadaném adresáři: {0}",
"Cannot_find_global_type_0_2318": "Globální typ {0} se nenašel.",
"Cannot_find_global_value_0_2468": "Globální hodnota {0} se nenašla.",
"Cannot_find_lib_definition_for_0_2726": "Nepovedlo se najít definici knihovny pro {0}.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Nepovedlo se najít definici knihovny pro {0}. Neměli jste na mysli spíš {1}?",
"Cannot_find_module_0_2307": "Nenašel se modul {0}.",
"Cannot_find_name_0_2304": "Název {0} se nenašel.",
"Cannot_find_name_0_Did_you_mean_1_2552": "Nepovedlo se najít název {0}. Měli jste na mysli {1}?",
@@ -941,6 +943,7 @@
"Unexpected_end_of_text_1126": "Neočekávaný konec textu",
"Unexpected_token_1012": "Neočekávaný token",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Neočekávaný token. Očekával se konstruktor, metoda, přístupový objekt nebo vlastnost.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Neočekávaný token. Očekával se název parametru typu bez složených závorek.",
"Unexpected_token_expected_1179": "Neočekávaný token. Očekává se znak {.",
"Unknown_compiler_option_0_5023": "Neznámá možnost kompilátoru {0}",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "Neznámá možnost excludes. Měli jste na mysli exclude?",
+28
View File
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Eine Namespacedeklaration darf nicht vor der Klasse oder Funktion positioniert werden, mit der sie zusammengeführt wird.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Eine Namespacedeklaration ist nur in einem Namespace oder Modul zulässig.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Ein Import im Namespacestil kann nicht aufgerufen oder erstellt werden und verursacht zur Laufzeit einen Fehler.",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Ein Parameterinitialisierer ist nur in einer Funktions- oder Konstruktorimplementierung zulässig.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Eine Parametereigenschaft darf nicht mithilfe eines rest-Parameters deklariert werden.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Eine Parametereigenschaft ist nur in einer Konstruktorimplementierung zulässig.",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "Es wurde eine Binärzahl erwartet.",
"Binding_element_0_implicitly_has_an_1_type_7031": "Das Bindungselement \"{0}\" weist implizit einen Typ \"{1}\" auf.",
"Block_scoped_variable_0_used_before_its_declaration_2448": "Die blockbezogene Variable \"{0}\" wurde vor ihrer Deklaration verwendet.",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "Decorator-Ausdruck aufrufen",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Eine Aufrufsignatur ohne Rückgabetypanmerkung weist implizit einen any-Rückgabetyp auf.",
"Call_target_does_not_contain_any_signatures_2346": "Das Aufrufziel enthält keine Signaturen.",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Im angegebenen Verzeichnis \"{0}\" wurde keine \"tsconfig.json\"-Datei gefunden.",
"Cannot_find_global_type_0_2318": "Der globale Typ \"{0}\" wurde nicht gefunden.",
"Cannot_find_global_value_0_2468": "Der globale Wert \"{0}\" wurde nicht gefunden.",
"Cannot_find_lib_definition_for_0_2726": "Die Bibliotheksdefinition für \"{0}\" wurde nicht gefunden.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Die Bibliotheksdefinition für \"{0}\" wurde nicht gefunden. Meinten Sie \"{1}\"?",
"Cannot_find_module_0_2307": "Das Modul \"{0}\" wurde nicht gefunden.",
"Cannot_find_name_0_2304": "Der Name \"{0}\" wurde nicht gefunden.",
"Cannot_find_name_0_Did_you_mean_1_2552": "Der Name \"{0}\" wurde nicht gefunden. Meinten Sie \"{1}\"?",
@@ -282,6 +289,8 @@
"Convert_all_to_default_imports_95035": "Alle in Standardimporte konvertieren",
"Convert_function_0_to_class_95002": "Funktion \"{0}\" in Klasse konvertieren",
"Convert_function_to_an_ES2015_class_95001": "Funktion in eine ES2015-Klasse konvertieren",
"Convert_named_imports_to_namespace_import_95057": "Benannte Importe in Namespaceimport konvertieren",
"Convert_namespace_import_to_named_imports_95056": "Namespaceimport in benannte Importe konvertieren",
"Convert_require_to_import_95047": "\"require\" in \"import\" konvertieren",
"Convert_to_ES6_module_95017": "In ES6-Modul konvertieren",
"Convert_to_default_import_95013": "In Standardimport konvertieren",
@@ -300,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Decorators dürfen nicht auf mehrere get-/set-Zugriffsmethoden mit dem gleichen Namen angewendet werden.",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Der Standardexport des Moduls besitzt oder verwendet den privaten Namen \"{0}\".",
"Delete_all_unused_declarations_95024": "Alle nicht verwendeten Deklarationen löschen",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[Veraltet] Verwenden Sie stattdessen \"--jsxFactory\". Geben Sie das Objekt an, das für \"createElement\" aufgerufen wurde, wenn das Ziel die JSX-Ausgabe \"react\" ist.",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[Veraltet] Verwenden Sie stattdessen \"--outFile\". Verketten und Ausgeben in eine einzige Datei",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Veraltet] Verwenden Sie stattdessen \"--skipLibCheck\". Überspringen Sie die Typüberprüfung der Standardbibliothek-Deklarationsdateien.",
@@ -350,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "Aktivieren Sie die strenge Überprüfung der Eigenschafteninitialisierung in Klassen.",
"Enable_strict_null_checks_6113": "Strenge NULL-Überprüfungen aktivieren.",
"Enable_tracing_of_the_name_resolution_process_6085": "Ablaufverfolgung des Namensauflösungsvorgangs aktivieren.",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Ermöglicht Ausgabeinteroperabilität zwischen CommonJS- und ES-Modulen durch die Erstellung von Namespaceobjekten für alle Importe. Impliziert \"AllowSyntheticDefaultImports\".",
"Enables_experimental_support_for_ES7_async_functions_6068": "Ermöglicht experimentelle Unterstützung für asynchrone ES7-Funktionen.",
"Enables_experimental_support_for_ES7_decorators_6065": "Ermöglicht experimentelle Unterstützung für asynchrone ES7-Decorators.",
@@ -584,6 +595,7 @@
"Not_all_code_paths_return_a_value_7030": "Nicht alle Codepfade geben einen Wert zurück.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Der numerische Indextyp \"{0}\" kann dem Zeichenfolgen-Indextyp \"{1}\" nicht zugewiesen werden.",
"Numeric_separators_are_not_allowed_here_6188": "Numerische Trennzeichen sind hier nicht zulässig.",
"Object_is_of_type_unknown_2571": "Das Objekt ist vom Typ \"Unbekannt\".",
"Object_is_possibly_null_2531": "Das Objekt ist möglicherweise \"NULL\".",
"Object_is_possibly_null_or_undefined_2533": "Das Objekt ist möglicherweise \"NULL\" oder \"nicht definiert\".",
"Object_is_possibly_undefined_2532": "Das Objekt ist möglicherweise \"nicht definiert\".",
@@ -610,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "Die Option \"{0}\" darf nicht ohne die Option \"{1}\" angegeben werden.",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "Die Option \"{0}\" kann nicht ohne die Option \"{1}\" oder \"{2}\" angegeben werden.",
"Option_0_should_have_array_of_strings_as_a_value_6103": "Die Option \"{0}\" muss ein Zeichenfolgenarray als Wert aufweisen.",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "Die Option \"isolatedModules\" kann nur verwendet werden, wenn entweder die Option \"--module\" angegeben ist oder die Option \"target\" den Wert \"ES2015\" oder höher aufweist.",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Die \"path\"-Option kann nicht ohne Angabe der \"-baseUrl\"-Option angegeben werden.",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Die Option \"project\" darf nicht mit Quelldateien in einer Befehlszeile kombiniert werden.",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Die Option \"--resolveJsonModule\" kann nicht ohne die Modulauflösungsstrategie \"node\" angegeben werden.",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "Optionen:",
"Output_directory_for_generated_declaration_files_6166": "Ausgabeverzeichnis für erstellte Deklarationsdateien.",
"Output_file_0_from_project_1_does_not_exist_6309": "Die Ausgabedatei \"{0}\" aus dem Projekt \"{1}\" ist nicht vorhanden.",
@@ -661,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "Drucknamen des generierten Dateiteils der Kompilierung.",
"Print_the_compiler_s_version_6019": "Die Version des Compilers ausgeben.",
"Print_this_message_6017": "Diese Nachricht ausgeben.",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "Projektverweise dürfen keinen kreisförmigen Graphen bilden. Zyklus erkannt: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "Zu referenzierende Projekte",
"Property_0_does_not_exist_on_const_enum_1_2479": "Die Eigenschaft \"{0}\" ist für die const-Enumeration \"{1}\" nicht vorhanden.",
"Property_0_does_not_exist_on_type_1_2339": "Die Eigenschaft \"{0}\" ist für den Typ \"{1}\" nicht vorhanden.",
@@ -775,8 +797,11 @@
"Show_all_compiler_options_6169": "Alle Compileroptionen anzeigen.",
"Show_diagnostic_information_6149": "Diagnoseinformationen anzeigen.",
"Show_verbose_diagnostic_information_6150": "Ausführliche Diagnoseinformationen anzeigen.",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "Die Signatur \"{0}\" muss ein Typprädikat sein.",
"Skip_type_checking_of_declaration_files_6012": "Überspringen Sie die Typüberprüfung von Deklarationsdateien.",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "Quellzuordnungsoptionen",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Eine spezialisierte Überladungssignatur kann keiner nicht spezialisierten Signatur zugewiesen werden.",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Der Spezifizierer des dynamischen Imports darf kein Spread-Element sein.",
@@ -938,6 +963,7 @@
"Unexpected_end_of_text_1126": "Unerwartetes Textende.",
"Unexpected_token_1012": "Unerwartetes Token.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Unerwartetes Token. Ein Konstruktor, eine Methode, eine Zugriffsmethode oder eine Eigenschaft wurde erwartet.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Unerwartetes Token. Es wurde ein Typparametername ohne geschweifte Klammern erwartet.",
"Unexpected_token_expected_1179": "Unerwartetes Token. \"{\" wurde erwartet.",
"Unknown_compiler_option_0_5023": "Unbekannte Compileroption \"{0}\".",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "Unbekannte Option \"exclude\". Meinten Sie \"exclude\"?",
@@ -951,6 +977,7 @@
"Unterminated_template_literal_1160": "Nicht abgeschlossenes Vorlagenliteral.",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "Nicht typisierte Funktionsaufrufe dürfen keine Typargumente annehmen.",
"Unused_label_7028": "Nicht verwendete Bezeichnung.",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "Verwenden Sie den synthetischen Member \"default\".",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Das Verwenden einer Zeichenfolge in einer for...of-Anweisung wird nur in ECMAScript 5 oder höher unterstützt.",
"VERSION_6036": "VERSION",
@@ -1011,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "Der const-Enumerationsmemberinitialisierer wurde in den unzulässigen Wert \"NaN\" ausgewertet.",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "const-Enumerationen können nur in Eigenschaften- bzw. Indexzugriffsausdrücken oder auf der rechten Seite einer Importdeklaration oder Exportzuweisung verwendet werden.",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "\"delete\" kann für einen Bezeichner im Strict-Modus nicht aufgerufen werden.",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "enum-Deklarationen können nur in einer TS-Datei verwendet werden.",
"export_can_only_be_used_in_a_ts_file_8003": "\"export=\" kann nur in einer TS-Datei verwendet werden.",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Der Modifizierer \"export\" kann nicht auf Umgebungsmodule und Modulerweiterungen angewendet werden, da diese immer sichtbar sind.",
@@ -309,6 +309,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_delete_the_following_files_Colon_0_6356" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would delete the following files: {0}]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A parameter initializer is only allowed in a function or constructor implementation.]]></Val>
@@ -615,6 +627,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_braces_to_arrow_function_95059" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add braces to arrow function]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_definite_assignment_assertion_to_property_0_95020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add definite assignment assertion to property '{0}']]></Val>
@@ -657,6 +675,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_or_remove_braces_in_an_arrow_function_95058" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add or remove braces in an arrow function]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
@@ -1149,6 +1173,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Build_all_projects_including_those_that_appear_to_be_up_to_date_6368" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Build all projects, including those that appear to be up to date]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Build one or more projects and their dependencies, if out of date]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Building_project_0_6358" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Building project '{0}'...]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression]]></Val>
@@ -1263,6 +1305,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_find_lib_definition_for_0_2726" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot find lib definition for '{0}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_find_lib_definition_for_0_Did_you_mean_1_2727" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot find lib definition for '{0}'. Did you mean '{1}'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_find_module_0_2307" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot find module '{0}'.]]></Val>
@@ -1827,6 +1881,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -2127,6 +2187,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Enable_verbose_logging_6366" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Enable verbose logging]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'.]]></Val>
@@ -3693,6 +3759,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Option_build_must_be_the_first_command_line_argument_6369" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Option '--build' must be the first command line argument.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.]]></Val>
@@ -3717,6 +3789,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Options_0_and_1_cannot_be_combined_6370" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Options '{0}' and '{1}' cannot be combined.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Options_Colon_6027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Options:]]></Val>
@@ -3999,12 +4077,60 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' can't be built because its dependency '{1}' has errors]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is out of date because its dependency '{1}' is out of date]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is out of date because output file '{1}' does not exist]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is up to date]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is up to date with .d.ts files from its dependencies]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project references may not form a circular graph. Cycle detected: {0}]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Projects_in_this_build_Colon_0_6355" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Projects in this build: {0}]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Projects_to_reference_6300" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Projects to reference]]></Val>
@@ -4311,6 +4437,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Remove_braces_from_arrow_function_95060" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove braces from arrow function]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
@@ -4683,6 +4815,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Show_what_would_be_built_or_deleted_if_specified_with_clean_6367" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Show what would be built (or deleted, if specified with '--clean')]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Signature_0_must_be_a_type_predicate_1224" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Signature '{0}' must be a type predicate.]]></Val>
@@ -4695,6 +4833,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Skipping build of project '{0}' because its dependency '{1}' has errors]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Skipping_clean_because_not_all_projects_could_be_located_6371" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Skipping clean because not all projects could be located]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Source_Map_Options_6175" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Source Map Options]]></Val>
@@ -5745,6 +5895,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Updating_output_timestamps_of_project_0_6359" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Updating output timestamps of project '{0}'...]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Use_synthetic_default_member_95016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Use synthetic 'default' member.]]></Val>
@@ -6105,6 +6261,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[delete this - Project '{0}' is up to date because it was previously built]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";enum_declarations_can_only_be_used_in_a_ts_file_8015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['enum declarations' can only be used in a .ts file.]]></Val>
+25
View File
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Una declaración de espacio de nombres no se puede situar antes que una clase o función con la que se combina.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Una declaración de espacio de nombres solo se permite en un espacio de nombres o en un módulo.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "No se puede llamar o construir una importación de estilo de espacio de nombres, y provocará un error en tiempo de ejecución.",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un inicializador de parámetros solo se permite en una implementación de función o de constructor.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Una propiedad de parámetro no se puede declarar mediante un parámetro rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Una propiedad de parámetro solo se permite en una implementación de constructor.",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "Se esperaba un dígito binario.",
"Binding_element_0_implicitly_has_an_1_type_7031": "El elemento de enlace '{0}' tiene un tipo '{1}' implícito.",
"Block_scoped_variable_0_used_before_its_declaration_2448": "Variable con ámbito de bloque '{0}' usada antes de su declaración.",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "Llamar a la expresión decorador",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signatura de llamada, que carece de una anotación de tipo de valor devuelto, tiene implícitamente un tipo de valor devuelto \"any\".",
"Call_target_does_not_contain_any_signatures_2346": "El destino de llamada no contiene signaturas.",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "No se encuentra ningún archivo tsconfig.json en el directorio especificado: \"{0}\".",
"Cannot_find_global_type_0_2318": "No se encuentra el tipo '{0}' global.",
"Cannot_find_global_value_0_2468": "No se encuentra el valor '{0}' global.",
"Cannot_find_lib_definition_for_0_2726": "No se encuentra la definición lib para \"{0}\".",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "No se encuentra la definición lib para \"{0}\". ¿Quiso decir \"{1}\"?",
"Cannot_find_module_0_2307": "No se encuentra el módulo '{0}'.",
"Cannot_find_name_0_2304": "No se encuentra el nombre '{0}'.",
"Cannot_find_name_0_Did_you_mean_1_2552": "No se encuentra el nombre \"{0}\". ¿Quería decir \"{1}\"?",
@@ -302,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "No se pueden aplicar elementos Decorator a varios descriptores de acceso get o set con el mismo nombre.",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "La exportación predeterminada del módulo tiene o usa el nombre privado '{0}'.",
"Delete_all_unused_declarations_95024": "Eliminar todas las declaraciones sin usar",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[En desuso] Use \"--jsxFactory\" en su lugar. Especifique el objeto invocado para createElement cuando el destino sea la emisión de JSX \"react\"",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[En desuso] Use \"--outFile\" en su lugar. Concatena y emite la salida en un solo archivo.",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[En desuso] Use \"--skipLibCheck\" en su lugar. Omite la comprobación de tipos de los archivos de declaración de biblioteca predeterminados.",
@@ -352,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "Habilite la comprobación estricta de inicialización de propiedades en las clases.",
"Enable_strict_null_checks_6113": "Habilitar comprobaciones estrictas de elementos nulos.",
"Enable_tracing_of_the_name_resolution_process_6085": "Habilitar seguimiento del proceso de resolución de nombres.",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Permite emitir interoperabilidad entre módulos CommonJS y ES mediante la creación de objetos de espacio de nombres para todas las importaciones. Implica \"allowSyntheticDefaultImports\".",
"Enables_experimental_support_for_ES7_async_functions_6068": "Habilita la compatibilidad experimental con las funciones asincrónicas de ES7.",
"Enables_experimental_support_for_ES7_decorators_6065": "Habilita la compatibilidad experimental con los elementos Decorator de ES7.",
@@ -613,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "La opción '{0}' no se puede especificar sin la opción '{1}'.",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "La opción \"{0}\" no se puede especificar sin la opción \"{1}\" o la opción \"{2}\".",
"Option_0_should_have_array_of_strings_as_a_value_6103": "La opción '{0}' debe tener una matriz de cadenas como valor.",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "La opción \"isolatedModules\" solo se puede usar cuando se proporciona la opción \"--module\" o si la opción \"target\" es \"ES2015\" o una versión posterior.",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "La opción 'paths' no se puede usar sin especificar la opción '--baseUrl'.",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "La opción \"project\" no se puede combinar con archivos de origen en una línea de comandos.",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "No se puede especificar la opción \"--resolveJsonModule\" sin la estrategia de resolución de módulos \"node\".",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "Opciones:",
"Output_directory_for_generated_declaration_files_6166": "Directorio de salida para los archivos de declaración generados.",
"Output_file_0_from_project_1_does_not_exist_6309": "El archivo de salida \"{0}\" del proyecto \"{1}\" no existe.",
@@ -664,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "Imprimir los nombres de los archivos generados que forman parte de la compilación.",
"Print_the_compiler_s_version_6019": "Imprima la versión del compilador.",
"Print_this_message_6017": "Imprima este mensaje.",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "Las referencias del proyecto no pueden formar un gráfico circular. Ciclo detectado: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "Proyectos a los que se hará referencia",
"Property_0_does_not_exist_on_const_enum_1_2479": "La propiedad '{0}' no existe en la enumeración 'const' '{1}'.",
"Property_0_does_not_exist_on_type_1_2339": "La propiedad '{0}' no existe en el tipo '{1}'.",
@@ -778,8 +797,11 @@
"Show_all_compiler_options_6169": "Mostrar todas las opciones de compilador.",
"Show_diagnostic_information_6149": "Mostrar información de diagnóstico.",
"Show_verbose_diagnostic_information_6150": "Mostrar información de diagnóstico detallada.",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "La signatura '{0}' debe tener un predicado de tipo.",
"Skip_type_checking_of_declaration_files_6012": "Omita la comprobación de tipos de los archivos de declaración.",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "Opciones de mapa de origen",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "La signatura de sobrecarga especializada no se puede asignar a ninguna signatura no especializada.",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "El especificador de importación dinámica no puede ser un elemento de propagación.",
@@ -941,6 +963,7 @@
"Unexpected_end_of_text_1126": "Final de texto inesperado.",
"Unexpected_token_1012": "Token inesperado.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token inesperado. Se esperaba un constructor, un método, un descriptor de acceso o una propiedad.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token inesperado. Se esperaba un nombre de parámetro de tipo sin llaves.",
"Unexpected_token_expected_1179": "Token inesperado. Se esperaba \"{\".",
"Unknown_compiler_option_0_5023": "Opción '{0}' del compilador desconocida.",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "Opción 'excludes' desconocida. ¿Quería decir 'exclude'?",
@@ -954,6 +977,7 @@
"Unterminated_template_literal_1160": "Literal de plantilla sin terminar.",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "Las llamadas a función sin tipo no pueden aceptar argumentos de tipo.",
"Unused_label_7028": "Etiqueta no usada.",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "Use el miembro sintético \"default\".",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "El uso de una cadena en una instrucción \"for...of\" solo se admite en ECMAScript 5 y versiones posteriores.",
"VERSION_6036": "VERSIÓN",
@@ -1014,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "El inicializador de miembros de enumeración \"const\" se evaluó con un valor \"NaN\" no permitido.",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Las enumeraciones \"const\" solo se pueden usar en expresiones de acceso de propiedad o índice, o en la parte derecha de una declaración de importación, una asignación de exportación o una consulta de tipo.",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "No se puede llamar a \"delete\" en un identificador en modo strict.",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "Las declaraciones \"enum\" solo se pueden usar en un archivo .ts.",
"export_can_only_be_used_in_a_ts_file_8003": "\"export=\" solo se puede usar en un archivo .ts.",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "El modificador 'export' no se puede aplicar a módulos de ambiente ni aumentos de módulos, porque siempre están visibles.",
+25
View File
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Une déclaration d'espace de noms ne peut pas se trouver avant une classe ou une fonction avec laquelle elle est fusionnée.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Une déclaration d'espace de noms est autorisée uniquement dans un espace de noms ou un module.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Impossible d'appeler ou de construire une importation de style d'espace de noms, ce qui va entraîner un échec au moment de l'exécution.",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un initialiseur de paramètre est uniquement autorisé dans une implémentation de fonction ou de constructeur.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Impossible de déclarer une propriété de paramètre à l'aide d'un paramètre rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Une propriété de paramètre est uniquement autorisée dans une implémentation de constructeur.",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "Chiffre binaire attendu.",
"Binding_element_0_implicitly_has_an_1_type_7031": "L'élément de liaison '{0}' possède implicitement un type '{1}'.",
"Block_scoped_variable_0_used_before_its_declaration_2448": "Variable de portée de bloc '{0}' utilisée avant sa déclaration.",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "Appeler l'expression de l'élément décoratif",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signature d'appel, qui ne dispose pas d'annotation de type de retour, possède implicitement un type de retour 'any'.",
"Call_target_does_not_contain_any_signatures_2346": "La cible de l'appel ne contient aucune signature.",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Le fichier tsconfig.json est introuvable dans le répertoire spécifié : '{0}'.",
"Cannot_find_global_type_0_2318": "Le type global '{0}' est introuvable.",
"Cannot_find_global_value_0_2468": "La valeur globale '{0}' est introuvable.",
"Cannot_find_lib_definition_for_0_2726": "Définition de lib introuvable pour '{0}'.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Définition de lib introuvable pour '{0}'. Est-ce qu'il ne s'agit pas plutôt de '{1}' ?",
"Cannot_find_module_0_2307": "Le module '{0}' est introuvable.",
"Cannot_find_name_0_2304": "Le nom '{0}' est introuvable.",
"Cannot_find_name_0_Did_you_mean_1_2552": "Le nom '{0}' est introuvable. Est-ce qu'il ne s'agit pas plutôt de '{1}' ?",
@@ -302,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Impossible d'appliquer des éléments décoratifs à plusieurs accesseurs get/set du même nom.",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "L'exportation par défaut du module a utilisé ou utilise le nom privé '{0}'.",
"Delete_all_unused_declarations_95024": "Supprimer toutes les déclarations inutilisées",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[Déconseillé] Utilisez '--jsxFactory' à la place. Permet de spécifier l'objet appelé pour createElement durant le ciblage de 'react' pour l'émission JSX",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[Déconseillé] Utilisez '--outFile' à la place. Permet de concaténer et d'émettre la sortie vers un seul fichier",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Déconseillé] Utilisez '--skipLibCheck' à la place. Permet d'ignorer le contrôle de type des fichiers de déclaration de la bibliothèque par défaut.",
@@ -352,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "Activez la vérification stricte de l'initialisation des propriétés dans les classes.",
"Enable_strict_null_checks_6113": "Activez strict null checks.",
"Enable_tracing_of_the_name_resolution_process_6085": "Activez le traçage du processus de résolution de noms.",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Active l'interopérabilité entre les modules CommonJS et ES via la création d'objets d'espace de noms pour toutes les importations. Implique 'allowSyntheticDefaultImports'.",
"Enables_experimental_support_for_ES7_async_functions_6068": "Active la prise en charge expérimentale des fonctions async ES7.",
"Enables_experimental_support_for_ES7_decorators_6065": "Active la prise en charge expérimentale des éléments décoratifs ES7.",
@@ -613,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "Impossible de spécifier l'option '{0}' sans spécifier l'option '{1}'.",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "Impossible de spécifier l'option '{0}' sans spécifier l'option '{1}' ou l'option '{2}'.",
"Option_0_should_have_array_of_strings_as_a_value_6103": "L'option '{0}' doit avoir un tableau de chaînes en tant que valeur.",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "L'option 'isolatedModules' peut être utilisée seulement quand l'option '--module' est spécifiée, ou quand l'option 'target' a la valeur 'ES2015' ou une version supérieure.",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Impossible d'utiliser l'option 'paths' sans spécifier l'option '--baseUrl'.",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Impossible d'associer l'option 'project' à des fichiers sources sur une ligne de commande.",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Impossible de spécifier l'option '--resolveJsonModule' sans la stratégie de résolution de module 'node'.",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "Options :",
"Output_directory_for_generated_declaration_files_6166": "Répertoire de sortie pour les fichiers de déclaration générés.",
"Output_file_0_from_project_1_does_not_exist_6309": "Le fichier de sortie '{0}' du projet '{1}' n'existe pas",
@@ -664,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "Imprimez les noms des fichiers générés faisant partie de la compilation.",
"Print_the_compiler_s_version_6019": "Affichez la version du compilateur.",
"Print_this_message_6017": "Imprimez ce message.",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "Les références de projet ne peuvent pas former un graphe circulaire. Cycle détecté : {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "Projets à référencer",
"Property_0_does_not_exist_on_const_enum_1_2479": "La propriété '{0}' n'existe pas sur l'enum 'const' '{1}'.",
"Property_0_does_not_exist_on_type_1_2339": "La propriété '{0}' n'existe pas sur le type '{1}'.",
@@ -778,8 +797,11 @@
"Show_all_compiler_options_6169": "Affichez toutes les options du compilateur.",
"Show_diagnostic_information_6149": "Affichez les informations de diagnostic.",
"Show_verbose_diagnostic_information_6150": "Affichez les informations de diagnostic détaillées.",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "La signature '{0}' doit être un prédicat de type.",
"Skip_type_checking_of_declaration_files_6012": "Ignorer le contrôle de type des fichiers de déclaration.",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "Options de mappage de source",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "La signature de surcharge spécialisée n'est assignable à aucune signature non spécialisée.",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Le spécificateur de l'importation dynamique ne peut pas être un élément spread.",
@@ -941,6 +963,7 @@
"Unexpected_end_of_text_1126": "Fin de texte inattendue.",
"Unexpected_token_1012": "Jeton inattendu.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Jeton inattendu. Un constructeur, une méthode, un accesseur ou une propriété est attendu.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Jeton inattendu. Un nom de paramètre de type est attendu sans accolades.",
"Unexpected_token_expected_1179": "Jeton inattendu. '{' est attendu.",
"Unknown_compiler_option_0_5023": "Option de compilateur '{0}' inconnue.",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "Option 'excludes' inconnue. Voulez-vous utiliser 'exclude' ?",
@@ -954,6 +977,7 @@
"Unterminated_template_literal_1160": "Littéral de modèle inachevé.",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "Les appels de fonctions non typées ne peuvent pas accepter d'arguments de type.",
"Unused_label_7028": "Étiquette inutilisée.",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "Utilisez un membre 'default' synthétique.",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "L'utilisation d'une chaîne dans une instruction 'for...of' est prise en charge uniquement dans ECMAScript 5 et version supérieure.",
"VERSION_6036": "VERSION",
@@ -1014,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "L'initialiseur de membre enum 'const' donne une valeur non autorisée 'NaN'.",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Les enums 'const' ne peuvent être utilisés que dans les expressions d'accès à une propriété ou un index, ou dans la partie droite d'une déclaration d'importation, d'une assignation d'exportation ou d'une requête de type.",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "'delete' ne peut pas être appelé dans un identificateur en mode strict.",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "'Les déclarations enum' peuvent uniquement être utilisées dans un fichier .ts.",
"export_can_only_be_used_in_a_ts_file_8003": "'export=' peut uniquement être utilisé dans un fichier .ts.",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Impossible d'appliquer le modificateur 'export' aux modules ambients et aux augmentations de module, car ils sont toujours visibles.",
+3
View File
@@ -208,6 +208,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Non è stato trovato alcun file tsconfig.json nella directory specificata '{0}'.",
"Cannot_find_global_type_0_2318": "Il tipo globale '{0}' non è stato trovato.",
"Cannot_find_global_value_0_2468": "Il valore globale '{0}' non è stato trovato.",
"Cannot_find_lib_definition_for_0_2726": "La definizione della libreria per '{0}' non è stata trovata.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "La definizione della libreria per '{0}' non è stata trovata. Si intendeva '{1}'?",
"Cannot_find_module_0_2307": "Il modulo '{0}' non è stato trovato.",
"Cannot_find_name_0_2304": "Il nome '{0}' non è stato trovato.",
"Cannot_find_name_0_Did_you_mean_1_2552": "Il nome '{0}' non è stato trovato. Si intendeva '{1}'?",
@@ -941,6 +943,7 @@
"Unexpected_end_of_text_1126": "Fine del testo imprevista.",
"Unexpected_token_1012": "Token imprevisto.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token imprevisto. È previsto un costruttore, un metodo, una funzione di accesso o una proprietà.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token imprevisto. Sono previsti nomi di parametro senza parentesi graffe.",
"Unexpected_token_expected_1179": "Token imprevisto. È previsto '{'.",
"Unknown_compiler_option_0_5023": "Opzione del compilatore sconosciuta: '{0}'.",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "L'opzione 'excludes' è sconosciuta. Si intendeva 'exclude'?",
+28
View File
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "名前空間宣言は、それとマージするクラスや関数より前に配置できません。",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "名前空間宣言は、名前空間かモジュールでのみ使用できます。",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "名前空間スタイルのインポートを呼び出したり、構築したりすることはできません。実行時にエラーが発生する原因となります。",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "パラメーター初期化子は、関数またはコンストラクターの実装でのみ指定できます。",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "パラメーター プロパティは、rest パラメーターを使用して宣言することはできません。",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "パラメーター プロパティは、コンストラクターの実装でのみ指定できます。",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "2 進の数字が必要です。",
"Binding_element_0_implicitly_has_an_1_type_7031": "バインド要素 '{0}' には暗黙的に '{1}' 型が含まれます。",
"Block_scoped_variable_0_used_before_its_declaration_2448": "ブロック スコープの変数 '{0}' が、宣言の前に使用されています。",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "デコレーター式を呼び出す",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "戻り値の型の注釈がない呼び出しシグネチャの戻り値の型は、暗黙的に 'any' になります。",
"Call_target_does_not_contain_any_signatures_2346": "呼び出しターゲットにシグネチャが含まれていません。",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "指定されたディレクトリに tsconfig.json ファイルが見つかりません: '{0}'。",
"Cannot_find_global_type_0_2318": "グローバル型 '{0}' が見つかりません。",
"Cannot_find_global_value_0_2468": "グローバル値 '{0}' が見つかりません。",
"Cannot_find_lib_definition_for_0_2726": "'{0}' のライブラリ定義が見つかりません。",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "'{0}' のライブラリ定義が見つかりません。'{1}' ですか?",
"Cannot_find_module_0_2307": "モジュール '{0}' が見つかりません。",
"Cannot_find_name_0_2304": "名前 '{0}' が見つかりません。",
"Cannot_find_name_0_Did_you_mean_1_2552": "'{0}' という名前は見つかりません。'{1}' ですか?",
@@ -282,6 +289,8 @@
"Convert_all_to_default_imports_95035": "すべてを既定のインポートに変換します",
"Convert_function_0_to_class_95002": "関数 '{0}' をクラスに変換します",
"Convert_function_to_an_ES2015_class_95001": "関数を ES2015 クラスに変換します",
"Convert_named_imports_to_namespace_import_95057": "名前付きインポートを名前空間インポートに変換します",
"Convert_namespace_import_to_named_imports_95056": "名前空間インポートを名前付きインポートに変換します",
"Convert_require_to_import_95047": "'require' を 'import' に変換",
"Convert_to_ES6_module_95017": "ES6 モジュールに変換します",
"Convert_to_default_import_95013": "既定のインポートに変換する",
@@ -300,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "デコレーターを同じ名前の複数の get/set アクセサーに適用することはできません。",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "モジュールの既定エクスポートがプライベート名 '{0}' を持っているか、使用しています。",
"Delete_all_unused_declarations_95024": "未使用の宣言をすべて削除します",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[非推奨] 代わりに '--jsxFactory' を使います。'react' JSX 発行を対象とするときに、createElement に対して呼び出されたオブジェクトを指定します",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[非推奨] 代わりに '--outFile' を使います。出力を連結して 1 つのファイルを生成します",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[非推奨] 代わりに '--skipLibCheck' を使います。既定のライブラリ宣言ファイルの型チェックをスキップします。",
@@ -350,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "クラス内のプロパティの初期化の厳密なチェックを有効にします。",
"Enable_strict_null_checks_6113": "厳格な null チェックを有効にします。",
"Enable_tracing_of_the_name_resolution_process_6085": "名前解決の処理のトレースを有効にします。",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "すべてのインポートの名前空間オブジェクトを作成して、CommonJS と ES モジュール間の生成の相互運用性を有効にします。'allowSyntheticDefaultImports' を暗黙のうちに表します。",
"Enables_experimental_support_for_ES7_async_functions_6068": "ES7 非同期関数用の実験的なサポートを有効にします。",
"Enables_experimental_support_for_ES7_decorators_6065": "ES7 デコレーター用の実験的なサポートを有効にします。",
@@ -584,6 +595,7 @@
"Not_all_code_paths_return_a_value_7030": "一部のコード パスは値を返しません。",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "数値インデックス型 '{0}' を文字列インデックス型 '{1}' に割り当てることはできません。",
"Numeric_separators_are_not_allowed_here_6188": "数値の区切り記号は、ここでは使用できません。",
"Object_is_of_type_unknown_2571": "オブジェクト型は 'unknown' です。",
"Object_is_possibly_null_2531": "オブジェクトは 'null' である可能性があります。",
"Object_is_possibly_null_or_undefined_2533": "オブジェクトは 'null' か 'undefined' である可能性があります。",
"Object_is_possibly_undefined_2532": "オブジェクトは 'undefined' である可能性があります。",
@@ -610,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "オプション '{1}' を指定せずに、オプション '{0}' を指定することはできません。",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "オプション '{1}' またはオプション '{2}' を指定せずに、オプション '{0}' を指定することはできません。",
"Option_0_should_have_array_of_strings_as_a_value_6103": "オプション '{0}' には、値として文字列の配列を指定する必要があります。",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "オプション 'isolatedModules' は、オプション '--module' が指定されているか、オプション 'target' が 'ES2015' 以上であるかのいずれかの場合でのみ使用できます。",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "オプション 'paths' は、'--baseUrl' オプションを指定せずに使用できません。",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "オプション 'project' をコマンド ライン上でソース ファイルと一緒に指定することはできません。",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "'node' モジュールの解決方法を使用せずにオプション '--resolveJsonModule' を指定することはできません。",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "オプション:",
"Output_directory_for_generated_declaration_files_6166": "生成された宣言ファイルの出力ディレクトリ。",
"Output_file_0_from_project_1_does_not_exist_6309": "プロジェクト '{1}' からの出力ファイル '{0}' がありません",
@@ -661,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "コンパイルの一環として生成されたファイル名を書き出します。",
"Print_the_compiler_s_version_6019": "コンパイラのバージョンを表示します。",
"Print_this_message_6017": "このメッセージを表示します。",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "プロジェクト参照が円グラフを形成できません。循環が検出されました: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "参照するプロジェクト",
"Property_0_does_not_exist_on_const_enum_1_2479": "プロパティ '{0}' が 'const' 列挙型 '{1}' に存在しません。",
"Property_0_does_not_exist_on_type_1_2339": "プロパティ '{0}' は型 '{1}' に存在しません。",
@@ -775,8 +797,11 @@
"Show_all_compiler_options_6169": "コンパイラ オプションをすべて表示します。",
"Show_diagnostic_information_6149": "診断情報を表示します。",
"Show_verbose_diagnostic_information_6150": "詳細な診断情報を表示します。",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "シグネチャ '{0}' は型の述語である必要があります。",
"Skip_type_checking_of_declaration_files_6012": "宣言ファイルの型チェックをスキップします。",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "ソース マップ オプション",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "特殊化されたオーバーロード シグネチャは、特殊化されていないシグネチャに割り当てることはできません。",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "動的インポートの指定子にはスプレッド要素を指定できません。",
@@ -938,6 +963,7 @@
"Unexpected_end_of_text_1126": "予期しないテキストの末尾です。",
"Unexpected_token_1012": "予期しないトークンです。",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "予期しないトークンです。コンストラクター、メソッド、アクセサー、またはプロパティが必要です。",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "予期しないトークンです。型パラメーター名には、中かっこを含めることはできません。",
"Unexpected_token_expected_1179": "予期しないトークンです。'{' が必要です。",
"Unknown_compiler_option_0_5023": "コンパイラ オプション '{0}' が不明です。",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "不明なオプション 'excludes' です。'exclude' ですか?",
@@ -951,6 +977,7 @@
"Unterminated_template_literal_1160": "未終了のテンプレート リテラルです。",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "型指定のない関数の呼び出しで型引数を使用することはできません。",
"Unused_label_7028": "未使用のラベル。",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "合成 'default' メンバーを使用します。",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "'for...of' ステートメントでの文字列の使用は ECMAScript 5 以上でのみサポートされています。",
"VERSION_6036": "バージョン",
@@ -1011,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' 列挙型メンバーの初期化子が、許可されない値 'NaN' に評価されました。",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 列挙型は、プロパティまたはインデックスのアクセス式、インポート宣言またはエクスポートの割り当ての右辺、型のクエリにのみ使用できます。",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "厳格モードでは 'delete' を識別子で呼び出すことはできません。",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "'列挙型宣言' を使用できるのは .ts ファイル内のみです。",
"export_can_only_be_used_in_a_ts_file_8003": "'export=' を使用できるのは .ts ファイル内のみです。",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "環境モジュールとモジュール拡張は常に表示されるので、これらに 'export' 修飾子を適用することはできません。",
+25
View File
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "네임스페이스 선언은 해당 선언이 병합된 클래스나 함수 앞에 있을 수 없습니다.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "네임스페이스 선언은 네임스페이스 또는 모듈에서만 사용할 수 있습니다.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "네임스페이스 스타일 가져오기를 호출하거나 생성할 수 없으며 런타임 시 오류가 발생합니다.",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "매개 변수 이니셜라이저는 함수 또는 생성자 구현에서만 허용됩니다.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "rest 매개 변수를 사용하여 매개 변수 속성을 선언할 수 없습니다.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "매개 변수 속성은 생성자 구현에서만 허용됩니다.",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "이진수가 있어야 합니다.",
"Binding_element_0_implicitly_has_an_1_type_7031": "바인딩 요소 '{0}'에 암시적으로 '{1}' 형식이 있습니다.",
"Block_scoped_variable_0_used_before_its_declaration_2448": "선언 전에 사용된 블록 범위 변수 '{0}'입니다.",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "데코레이터 식 호출",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "반환 형식 주석이 없는 호출 시그니처에는 암시적으로 'any' 반환 형식이 포함됩니다.",
"Call_target_does_not_contain_any_signatures_2346": "호출 대상에 시그니처가 포함되어 있지 않습니다.",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "지정된 디렉터리에서 tsconfig.json 파일을 찾을 수 없습니다. '{0}'.",
"Cannot_find_global_type_0_2318": "전역 형식 '{0}'을(를) 찾을 수 없습니다.",
"Cannot_find_global_value_0_2468": "전역 값 '{0}'을(를) 찾을 수 없습니다.",
"Cannot_find_lib_definition_for_0_2726": "'{0}'에 대한 lib 정의를 찾을 수 없습니다.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "'{0}'에 대한 lib 정의를 찾을 수 없습니다. '{1}'이(가) 아닌지 확인하세요.",
"Cannot_find_module_0_2307": "'{0}' 모듈을 찾을 수 없습니다.",
"Cannot_find_name_0_2304": "'{0}' 이름을 찾을 수 없습니다.",
"Cannot_find_name_0_Did_you_mean_1_2552": "'{0}' 이름을 찾을 수 없습니다. '{1}'을(를) 사용하시겠습니까?",
@@ -302,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "동일한 이름의 여러 get/set 접근자에 데코레이터를 적용할 수 없습니다.",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "모듈의 기본 내보내기에서 전용 이름 '{0}'을(를) 가지고 있거나 사용 중입니다.",
"Delete_all_unused_declarations_95024": "사용하지 않는 선언 모두 삭제",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[사용되지 않음] 대신 '--jsxFactory'를 사용합니다. 'react' JSX 내보내기를 대상으로 할 경우 createElement에 대해 호출되는 개체를 지정합니다.",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[사용되지 않음] 대신 '--outFile'을 사용합니다. 출력을 연결하고 단일 파일로 내보냅니다.",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[사용되지 않음] 대신 '--skipLibCheck'를 사용합니다. 기본 라이브러리 선언 파일의 형식 검사를 건너뜁니다.",
@@ -352,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "클래스의 속성 초기화에 대해 엄격한 검사를 사용하도록 설정합니다.",
"Enable_strict_null_checks_6113": "엄격한 null 검사를 사용하도록 설정하세요.",
"Enable_tracing_of_the_name_resolution_process_6085": "이름 확인 프로세스 추적을 사용하도록 설정하세요.",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "모든 가져오기에 대한 네임스페이스 개체를 만들어 CommonJS 및 ES 모듈 간의 내보내기 상호 운용성을 사용하도록 설정합니다. 'allowSyntheticDefaultImports'를 의미합니다.",
"Enables_experimental_support_for_ES7_async_functions_6068": "ES7 비동기 함수에 대해 실험적 지원을 사용합니다.",
"Enables_experimental_support_for_ES7_decorators_6065": "ES7 데코레이터에 대해 실험적 지원을 사용합니다.",
@@ -613,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "'{1}' 옵션을 지정하지 않고 '{0}' 옵션을 지정할 수 없습니다.",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "'{1}' 또는 '{2}' 옵션을 지정하지 않고 '{0}' 옵션을 지정할 수 없습니다.",
"Option_0_should_have_array_of_strings_as_a_value_6103": "'{0}' 옵션은 문자열 배열 값을 사용해야 합니다.",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "'isolatedModules' 옵션은 '--module' 옵션을 지정하거나 'target' 옵션이 'ES2015' 이상인 경우에만 사용할 수 있습니다.",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "'paths' 옵션은 '--baseUrl' 옵션을 지정하지 않고 사용할 수 없습니다.",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "명령줄에서 'project' 옵션을 원본 파일과 혼합하여 사용할 수 없습니다.",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "'node' 모듈 확인 전략 없이 '--resolveJsonModule' 옵션을 지정할 수 없습니다.",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "옵션:",
"Output_directory_for_generated_declaration_files_6166": "생성된 선언 파일의 출력 디렉터리입니다.",
"Output_file_0_from_project_1_does_not_exist_6309": "프로젝트 '{1}'의 출력 파일 '{0}'이(가) 존재하지 않습니다.",
@@ -664,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "컴파일의 일부인 생성된 파일의 이름을 인쇄합니다.",
"Print_the_compiler_s_version_6019": "컴파일러 버전을 인쇄합니다.",
"Print_this_message_6017": "이 메시지를 출력합니다.",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "프로젝트 참조는 순환 그래프를 형성할 수 없습니다. 순환이 발견되었습니다. {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "참조할 프로젝트",
"Property_0_does_not_exist_on_const_enum_1_2479": "'const' 열거형 '{1}'에 '{0}' 속성이 없습니다.",
"Property_0_does_not_exist_on_type_1_2339": "'{1}' 형식에 '{0}' 속성이 없습니다.",
@@ -778,8 +797,11 @@
"Show_all_compiler_options_6169": "모든 컴파일러 옵션을 표시합니다.",
"Show_diagnostic_information_6149": "진단 정보를 표시합니다.",
"Show_verbose_diagnostic_information_6150": "자세한 진단 정보를 표시합니다.",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "'{0}' 시그니처는 형식 조건자여야 합니다.",
"Skip_type_checking_of_declaration_files_6012": "선언 파일 형식 검사를 건너뜁니다.",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "소스 맵 옵션",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "특수화된 오버로드 시그니처는 특수화되지 않은 서명에 할당할 수 없습니다.",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "동적 가져오기의 지정자는 스프레드 요소일 수 없습니다.",
@@ -941,6 +963,7 @@
"Unexpected_end_of_text_1126": "예기치 않은 텍스트 끝입니다.",
"Unexpected_token_1012": "예기치 않은 토큰입니다.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "예기치 않은 토큰입니다. 생성자, 메서드, 접근자 또는 속성이 필요합니다.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "예기치 않은 토큰입니다. 중괄호가 없는 형식 매개 변수 이름이 필요합니다.",
"Unexpected_token_expected_1179": "예기치 않은 토큰입니다. '{'가 있어야 합니다.",
"Unknown_compiler_option_0_5023": "알 수 없는 컴파일러 옵션 '{0}'입니다.",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "알 수 없는 옵션 'excludes'입니다. 'exclude'를 사용하시겠습니까?",
@@ -954,6 +977,7 @@
"Unterminated_template_literal_1160": "종결되지 않은 템플릿 리터럴입니다.",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "형식화되지 않은 함수 호출에는 형식 인수를 사용할 수 없습니다.",
"Unused_label_7028": "사용되지 않는 레이블입니다.",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "가상 '기본' 멤버를 사용합니다.",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "ECMAScript 5 이상에서만 'for...of' 문에서 문자열을 사용할 수 있습니다.",
"VERSION_6036": "버전",
@@ -1014,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' 열거형 멤버 이니셜라이저가 허용되지 않은 'NaN' 값에 대해 평가되었습니다.",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 열거형은 속성 또는 인덱스 액세스 식 또는 내보내기 할당 또는 가져오기 선언의 오른쪽 또는 형식 쿼리에서만 사용할 수 있습니다.",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "strict 모드에서는 식별자에 대해 'delete'를 호출할 수 없습니다.",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum 선언'은 .ts 파일에서만 사용할 수 있습니다.",
"export_can_only_be_used_in_a_ts_file_8003": "'export='는 .ts 파일에서만 사용할 수 있습니다.",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "앰비언트 모듈 및 모듈 확대는 항상 표시되므로 'export' 한정자를 적용할 수 없습니다.",
+4 -20540
View File
File diff suppressed because it is too large Load Diff
+2147 -929
View File
File diff suppressed because it is too large Load Diff
+126 -53
View File
@@ -18,12 +18,84 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.dom.d.ts" />
/////////////////////////////
/// DOM Iterable APIs
/////////////////////////////
interface AudioParamMap extends ReadonlyMap<string, AudioParam> {
}
interface AudioTrackList {
[Symbol.iterator](): IterableIterator<AudioTrack>;
}
interface CSSRuleList {
[Symbol.iterator](): IterableIterator<CSSRule>;
}
interface CSSStyleDeclaration {
[Symbol.iterator](): IterableIterator<string>;
}
interface ClientRectList {
[Symbol.iterator](): IterableIterator<ClientRect>;
}
interface DOMRectList {
[Symbol.iterator](): IterableIterator<DOMRect>;
}
interface DOMStringList {
[Symbol.iterator](): IterableIterator<string>;
}
interface DOMTokenList {
[Symbol.iterator](): IterableIterator<string>;
}
interface DataTransferItemList {
[Symbol.iterator](): IterableIterator<File>;
}
interface FileList {
[Symbol.iterator](): IterableIterator<File>;
}
interface FormData {
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
/**
* Returns an array of key, value pairs for every entry in the list.
*/
entries(): IterableIterator<[string, FormDataEntryValue]>;
/**
* Returns a list of keys in the list.
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the list.
*/
values(): IterableIterator<FormDataEntryValue>;
}
interface HTMLAllCollection {
[Symbol.iterator](): IterableIterator<Element>;
}
interface HTMLCollectionBase {
[Symbol.iterator](): IterableIterator<Element>;
}
interface HTMLCollectionOf<T extends Element> {
[Symbol.iterator](): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
keys(): IterableIterator<number>;
values(): IterableIterator<T>;
}
interface HTMLSelectElement {
[Symbol.iterator](): IterableIterator<Element>;
}
interface Headers {
[Symbol.iterator](): IterableIterator<[string, string]>;
/**
@@ -31,7 +103,7 @@ interface Headers {
*/
entries(): IterableIterator<[string, string]>;
/**
* Returns an iterator allowing to go through all keys f the key/value pairs contained in this object.
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
keys(): IterableIterator<string>;
/**
@@ -40,96 +112,97 @@ interface Headers {
values(): IterableIterator<string>;
}
interface MediaList {
[Symbol.iterator](): IterableIterator<string>;
}
interface MimeTypeArray {
[Symbol.iterator](): IterableIterator<Plugin>;
}
interface NamedNodeMap {
[Symbol.iterator](): IterableIterator<Attr>;
}
interface NodeList {
[Symbol.iterator](): IterableIterator<Node>;
/**
* Returns an array of key, value pairs for every entry in the list
* Returns an array of key, value pairs for every entry in the list.
*/
entries(): IterableIterator<[number, Node]>;
/**
* Performs the specified action for each node in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void;
/**
* Returns an list of keys in the list
* Returns an list of keys in the list.
*/
keys(): IterableIterator<number>;
/**
* Returns an list of values in the list
* Returns an list of values in the list.
*/
values(): IterableIterator<Node>;
[Symbol.iterator](): IterableIterator<Node>;
}
interface NodeListOf<TNode extends Node> {
[Symbol.iterator](): IterableIterator<TNode>;
/**
* Returns an array of key, value pairs for every entry in the list
* Returns an array of key, value pairs for every entry in the list.
*/
entries(): IterableIterator<[number, TNode]>;
/**
* Performs the specified action for each node in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf<TNode>) => void, thisArg?: any): void;
/**
* Returns an list of keys in the list
* Returns an list of keys in the list.
*/
keys(): IterableIterator<number>;
/**
* Returns an list of values in the list
* Returns an list of values in the list.
*/
values(): IterableIterator<TNode>;
[Symbol.iterator](): IterableIterator<TNode>;
}
interface HTMLCollectionBase {
[Symbol.iterator](): IterableIterator<Element>;
interface Plugin {
[Symbol.iterator](): IterableIterator<MimeType>;
}
interface HTMLCollectionOf<T extends Element> {
[Symbol.iterator](): IterableIterator<T>;
interface PluginArray {
[Symbol.iterator](): IterableIterator<Plugin>;
}
interface FormData {
/**
* Returns an array of key, value pairs for every entry in the list
*/
entries(): IterableIterator<[string, string | File]>;
/**
* Returns a list of keys in the list
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the list
*/
values(): IterableIterator<string | File>;
interface RTCStatsReport extends ReadonlyMap<string, any> {
}
[Symbol.iterator](): IterableIterator<string | File>;
interface SourceBufferList {
[Symbol.iterator](): IterableIterator<SourceBuffer>;
}
interface StyleSheetList {
[Symbol.iterator](): IterableIterator<StyleSheet>;
}
interface TextTrackCueList {
[Symbol.iterator](): IterableIterator<TextTrackCue>;
}
interface TextTrackList {
[Symbol.iterator](): IterableIterator<TextTrack>;
}
interface TouchList {
[Symbol.iterator](): IterableIterator<Touch>;
}
interface URLSearchParams {
[Symbol.iterator](): IterableIterator<[string, string]>;
/**
* Returns an array of key, value pairs for every entry in the search params
* Returns an array of key, value pairs for every entry in the search params.
*/
entries(): IterableIterator<[string, string]>;
/**
* Returns a list of keys in the search params
* Returns a list of keys in the search params.
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the search params
* Returns a list of values in the search params.
*/
values(): IterableIterator<string>;
/**
* iterate over key/value pairs
*/
[Symbol.iterator](): IterableIterator<[string, string]>;
}
interface VideoTrackList {
[Symbol.iterator](): IterableIterator<VideoTrack>;
}
+10 -10
View File
@@ -18,13 +18,13 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2015.core.d.ts" />
/// <reference path="lib.es2015.collection.d.ts" />
/// <reference path="lib.es2015.generator.d.ts" />
/// <reference path="lib.es2015.promise.d.ts" />
/// <reference path="lib.es2015.iterable.d.ts" />
/// <reference path="lib.es2015.proxy.d.ts" />
/// <reference path="lib.es2015.reflect.d.ts" />
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.symbol.wellknown.d.ts" />
/// <reference path="lib.es5.d.ts" />
/// <reference lib="es5" />
/// <reference lib="es2015.core" />
/// <reference lib="es2015.collection" />
/// <reference lib="es2015.generator" />
/// <reference lib="es2015.promise" />
/// <reference lib="es2015.iterable" />
/// <reference lib="es2015.proxy" />
/// <reference lib="es2015.reflect" />
/// <reference lib="es2015.symbol" />
/// <reference lib="es2015.symbol.wellknown" />
+1 -1
View File
@@ -18,7 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference lib="es2015.symbol" />
interface SymbolConstructor {
/**
+1 -1
View File
@@ -18,7 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference lib="es2015.symbol" />
interface SymbolConstructor {
/**
+2 -2
View File
@@ -18,5 +18,5 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2015.d.ts" />
/// <reference path="lib.es2016.array.include.d.ts" />
/// <reference lib="es2015" />
/// <reference lib="es2016.array.include" />
+5 -16505
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -18,9 +18,9 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2016.d.ts" />
/// <reference path="lib.es2017.object.d.ts" />
/// <reference path="lib.es2017.sharedmemory.d.ts" />
/// <reference path="lib.es2017.string.d.ts" />
/// <reference path="lib.es2017.intl.d.ts" />
/// <reference path="lib.es2017.typedarrays.d.ts" />
/// <reference lib="es2016" />
/// <reference lib="es2017.object" />
/// <reference lib="es2017.sharedmemory" />
/// <reference lib="es2017.string" />
/// <reference lib="es2017.intl" />
/// <reference lib="es2017.typedarrays" />
+5 -16510
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -18,8 +18,8 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.symbol.wellknown.d.ts" />
/// <reference lib="es2015.symbol" />
/// <reference lib="es2015.symbol.wellknown" />
interface SharedArrayBuffer {
/**
+4 -4
View File
@@ -18,7 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2017.d.ts" />
/// <reference path="lib.es2018.promise.d.ts" />
/// <reference path="lib.es2018.regexp.d.ts" />
/// <reference path="lib.es2018.intl.d.ts" />
/// <reference lib="es2017" />
/// <reference lib="es2018.promise" />
/// <reference lib="es2018.regexp" />
/// <reference lib="es2018.intl" />
+5 -16508
View File
File diff suppressed because it is too large Load Diff
+5 -22318
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -18,8 +18,8 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.iterable.d.ts" />
/// <reference lib="es2015.symbol" />
/// <reference lib="es2015.iterable" />
interface SymbolConstructor {
/**
+4 -4
View File
@@ -18,7 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference path="lib.es2018.d.ts" />
/// <reference path="lib.esnext.asynciterable.d.ts" />
/// <reference path="lib.esnext.array.d.ts" />
/// <reference path="lib.esnext.symbol.d.ts" />
/// <reference lib="es2018" />
/// <reference lib="esnext.asynciterable" />
/// <reference lib="esnext.array" />
/// <reference lib="esnext.symbol" />
+5 -16508
View File
File diff suppressed because it is too large Load Diff
+1147 -315
View File
File diff suppressed because it is too large Load Diff
+26
View File
@@ -0,0 +1,26 @@
/*! *****************************************************************************
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"/>
/////////////////////////////
/// WorkerGlobalScope APIs
/////////////////////////////
// These are only available in a Web Worker
declare function importScripts(...urls: string[]): void;
+25
View File
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Deklaracja przestrzeni nazw nie może występować przed klasą lub funkcją, z którą ją scalono.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Deklaracja przestrzeni nazw jest dozwolona tylko w przestrzeni nazw lub module.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Nie można wywołać lub skonstruować importu stylu przestrzeni nazw. Spowoduje to błąd w czasie wykonania.",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Inicjator parametru jest dozwolony tylko w implementacji funkcji lub konstruktora.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Właściwości parametru nie można zadeklarować za pomocą parametru rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Właściwość parametru jest dozwolona tylko w implementacji konstruktora.",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "Oczekiwano bitu.",
"Binding_element_0_implicitly_has_an_1_type_7031": "Dla elementu powiązania „{0}” niejawnie określono typ „{1}”.",
"Block_scoped_variable_0_used_before_its_declaration_2448": "Zmienna „{0}” o zakresie bloku została użyta przed jej deklaracją.",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "Wywołaj wyrażenie dekoratora",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Dla sygnatury wywołania bez adnotacji zwracanego typu niejawnie określono zwracany typ „any”.",
"Call_target_does_not_contain_any_signatures_2346": "Cel wywołania nie zawiera żadnych podpisów.",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Nie można znaleźć pliku tsconfig.json w określonym katalogu: „{0}”.",
"Cannot_find_global_type_0_2318": "Nie można odnaleźć typu globalnego „{0}”.",
"Cannot_find_global_value_0_2468": "Nie można odnaleźć wartości globalnej „{0}”.",
"Cannot_find_lib_definition_for_0_2726": "Nie można znaleźć definicji biblioteki dla elementu „{0}”.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Nie można znaleźć definicji biblioteki dla elementu „{0}”. Czy chodziło Ci o element „{1}”?",
"Cannot_find_module_0_2307": "Nie można odnaleźć modułu „{0}”.",
"Cannot_find_name_0_2304": "Nie można odnaleźć nazwy „{0}”.",
"Cannot_find_name_0_Did_you_mean_1_2552": "Nie można znaleźć nazwy „{0}”. Czy chodziło Ci o „{1}”?",
@@ -302,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Nie można stosować elementów Decorator do wielu metod dostępu pobierania/ustawiania o takiej samej nazwie.",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Domyślny eksport modułu ma nazwę prywatną „{0}” lub używa tej nazwy.",
"Delete_all_unused_declarations_95024": "Usuń wszystkie nieużywane deklaracje",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[Przestarzałe] Użyj w zastępstwie opcji „--jsxFactory”. Określ obiekt wywoływany dla elementu createElement przy określaniu jako celu emisji JSX „react”",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[Przestarzałe] Użyj w zastępstwie opcji „--outFile”. Połącz dane wyjściowe i wyemituj jako jeden plik",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Przestarzałe] Użyj w zastępstwie opcji „--skipLibCheck”. Pomiń sprawdzanie typów domyślnych plików deklaracji biblioteki.",
@@ -352,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "Włącz dokładne sprawdzanie inicjowania właściwości w klasach.",
"Enable_strict_null_checks_6113": "Włącz dokładne sprawdzanie wartości null.",
"Enable_tracing_of_the_name_resolution_process_6085": "Włącz śledzenie procesu rozpoznawania nazw.",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Umożliwia współdziałanie emitowania między modułami CommonJS i ES przez tworzenie obiektów przestrzeni nazw dla wszystkich importów. Implikuje użycie ustawienia „allowSyntheticDefaultImports”.",
"Enables_experimental_support_for_ES7_async_functions_6068": "Umożliwia obsługę eksperymentalną funkcji asynchronicznych języka ES7.",
"Enables_experimental_support_for_ES7_decorators_6065": "Umożliwia obsługę eksperymentalną elementów Decorator języka ES7.",
@@ -613,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "Opcji „{0}” nie można określić bez opcji „{1}”.",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "Opcji „{0}” nie można określić bez opcji „{1}” lub opcji „{2}”.",
"Option_0_should_have_array_of_strings_as_a_value_6103": "Wartość opcji „{0}” powinna być tablicą łańcuchów.",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "Opcji „isolatedModules” można użyć tylko wtedy, gdy podano opcję „--module” lub opcja „target” określa cel „ES2015” lub wyższy.",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Opcji „paths” nie można użyć bez podawania opcji „--baseUrl”.",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Nie można mieszać opcji „project” z plikami źródłowymi w wierszu polecenia.",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Nie można określić opcji „--resolveJsonModule” bez strategii rozpoznawania modułów „node”.",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "Opcje:",
"Output_directory_for_generated_declaration_files_6166": "Katalog wyjściowy dla wygenerowanych plików deklaracji.",
"Output_file_0_from_project_1_does_not_exist_6309": "Plik wyjściowy „{0}” z projektu „{1}” nie istnieje",
@@ -664,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "Drukuj nazwy wygenerowanych plików będących częścią kompilacji.",
"Print_the_compiler_s_version_6019": "Wypisz wersję kompilatora.",
"Print_this_message_6017": "Wypisz ten komunikat.",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "Odwołania do projektu nie mogą tworzyć grafu kołowego. Wykryto cykl: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "Projekty do przywołania",
"Property_0_does_not_exist_on_const_enum_1_2479": "Właściwość „{0}” nie istnieje w wyliczeniu ze specyfikatorem „const” „{1}”.",
"Property_0_does_not_exist_on_type_1_2339": "Właściwość „{0}” nie istnieje w typie „{1}”.",
@@ -778,8 +797,11 @@
"Show_all_compiler_options_6169": "Pokaż wszystkie opcje kompilatora.",
"Show_diagnostic_information_6149": "Pokaż informacje diagnostyczne.",
"Show_verbose_diagnostic_information_6150": "Pokaż pełne informacje diagnostyczne.",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "Sygnatura „{0}” musi być predykatem typów.",
"Skip_type_checking_of_declaration_files_6012": "Pomiń sprawdzanie typu plików deklaracji.",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "Opcje mapy źródła",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Nie można przypisać specjalizowanej sygnatury przeciążenia do żadnej sygnatury niespecjalizowanej.",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Specyfikator dynamicznego importowania nie może być elementem spread.",
@@ -941,6 +963,7 @@
"Unexpected_end_of_text_1126": "Nieoczekiwany koniec tekstu.",
"Unexpected_token_1012": "Nieoczekiwany token.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Nieoczekiwany token. Oczekiwano konstruktora, metody, metody dostępu lub właściwości.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Nieoczekiwany token. Oczekiwano nazwy parametru typu bez nawiasów klamrowych.",
"Unexpected_token_expected_1179": "Nieoczekiwany token. Oczekiwano znaku „{”.",
"Unknown_compiler_option_0_5023": "Nieznana opcja kompilatora „{0}”.",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "Nieznana opcja „excludes”. Czy chodziło o „exclude”?",
@@ -954,6 +977,7 @@
"Unterminated_template_literal_1160": "Niezakończony literał szablonu.",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "Wywołania funkcji bez typu nie mogą przyjmować argumentów typu.",
"Unused_label_7028": "Nieużywana etykieta.",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "Użyj syntetycznej składowej „default”.",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Używanie ciągu w instrukcji „for...of” jest obsługiwane tylko w języku ECMAScript 5 lub nowszym.",
"VERSION_6036": "WERSJA",
@@ -1014,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "Wynikiem obliczenia inicjatora składowej wyliczenia ze specyfikatorem „const” jest niedozwolona wartość „NaN”.",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Wyliczenia ze specyfikatorem „const” mogą być używane tylko w wyrażeniach dostępu do indeksu lub właściwości albo po prawej stronie deklaracji importu, przypisania eksportu lub typu zapytania.",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "Nie można wywołać elementu „delete” dla identyfikatora w trybie z ograniczeniami.",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "Deklaracji enum można używać tylko w pliku ts.",
"export_can_only_be_used_in_a_ts_file_8003": "Ciągu „export=” można użyć tylko w pliku ts.",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Modyfikator „export” nie może być stosowany do modułów otoczenia ani rozszerzeń modułów, ponieważ są one zawsze widoczne.",
+1
View File
@@ -2005,6 +2005,7 @@ declare namespace ts.server.protocol {
kind: ScriptElementKind;
kindModifiers: string;
spans: TextSpan[];
nameSpan: TextSpan | undefined;
childItems?: NavigationTree[];
}
type TelemetryEventName = "telemetry";
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Uma declaração de namespace não pode estar localizada antes de uma classe ou função com a qual ela é mesclada.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Uma declaração de namespace só é permitida e um namespace ou módulo.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Uma importação de estilo do namespace não pode ser chamada nem construída e causará uma falha no tempo de execução.",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Um inicializador de parâmetro só é permitido em uma implementação de função ou de construtor.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Uma propriedade de parâmetro não pode ser declarada usando um parâmetro rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Uma propriedade de parâmetro somente é permitida em uma implementação de construtor.",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "Dígito binário esperado.",
"Binding_element_0_implicitly_has_an_1_type_7031": "O elemento de associação '{0}' tem implicitamente um tipo '{1}'.",
"Block_scoped_variable_0_used_before_its_declaration_2448": "Variável de escopo de bloco '{0}' usada antes da sua declaração.",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "Chamar expressão do decorador",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Assinatura de chamada, que não tem a anotação de tipo de retorno, implicitamente tem um tipo de retorno 'any'.",
"Call_target_does_not_contain_any_signatures_2346": "O destino da chamada não contém nenhuma assinatura.",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Não é possível encontrar um arquivo tsconfig.json no diretório especificado: '{0}'.",
"Cannot_find_global_type_0_2318": "Não é possível encontrar o tipo global '{0}'.",
"Cannot_find_global_value_0_2468": "Não é possível encontrar o valor global '{0}'.",
"Cannot_find_lib_definition_for_0_2726": "Não é possível encontrar a definição de lib para '{0}'.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Cannot find lib definition for '{0}'. Did you mean '{1}'?",
"Cannot_find_module_0_2307": "Não é possível encontrar o módulo '{0}'.",
"Cannot_find_name_0_2304": "Não é possível encontrar o nome '{0}'.",
"Cannot_find_name_0_Did_you_mean_1_2552": "Não é possível localizar o nome '{0}'. Você quis dizer '{1}'?",
@@ -302,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Os decoradores não podem ser aplicados a vários acessadores get/set de mesmo nome.",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "A exportação padrão do módulo tem ou está usando o nome particular '{0}'.",
"Delete_all_unused_declarations_95024": "Excluir todas as declarações não usadas",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[Preterido] Use '--jsxFactory' no lugar. Especifique o objeto invocado para createElement ao direcionar uma emissão de JSX 'react'",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[Preterido] Use '--outFile' no lugar. Concatene e emita uma saída para um arquivo único",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Preterido] Use '--skipLibCheck' no lugar. Ignore a verificação de tipo dos arquivos de declaração de biblioteca padrão.",
@@ -352,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "Habilite a verificação estrita de inicialização de propriedade nas classes.",
"Enable_strict_null_checks_6113": "Habilite verificações nulas estritas.",
"Enable_tracing_of_the_name_resolution_process_6085": "Habilite o rastreio do processo de resolução de nome.",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Permite emissão de interoperabilidade entre CommonJS e Módulos ES através da criação de objetos de namespace para todas as importações. Implica em 'allowSyntheticDefaultImports'.",
"Enables_experimental_support_for_ES7_async_functions_6068": "Habilita o suporte experimental para funções assíncronas de ES7.",
"Enables_experimental_support_for_ES7_decorators_6065": "Habilita o suporte experimental para decoradores ES7.",
@@ -613,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "A opção '{0}' não pode ser especificada sem especificar a opção '{1}'.",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "A opção '{0}' não pode ser especificada sem especificar a opção '{1}' ou a opção '{2}'.",
"Option_0_should_have_array_of_strings_as_a_value_6103": "A opção '{0}' deve ter matriz de cadeias de um valor.",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "A opção 'isolatedModules' só pode ser usada quando nenhuma opção de '--module' for fornecida ou a opção 'target' for 'ES2015' ou superior.",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "A opção 'paths' não pode ser usada sem se especificar a opção '--baseUrl'.",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "A opção 'project' não pode ser mesclada com arquivos de origem em uma linha de comando.",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "A opção '--resolveJsonModule' não pode ser especificada sem a estratégia de resolução de módulo de 'nó'.",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "Opções:",
"Output_directory_for_generated_declaration_files_6166": "Diretório de saída para os arquivos de declaração gerados.",
"Output_file_0_from_project_1_does_not_exist_6309": "O arquivo de saída '{0}' do projeto '{1}' não existe",
@@ -664,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "Nomes de impressão das partes dos arquivos gerados da compilação.",
"Print_the_compiler_s_version_6019": "Imprima a versão do compilador.",
"Print_this_message_6017": "Imprima esta mensagem.",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "Referências de projeto não podem formar um gráfico circular. Ciclo detectado: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "Projetos para referência",
"Property_0_does_not_exist_on_const_enum_1_2479": "A propriedade '{0}' não existe na enumeração 'const' '{1}'.",
"Property_0_does_not_exist_on_type_1_2339": "A propriedade '{0}' não existe no tipo '{1}'.",
@@ -778,8 +797,11 @@
"Show_all_compiler_options_6169": "Mostrar todas as opções do compilador.",
"Show_diagnostic_information_6149": "Mostras as informações de diagnóstico.",
"Show_verbose_diagnostic_information_6150": "Mostras as informações detalhadas de diagnóstico.",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "A assinatura '{0}' deve ser um predicado de tipo.",
"Skip_type_checking_of_declaration_files_6012": "Ignorar a verificação de tipo dos arquivos de declaração.",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "Opções do Sourcemap",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "A assinatura de sobrecarga especializada não pode ser atribuída a qualquer assinatura não especializada.",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "O especificador de importação dinâmica não pode ser o elemento de difusão.",
@@ -941,6 +963,7 @@
"Unexpected_end_of_text_1126": "Fim inesperado do texto.",
"Unexpected_token_1012": "Token inesperado.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token inesperado. Um construtor, método, acessador ou propriedade era esperado.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token inesperado. Um nome de parâmetro de tipo era esperado sem chaves.",
"Unexpected_token_expected_1179": "Token inesperado. '{' esperado.",
"Unknown_compiler_option_0_5023": "Opção do compilador '{0}' desconhecida.",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "Opção desconhecida 'excludes'. Você quis dizer 'exclude'?",
@@ -954,6 +977,7 @@
"Unterminated_template_literal_1160": "Literal de modelo não finalizado.",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "Chamadas de função não tipadas não podem aceitar argumentos de tipo.",
"Unused_label_7028": "Rótulo não utilizado.",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "Use o membro sintético 'padrão'.",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Há suporte para o uso de uma cadeia de caracteres em uma instrução 'for...of' somente no ECMAScript 5 e superior.",
"VERSION_6036": "VERSÃO",
@@ -1014,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "O inicializador de membro de enumeração 'const' foi avaliado como o valor não permitido 'NaN'.",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Enumerações 'const' só podem ser usadas em expressões de acesso de índice ou propriedade, ou então do lado direito de uma consulta de tipo, declaração de importação ou atribuição de exportação.",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "'delete' não pode ser chamado em um identificador no modo estrito.",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum declarations' só podem ser usadas em um arquivo .ts.",
"export_can_only_be_used_in_a_ts_file_8003": "'export=' só pode ser usado em um arquivo .ts.",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "O modificador 'export' não pode ser aplicado a módulos de ambiente e acréscimos de módulo, pois eles estão sempre visíveis.",
+3
View File
@@ -208,6 +208,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Не удается найти файл tsconfig.json в указанном каталоге: \"{0}\".",
"Cannot_find_global_type_0_2318": "Не удается найти глобальный тип \"{0}\".",
"Cannot_find_global_value_0_2468": "Не удается найти глобальное значение \"{0}\".",
"Cannot_find_lib_definition_for_0_2726": "Cannot find lib definition for '{0}'.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Cannot find lib definition for '{0}'. Did you mean '{1}'?",
"Cannot_find_module_0_2307": "Не удается найти модуль \"{0}\".",
"Cannot_find_name_0_2304": "Не удается найти имя \"{0}\".",
"Cannot_find_name_0_Did_you_mean_1_2552": "Не удается найти имя \"{0}\". Вы имели в виду \"{1}\"?",
@@ -941,6 +943,7 @@
"Unexpected_end_of_text_1126": "Неожиданный конец текста.",
"Unexpected_token_1012": "Неожиданный токен.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Неожиданный токен. Ожидался конструктор, метод, метод доступа или свойство.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Непредвиденная лексема. Ожидалось имя параметра типа без фигурных скобок.",
"Unexpected_token_expected_1179": "Неожиданный токен. Ожидался символ \"{\".",
"Unknown_compiler_option_0_5023": "Неизвестный параметр компилятора \"{0}\".",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "Неизвестный параметр excludes. Возможно, вы имели в виду exclude?",
+28
View File
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Bir ad alanı bildirimi, birleştirildiği sınıf veya işlevden önce gelemez.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Ad alanı bildirimine yalnızca bir ad alanında veya modülde izin verilir.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Bir ad alanı stili içeri aktarma işlemi çağrılamadığından veya oluşturulamadığından çalışma zamanında hataya yol açacak.",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Parametre başlatıcısına yalnızca bir işlevde veya oluşturucu uygulamasında izin verilir.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Parametre özelliği, rest parametresi kullanılarak bildirilemez.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Parametre özelliğine yalnızca bir oluşturucu uygulamasında izin verilir.",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "İkili sayı bekleniyor.",
"Binding_element_0_implicitly_has_an_1_type_7031": "'{0}' bağlama öğesi, örtük olarak '{1}' türü içeriyor.",
"Block_scoped_variable_0_used_before_its_declaration_2448": "Blok kapsamlı değişken '{0}', bildirilmeden önce kullanıldı.",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "Dekoratör ifadesini çağır",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Dönüş türü ek açıklaması bulunmayan çağrı imzası, örtük olarak 'any' dönüş türüne sahip.",
"Call_target_does_not_contain_any_signatures_2346": "Çağrı hedefi imza içermiyor.",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "Belirtilen dizinde tsconfig.json dosyası bulunamıyor: '{0}'.",
"Cannot_find_global_type_0_2318": "'{0}' genel türü bulunamıyor.",
"Cannot_find_global_value_0_2468": "'{0}' genel değeri bulunamıyor.",
"Cannot_find_lib_definition_for_0_2726": "'{0}' için kitaplık tanımı bulunamıyor.",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "'{0}' için kitaplık tanımı bulunamıyor. Şunu mu demek istediniz: '{1}'?",
"Cannot_find_module_0_2307": "'{0}' modülü bulunamıyor.",
"Cannot_find_name_0_2304": "'{0}' adı bulunamıyor.",
"Cannot_find_name_0_Did_you_mean_1_2552": "'{0}' adı bulunamıyor. Bunu mu demek istediniz: '{1}'?",
@@ -282,6 +289,8 @@
"Convert_all_to_default_imports_95035": "Tümünü varsayılan içeri aktarmalara dönüştür",
"Convert_function_0_to_class_95002": "'{0}' işlevini sınıfa dönüştür",
"Convert_function_to_an_ES2015_class_95001": "İşlevi bir ES2015 sınıfına dönüştür",
"Convert_named_imports_to_namespace_import_95057": "Adlandırılmış içeri aktarmaları ad alanı içeri aktarmasına dönüştür",
"Convert_namespace_import_to_named_imports_95056": "Ad alanı içeri aktarmasını adlandırılmış içeri aktarmalara dönüştür",
"Convert_require_to_import_95047": "'require' öğesini 'import' olarak dönüştür",
"Convert_to_ES6_module_95017": "ES6 modülüne dönüştür",
"Convert_to_default_import_95013": "Varsayılan içeri aktarmaya dönüştür",
@@ -300,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Dekoratörler aynı ada sahip birden fazla get/set erişimcisine uygulanamaz.",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Modülün varsayılan dışarı aktarımı '{0}' özel adına sahip veya bu adı kullanıyor.",
"Delete_all_unused_declarations_95024": "Kullanılmayan tüm bildirimleri sil",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[Kullanım Dışı] Bunun yerine '--jsxFactory' kullanın. 'react' JSX gösterimi hedefleniyorsa, createElement için çağrılan nesneyi belirtin",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[Kullanım Dışı] Bunun yerine '--outFile' kullanın. Çıkışı tek bir dosya olarak birleştirin ve gösterin",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Kullanım Dışı] Bunun yerine '--skipLibCheck' kullanın. Varsayılan kitaplık bildirim dosyalarının tür denetimini atlayın.",
@@ -350,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "Sınıflarda sıkı özellik başlatma denetimini etkinleştirin.",
"Enable_strict_null_checks_6113": "Katı null denetimlerini etkinleştir.",
"Enable_tracing_of_the_name_resolution_process_6085": "Ad çözümleme işlemini izlemeyi etkinleştir.",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Tüm içeri aktarma işlemleri için ad alanı nesnelerinin oluşturulması aracılığıyla CommonJS ile ES Modülleri arasında yayımlama birlikte çalışabilirliğine imkan tanır. Şu anlama gelir: 'allowSyntheticDefaultImports'.",
"Enables_experimental_support_for_ES7_async_functions_6068": "Zaman uyumsuz ES7 işlevleri için deneysel desteği etkinleştirir.",
"Enables_experimental_support_for_ES7_decorators_6065": "ES7 dekoratörleri için deneysel desteği etkinleştirir.",
@@ -584,6 +595,7 @@
"Not_all_code_paths_return_a_value_7030": "Tüm kod yolları bir değer döndürmez.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "'{0}' sayısal dizin türü, '{1}' dize dizini türüne atanamaz.",
"Numeric_separators_are_not_allowed_here_6188": "Burada sayısal ayırıcılara izin verilmez.",
"Object_is_of_type_unknown_2571": "Nesne 'unknown' türünde.",
"Object_is_possibly_null_2531": "Nesne büyük olasılıkla 'null'.",
"Object_is_possibly_null_or_undefined_2533": "Nesne büyük olasılıkla 'null' veya 'undefined'.",
"Object_is_possibly_undefined_2532": "Nesne büyük olasılıkla 'undefined'.",
@@ -610,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "'{0}' seçeneği, '{1}' seçeneği belirtilmeden belirtilemez.",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "'{1}' seçeneği veya '{2}' seçeneği belirtilmeden '{0}' seçeneği belirtilemez.",
"Option_0_should_have_array_of_strings_as_a_value_6103": "'{0}' seçeneği değer olarak, dizelerden oluşan bir dizi içermelidir.",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "'isolatedModules' seçeneği, yalnızca '--module' sağlandığında veya 'target' seçeneği 'ES2015' veya daha yüksek bir sürüm değerine sahip olduğunda kullanılabilir.",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "'Paths' seçeneği, '--baseUrl' seçeneği belirtilmeden kullanılamaz.",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "'project' seçeneği, komut satırındaki kaynak dosyalarıyla karıştırılamaz.",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "'node' modül çözümleme stratejisi olmadan '--resolveJsonModule' seçeneği belirtilemez.",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "Seçenekler:",
"Output_directory_for_generated_declaration_files_6166": "Oluşturulan bildirim dosyaları için çıkış dizini.",
"Output_file_0_from_project_1_does_not_exist_6309": "'{1}' projesinden '{0}' çıkış dosyası yok",
@@ -661,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "Oluşturulan dosyalardan, derlemenin parçası olanların adlarını yazdırın.",
"Print_the_compiler_s_version_6019": "Derleyici sürümünü yazdır.",
"Print_this_message_6017": "Bu iletiyi yazdır.",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "Proje başvuruları döngüsel bir grafik formu oluşturamaz. Döngü tespit edildi: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "Başvurulacak projeler",
"Property_0_does_not_exist_on_const_enum_1_2479": "'{0}' özelliği, '{1}' 'const' sabit listesi üzerinde değil.",
"Property_0_does_not_exist_on_type_1_2339": "'{0}' özelliği, '{1}' türünde değil.",
@@ -775,8 +797,11 @@
"Show_all_compiler_options_6169": "Tüm derleyici seçeneklerini gösterin.",
"Show_diagnostic_information_6149": "Tanılama bilgilerini gösterin.",
"Show_verbose_diagnostic_information_6150": "Ayrıntılı tanılama bilgilerini gösterin.",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "'{0}' imzası bir tür koşulu olmalıdır.",
"Skip_type_checking_of_declaration_files_6012": "Bildirim dosyalarının tür denetimini atla.",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "Kaynak Eşleme Seçenekleri",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Özelleşmiş aşırı yükleme imzası özelleşmemiş imzalara atanamaz.",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Dinamik içeri aktarmanın tanımlayıcısı, yayılma öğesi olamaz.",
@@ -938,6 +963,7 @@
"Unexpected_end_of_text_1126": "Beklenmeyen metin sonu.",
"Unexpected_token_1012": "Beklenmeyen belirteç.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Beklenmeyen belirteç. Bir oluşturucu, metot, erişimci veya özellik bekleniyordu.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Beklenmeyen belirteç. Küme ayracı olmadan bir tür parametresi adı bekleniyordu.",
"Unexpected_token_expected_1179": "Beklenmeyen belirteç. '{' bekleniyordu.",
"Unknown_compiler_option_0_5023": "Bilinmeyen '{0}' derleyici seçeneği.",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "'Excludes' seçeneği bilinmiyor. 'Exclude' seçeneğini mi belirtmek istediniz?",
@@ -951,6 +977,7 @@
"Unterminated_template_literal_1160": "Sonlandırılmamış şablon sabit değeri.",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "Türü belirtilmemiş işlev çağrıları tür bağımsız değişkenlerini kabul etmeyebilir.",
"Unused_label_7028": "Kullanılmayan etiket.",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "Yapay 'default' üyesini kullanın.",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "'for...of' deyiminde dize kullanma yalnızca ECMAScript 5 veya üzerinde desteklenir.",
"VERSION_6036": "SÜRÜM",
@@ -1011,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' sabit listesi üyesi başlatıcısı, izin verilmeyen 'NaN' değeri olarak hesaplandı.",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' sabit listeleri yalnızca bir özellikte, dizin erişim ifadelerinde, içeri aktarma bildiriminin veya dışarı aktarma atamasının sağ tarafında ya da tür sorgusunda kullanılabilir.",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "'delete', katı moddaki bir tanımlayıcıda çağrılamaz.",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum declarations' yalnızca bir .ts dosyasında kullanılabilir.",
"export_can_only_be_used_in_a_ts_file_8003": "'export=' yalnızca bir .ts dosyasında kullanılabilir.",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "'export' değiştiricisi, her zaman görünür olduğu için çevresel modüllere ve modül genişletmelerine uygulanamaz.",
+6038 -4649
View File
File diff suppressed because it is too large Load Diff
+42353 -22936
View File
File diff suppressed because one or more lines are too long
+7145 -1594
View File
File diff suppressed because one or more lines are too long
+9785 -9094
View File
File diff suppressed because it is too large Load Diff
+284 -84
View File
@@ -13,6 +13,12 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
declare namespace ts {
const versionMajorMinor = "3.0";
/** The version of the TypeScript compiler release */
const version: string;
}
declare namespace ts {
/**
* Type of objects whose values are all of the same type.
@@ -22,6 +28,9 @@ declare namespace ts {
interface MapLike<T> {
[index: string]: T;
}
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
/** ES6 Map interface, only read methods included. */
interface ReadonlyMap<T> {
get(key: string): T | undefined;
@@ -52,6 +61,8 @@ declare namespace ts {
interface Push<T> {
push(...values: T[]): void;
}
}
declare namespace ts {
type Path = string & {
__pathBrand: any;
};
@@ -715,10 +726,14 @@ declare namespace ts {
kind: SyntaxKind.ThisType;
}
type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
interface FunctionTypeNode extends TypeNode, SignatureDeclarationBase {
interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
type: TypeNode;
}
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
kind: SyntaxKind.FunctionType;
}
interface ConstructorTypeNode extends TypeNode, SignatureDeclarationBase {
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
kind: SyntaxKind.ConstructorType;
}
interface NodeWithTypeArguments extends TypeNode {
@@ -1648,6 +1663,7 @@ declare namespace ts {
moduleName?: string;
referencedFiles: ReadonlyArray<FileReference>;
typeReferenceDirectives: ReadonlyArray<FileReference>;
libReferenceDirectives: ReadonlyArray<FileReference>;
languageVariant: LanguageVariant;
isDeclarationFile: boolean;
/**
@@ -1669,11 +1685,14 @@ declare namespace ts {
interface InputFiles extends Node {
kind: SyntaxKind.InputFiles;
javascriptText: string;
javascriptMapText?: string;
declarationText: string;
declarationMapText?: string;
}
interface UnparsedSource extends Node {
kind: SyntaxKind.UnparsedSource;
text: string;
sourceMapText?: string;
}
interface JsonSourceFile extends SourceFile {
statements: NodeArray<JsonObjectExpressionStatement>;
@@ -2063,7 +2082,7 @@ declare namespace ts {
AliasExcludes = 2097152,
ModuleMember = 2623475,
ExportHasLocal = 944,
HasExports = 1952,
HasExports = 1955,
HasMembers = 6240,
BlockScoped = 418,
PropertyOrAccessor = 98308,
@@ -2656,6 +2675,9 @@ declare namespace ts {
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
getEnvironmentVariable?(name: string): string | undefined;
createHash?(data: string): string;
getModifiedTime?(fileName: string): Date;
setModifiedTime?(fileName: string, date: Date): void;
deleteFile?(fileName: string): void;
}
interface SourceMapRange extends TextRange {
source?: SourceMapSource;
@@ -2876,6 +2898,10 @@ declare namespace ts {
omitTrailingSemicolon?: boolean;
noEmitHelpers?: boolean;
}
interface GetEffectiveTypeRootsHost {
directoryExists?(directoryName: string): boolean;
getCurrentDirectory?(): string;
}
/** @deprecated See comment on SymbolWriter */
interface SymbolTracker {
trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void;
@@ -2891,9 +2917,6 @@ declare namespace ts {
span: TextSpan;
newLength: number;
}
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
interface SyntaxList extends Node {
_children: Node[];
}
@@ -2963,15 +2986,6 @@ declare namespace ts {
IndexSignatureParameters = 4432
}
}
declare namespace ts {
const versionMajorMinor = "3.0";
/** The version of the TypeScript compiler release */
const version: string;
}
declare namespace ts {
function isExternalModuleNameRelative(moduleName: string): boolean;
function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[];
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
declare namespace ts {
@@ -3006,6 +3020,8 @@ declare namespace ts {
getDirectories(path: string): string[];
readDirectory(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[];
getModifiedTime?(path: string): Date;
setModifiedTime?(path: string, time: Date): void;
deleteFile?(path: string): void;
/**
* A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
*/
@@ -3082,6 +3098,11 @@ declare namespace ts {
function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
}
/** Non-internal stuff goes here */
declare namespace ts {
function isExternalModuleNameRelative(moduleName: string): boolean;
function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[];
}
declare namespace ts {
function getDefaultLibFileName(options: CompilerOptions): string;
function textSpanEnd(span: TextSpan): number;
@@ -3371,6 +3392,7 @@ declare namespace ts {
function isEnumMember(node: Node): node is EnumMember;
function isSourceFile(node: Node): node is SourceFile;
function isBundle(node: Node): node is Bundle;
function isUnparsedSource(node: Node): node is UnparsedSource;
function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression;
function isJSDocAllType(node: JSDocAllType): node is JSDocAllType;
function isJSDocUnknownType(node: Node): node is JSDocUnknownType;
@@ -3467,10 +3489,79 @@ declare namespace ts {
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
}
declare namespace ts {
interface GetEffectiveTypeRootsHost {
directoryExists?(directoryName: string): boolean;
getCurrentDirectory?(): string;
function parseCommandLine(commandLine: ReadonlyArray<string>, readFile?: (path: string) => string | undefined): ParsedCommandLine;
type DiagnosticReporter = (diagnostic: Diagnostic) => void;
/**
* Reports config file diagnostics
*/
interface ConfigFileDiagnosticsReporter {
/**
* Reports unrecoverable error when parsing config file
*/
onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
}
/**
* Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
*/
interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
getCurrentDirectory(): string;
}
/**
* Reads the config file, reports errors if any and exits if the config file cannot be found
*/
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined;
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
config?: any;
error?: Diagnostic;
};
/**
* Parse the text of the tsconfig.json file
* @param fileName The path to the config file
* @param jsonText The text of the config file
*/
function parseConfigFileTextToJson(fileName: string, jsonText: string): {
config?: any;
error?: Diagnostic;
};
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
/**
* Convert the json syntax tree into the json value
*/
function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
/**
* Parse the contents of a config file (tsconfig.json).
* @param jsonNode The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: CompilerOptions;
errors: Diagnostic[];
};
function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: TypeAcquisition;
errors: Diagnostic[];
};
}
declare namespace ts {
function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
/**
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
@@ -3801,7 +3892,7 @@ declare namespace ts {
function updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment;
function createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember;
function updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember;
function updateSourceFileNode(node: SourceFile, statements: ReadonlyArray<Statement>, isDeclarationFile?: boolean, referencedFiles?: SourceFile["referencedFiles"], typeReferences?: SourceFile["typeReferenceDirectives"], hasNoDefaultLib?: boolean): SourceFile;
function updateSourceFileNode(node: SourceFile, statements: ReadonlyArray<Statement>, isDeclarationFile?: boolean, referencedFiles?: SourceFile["referencedFiles"], typeReferences?: SourceFile["typeReferenceDirectives"], hasNoDefaultLib?: boolean, libReferences?: SourceFile["libReferenceDirectives"]): SourceFile;
/**
* Creates a shallow, memberwise clone of a node for mutation.
*/
@@ -3826,8 +3917,8 @@ declare namespace ts {
function createCommaList(elements: ReadonlyArray<Expression>): CommaListExpression;
function updateCommaList(node: CommaListExpression, elements: ReadonlyArray<Expression>): CommaListExpression;
function createBundle(sourceFiles: ReadonlyArray<SourceFile>, prepends?: ReadonlyArray<UnparsedSource | InputFiles>): Bundle;
function createUnparsedSourceFile(text: string): UnparsedSource;
function createInputFiles(javascript: string, declaration: string): InputFiles;
function createUnparsedSourceFile(text: string, map?: string): UnparsedSource;
function createInputFiles(javascript: string, declaration: string, javascriptMapText?: string, declarationMapText?: string): InputFiles;
function updateBundle(node: Bundle, sourceFiles: ReadonlyArray<SourceFile>, prepends?: ReadonlyArray<UnparsedSource>): Bundle;
function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray<Statement>): CallExpression;
function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray<Statement>, param: ParameterDeclaration, paramValue: Expression): CallExpression;
@@ -4048,6 +4139,10 @@ declare namespace ts {
* @returns A 'Program' object.
*/
function createProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): Program;
/**
* Returns the target config filename of a project reference
*/
function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined;
}
declare namespace ts {
interface EmitOutput {
@@ -4293,76 +4388,179 @@ declare namespace ts {
function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
}
declare namespace ts {
function parseCommandLine(commandLine: ReadonlyArray<string>, readFile?: (path: string) => string | undefined): ParsedCommandLine;
type DiagnosticReporter = (diagnostic: Diagnostic) => void;
/**
* Reports config file diagnostics
* Branded string for keeping track of when we've turned an ambiguous path
* specified like "./blah" to an absolute path to an actual
* tsconfig file, e.g. "/root/blah/tsconfig.json"
*/
interface ConfigFileDiagnosticsReporter {
type ResolvedConfigFileName = string & {
_isResolvedConfigFileName: never;
};
interface BuildHost {
verbose(diag: DiagnosticMessage, ...args: string[]): void;
error(diag: DiagnosticMessage, ...args: string[]): void;
errorDiagnostic(diag: Diagnostic): void;
message(diag: DiagnosticMessage, ...args: string[]): void;
}
/**
* A BuildContext tracks what's going on during the course of a build.
*
* Callers may invoke any number of build requests within the same context;
* until the context is reset, each project will only be built at most once.
*
* Example: In a standard setup where project B depends on project A, and both are out of date,
* a failed build of A will result in A remaining out of date. When we try to build
* B, we should immediately bail instead of recomputing A's up-to-date status again.
*
* This also matters for performing fast (i.e. fake) downstream builds of projects
* when their upstream .d.ts files haven't changed content (but have newer timestamps)
*/
interface BuildContext {
options: BuildOptions;
/**
* Reports unrecoverable error when parsing config file
* Map from output file name to its pre-build timestamp
*/
onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
unchangedOutputs: FileMap<Date>;
/**
* Map from config file name to up-to-date status
*/
projectStatus: FileMap<UpToDateStatus>;
invalidatedProjects: FileMap<true>;
queuedProjects: FileMap<true>;
missingRoots: Map<true>;
}
/**
* Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
*/
interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
getCurrentDirectory(): string;
type Mapper = ReturnType<typeof createDependencyMapper>;
interface DependencyGraph {
buildQueue: ResolvedConfigFileName[];
dependencyMap: Mapper;
}
/**
* Reads the config file, reports errors if any and exits if the config file cannot be found
*/
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined;
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
config?: any;
error?: Diagnostic;
interface BuildOptions {
dry: boolean;
force: boolean;
verbose: boolean;
}
enum UpToDateStatusType {
Unbuildable = 0,
UpToDate = 1,
/**
* The project appears out of date because its upstream inputs are newer than its outputs,
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
* This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
*/
UpToDateWithUpstreamTypes = 2,
OutputMissing = 3,
OutOfDateWithSelf = 4,
OutOfDateWithUpstream = 5,
UpstreamOutOfDate = 6,
UpstreamBlocked = 7,
/**
* Projects with no outputs (i.e. "solution" files)
*/
ContainerOnly = 8
}
type UpToDateStatus = Status.Unbuildable | Status.UpToDate | Status.OutputMissing | Status.OutOfDateWithSelf | Status.OutOfDateWithUpstream | Status.UpstreamOutOfDate | Status.UpstreamBlocked | Status.ContainerOnly;
namespace Status {
/**
* The project can't be built at all in its current state. For example,
* its config file cannot be parsed, or it has a syntax error or missing file
*/
interface Unbuildable {
type: UpToDateStatusType.Unbuildable;
reason: string;
}
/**
* This project doesn't have any outputs, so "is it up to date" is a meaningless question.
*/
interface ContainerOnly {
type: UpToDateStatusType.ContainerOnly;
}
/**
* The project is up to date with respect to its inputs.
* We track what the newest input file is.
*/
interface UpToDate {
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
newestInputFileTime: Date;
newestInputFileName: string;
newestDeclarationFileContentChangedTime: Date;
newestOutputFileTime: Date;
newestOutputFileName: string;
oldestOutputFileName: string;
}
/**
* One or more of the outputs of the project does not exist.
*/
interface OutputMissing {
type: UpToDateStatusType.OutputMissing;
/**
* The name of the first output file that didn't exist
*/
missingOutputFileName: string;
}
/**
* One or more of the project's outputs is older than its newest input.
*/
interface OutOfDateWithSelf {
type: UpToDateStatusType.OutOfDateWithSelf;
outOfDateOutputFileName: string;
newerInputFileName: string;
}
/**
* This project depends on an out-of-date project, so shouldn't be built yet
*/
interface UpstreamOutOfDate {
type: UpToDateStatusType.UpstreamOutOfDate;
upstreamProjectName: string;
}
/**
* This project depends an upstream project with build errors
*/
interface UpstreamBlocked {
type: UpToDateStatusType.UpstreamBlocked;
upstreamProjectName: string;
}
/**
* One or more of the project's outputs is older than the newest output of
* an upstream project.
*/
interface OutOfDateWithUpstream {
type: UpToDateStatusType.OutOfDateWithUpstream;
outOfDateOutputFileName: string;
newerProjectName: string;
}
}
interface FileMap<T> {
setValue(fileName: string, value: T): void;
getValue(fileName: string): T | never;
getValueOrUndefined(fileName: string): T | undefined;
hasKey(fileName: string): boolean;
removeKey(fileName: string): void;
getKeys(): string[];
}
function createDependencyMapper(): {
addReference: (childConfigFileName: ResolvedConfigFileName, parentConfigFileName: ResolvedConfigFileName) => void;
getReferencesTo: (parentConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
getReferencesOf: (childConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
};
function createBuildContext(options: BuildOptions): BuildContext;
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
/**
* Parse the text of the tsconfig.json file
* @param fileName The path to the config file
* @param jsonText The text of the config file
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
* can dynamically add/remove other projects based on changes on the rootNames' references
*/
function parseConfigFileTextToJson(fileName: string, jsonText: string): {
config?: any;
error?: Diagnostic;
};
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
/**
* Convert the json syntax tree into the json value
*/
function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
/**
* Parse the contents of a config file (tsconfig.json).
* @param jsonNode The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: CompilerOptions;
errors: Diagnostic[];
};
function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: TypeAcquisition;
errors: Diagnostic[];
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
buildAllProjects: () => number;
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
resetBuildContext: (opts?: BuildOptions) => void;
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
invalidateProject: (configFileName: string) => void;
buildInvalidatedProjects: () => void;
buildDependentInvalidatedProjects: () => void;
resolveProjectName: (name: string) => ResolvedConfigFileName | undefined;
startWatching: () => void;
};
}
declare namespace ts {
@@ -4467,6 +4665,7 @@ declare namespace ts {
interface PreProcessedFileInfo {
referencedFiles: FileReference[];
typeReferenceDirectives: FileReference[];
libReferenceDirectives: FileReference[];
importedFiles: FileReference[];
ambientExternalModules?: string[];
isLibFile: boolean;
@@ -4651,6 +4850,7 @@ declare namespace ts {
* There will be more than one if this is the result of merging.
*/
spans: TextSpan[];
nameSpan: TextSpan | undefined;
/** Present if non-empty */
childItems?: NavigationTree[];
}
@@ -5326,5 +5526,5 @@ declare namespace ts {
*/
function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>;
}
export = ts;
//# sourceMappingURL=typescriptservices.d.ts.map
export = ts
+9457 -7925
View File
File diff suppressed because it is too large Load Diff
+283 -82
View File
@@ -13,6 +13,12 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
declare namespace ts {
const versionMajorMinor = "3.0";
/** The version of the TypeScript compiler release */
const version: string;
}
declare namespace ts {
/**
* Type of objects whose values are all of the same type.
@@ -22,6 +28,9 @@ declare namespace ts {
interface MapLike<T> {
[index: string]: T;
}
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
/** ES6 Map interface, only read methods included. */
interface ReadonlyMap<T> {
get(key: string): T | undefined;
@@ -52,6 +61,8 @@ declare namespace ts {
interface Push<T> {
push(...values: T[]): void;
}
}
declare namespace ts {
type Path = string & {
__pathBrand: any;
};
@@ -715,10 +726,14 @@ declare namespace ts {
kind: SyntaxKind.ThisType;
}
type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
interface FunctionTypeNode extends TypeNode, SignatureDeclarationBase {
interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
type: TypeNode;
}
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
kind: SyntaxKind.FunctionType;
}
interface ConstructorTypeNode extends TypeNode, SignatureDeclarationBase {
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
kind: SyntaxKind.ConstructorType;
}
interface NodeWithTypeArguments extends TypeNode {
@@ -1648,6 +1663,7 @@ declare namespace ts {
moduleName?: string;
referencedFiles: ReadonlyArray<FileReference>;
typeReferenceDirectives: ReadonlyArray<FileReference>;
libReferenceDirectives: ReadonlyArray<FileReference>;
languageVariant: LanguageVariant;
isDeclarationFile: boolean;
/**
@@ -1669,11 +1685,14 @@ declare namespace ts {
interface InputFiles extends Node {
kind: SyntaxKind.InputFiles;
javascriptText: string;
javascriptMapText?: string;
declarationText: string;
declarationMapText?: string;
}
interface UnparsedSource extends Node {
kind: SyntaxKind.UnparsedSource;
text: string;
sourceMapText?: string;
}
interface JsonSourceFile extends SourceFile {
statements: NodeArray<JsonObjectExpressionStatement>;
@@ -2063,7 +2082,7 @@ declare namespace ts {
AliasExcludes = 2097152,
ModuleMember = 2623475,
ExportHasLocal = 944,
HasExports = 1952,
HasExports = 1955,
HasMembers = 6240,
BlockScoped = 418,
PropertyOrAccessor = 98308,
@@ -2656,6 +2675,9 @@ declare namespace ts {
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
getEnvironmentVariable?(name: string): string | undefined;
createHash?(data: string): string;
getModifiedTime?(fileName: string): Date;
setModifiedTime?(fileName: string, date: Date): void;
deleteFile?(fileName: string): void;
}
interface SourceMapRange extends TextRange {
source?: SourceMapSource;
@@ -2876,6 +2898,10 @@ declare namespace ts {
omitTrailingSemicolon?: boolean;
noEmitHelpers?: boolean;
}
interface GetEffectiveTypeRootsHost {
directoryExists?(directoryName: string): boolean;
getCurrentDirectory?(): string;
}
/** @deprecated See comment on SymbolWriter */
interface SymbolTracker {
trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void;
@@ -2891,9 +2917,6 @@ declare namespace ts {
span: TextSpan;
newLength: number;
}
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
interface SyntaxList extends Node {
_children: Node[];
}
@@ -2963,15 +2986,6 @@ declare namespace ts {
IndexSignatureParameters = 4432
}
}
declare namespace ts {
const versionMajorMinor = "3.0";
/** The version of the TypeScript compiler release */
const version: string;
}
declare namespace ts {
function isExternalModuleNameRelative(moduleName: string): boolean;
function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[];
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
declare namespace ts {
@@ -3006,6 +3020,8 @@ declare namespace ts {
getDirectories(path: string): string[];
readDirectory(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[];
getModifiedTime?(path: string): Date;
setModifiedTime?(path: string, time: Date): void;
deleteFile?(path: string): void;
/**
* A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
*/
@@ -3082,6 +3098,11 @@ declare namespace ts {
function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
}
/** Non-internal stuff goes here */
declare namespace ts {
function isExternalModuleNameRelative(moduleName: string): boolean;
function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[];
}
declare namespace ts {
function getDefaultLibFileName(options: CompilerOptions): string;
function textSpanEnd(span: TextSpan): number;
@@ -3371,6 +3392,7 @@ declare namespace ts {
function isEnumMember(node: Node): node is EnumMember;
function isSourceFile(node: Node): node is SourceFile;
function isBundle(node: Node): node is Bundle;
function isUnparsedSource(node: Node): node is UnparsedSource;
function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression;
function isJSDocAllType(node: JSDocAllType): node is JSDocAllType;
function isJSDocUnknownType(node: Node): node is JSDocUnknownType;
@@ -3467,10 +3489,79 @@ declare namespace ts {
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
}
declare namespace ts {
interface GetEffectiveTypeRootsHost {
directoryExists?(directoryName: string): boolean;
getCurrentDirectory?(): string;
function parseCommandLine(commandLine: ReadonlyArray<string>, readFile?: (path: string) => string | undefined): ParsedCommandLine;
type DiagnosticReporter = (diagnostic: Diagnostic) => void;
/**
* Reports config file diagnostics
*/
interface ConfigFileDiagnosticsReporter {
/**
* Reports unrecoverable error when parsing config file
*/
onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
}
/**
* Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
*/
interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
getCurrentDirectory(): string;
}
/**
* Reads the config file, reports errors if any and exits if the config file cannot be found
*/
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined;
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
config?: any;
error?: Diagnostic;
};
/**
* Parse the text of the tsconfig.json file
* @param fileName The path to the config file
* @param jsonText The text of the config file
*/
function parseConfigFileTextToJson(fileName: string, jsonText: string): {
config?: any;
error?: Diagnostic;
};
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
/**
* Convert the json syntax tree into the json value
*/
function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
/**
* Parse the contents of a config file (tsconfig.json).
* @param jsonNode The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: CompilerOptions;
errors: Diagnostic[];
};
function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: TypeAcquisition;
errors: Diagnostic[];
};
}
declare namespace ts {
function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
/**
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
@@ -3801,7 +3892,7 @@ declare namespace ts {
function updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment;
function createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember;
function updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember;
function updateSourceFileNode(node: SourceFile, statements: ReadonlyArray<Statement>, isDeclarationFile?: boolean, referencedFiles?: SourceFile["referencedFiles"], typeReferences?: SourceFile["typeReferenceDirectives"], hasNoDefaultLib?: boolean): SourceFile;
function updateSourceFileNode(node: SourceFile, statements: ReadonlyArray<Statement>, isDeclarationFile?: boolean, referencedFiles?: SourceFile["referencedFiles"], typeReferences?: SourceFile["typeReferenceDirectives"], hasNoDefaultLib?: boolean, libReferences?: SourceFile["libReferenceDirectives"]): SourceFile;
/**
* Creates a shallow, memberwise clone of a node for mutation.
*/
@@ -3826,8 +3917,8 @@ declare namespace ts {
function createCommaList(elements: ReadonlyArray<Expression>): CommaListExpression;
function updateCommaList(node: CommaListExpression, elements: ReadonlyArray<Expression>): CommaListExpression;
function createBundle(sourceFiles: ReadonlyArray<SourceFile>, prepends?: ReadonlyArray<UnparsedSource | InputFiles>): Bundle;
function createUnparsedSourceFile(text: string): UnparsedSource;
function createInputFiles(javascript: string, declaration: string): InputFiles;
function createUnparsedSourceFile(text: string, map?: string): UnparsedSource;
function createInputFiles(javascript: string, declaration: string, javascriptMapText?: string, declarationMapText?: string): InputFiles;
function updateBundle(node: Bundle, sourceFiles: ReadonlyArray<SourceFile>, prepends?: ReadonlyArray<UnparsedSource>): Bundle;
function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray<Statement>): CallExpression;
function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray<Statement>, param: ParameterDeclaration, paramValue: Expression): CallExpression;
@@ -4048,6 +4139,10 @@ declare namespace ts {
* @returns A 'Program' object.
*/
function createProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): Program;
/**
* Returns the target config filename of a project reference
*/
function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined;
}
declare namespace ts {
interface EmitOutput {
@@ -4293,76 +4388,179 @@ declare namespace ts {
function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
}
declare namespace ts {
function parseCommandLine(commandLine: ReadonlyArray<string>, readFile?: (path: string) => string | undefined): ParsedCommandLine;
type DiagnosticReporter = (diagnostic: Diagnostic) => void;
/**
* Reports config file diagnostics
* Branded string for keeping track of when we've turned an ambiguous path
* specified like "./blah" to an absolute path to an actual
* tsconfig file, e.g. "/root/blah/tsconfig.json"
*/
interface ConfigFileDiagnosticsReporter {
type ResolvedConfigFileName = string & {
_isResolvedConfigFileName: never;
};
interface BuildHost {
verbose(diag: DiagnosticMessage, ...args: string[]): void;
error(diag: DiagnosticMessage, ...args: string[]): void;
errorDiagnostic(diag: Diagnostic): void;
message(diag: DiagnosticMessage, ...args: string[]): void;
}
/**
* A BuildContext tracks what's going on during the course of a build.
*
* Callers may invoke any number of build requests within the same context;
* until the context is reset, each project will only be built at most once.
*
* Example: In a standard setup where project B depends on project A, and both are out of date,
* a failed build of A will result in A remaining out of date. When we try to build
* B, we should immediately bail instead of recomputing A's up-to-date status again.
*
* This also matters for performing fast (i.e. fake) downstream builds of projects
* when their upstream .d.ts files haven't changed content (but have newer timestamps)
*/
interface BuildContext {
options: BuildOptions;
/**
* Reports unrecoverable error when parsing config file
* Map from output file name to its pre-build timestamp
*/
onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
unchangedOutputs: FileMap<Date>;
/**
* Map from config file name to up-to-date status
*/
projectStatus: FileMap<UpToDateStatus>;
invalidatedProjects: FileMap<true>;
queuedProjects: FileMap<true>;
missingRoots: Map<true>;
}
/**
* Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
*/
interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
getCurrentDirectory(): string;
type Mapper = ReturnType<typeof createDependencyMapper>;
interface DependencyGraph {
buildQueue: ResolvedConfigFileName[];
dependencyMap: Mapper;
}
/**
* Reads the config file, reports errors if any and exits if the config file cannot be found
*/
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined;
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
config?: any;
error?: Diagnostic;
interface BuildOptions {
dry: boolean;
force: boolean;
verbose: boolean;
}
enum UpToDateStatusType {
Unbuildable = 0,
UpToDate = 1,
/**
* The project appears out of date because its upstream inputs are newer than its outputs,
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
* This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
*/
UpToDateWithUpstreamTypes = 2,
OutputMissing = 3,
OutOfDateWithSelf = 4,
OutOfDateWithUpstream = 5,
UpstreamOutOfDate = 6,
UpstreamBlocked = 7,
/**
* Projects with no outputs (i.e. "solution" files)
*/
ContainerOnly = 8
}
type UpToDateStatus = Status.Unbuildable | Status.UpToDate | Status.OutputMissing | Status.OutOfDateWithSelf | Status.OutOfDateWithUpstream | Status.UpstreamOutOfDate | Status.UpstreamBlocked | Status.ContainerOnly;
namespace Status {
/**
* The project can't be built at all in its current state. For example,
* its config file cannot be parsed, or it has a syntax error or missing file
*/
interface Unbuildable {
type: UpToDateStatusType.Unbuildable;
reason: string;
}
/**
* This project doesn't have any outputs, so "is it up to date" is a meaningless question.
*/
interface ContainerOnly {
type: UpToDateStatusType.ContainerOnly;
}
/**
* The project is up to date with respect to its inputs.
* We track what the newest input file is.
*/
interface UpToDate {
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
newestInputFileTime: Date;
newestInputFileName: string;
newestDeclarationFileContentChangedTime: Date;
newestOutputFileTime: Date;
newestOutputFileName: string;
oldestOutputFileName: string;
}
/**
* One or more of the outputs of the project does not exist.
*/
interface OutputMissing {
type: UpToDateStatusType.OutputMissing;
/**
* The name of the first output file that didn't exist
*/
missingOutputFileName: string;
}
/**
* One or more of the project's outputs is older than its newest input.
*/
interface OutOfDateWithSelf {
type: UpToDateStatusType.OutOfDateWithSelf;
outOfDateOutputFileName: string;
newerInputFileName: string;
}
/**
* This project depends on an out-of-date project, so shouldn't be built yet
*/
interface UpstreamOutOfDate {
type: UpToDateStatusType.UpstreamOutOfDate;
upstreamProjectName: string;
}
/**
* This project depends an upstream project with build errors
*/
interface UpstreamBlocked {
type: UpToDateStatusType.UpstreamBlocked;
upstreamProjectName: string;
}
/**
* One or more of the project's outputs is older than the newest output of
* an upstream project.
*/
interface OutOfDateWithUpstream {
type: UpToDateStatusType.OutOfDateWithUpstream;
outOfDateOutputFileName: string;
newerProjectName: string;
}
}
interface FileMap<T> {
setValue(fileName: string, value: T): void;
getValue(fileName: string): T | never;
getValueOrUndefined(fileName: string): T | undefined;
hasKey(fileName: string): boolean;
removeKey(fileName: string): void;
getKeys(): string[];
}
function createDependencyMapper(): {
addReference: (childConfigFileName: ResolvedConfigFileName, parentConfigFileName: ResolvedConfigFileName) => void;
getReferencesTo: (parentConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
getReferencesOf: (childConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
};
function createBuildContext(options: BuildOptions): BuildContext;
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
/**
* Parse the text of the tsconfig.json file
* @param fileName The path to the config file
* @param jsonText The text of the config file
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
* can dynamically add/remove other projects based on changes on the rootNames' references
*/
function parseConfigFileTextToJson(fileName: string, jsonText: string): {
config?: any;
error?: Diagnostic;
};
/**
* Read tsconfig.json file
* @param fileName The path to the config file
*/
function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
/**
* Convert the json syntax tree into the json value
*/
function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
/**
* Parse the contents of a config file (tsconfig.json).
* @param jsonNode The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: CompilerOptions;
errors: Diagnostic[];
};
function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
options: TypeAcquisition;
errors: Diagnostic[];
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
buildAllProjects: () => number;
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
resetBuildContext: (opts?: BuildOptions) => void;
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
invalidateProject: (configFileName: string) => void;
buildInvalidatedProjects: () => void;
buildDependentInvalidatedProjects: () => void;
resolveProjectName: (name: string) => ResolvedConfigFileName | undefined;
startWatching: () => void;
};
}
declare namespace ts {
@@ -4467,6 +4665,7 @@ declare namespace ts {
interface PreProcessedFileInfo {
referencedFiles: FileReference[];
typeReferenceDirectives: FileReference[];
libReferenceDirectives: FileReference[];
importedFiles: FileReference[];
ambientExternalModules?: string[];
isLibFile: boolean;
@@ -4651,6 +4850,7 @@ declare namespace ts {
* There will be more than one if this is the result of merging.
*/
spans: TextSpan[];
nameSpan: TextSpan | undefined;
/** Present if non-empty */
childItems?: NavigationTree[];
}
@@ -5326,3 +5526,4 @@ declare namespace ts {
*/
function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>;
}
//# sourceMappingURL=typescriptservices.d.ts.map
+9457 -7925
View File
File diff suppressed because it is too large Load Diff
+72484 -6420
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -13,6 +13,7 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
"use strict";
if (process.argv.length < 3) {
process.exit(1);
@@ -25,3 +26,4 @@ try {
}
catch (_a) { }
process.exit(0);
//# sourceMappingURL=watchGuard.js.map
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "命名空间声明不能位于与之合并的类或函数前",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "只允许在命名空间或模块中使用命名空间声明。",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "命名空间样式导入不能调用或构造,并将在运行时导致失败。",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "只允许在函数或构造函数实现中使用参数初始化表达式。",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "不能使用 rest 参数声明参数属性。",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "只允许在构造函数实现中使用参数属性。",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "需要二进制数字。",
"Binding_element_0_implicitly_has_an_1_type_7031": "绑定元素“{0}”隐式具有“{1}”类型。",
"Block_scoped_variable_0_used_before_its_declaration_2448": "声明之前已使用的块范围变量“{0}”。",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "调用修饰器表达式",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "缺少返回类型批注的调用签名隐式具有返回类型 \"any\"。",
"Call_target_does_not_contain_any_signatures_2346": "调用目标不包含任何签名。",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "无法在指定目录找到 tsconfig.json 文件:“{0}”。",
"Cannot_find_global_type_0_2318": "找不到全局类型“{0}”。",
"Cannot_find_global_value_0_2468": "找不到全局值“{0}”。",
"Cannot_find_lib_definition_for_0_2726": "找不到“{0}”的 LIB 定义。",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "找不到“{0}”的 LIB 定义。你是指“{1}”?",
"Cannot_find_module_0_2307": "找不到模块“{0}”。",
"Cannot_find_name_0_2304": "找不到名称“{0}”。",
"Cannot_find_name_0_Did_you_mean_1_2552": "找不到名称“{0}”。你是否指的是“{1}”?",
@@ -302,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "不能向多个同名的 get/set 访问器应用修饰器。",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "模块的默认导出具有或正在使用专用名称“{0}”。",
"Delete_all_unused_declarations_95024": "删除未使用的所有声明",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[已弃用] 请改用 \"--jsxFactory\"。已 \"react\" JSX 发出设为目标时,请指定要为 createElement 调用的对象",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[已弃用] 请改用 \"--outFile\"。连接并发出到单个文件的输出",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[已弃用] 请改用 \"--skipLibCheck\"。请跳过默认库声明文件的类型检查。",
@@ -352,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "启用类中属性初始化的严格检查。",
"Enable_strict_null_checks_6113": "启用严格的 NULL 检查。",
"Enable_tracing_of_the_name_resolution_process_6085": "启用名称解析过程的跟踪。",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "通过为所有导入创建命名空间对象来启用 CommonJS 和 ES 模块之间的发出互操作性。表示 \"allowSyntheticDefaultImports\"。",
"Enables_experimental_support_for_ES7_async_functions_6068": "对 ES7 异步函数启用实验支持。",
"Enables_experimental_support_for_ES7_decorators_6065": "对 ES7 修饰器启用实验支持。",
@@ -613,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "无法在不指定选项“{1}”的情况下指定选项“{0}”。",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "无法在不指定选项 {1} 或选项 {2} 的情况下指定选项 {0}。",
"Option_0_should_have_array_of_strings_as_a_value_6103": "选项“{0}”应将字符串数组作为一个值。",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "选项 \"isolatedModules\" 只可在提供了选项 \"--module\" 或者选项 \"target\" 是 \"ES2015\" 或更高版本时使用。",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "在未指定 \"--baseUrl\" 选项的情况下,无法使用选项 \"paths\"。",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "选项 \"project\" 在命令行上不能与源文件混合使用。",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "没有 \"node\" 模块解析策略的情况下,无法指定选项 \"-resolveJsonModule\"。",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "选项:",
"Output_directory_for_generated_declaration_files_6166": "已生成声明文件的输出目录。",
"Output_file_0_from_project_1_does_not_exist_6309": "来自项目“{1}”的输出文件“{0}”不存在",
@@ -664,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "属于编译一部分的已生成文件的打印名称。",
"Print_the_compiler_s_version_6019": "打印编译器的版本。",
"Print_this_message_6017": "打印此消息。",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "项目引用不能形成环形图。检测到循环: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "要引用的项目",
"Property_0_does_not_exist_on_const_enum_1_2479": "\"const\" 枚举“{1}”上不存在属性“{0}”。",
"Property_0_does_not_exist_on_type_1_2339": "类型“{1}”上不存在属性“{0}”。",
@@ -778,8 +797,11 @@
"Show_all_compiler_options_6169": "显示所有编译器选项。",
"Show_diagnostic_information_6149": "显示诊断信息。",
"Show_verbose_diagnostic_information_6150": "显示详细的诊断信息。",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "签名“{0}”必须为类型谓词。",
"Skip_type_checking_of_declaration_files_6012": "跳过声明文件的类型检查。",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "源映射选项",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "指定的重载签名不可分配给任何非专用化签名。",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "动态导入的说明符不能是扩散元素。",
@@ -941,6 +963,7 @@
"Unexpected_end_of_text_1126": "文本意外结束。",
"Unexpected_token_1012": "意外的标记。",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "意外的标记。应为构造函数、方法、访问器或属性。",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "意外的标记。类型参数名不应包含大括号。",
"Unexpected_token_expected_1179": "意外标记。应为 \"{\"。",
"Unknown_compiler_option_0_5023": "未知的编译器选项“{0}”。",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "未知的 \"excludes\" 选项。你的意思是 \"exclude\"?",
@@ -954,6 +977,7 @@
"Unterminated_template_literal_1160": "未终止的模板文本。",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "非类型化函数调用不能接受类型参数。",
"Unused_label_7028": "未使用的标签。",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "使用综合的“默认”成员。",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "仅 ECMAScript 5 和更高版本支持在 \"for...of\" 语句中使用字符串。",
"VERSION_6036": "版本",
@@ -1014,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "\"const\" 枚举成员初始化表达式的求值结果为不允许使用的值 \"NaN\"。",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "\"const\" 枚举仅可在属性、索引访问表达式、导入声明的右侧、导出分配或类型查询中使用。",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "在严格模式下,无法对标识符调用 \"delete\"。",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "\"enum declarations\" 只能在 .ts 文件中使用。",
"export_can_only_be_used_in_a_ts_file_8003": "\"export=\" 只能在 .ts 文件中使用。",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "\"export\" 修饰符不可用于环境模块和模块扩大,因为它们始终可见。",
@@ -49,6 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "命名空間宣告的位置不得先於其要合併的類別或函式。",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "只有命名空間或模組才允許命名空間宣告。",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "命名空間樣式的匯入無法加以呼叫或建構,而且會導致執行階段失敗。",
"A_non_dry_build_would_build_project_0_6357": "A non-dry build would build project '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "A non-dry build would delete the following files: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "只有函式或建構函式實作才可使用參數初始設定式。",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "無法使用剩餘參數宣告參數屬性。",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "建構函式實作中只可有一個參數屬性。",
@@ -189,6 +191,9 @@
"Binary_digit_expected_1177": "必須是二進位數字。",
"Binding_element_0_implicitly_has_an_1_type_7031": "繫結元素 '{0}' 隱含擁有 '{1}' 類型。",
"Block_scoped_variable_0_used_before_its_declaration_2448": "已在其宣告之前使用區塊範圍變數 '{0}'。",
"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368": "Build all projects, including those that appear to be up to date",
"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": "Build one or more projects and their dependencies, if out of date",
"Building_project_0_6358": "Building project '{0}'...",
"Call_decorator_expression_90028": "呼叫裝飾項目運算式",
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "缺少傳回型別註解的呼叫簽章隱含了 'any' 傳回型別。",
"Call_target_does_not_contain_any_signatures_2346": "呼叫目標未包含任何特徵標記。",
@@ -208,6 +213,8 @@
"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": "在指定的目錄 '{0}' 中找不到 tsconfig.json 檔案。",
"Cannot_find_global_type_0_2318": "找不到全域類型 '{0}'。",
"Cannot_find_global_value_0_2468": "找不到全域值 '{0}'。",
"Cannot_find_lib_definition_for_0_2726": "找不到 '{0}' 的 lib 定義。",
"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "找不到 '{0}' 的 lib 定義。您是指 '{1}' 嗎?",
"Cannot_find_module_0_2307": "找不到模組 '{0}'。",
"Cannot_find_name_0_2304": "找不到名稱 '{0}'。",
"Cannot_find_name_0_Did_you_mean_1_2552": "找不到名稱 '{0}'。您指的是 '{1}' 嗎?",
@@ -302,6 +309,7 @@
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "無法將裝飾項目套用至多個同名的 get/set 存取子。",
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "模組的預設匯出具有或正在使用私用名稱 '{0}'。",
"Delete_all_unused_declarations_95024": "刪除所有未使用的宣告",
"Delete_the_outputs_of_all_projects_6365": "Delete the outputs of all projects",
"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[即將淘汰] 請改用 '--jsxFactory'。當目標為 'react' JSX 發出時,為 createElement 指定所叫用的物件",
"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[即將淘汰] 請改用 '--outFile'。 串連輸出並將其發出到單一檔案",
"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[即將淘汰] 請改用 '--skipLibCheck'。跳過預設程式庫宣告檔案的類型檢查。",
@@ -352,6 +360,7 @@
"Enable_strict_checking_of_property_initialization_in_classes_6187": "啟用類別中屬性初始化的 strict 檢查。",
"Enable_strict_null_checks_6113": "啟用嚴格 null 檢查。",
"Enable_tracing_of_the_name_resolution_process_6085": "啟用名稱解析流程的追蹤。",
"Enable_verbose_logging_6366": "Enable verbose logging",
"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "透過為所有匯入建立命名空間物件,讓 CommonJS 和 ES 模組之間的產出有互通性。意指 'allowSyntheticDefaultImports'。",
"Enables_experimental_support_for_ES7_async_functions_6068": "啟用 ES7 非同步函式的實驗支援。",
"Enables_experimental_support_for_ES7_decorators_6065": "啟用 ES7 裝飾項目的實驗支援。",
@@ -613,10 +622,12 @@
"Option_0_cannot_be_specified_without_specifying_option_1_5052": "必須指定選項 '{1}' 才可指定選項 '{0}'。",
"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": "指定選項 '{0}' 時,必須指定選項 '{1}' 或選項 '{2}'。",
"Option_0_should_have_array_of_strings_as_a_value_6103": "選項 '{0}' 應以字串陣列作為值。",
"Option_build_must_be_the_first_command_line_argument_6369": "Option '--build' must be the first command line argument.",
"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "只有在提供選項 '--module' 或是 'target' 為 'ES2015' 或更高項目時,才可使用選項 'isolatedModules'。",
"Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "必須指定 '--baseUrl' 選項才能使用選項 'paths'。",
"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "在命令列上,'project' 選項不得與原始程式檔並用。",
"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "指定選項 '-resolveJsonModule' 時,不可沒有 'node' 模組解析策略。",
"Options_0_and_1_cannot_be_combined_6370": "Options '{0}' and '{1}' cannot be combined.",
"Options_Colon_6027": "選項:",
"Output_directory_for_generated_declaration_files_6166": "所產生之宣告檔案的輸出目錄。",
"Output_file_0_from_project_1_does_not_exist_6309": "沒有來自專案 '{1}' 的輸出檔 '{0}'",
@@ -664,7 +675,15 @@
"Print_names_of_generated_files_part_of_the_compilation_6154": "列印編譯時所產生之檔案部分的名稱。",
"Print_the_compiler_s_version_6019": "列印編譯器的版本。",
"Print_this_message_6017": "列印這則訊息。",
"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Project '{0}' can't be built because its dependency '{1}' has errors",
"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "Project '{0}' is out of date because its dependency '{1}' is out of date",
"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'",
"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "Project '{0}' is out of date because output file '{1}' does not exist",
"Project_0_is_up_to_date_6361": "Project '{0}' is up to date",
"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'",
"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "Project '{0}' is up to date with .d.ts files from its dependencies",
"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "專案參考不會形成循環圖。但偵測到循環: {0}",
"Projects_in_this_build_Colon_0_6355": "Projects in this build: {0}",
"Projects_to_reference_6300": "專案至參考",
"Property_0_does_not_exist_on_const_enum_1_2479": "'const' 列舉 '{1}' 上並沒有屬性 '{0}'。",
"Property_0_does_not_exist_on_type_1_2339": "類型 '{1}' 沒有屬性 '{0}'。",
@@ -778,8 +797,11 @@
"Show_all_compiler_options_6169": "顯示所有的編譯器選項。",
"Show_diagnostic_information_6149": "顯示診斷資訊。",
"Show_verbose_diagnostic_information_6150": "顯示詳細診斷資訊。",
"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": "Show what would be built (or deleted, if specified with '--clean')",
"Signature_0_must_be_a_type_predicate_1224": "簽章 '{0}' 必須是型別述詞。",
"Skip_type_checking_of_declaration_files_6012": "跳過宣告檔案的類型檢查。",
"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": "Skipping build of project '{0}' because its dependency '{1}' has errors",
"Skipping_clean_because_not_all_projects_could_be_located_6371": "Skipping clean because not all projects could be located",
"Source_Map_Options_6175": "來源對應選項",
"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "特製化的多載簽章不可指派給任何非特製化的簽章。",
"Specifier_of_dynamic_import_cannot_be_spread_element_1325": "動態匯入的指定名稱不能是展開元素。",
@@ -941,6 +963,7 @@
"Unexpected_end_of_text_1126": "未預期的文字結尾。",
"Unexpected_token_1012": "未預期的語彙基元。",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "未預期的語彙基元。必須是建構函式、方法、存取子或屬性。",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "權杖錯誤。類型參數名稱不應有大括號。",
"Unexpected_token_expected_1179": "未預期的語彙基元。必須是 '{'。",
"Unknown_compiler_option_0_5023": "不明的編譯器選項 '{0}'。",
"Unknown_option_excludes_Did_you_mean_exclude_6114": "選項 'excludes' 未知。您是指 'exclude' 嗎?",
@@ -954,6 +977,7 @@
"Unterminated_template_literal_1160": "未結束的樣板常值。",
"Untyped_function_calls_may_not_accept_type_arguments_2347": "不具類型的函式呼叫無法接受類型引數。",
"Unused_label_7028": "未使用的標籤。",
"Updating_output_timestamps_of_project_0_6359": "Updating output timestamps of project '{0}'...",
"Use_synthetic_default_member_95016": "使用綜合 'default' 成員。",
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "只有在 ECMAScript 5 及更高版本中,才可在 'for...of' 陳述式中使用字串。",
"VERSION_6036": "版本",
@@ -1014,6 +1038,7 @@
"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' 列舉成員初始設定式已評估為不允許的值 'NaN'。",
"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 列舉只可用於屬性或索引存取運算式中,或用於匯入宣告、匯出指派或類型查詢的右側。",
"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "不得在 strict 模式中對識別碼呼叫 'delete'。",
"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360": "delete this - Project '{0}' is up to date because it was previously built",
"enum_declarations_can_only_be_used_in_a_ts_file_8015": "「列舉宣告」只可用於 .ts 檔案中。",
"export_can_only_be_used_in_a_ts_file_8003": "'export=' 只可用於 .ts 檔案中。",
"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "'export' 修飾詞無法套用至環境模組或模組增強指定,原因是這二者永遠會顯示。",
+627 -164
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -59,6 +59,7 @@
"chalk": "latest",
"convert-source-map": "latest",
"del": "latest",
"fs-extra": "^6.0.1",
"gulp": "3.X",
"gulp-clone": "latest",
"gulp-concat": "latest",
@@ -75,6 +76,7 @@
"mocha": "latest",
"mocha-fivemat-progress-reporter": "latest",
"q": "latest",
"remove-internal": "^2.9.2",
"run-sequence": "latest",
"sorcery": "latest",
"source-map-support": "latest",
+3 -10
View File
@@ -4,26 +4,19 @@ const { join } = require("path");
/**
* Find the size of a directory recursively.
* Symbolic links are counted once (same inode).
* Symbolic links can cause a loop.
* @param {string} root
* @param {Set} seen
* @returns {number} bytes
*/
function getDirSize(root, seen = new Set()) {
function getDirSize(root) {
const stats = lstatSync(root);
if (seen.has(stats.ino)) {
return 0;
}
seen.add(stats.ino);
if (!stats.isDirectory()) {
return stats.size;
}
return readdirSync(root)
.map(file => getDirSize(join(root, file), seen))
.map(file => getDirSize(join(root, file)))
.reduce((acc, num) => acc + num, 0);
}
+13 -6
View File
@@ -46,7 +46,7 @@ class DeclarationsWalker {
if (!s) {
return;
}
if (s.name === "Array") {
if (s.name === "Array" || s.name === "ReadOnlyArray") {
// we should process type argument instead
return this.processType((<any>type).typeArguments[0]);
}
@@ -55,7 +55,7 @@ class DeclarationsWalker {
if (declarations) {
for (const decl of declarations) {
const sourceFile = decl.getSourceFile();
if (sourceFile === this.protocolFile || path.basename(sourceFile.fileName) === "lib.d.ts") {
if (sourceFile === this.protocolFile || /lib(\..+)?\.d.ts/.test(path.basename(sourceFile.fileName))) {
return;
}
if (decl.kind === ts.SyntaxKind.EnumDeclaration && !isStringEnum(decl as ts.EnumDeclaration)) {
@@ -121,23 +121,30 @@ class DeclarationsWalker {
}
function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptServicesDts: string) {
const options = { target: ts.ScriptTarget.ES5, declaration: true, noResolve: true, types: <string[]>[], stripInternal: true };
const options = { target: ts.ScriptTarget.ES5, declaration: true, noResolve: false, types: <string[]>[], stripInternal: true };
/**
* 1st pass - generate a program from protocol.ts and typescriptservices.d.ts and emit core version of protocol.d.ts with all internal members stripped
* @return text of protocol.d.t.s
*/
function getInitialDtsFileForProtocol() {
const program = ts.createProgram([protocolTs, typeScriptServicesDts], options);
const program = ts.createProgram([protocolTs, typeScriptServicesDts, path.join(typeScriptServicesDts, "../lib.es5.d.ts")], options);
let protocolDts: string | undefined;
program.emit(program.getSourceFile(protocolTs), (file, content) => {
const emitResult = program.emit(program.getSourceFile(protocolTs), (file, content) => {
if (endsWith(file, ".d.ts")) {
protocolDts = content;
}
});
if (protocolDts === undefined) {
throw new Error(`Declaration file for protocol.ts is not generated`)
const diagHost: ts.FormatDiagnosticsHost = {
getCanonicalFileName: function (f) { return f; },
getCurrentDirectory: function() { return '.'; },
getNewLine: function() { return "\r\n"; }
}
const diags = emitResult.diagnostics.map(d => ts.formatDiagnostic(d, diagHost)).join("\r\n");
throw new Error(`Declaration file for protocol.ts is not generated:\r\n${diags}`);
}
return protocolDts;
}
+23 -16
View File
@@ -1,3 +1,6 @@
import path = require("path");
import fs = require("fs");
interface DiagnosticDetails {
category: string;
code: number;
@@ -5,32 +8,36 @@ interface DiagnosticDetails {
isEarly?: boolean;
}
type InputDiagnosticMessageTable = ts.Map<DiagnosticDetails>;
type InputDiagnosticMessageTable = Map<string, DiagnosticDetails>;
function main(): void {
const sys = ts.sys;
if (sys.args.length < 1) {
sys.write("Usage:" + sys.newLine);
sys.write("\tnode processDiagnosticMessages.js <diagnostic-json-input-file>" + sys.newLine);
if (process.argv.length < 3) {
console.log("Usage:");
console.log("\tnode processDiagnosticMessages.js <diagnostic-json-input-file>");
return;
}
function writeFile(fileName: string, contents: string) {
const inputDirectory = ts.getDirectoryPath(inputFilePath);
const fileOutputPath = ts.combinePaths(inputDirectory, fileName);
sys.writeFile(fileOutputPath, contents);
fs.writeFile(path.join(path.dirname(inputFilePath), fileName), contents, { encoding: "utf-8" }, err => {
if (err) throw err;
})
}
const inputFilePath = sys.args[0].replace(/\\/g, "/");
const inputStr = sys.readFile(inputFilePath)!;
const inputFilePath = process.argv[2].replace(/\\/g, "/");
console.log(`Reading diagnostics from ${inputFilePath}`);
const inputStr = fs.readFileSync(inputFilePath, { encoding: "utf-8" });
const diagnosticMessagesJson: { [key: string]: DiagnosticDetails } = JSON.parse(inputStr);
const diagnosticMessages: InputDiagnosticMessageTable = ts.createMapFromTemplate(diagnosticMessagesJson);
const diagnosticMessages: InputDiagnosticMessageTable = new Map();
for (const key in diagnosticMessagesJson) {
if (Object.hasOwnProperty.call(diagnosticMessagesJson, key)) {
diagnosticMessages.set(key, diagnosticMessagesJson[key]);
}
}
const outputFilesDir = ts.getDirectoryPath(inputFilePath);
const thisFilePathRel = ts.getRelativePathToDirectoryOrUrl(outputFilesDir, sys.getExecutingFilePath(),
sys.getCurrentDirectory(), ts.createGetCanonicalFileName(sys.useCaseSensitiveFileNames), /* isAbsolutePathAnUrl */ false);
const outputFilesDir = path.dirname(inputFilePath);
const thisFilePathRel = path.relative(process.cwd(), outputFilesDir);
const infoFileOutput = buildInfoFileOutput(diagnosticMessages, "./diagnosticInformationMap.generated.ts", thisFilePathRel);
checkForUniqueCodes(diagnosticMessages);
@@ -53,7 +60,7 @@ function checkForUniqueCodes(diagnosticTable: InputDiagnosticMessageTable) {
function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, inputFilePathRel: string, thisFilePathRel: string): string {
let result =
"// <auto-generated />\r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel + "'\r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel.replace(/\\/g, '/') + "'\r\n" +
"/* @internal */\r\n" +
"namespace ts {\r\n" +
" function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}): DiagnosticMessage {\r\n" +
@@ -112,4 +119,4 @@ function convertPropertyName(origName: string): string {
return result;
}
main();
main();
@@ -1,20 +1,15 @@
{
"compilerOptions": {
"removeComments": false,
"outFile": "processDiagnosticMessages.js",
"target": "es5",
"declaration": false,
"lib": [
"es6",
"scripthost"
]
],
"types": ["node"]
},
"files": [
"../src/compiler/types.ts",
"../src/compiler/performance.ts",
"../src/compiler/core.ts",
"../src/compiler/sys.ts",
"processDiagnosticMessages.ts"
]
}
+100
View File
@@ -0,0 +1,100 @@
/// <reference types="node" />
import childProcess = require('child_process');
import fs = require('fs-extra');
import path = require('path');
import removeInternal = require('remove-internal');
import glob = require('glob');
const root = path.join(__dirname, "..");
const source = path.join(root, "built/local");
const dest = path.join(root, "lib");
const copyright = fs.readFileSync(path.join(__dirname, "../CopyrightNotice.txt"), "utf-8");
async function produceLKG() {
console.log(`Building LKG from ${source} to ${dest}`);
await copyLibFiles();
await copyLocalizedDiagnostics();
await buildProtocol();
await copyScriptOutputs();
await buildTsc();
await copyDeclarationOutputs();
await writeGitAttributes();
}
async function copyLibFiles() {
await copyFilesWithGlob("lib?(.*).d.ts");
}
async function copyLocalizedDiagnostics() {
const dir = await fs.readdir(source);
for (const d of dir) {
const fileName = path.join(source, d);
if (fs.statSync(fileName).isDirectory()) {
if (d === 'tslint') continue;
await fs.copy(fileName, path.join(dest, d));
}
}
}
async function buildProtocol() {
const protocolScript = path.join(__dirname, "buildProtocol.js");
if (!fs.existsSync(protocolScript)) {
throw new Error(`Expected protocol script ${protocolScript} to exist`);
}
const protocolInput = path.join(__dirname, "../src/server/protocol.ts");
const protocolServices = path.join(source, "typescriptServices.d.ts");
const protocolOutput = path.join(dest, "protocol.d.ts");
console.log(`Building ${protocolOutput}...`);
await exec(protocolScript, [protocolInput, protocolServices, protocolOutput]);
}
async function copyScriptOutputs() {
await copyWithCopyright("tsserver.js");
await copyWithCopyright("tsc.js");
await copyWithCopyright("watchGuard.js");
await copyWithCopyright("cancellationToken.js");
await copyWithCopyright("typingsInstaller.js");
}
async function buildTsc() {
await exec(path.join(source, "tsc.js"), [`-b -f ${path.join(root, "src/tsc/tsconfig.release.json")}`]);
}
async function copyDeclarationOutputs() {
await copyWithCopyright("typescript.d.ts");
await copyWithCopyright("typescriptServices.d.ts");
await copyWithCopyright("tsserverlibrary.d.ts");
}
async function writeGitAttributes() {
await fs.writeFile(path.join(dest, ".gitattributes"), `* text eol=lf`, "utf-8");
}
async function copyWithCopyright(fileName: string) {
const content = await fs.readFile(path.join(source, fileName), "utf-8");
await fs.writeFile(path.join(dest, fileName), copyright + "\n" + content);
}
async function copyFromBuiltLocal(fileName: string) {
await fs.copy(path.join(source, fileName), path.join(dest, fileName));
}
async function copyFilesWithGlob(pattern: string) {
const files = glob.sync(path.join(source, pattern)).map(f => path.basename(f));
for (const f of files) {
await copyFromBuiltLocal(f);
}
console.log(`Copied ${files.length} files matching pattern ${pattern}`);
}
async function exec(path: string, args: string[] = []) {
const cmdLine = ["node", path, ...args].join(" ");
console.log(cmdLine);
childProcess.execSync(cmdLine);
}
process.on("unhandledRejection", err => { throw err; });
produceLKG().then(() => console.log("Done"), err => { throw err; });
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"removeComments": false,
"target": "es6",
"module": "commonjs",
"declaration": false,
"lib": [
"es6",
"scripthost"
],
"types": ["node"]
},
"files": [
"produceLKG.ts",
"buildProtocol.ts",
"processDiagnosticMessages.ts",
"generateLocalizedDiagnosticMessages.ts",
"configurePrerelease.ts"
]
}
+7 -1
View File
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"lib": ["es6"],
"sourceMap": false,
"declaration": false,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
@@ -8,6 +10,10 @@
"noUnusedParameters": true,
"strictNullChecks": true,
"module": "commonjs",
"outDir": "../../built/local/tslint"
"outDir": "../../built/local/tslint",
"baseUrl": "../..",
"paths": {
"typescript": ["lib/typescript.d.ts"]
}
}
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
+2856
View File
File diff suppressed because it is too large Load Diff
+109
View File
@@ -0,0 +1,109 @@
import Mocha = require("../../");
export = common;
declare function common(suites: Mocha.Suite[], context: Mocha.MochaGlobals, mocha: Mocha): common.CommonFunctions;
declare namespace common {
export interface CommonFunctions {
/**
* This is only present if flag --delay is passed into Mocha. It triggers
* root suite execution.
*/
runWithSuite(suite: Mocha.Suite): () => void;
/**
* Execute before running tests.
*/
before(fn?: Mocha.Func | Mocha.AsyncFunc): void;
/**
* Execute before running tests.
*/
before(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
/**
* Execute after running tests.
*/
after(fn?: Mocha.Func | Mocha.AsyncFunc): void;
/**
* Execute after running tests.
*/
after(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
/**
* Execute before each test case.
*/
beforeEach(fn?: Mocha.Func | Mocha.AsyncFunc): void;
/**
* Execute before each test case.
*/
beforeEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
/**
* Execute after each test case.
*/
afterEach(fn?: Mocha.Func | Mocha.AsyncFunc): void;
/**
* Execute after each test case.
*/
afterEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
suite: SuiteFunctions;
test: TestFunctions;
}
export interface CreateOptions {
/** Title of suite */
title: string;
/** Suite function */
fn?: (this: Mocha.Suite) => void;
/** Is suite pending? */
pending?: boolean;
/** Filepath where this Suite resides */
file?: string;
/** Is suite exclusive? */
isOnly?: boolean;
}
export interface SuiteFunctions {
/**
* Create an exclusive Suite; convenience function
*/
only(opts: CreateOptions): Mocha.Suite;
/**
* Create a Suite, but skip it; convenience function
*/
skip(opts: CreateOptions): Mocha.Suite;
/**
* Creates a suite.
*/
create(opts: CreateOptions): Mocha.Suite;
}
export interface TestFunctions {
/**
* Exclusive test-case.
*/
only(mocha: Mocha, test: Mocha.Test): Mocha.Test;
/**
* Pending test case.
*/
skip(title: string): void;
/**
* Number of retry attempts
*/
retries(n: number): void;
}
}
+17
View File
@@ -0,0 +1,17 @@
export = milliseconds;
/**
* Parse the given `str` and return milliseconds.
*
* @see {@link https://mochajs.org/api/module-milliseconds.html}
* @see {@link https://mochajs.org/api/module-milliseconds.html#~parse}
*/
declare function milliseconds(val: string): number;
/**
* Format for `ms`.
*
* @see {@link https://mochajs.org/api/module-milliseconds.html}
* @see {@link https://mochajs.org/api/module-milliseconds.html#~format}
*/
declare function milliseconds(val: number): string;
+5
View File
@@ -0,0 +1,5 @@
{
"name": "@types/mocha",
"private": true,
"version": "5.2.1"
}
@@ -1,6 +1,10 @@
{
"extends": "../../tsconfig-base",
"extends": "../tsconfig-base",
"compilerOptions": {
"outDir": "../../built/local/",
"composite": false,
"declaration": false,
"declarationMap": false,
"removeComments": true,
"module": "commonjs",
"types": [
+13 -8
View File
@@ -2305,18 +2305,22 @@ namespace ts {
}
function setCommonJsModuleIndicator(node: Node) {
if (file.externalModuleIndicator) {
return false;
}
if (!file.commonJsModuleIndicator) {
file.commonJsModuleIndicator = node;
if (!file.externalModuleIndicator) {
bindSourceFileAsExternalModule();
}
bindSourceFileAsExternalModule();
}
return true;
}
function bindExportsPropertyAssignment(node: BinaryExpression) {
// When we create a property via 'exports.foo = bar', the 'exports.foo' property access
// expression is the declaration
setCommonJsModuleIndicator(node);
if (!setCommonJsModuleIndicator(node)) {
return;
}
const lhs = node.left as PropertyAccessEntityNameExpression;
const symbol = forEachIdentifierInEntityName(lhs.expression, /*parent*/ undefined, (id, symbol) => {
if (symbol) {
@@ -2337,15 +2341,15 @@ namespace ts {
// is still pointing to 'module.exports'.
// We do not want to consider this as 'export=' since a module can have only one of these.
// Similarly we do not want to treat 'module.exports = exports' as an 'export='.
if (!setCommonJsModuleIndicator(node)) {
return;
}
const assignedExpression = getRightMostAssignedExpression(node.right);
if (isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) {
// Mark it as a module in case there are no other exports in the file
setCommonJsModuleIndicator(node);
return;
}
// 'module.exports = expr' assignment
setCommonJsModuleIndicator(node);
const flags = exportAssignmentIsAlias(node)
? SymbolFlags.Alias // An export= with an EntityNameExpression or a ClassExpression exports all meanings of that identifier or class
: SymbolFlags.Property | SymbolFlags.ExportValue | SymbolFlags.ValueModule;
@@ -2514,11 +2518,12 @@ namespace ts {
return true;
}
const node = symbol.valueDeclaration;
const init = !node ? undefined :
let init = !node ? undefined :
isVariableDeclaration(node) ? node.initializer :
isBinaryExpression(node) ? node.right :
isPropertyAccessExpression(node) && isBinaryExpression(node.parent) ? node.parent.right :
undefined;
init = init && getRightMostAssignedExpression(init);
if (init) {
const isPrototypeAssignment = isPrototypeAccess(isVariableDeclaration(node) ? node.name : isBinaryExpression(node) ? node.left : node);
return !!getJavascriptInitializer(isBinaryExpression(init) && init.operatorToken.kind === SyntaxKind.BarBarToken ? init.right : init, isPrototypeAssignment);
+191 -104
View File
@@ -833,11 +833,12 @@ namespace ts {
return emitResolver;
}
function error(location: Node | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void {
function error(location: Node | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic {
const diagnostic = location
? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3)
: createCompilerDiagnostic(message, arg0, arg1, arg2, arg3);
diagnostics.add(diagnostic);
return diagnostic;
}
function addErrorOrSuggestion(isError: boolean, diagnostic: DiagnosticWithLocation) {
@@ -4091,7 +4092,14 @@ namespace ts {
}
else {
const contextFile = getSourceFileOfNode(getOriginalNode(context!.enclosingDeclaration))!;
return `"${file.moduleName || moduleSpecifiers.getModuleSpecifier(compilerOptions, contextFile, contextFile.path, file.path, context!.tracker.moduleResolverHost!)}"`;
return `"${file.moduleName || moduleSpecifiers.getModuleSpecifiers(
symbol,
compilerOptions,
contextFile,
context!.tracker.moduleResolverHost!,
context!.tracker.moduleResolverHost!.getSourceFiles!(),
{ importModuleSpecifierPreference: "non-relative" }
)[0]}"`;
}
}
const declaration = symbol.declarations[0];
@@ -4868,7 +4876,10 @@ namespace ts {
// binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the
// tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string.
function getWidenedTypeForVariableLikeDeclaration(declaration: ParameterDeclaration | PropertyDeclaration | PropertySignature | VariableDeclaration | BindingElement, reportErrors?: boolean): Type {
let type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true);
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true), declaration, reportErrors);
}
function widenTypeForVariableLikeDeclaration(type: Type | undefined, declaration: any, reportErrors?: boolean) {
if (type) {
if (reportErrors) {
reportErrorsFromWidening(declaration, type);
@@ -4931,59 +4942,48 @@ namespace ts {
if (declaration.kind === SyntaxKind.ExportAssignment) {
return links.type = checkExpression((<ExportAssignment>declaration).expression);
}
if (isInJavaScriptFile(declaration) && isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) {
return links.type = getTypeFromTypeNode(declaration.typeExpression.type);
}
// Handle variable, parameter or property
if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) {
return errorType;
}
let type: Type;
// Handle certain special assignment kinds, which happen to union across multiple declarations:
// * module.exports = expr
// * exports.p = expr
// * this.p = expr
// * className.prototype.method = expr
if (declaration.kind === SyntaxKind.BinaryExpression ||
declaration.kind === SyntaxKind.PropertyAccessExpression && declaration.parent.kind === SyntaxKind.BinaryExpression) {
type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol);
}
else if (isJSDocPropertyLikeTag(declaration)
|| isPropertyAccessExpression(declaration)
|| isIdentifier(declaration)
|| isClassDeclaration(declaration)
|| isFunctionDeclaration(declaration)
|| (isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration))
|| isMethodSignature(declaration)) {
// Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty`
if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) {
return getTypeOfFuncClassEnumModule(symbol);
let type = getJSSpecialType(symbol, declaration);
if (!type) {
if (isJSDocPropertyLikeTag(declaration)
|| isPropertyAccessExpression(declaration)
|| isIdentifier(declaration)
|| isClassDeclaration(declaration)
|| isFunctionDeclaration(declaration)
|| (isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration))
|| isMethodSignature(declaration)) {
// Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty`
if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) {
return getTypeOfFuncClassEnumModule(symbol);
}
type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType;
}
else if (isPropertyAssignment(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration);
}
else if (isJsxAttribute(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration);
}
else if (isShorthandPropertyAssignment(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, CheckMode.Normal);
}
else if (isObjectLiteralMethod(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, CheckMode.Normal);
}
else if (isParameter(declaration)
|| isPropertyDeclaration(declaration)
|| isPropertySignature(declaration)
|| isVariableDeclaration(declaration)
|| isBindingElement(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true);
}
else {
return Debug.fail("Unhandled declaration kind! " + Debug.showSyntaxKind(declaration) + " for " + Debug.showSymbol(symbol));
}
type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType;
}
else if (isPropertyAssignment(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration);
}
else if (isJsxAttribute(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration);
}
else if (isShorthandPropertyAssignment(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, CheckMode.Normal);
}
else if (isObjectLiteralMethod(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, CheckMode.Normal);
}
else if (isParameter(declaration)
|| isPropertyDeclaration(declaration)
|| isPropertySignature(declaration)
|| isVariableDeclaration(declaration)
|| isBindingElement(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
}
else {
return Debug.fail("Unhandled declaration kind! " + Debug.showSyntaxKind(declaration) + " for " + Debug.showSymbol(symbol));
}
if (!popTypeResolution()) {
@@ -4994,6 +4994,56 @@ namespace ts {
return links.type;
}
function getJSSpecialType(symbol: Symbol, decl: Declaration): Type | undefined {
if (!isInJavaScriptFile(decl)) {
return undefined;
}
else if (isJSDocPropertyLikeTag(decl) && decl.typeExpression) {
return getTypeFromTypeNode(decl.typeExpression.type);
}
// Handle certain special assignment kinds, which happen to union across multiple declarations:
// * module.exports = expr
// * exports.p = expr
// * this.p = expr
// * className.prototype.method = expr
else if (isBinaryExpression(decl) ||
isPropertyAccessExpression(decl) && isBinaryExpression(decl.parent)) {
return getJSInitializerType(decl, symbol, getAssignedJavascriptInitializer(isBinaryExpression(decl) ? decl.left : decl)) ||
getWidenedTypeFromJSSpecialPropertyDeclarations(symbol);
}
else if (isParameter(decl)
|| isPropertyDeclaration(decl)
|| isPropertySignature(decl)
|| isVariableDeclaration(decl)
|| isBindingElement(decl)) {
// Use type from type annotation if one is present
const isOptional = isParameter(decl) && isJSDocOptionalParameter(decl) ||
!isBindingElement(decl) && !isVariableDeclaration(decl) && !!decl.questionToken;
const declaredType = tryGetTypeFromEffectiveTypeNode(decl);
return declaredType && addOptionality(declaredType, isOptional) ||
getJSInitializerType(decl, symbol, getDeclaredJavascriptInitializer(decl)) ||
getWidenedTypeForVariableLikeDeclaration(decl, /*includeOptionality*/ true);
}
}
function getJSInitializerType(decl: Node, symbol: Symbol, init: Expression | undefined): Type | undefined {
if (init && isInJavaScriptFile(init) && isObjectLiteralExpression(init)) {
const exports = createSymbolTable();
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
const s = getSymbolOfNode(decl);
if (s && hasEntries(s.exports)) {
mergeSymbolTable(exports, s.exports);
}
decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
}
const s = getSymbolOfNode(decl);
if (s && hasEntries(s.exports)) {
mergeSymbolTable(exports, s.exports);
}
return createAnonymousType(symbol, exports, emptyArray, emptyArray, jsObjectLiteralIndexInfo, undefined);
}
}
function getAnnotatedAccessorType(accessor: AccessorDeclaration | undefined): Type | undefined {
if (accessor) {
if (accessor.kind === SyntaxKind.GetAccessor) {
@@ -10442,18 +10492,21 @@ namespace ts {
}
}
diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo)); // TODO: GH#18217
}
// Check if we should issue an extra diagnostic to produce a quickfix for a slightly incorrect import statement
if (headMessage && errorNode && !result && source.symbol) {
const links = getSymbolLinks(source.symbol);
if (links.originatingImport && !isImportCall(links.originatingImport)) {
const helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target!), target, relation, /*errorNode*/ undefined);
if (helpfulRetry) {
// Likely an incorrect import. Issue a helpful diagnostic to produce a quickfix to change the import
diagnostics.add(createDiagnosticForNode(links.originatingImport, Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime));
let relatedInformation: DiagnosticRelatedInformation[] | undefined;
// Check if we should issue an extra diagnostic to produce a quickfix for a slightly incorrect import statement
if (headMessage && errorNode && !result && source.symbol) {
const links = getSymbolLinks(source.symbol);
if (links.originatingImport && !isImportCall(links.originatingImport)) {
const helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target!), target, relation, /*errorNode*/ undefined);
if (helpfulRetry) {
// Likely an incorrect import. Issue a helpful diagnostic to produce a quickfix to change the import
const diag = createDiagnosticForNode(links.originatingImport, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);
relatedInformation = append(relatedInformation, diag); // Cause the error to appear with the error that triggered it
}
}
}
diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation)); // TODO: GH#18217
}
return result !== Ternary.False;
@@ -12181,14 +12234,6 @@ namespace ts {
// widen accessor based properties here.
return prop;
}
if (prop.flags & SymbolFlags.JSContainer) {
const node = prop.declarations && first(prop.declarations);
const init = getAssignedJavascriptInitializer(node);
if (init && init.kind !== SyntaxKind.ObjectLiteralExpression) {
// for JS special declarations, the only kind of initializer that will widen is object literals
return prop;
}
}
const original = getTypeOfSymbol(prop);
const propContext = context && createWideningContext(context, prop.escapedName, /*siblings*/ undefined);
const widened = getWidenedTypeWithContext(original, propContext);
@@ -14849,6 +14894,10 @@ namespace ts {
return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type!);
}
}
const thisTag = getJSDocThisTag(node);
if (thisTag && thisTag.typeExpression) {
return getTypeFromTypeNode(thisTag.typeExpression);
}
}
function isInConstructorArgumentInitializer(node: Node, constructorDecl: Node): boolean {
@@ -15996,19 +16045,6 @@ namespace ts {
let patternWithComputedProperties = false;
let hasComputedStringProperty = false;
let hasComputedNumberProperty = false;
if (isInJSFile) {
const decl = getDeclarationOfJSInitializer(node);
if (decl) {
// a JS object literal whose declaration's symbol has exports is a JS namespace
const symbol = getSymbolOfNode(decl);
if (symbol && hasEntries(symbol.exports)) {
propertiesTable = symbol.exports;
symbol.exports.forEach(s => propertiesArray.push(getMergedSymbol(s)));
return createObjectLiteralType();
}
}
}
propertiesTable = createSymbolTable();
let offset = 0;
@@ -17122,20 +17158,28 @@ namespace ts {
// Find the first enclosing class that has the declaring classes of the protected constituents
// of the property as base classes
const enclosingClass = forEachEnclosingClass(node, enclosingDeclaration => {
let enclosingClass = forEachEnclosingClass(node, enclosingDeclaration => {
const enclosingClass = <InterfaceType>getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)!);
return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined;
});
// A protected property is accessible if the property is within the declaring class or classes derived from it
if (!enclosingClass) {
error(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type));
return false;
// allow PropertyAccessibility if context is in function with this parameter
// static member access is disallow
let thisParameter: ParameterDeclaration | undefined;
if (flags & ModifierFlags.Static || !(thisParameter = getThisParameterFromNodeContext(node)) || !thisParameter.type) {
error(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type));
return false;
}
const thisType = getTypeFromTypeNode(thisParameter.type);
enclosingClass = ((thisType.flags & TypeFlags.TypeParameter) ? getConstraintFromTypeParameter(<TypeParameter>thisType) : thisType) as InterfaceType;
}
// No further restrictions for static properties
if (flags & ModifierFlags.Static) {
return true;
}
if (type.flags & TypeFlags.TypeParameter) {
if (type.flags & TypeFlags.TypeParameter) {
// get the original type -- represented as the type constraint of the 'this' type
type = (type as TypeParameter).isThisType ? getConstraintOfTypeParameter(<TypeParameter>type)! : getBaseConstraintOfType(<TypeParameter>type)!; // TODO: GH#18217 Use a different variable that's allowed to be undefined
}
@@ -17146,6 +17190,11 @@ namespace ts {
return true;
}
function getThisParameterFromNodeContext (node: Node) {
const thisContainer = getThisContainer(node, /* includeArrowFunctions */ false);
return thisContainer && isFunctionLike(thisContainer) ? getThisParameter(thisContainer) : undefined;
}
function symbolHasNonMethodDeclaration(symbol: Symbol) {
return forEachProperty(symbol, prop => {
const propKind = getDeclarationKindFromSymbol(prop);
@@ -18820,14 +18869,13 @@ namespace ts {
}
function invocationError(node: Node, apparentType: Type, kind: SignatureKind) {
error(node, kind === SignatureKind.Call
invocationErrorRecovery(apparentType, kind, error(node, kind === SignatureKind.Call
? Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures
: Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature
, typeToString(apparentType));
invocationErrorRecovery(apparentType, kind);
, typeToString(apparentType)));
}
function invocationErrorRecovery(apparentType: Type, kind: SignatureKind) {
function invocationErrorRecovery(apparentType: Type, kind: SignatureKind, diagnostic: Diagnostic) {
if (!apparentType.symbol) {
return;
}
@@ -18837,7 +18885,8 @@ namespace ts {
if (importNode && !isImportCall(importNode)) {
const sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target!), kind);
if (!sigs || !sigs.length) return;
error(importNode, Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime);
diagnostic.relatedInformation = diagnostic.relatedInformation || [];
diagnostic.relatedInformation.push(createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));
}
}
@@ -18916,8 +18965,9 @@ namespace ts {
if (!callSignatures.length) {
let errorInfo = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
errorInfo = chainDiagnosticMessages(errorInfo, headMessage);
diagnostics.add(createDiagnosticForNodeFromMessageChain(node, errorInfo));
invocationErrorRecovery(apparentType, SignatureKind.Call);
const diag = createDiagnosticForNodeFromMessageChain(node, errorInfo);
diagnostics.add(diag);
invocationErrorRecovery(apparentType, SignatureKind.Call, diag);
return resolveErrorCall(node);
}
@@ -20427,9 +20477,15 @@ namespace ts {
getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], UnionReduction.Subtype) :
leftType;
case SyntaxKind.EqualsToken:
checkSpecialAssignment(left, right);
checkAssignmentOperator(rightType);
return getRegularTypeOfObjectLiteral(rightType);
const special = getSpecialPropertyAssignmentKind(left.parent as BinaryExpression);
checkSpecialAssignment(special, right);
if (isJSSpecialPropertyAssignment(special)) {
return leftType;
}
else {
checkAssignmentOperator(rightType);
return getRegularTypeOfObjectLiteral(rightType);
}
case SyntaxKind.CommaToken:
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) {
error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
@@ -20440,8 +20496,7 @@ namespace ts {
return Debug.fail();
}
function checkSpecialAssignment(left: Node, right: Expression) {
const special = getSpecialPropertyAssignmentKind(left.parent as BinaryExpression);
function checkSpecialAssignment(special: SpecialPropertyAssignmentKind, right: Expression) {
if (special === SpecialPropertyAssignmentKind.ModuleExports) {
const rightType = checkExpression(right, checkMode);
for (const prop of getPropertiesOfObjectType(rightType)) {
@@ -20500,6 +20555,7 @@ namespace ts {
// requires VarExpr to be classified as a reference
// A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1)
// and the type of the non-compound operation to be assignable to the type of VarExpr.
if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)
&& (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) {
// to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported
@@ -20508,6 +20564,23 @@ namespace ts {
}
}
function isJSSpecialPropertyAssignment(special: SpecialPropertyAssignmentKind) {
switch (special) {
case SpecialPropertyAssignmentKind.ExportsProperty:
case SpecialPropertyAssignmentKind.ModuleExports:
case SpecialPropertyAssignmentKind.Property:
case SpecialPropertyAssignmentKind.Prototype:
case SpecialPropertyAssignmentKind.PrototypeProperty:
case SpecialPropertyAssignmentKind.ThisProperty:
const symbol = getSymbolOfNode(left);
const init = getAssignedJavascriptInitializer(right);
return init && isObjectLiteralExpression(init) &&
symbol && hasEntries(symbol.exports);
default:
return false;
}
}
function reportOperatorError() {
error(errorNode || operatorToken, Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, tokenToString(operatorToken.kind), typeToString(leftType), typeToString(rightType));
}
@@ -22533,6 +22606,10 @@ namespace ts {
checkSourceElement(node.typeExpression);
}
function checkJSDocTypeTag(node: JSDocTypeTag) {
checkSourceElement(node.typeExpression);
}
function checkJSDocParameterTag(node: JSDocParameterTag) {
checkSourceElement(node.typeExpression);
if (!getParameterSymbolFromJSDoc(node)) {
@@ -22827,7 +22904,11 @@ namespace ts {
}
for (const declaration of local.declarations) {
if (isAmbientModule(declaration)) continue;
if (isAmbientModule(declaration) ||
(isVariableDeclaration(declaration) && isForInOrOfStatement(declaration.parent.parent) || isImportedDeclaration(declaration)) && isIdentifierThatStartsWithUnderScore(declaration.name!)) {
continue;
}
if (isImportedDeclaration(declaration)) {
addToGroup(unusedImports, importClauseFromImported(declaration), declaration, getNodeId);
}
@@ -22839,9 +22920,7 @@ namespace ts {
}
}
else if (isVariableDeclaration(declaration)) {
if (!isIdentifierThatStartsWithUnderScore(declaration.name) || !isForInOrOfStatement(declaration.parent.parent)) {
addToGroup(unusedVariables, declaration.parent, declaration, getNodeId);
}
addToGroup(unusedVariables, declaration.parent, declaration, getNodeId);
}
else {
const parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration);
@@ -23284,9 +23363,15 @@ namespace ts {
// Node is the primary declaration of the symbol, just validate the initializer
// Don't validate for-in initializer as it is already an error
const initializer = getEffectiveInitializer(node);
if (initializer && node.parent.parent.kind !== SyntaxKind.ForInStatement) {
checkTypeAssignableTo(checkExpressionCached(initializer), type, node, /*headMessage*/ undefined);
checkParameterInitializer(node);
if (initializer) {
const isJSObjectLiteralInitializer = isInJavaScriptFile(node) &&
isObjectLiteralExpression(initializer) &&
(initializer.properties.length === 0 || isPrototypeAccess(node.name)) &&
hasEntries(symbol.exports);
if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== SyntaxKind.ForInStatement) {
checkTypeAssignableTo(checkExpressionCached(initializer), type, node, /*headMessage*/ undefined);
checkParameterInitializer(node);
}
}
}
else {
@@ -25486,6 +25571,8 @@ namespace ts {
case SyntaxKind.JSDocTypedefTag:
case SyntaxKind.JSDocCallbackTag:
return checkJSDocTypeAliasTag(node as JSDocTypedefTag);
case SyntaxKind.JSDocTypeTag:
return checkJSDocTypeTag(node as JSDocTypeTag);
case SyntaxKind.JSDocParameterTag:
return checkJSDocParameterTag(node as JSDocParameterTag);
case SyntaxKind.JSDocFunctionType:
-2
View File
@@ -475,7 +475,6 @@ namespace ts {
{
name: "sourceRoot",
type: "string",
isFilePath: true,
paramType: Diagnostics.LOCATION,
category: Diagnostics.Source_Map_Options,
description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,
@@ -483,7 +482,6 @@ namespace ts {
{
name: "mapRoot",
type: "string",
isFilePath: true,
paramType: Diagnostics.LOCATION,
category: Diagnostics.Source_Map_Options,
description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
+148 -1631
View File
File diff suppressed because it is too large Load Diff
+13 -1
View File
@@ -3828,7 +3828,7 @@
"category": "Message",
"code": 7037
},
"A namespace-style import cannot be called or constructed, and will cause a failure at runtime.": {
"Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.": {
"category": "Error",
"code": 7038
},
@@ -4402,5 +4402,17 @@
"Convert named imports to namespace import": {
"category": "Message",
"code": 95057
},
"Add or remove braces in an arrow function": {
"category": "Message",
"code": 95058
},
"Add braces to arrow function": {
"category": "Message",
"code": 95059
},
"Remove braces from arrow function": {
"category": "Message",
"code": 95060
}
}
+26 -3
View File
@@ -2587,18 +2587,41 @@ namespace ts {
return node;
}
export function createUnparsedSourceFile(text: string, map?: string): UnparsedSource {
export function createUnparsedSourceFile(text: string): UnparsedSource;
export function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
export function createUnparsedSourceFile(text: string, mapPath?: string, map?: string): UnparsedSource {
const node = <UnparsedSource>createNode(SyntaxKind.UnparsedSource);
node.text = text;
node.sourceMapPath = mapPath;
node.sourceMapText = map;
return node;
}
export function createInputFiles(javascript: string, declaration: string, javascriptMapText?: string, declarationMapText?: string): InputFiles {
export function createInputFiles(
javascript: string,
declaration: string
): InputFiles;
export function createInputFiles(
javascript: string,
declaration: string,
javascriptMapPath: string | undefined,
javascriptMapText: string | undefined,
declarationMapPath: string | undefined,
declarationMapText: string | undefined
): InputFiles;
export function createInputFiles(
javascript: string,
declaration: string,
javascriptMapPath?: string,
javascriptMapText?: string,
declarationMapPath?: string,
declarationMapText?: string
): InputFiles {
const node = <InputFiles>createNode(SyntaxKind.InputFiles);
node.javascriptText = javascript;
node.javascriptMapPath = javascriptMapPath;
node.javascriptMapText = javascriptMapText;
node.declarationText = declaration;
node.declarationMapPath = declarationMapPath;
node.declarationMapText = declarationMapText;
return node;
}
+53 -7
View File
@@ -15,17 +15,20 @@ namespace ts.moduleSpecifiers {
// For each symlink/original for a module, returns a list of ways to import that file.
export function getModuleSpecifiers(
moduleSymbol: Symbol,
program: Program,
compilerOptions: CompilerOptions,
importingSourceFile: SourceFile,
host: ModuleSpecifierResolutionHost,
files: ReadonlyArray<SourceFile>,
preferences: ModuleSpecifierPreferences,
): ReadonlyArray<ReadonlyArray<string>> {
const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol);
if (ambient) return [[ambient]];
const compilerOptions = program.getCompilerOptions();
const info = getInfo(compilerOptions, importingSourceFile, importingSourceFile.fileName, host);
const modulePaths = getAllModulePaths(program, getSourceFileOfNode(moduleSymbol.valueDeclaration));
const info = getInfo(compilerOptions, importingSourceFile, importingSourceFile.path, host);
if (!files) {
return Debug.fail("Files list must be present to resolve symlinks in specifier resolution");
}
const modulePaths = getAllModulePaths(files, getSourceFileOfNode(moduleSymbol.valueDeclaration), info.getCanonicalFileName, host);
const global = mapDefined(modulePaths, moduleFileName => getGlobalModuleSpecifier(moduleFileName, info, host, compilerOptions));
return global.length ? global.map(g => [g]) : modulePaths.map(moduleFileName =>
@@ -130,15 +133,58 @@ namespace ts.moduleSpecifiers {
return firstDefined(imports, ({ text }) => pathIsRelative(text) ? fileExtensionIs(text, Extension.Js) : undefined) || false;
}
function discoverProbableSymlinks(files: ReadonlyArray<SourceFile>, getCanonicalFileName: (file: string) => string, host: ModuleSpecifierResolutionHost) {
const symlinks = mapDefined(files, sf =>
sf.resolvedModules && firstDefinedIterator(sf.resolvedModules.values(), res =>
res && res.originalPath && res.resolvedFileName !== res.originalPath ? [res.resolvedFileName, res.originalPath] : undefined));
const result = createMap<string>();
if (symlinks) {
const currentDirectory = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
for (const [resolvedPath, originalPath] of symlinks) {
const resolvedParts = getPathComponents(toPath(resolvedPath, currentDirectory, getCanonicalFileName));
const originalParts = getPathComponents(toPath(originalPath, currentDirectory, getCanonicalFileName));
while (resolvedParts[resolvedParts.length - 1] === originalParts[originalParts.length - 1]) {
resolvedParts.pop();
originalParts.pop();
}
result.set(getPathFromPathComponents(originalParts), getPathFromPathComponents(resolvedParts));
}
}
return result;
}
function getAllModulePathsUsingIndirectSymlinks(files: ReadonlyArray<SourceFile>, target: string, getCanonicalFileName: (file: string) => string, host: ModuleSpecifierResolutionHost) {
const links = discoverProbableSymlinks(files, getCanonicalFileName, host);
const paths = arrayFrom(links.keys());
let options: string[] | undefined;
const compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? compareStringsCaseSensitive : compareStringsCaseInsensitive;
for (const path of paths) {
const resolved = links.get(path)!;
if (compareStrings(target.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo) {
const relative = getRelativePathFromDirectory(resolved, target, getCanonicalFileName);
const option = resolvePath(path, relative);
if (!host.fileExists || host.fileExists(option)) {
if (!options) options = [];
options.push(option);
}
}
}
if (options) {
options.push(target); // Since these are speculative, we also include the original resolved name as a possibility
return options;
}
return [target];
}
/**
* Looks for a existing imports that use symlinks to this module.
* Only if no symlink is available, the real path will be used.
*/
function getAllModulePaths(program: Program, { fileName }: SourceFile): ReadonlyArray<string> {
const symlinks = mapDefined(program.getSourceFiles(), sf =>
function getAllModulePaths(files: ReadonlyArray<SourceFile>, { fileName }: SourceFile, getCanonicalFileName: (file: string) => string, host: ModuleSpecifierResolutionHost): ReadonlyArray<string> {
const symlinks = mapDefined(files, sf =>
sf.resolvedModules && firstDefinedIterator(sf.resolvedModules.values(), res =>
res && res.resolvedFileName === fileName ? res.originalPath : undefined));
return symlinks.length === 0 ? [fileName] : symlinks;
return symlinks.length === 0 ? getAllModulePathsUsingIndirectSymlinks(files, getNormalizedAbsolutePath(fileName, host.getCurrentDirectory ? host.getCurrentDirectory() : ""), getCanonicalFileName, host) : symlinks;
}
function getRelativePathNParents(relativePath: string): number {
+14
View File
@@ -491,6 +491,8 @@ namespace ts {
case SyntaxKind.JSDocCallbackTag:
return visitNode(cbNode, (node as JSDocCallbackTag).fullName) ||
visitNode(cbNode, (node as JSDocCallbackTag).typeExpression);
case SyntaxKind.JSDocThisTag:
return visitNode(cbNode, (node as JSDocThisTag).typeExpression);
case SyntaxKind.JSDocSignature:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
@@ -6497,6 +6499,9 @@ namespace ts {
case "constructor":
tag = parseClassTag(atToken, tagName);
break;
case "this":
tag = parseThisTag(atToken, tagName);
break;
case "arg":
case "argument":
case "param":
@@ -6768,6 +6773,15 @@ namespace ts {
return finishNode(tag);
}
function parseThisTag(atToken: AtToken, tagName: Identifier): JSDocThisTag {
const tag = <JSDocThisTag>createNode(SyntaxKind.JSDocThisTag, atToken.pos);
tag.atToken = atToken;
tag.tagName = tagName;
tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true);
skipWhitespace();
return finishNode(tag);
}
function parseTypedefTag(atToken: AtToken, tagName: Identifier, indent: number): JSDocTypedefTag {
const typeExpression = tryParseTypeExpression();
skipWhitespace();
+93 -65
View File
@@ -252,7 +252,9 @@ namespace ts {
const gutterSeparator = " ";
const resetEscapeSequence = "\u001b[0m";
const ellipsis = "...";
function getCategoryFormat(category: DiagnosticCategory): string {
const halfIndent = " ";
const indent = " ";
function getCategoryFormat(category: DiagnosticCategory): ForegroundColorEscapeSequences {
switch (category) {
case DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;
case DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow;
@@ -273,68 +275,79 @@ namespace ts {
return s;
}
function formatCodeSpan(file: SourceFile, start: number, length: number, indent: string, squiggleColor: ForegroundColorEscapeSequences, host: FormatDiagnosticsHost) {
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start);
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length);
const lastLineInFile = getLineAndCharacterOfPosition(file, file.text.length).line;
const hasMoreThanFiveLines = (lastLine - firstLine) >= 4;
let gutterWidth = (lastLine + 1 + "").length;
if (hasMoreThanFiveLines) {
gutterWidth = Math.max(ellipsis.length, gutterWidth);
}
let context = "";
for (let i = firstLine; i <= lastLine; i++) {
context += host.getNewLine();
// If the error spans over 5 lines, we'll only show the first 2 and last 2 lines,
// so we'll skip ahead to the second-to-last line.
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
context += indent + formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
i = lastLine - 1;
}
const lineStart = getPositionOfLineAndCharacter(file, i, 0);
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
let lineContent = file.text.slice(lineStart, lineEnd);
lineContent = lineContent.replace(/\s+$/g, ""); // trim from end
lineContent = lineContent.replace("\t", " "); // convert tabs to single spaces
// Output the gutter and the actual contents of the line.
context += indent + formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += lineContent + host.getNewLine();
// Output the gutter and the error span for the line using tildes.
context += indent + formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += squiggleColor;
if (i === firstLine) {
// If we're on the last line, then limit it to the last character of the last line.
// Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position.
const lastCharForLine = i === lastLine ? lastLineChar : undefined;
context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~");
}
else if (i === lastLine) {
context += lineContent.slice(0, lastLineChar).replace(/./g, "~");
}
else {
// Squiggle the entire line.
context += lineContent.replace(/./g, "~");
}
context += resetEscapeSequence;
}
return context;
}
function formatLocation(file: SourceFile, start: number, host: FormatDiagnosticsHost) {
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start); // TODO: GH#18217
const relativeFileName = host ? convertToRelativePath(file.fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName)) : file.fileName;
let output = "";
output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
output += formatColorAndReset(`${firstLine + 1}`, ForegroundColorEscapeSequences.Yellow);
output += ":";
output += formatColorAndReset(`${firstLineChar + 1}`, ForegroundColorEscapeSequences.Yellow);
return output;
}
export function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray<Diagnostic>, host: FormatDiagnosticsHost): string {
let output = "";
for (const diagnostic of diagnostics) {
let context = "";
if (diagnostic.file) {
const { start, length, file } = diagnostic;
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start!); // TODO: GH#18217
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start! + length!);
const lastLineInFile = getLineAndCharacterOfPosition(file, file.text.length).line;
const relativeFileName = host ? convertToRelativePath(file.fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName)) : file.fileName;
const hasMoreThanFiveLines = (lastLine - firstLine) >= 4;
let gutterWidth = (lastLine + 1 + "").length;
if (hasMoreThanFiveLines) {
gutterWidth = Math.max(ellipsis.length, gutterWidth);
}
for (let i = firstLine; i <= lastLine; i++) {
context += host.getNewLine();
// If the error spans over 5 lines, we'll only show the first 2 and last 2 lines,
// so we'll skip ahead to the second-to-last line.
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
context += formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
i = lastLine - 1;
}
const lineStart = getPositionOfLineAndCharacter(file, i, 0);
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
let lineContent = file.text.slice(lineStart, lineEnd);
lineContent = lineContent.replace(/\s+$/g, ""); // trim from end
lineContent = lineContent.replace("\t", " "); // convert tabs to single spaces
// Output the gutter and the actual contents of the line.
context += formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += lineContent + host.getNewLine();
// Output the gutter and the error span for the line using tildes.
context += formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += ForegroundColorEscapeSequences.Red;
if (i === firstLine) {
// If we're on the last line, then limit it to the last character of the last line.
// Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position.
const lastCharForLine = i === lastLine ? lastLineChar : undefined;
context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~");
}
else if (i === lastLine) {
context += lineContent.slice(0, lastLineChar).replace(/./g, "~");
}
else {
// Squiggle the entire line.
context += lineContent.replace(/./g, "~");
}
context += resetEscapeSequence;
}
output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
output += formatColorAndReset(`${firstLine + 1}`, ForegroundColorEscapeSequences.Yellow);
output += ":";
output += formatColorAndReset(`${firstLineChar + 1}`, ForegroundColorEscapeSequences.Yellow);
const { file, start } = diagnostic;
output += formatLocation(file, start!, host); // TODO: GH#18217
output += " - ";
}
@@ -344,12 +357,24 @@ namespace ts {
if (diagnostic.file) {
output += host.getNewLine();
output += context;
output += formatCodeSpan(diagnostic.file, diagnostic.start!, diagnostic.length!, "", getCategoryFormat(diagnostic.category), host); // TODO: GH#18217
if (diagnostic.relatedInformation) {
output += host.getNewLine();
for (const { file, start, length, messageText } of diagnostic.relatedInformation) {
if (file) {
output += host.getNewLine();
output += halfIndent + formatLocation(file, start!, host); // TODO: GH#18217
output += formatCodeSpan(file, start!, length!, indent, ForegroundColorEscapeSequences.Cyan, host); // TODO: GH#18217
}
output += host.getNewLine();
output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
}
}
}
output += host.getNewLine();
}
return output + host.getNewLine();
return output;
}
export function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string {
@@ -616,7 +641,7 @@ namespace ts {
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? createMap<SourceFile>() : undefined;
// A parallel array to projectReferences storing the results of reading in the referenced tsconfig files
const resolvedProjectReferences: (ResolvedProjectReference | undefined)[] | undefined = projectReferences ? [] : undefined;
let resolvedProjectReferences: (ResolvedProjectReference | undefined)[] | undefined = projectReferences ? [] : undefined;
const projectReferenceRedirects: Map<string> = createMap();
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
@@ -1190,6 +1215,7 @@ namespace ts {
fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile);
}
resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives();
resolvedProjectReferences = oldProgram.getProjectReferences();
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
redirectTargetsSet = oldProgram.redirectTargetsSet;
@@ -1239,10 +1265,12 @@ namespace ts {
const dtsFilename = changeExtension(resolvedRefOpts.options.outFile, ".d.ts");
const js = host.readFile(resolvedRefOpts.options.outFile) || `/* Input file ${resolvedRefOpts.options.outFile} was missing */\r\n`;
const jsMap = host.readFile(resolvedRefOpts.options.outFile + ".map"); // TODO: try to read sourceMappingUrl comment from the js file
const jsMapPath = resolvedRefOpts.options.outFile + ".map"; // TODO: try to read sourceMappingUrl comment from the file
const jsMap = host.readFile(jsMapPath);
const dts = host.readFile(dtsFilename) || `/* Input file ${dtsFilename} was missing */\r\n`;
const dtsMap = host.readFile(dtsFilename + ".map");
const node = createInputFiles(js, dts, jsMap, dtsMap);
const dtsMapPath = dtsFilename + ".map";
const dtsMap = host.readFile(dtsMapPath);
const node = createInputFiles(js, dts, jsMap && jsMapPath, jsMap, dtsMap && dtsMapPath, dtsMap);
nodes.push(node);
}
}
+29 -22
View File
@@ -6,7 +6,7 @@ namespace ts {
finishRecordingFilesWithChangedResolutions(): Path[] | undefined;
resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined): ResolvedModuleFull[];
getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): CachedResolvedModuleWithFailedLookupLocations | undefined;
resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
invalidateResolutionOfFile(filePath: Path): void;
@@ -33,10 +33,10 @@ namespace ts {
resolvedFileName: string | undefined;
}
interface ResolvedModuleWithFailedLookupLocations extends ts.ResolvedModuleWithFailedLookupLocations, ResolutionWithFailedLookupLocations {
interface CachedResolvedModuleWithFailedLookupLocations extends ResolvedModuleWithFailedLookupLocations, ResolutionWithFailedLookupLocations {
}
interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations extends ts.ResolvedTypeReferenceDirectiveWithFailedLookupLocations, ResolutionWithFailedLookupLocations {
interface CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations extends ResolvedTypeReferenceDirectiveWithFailedLookupLocations, ResolutionWithFailedLookupLocations {
}
export interface ResolutionCacheHost extends ModuleResolutionHost {
@@ -60,11 +60,14 @@ namespace ts {
watcher: FileWatcher;
/** ref count keeping this directory watch alive */
refCount: number;
/** is the directory watched being non recursive */
nonRecursive?: boolean;
}
interface DirectoryOfFailedLookupWatch {
dir: string;
dirPath: Path;
nonRecursive?: boolean;
ignore?: true;
}
@@ -85,8 +88,8 @@ namespace ts {
// The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file.
// The key in the map is source file's path.
// The values are Map of resolutions with key being name lookedup.
const resolvedModuleNames = createMap<Map<ResolvedModuleWithFailedLookupLocations>>();
const perDirectoryResolvedModuleNames = createMap<Map<ResolvedModuleWithFailedLookupLocations>>();
const resolvedModuleNames = createMap<Map<CachedResolvedModuleWithFailedLookupLocations>>();
const perDirectoryResolvedModuleNames = createMap<Map<CachedResolvedModuleWithFailedLookupLocations>>();
const nonRelaticeModuleNameCache = createMap<PerModuleNameCache>();
const moduleResolutionCache = createModuleResolutionCacheWithMaps(
perDirectoryResolvedModuleNames,
@@ -95,8 +98,8 @@ namespace ts {
resolutionHost.getCanonicalFileName
);
const resolvedTypeReferenceDirectives = createMap<Map<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>>();
const perDirectoryResolvedTypeReferenceDirectives = createMap<Map<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>>();
const resolvedTypeReferenceDirectives = createMap<Map<CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations>>();
const perDirectoryResolvedTypeReferenceDirectives = createMap<Map<CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations>>();
/**
* These are the extensions that failed lookup files will have by default,
@@ -133,11 +136,11 @@ namespace ts {
clear
};
function getResolvedModule(resolution: ResolvedModuleWithFailedLookupLocations) {
function getResolvedModule(resolution: CachedResolvedModuleWithFailedLookupLocations) {
return resolution.resolvedModule;
}
function getResolvedTypeReferenceDirective(resolution: ResolvedTypeReferenceDirectiveWithFailedLookupLocations) {
function getResolvedTypeReferenceDirective(resolution: CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations) {
return resolution.resolvedTypeReferenceDirective;
}
@@ -211,7 +214,7 @@ namespace ts {
clearPerDirectoryResolutions();
}
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations {
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): CachedResolvedModuleWithFailedLookupLocations {
const primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache);
// return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts
if (!resolutionHost.getGlobalCache) {
@@ -251,7 +254,6 @@ namespace ts {
perDirectoryResolution = createMap();
perDirectoryCache.set(dirPath, perDirectoryResolution);
}
const resolvedModules: R[] = [];
const compilerOptions = resolutionHost.getCompilationSettings();
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
@@ -319,7 +321,7 @@ namespace ts {
}
function resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[] {
return resolveNamesWithLocalCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations, ResolvedTypeReferenceDirective>(
return resolveNamesWithLocalCache<CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations, ResolvedTypeReferenceDirective>(
typeDirectiveNames, containingFile,
resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives,
resolveTypeReferenceDirective, getResolvedTypeReferenceDirective,
@@ -328,7 +330,7 @@ namespace ts {
}
function resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined): ResolvedModuleFull[] {
return resolveNamesWithLocalCache<ResolvedModuleWithFailedLookupLocations, ResolvedModuleFull>(
return resolveNamesWithLocalCache<CachedResolvedModuleWithFailedLookupLocations, ResolvedModuleFull>(
moduleNames, containingFile,
resolvedModuleNames, perDirectoryResolvedModuleNames,
resolveModuleName, getResolvedModule,
@@ -336,7 +338,7 @@ namespace ts {
);
}
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined {
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): CachedResolvedModuleWithFailedLookupLocations | undefined {
const cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile));
return cache && cache.get(moduleName);
}
@@ -393,6 +395,7 @@ namespace ts {
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation: string, failedLookupLocationPath: Path): DirectoryOfFailedLookupWatch {
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
// Always watch root directory recursively
return { dir: rootDir!, dirPath: rootPath }; // TODO: GH#18217
}
@@ -409,11 +412,12 @@ namespace ts {
dirPath = getDirectoryPath(dirPath);
}
// If the directory is node_modules use it to watch
// If the directory is node_modules use it to watch, always watch it recursively
if (isNodeModulesDirectory(dirPath)) {
return filterFSRootDirectoriesToWatch({ dir, dirPath }, getDirectoryPath(dirPath));
}
let nonRecursive = true;
// Use some ancestor of the root directory
let subDirectoryPath: Path | undefined, subDirectory: string | undefined;
if (rootPath !== undefined) {
@@ -422,6 +426,7 @@ namespace ts {
if (parentPath === dirPath) {
break;
}
nonRecursive = false;
subDirectoryPath = dirPath;
subDirectory = dir;
dirPath = parentPath;
@@ -429,7 +434,7 @@ namespace ts {
}
}
return filterFSRootDirectoriesToWatch({ dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath }, dirPath);
return filterFSRootDirectoriesToWatch({ dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive }, dirPath);
}
function isPathWithDefaultFailedLookupExtension(path: Path) {
@@ -452,7 +457,7 @@ namespace ts {
let setAtRoot = false;
for (const failedLookupLocation of failedLookupLocations) {
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
const { dir, dirPath, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
const { dir, dirPath, nonRecursive, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
if (!ignore) {
// If the failed lookup location path is not one of the supported extensions,
// store it in the custom path
@@ -464,23 +469,25 @@ namespace ts {
setAtRoot = true;
}
else {
setDirectoryWatcher(dir, dirPath);
setDirectoryWatcher(dir, dirPath, nonRecursive);
}
}
}
if (setAtRoot) {
// This is always recursive
setDirectoryWatcher(rootDir!, rootPath); // TODO: GH#18217
}
}
function setDirectoryWatcher(dir: string, dirPath: Path) {
function setDirectoryWatcher(dir: string, dirPath: Path, nonRecursive?: boolean) {
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
if (dirWatcher) {
Debug.assert(!!nonRecursive === !!dirWatcher.nonRecursive);
dirWatcher.refCount++;
}
else {
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 });
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
}
}
@@ -530,7 +537,7 @@ namespace ts {
dirWatcher.refCount--;
}
function createDirectoryWatcher(directory: string, dirPath: Path) {
function createDirectoryWatcher(directory: string, dirPath: Path, nonRecursive: boolean | undefined) {
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, fileOrDirectory => {
const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);
if (cachedDirectoryStructureHost) {
@@ -541,7 +548,7 @@ namespace ts {
if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) {
resolutionHost.onInvalidatedResolution();
}
}, WatchDirectoryFlags.Recursive);
}, nonRecursive ? WatchDirectoryFlags.None : WatchDirectoryFlags.Recursive);
}
function removeResolutionsOfFileFromCache(cache: Map<Map<ResolutionWithFailedLookupLocations>>, filePath: Path) {
+62 -71
View File
@@ -64,10 +64,10 @@ namespace ts {
// Used for initialize lastEncodedSourceMapSpan and reset lastEncodedSourceMapSpan when updateLastEncodedAndRecordedSpans
const defaultLastEncodedSourceMapSpan: SourceMapSpan = {
emittedLine: 1,
emittedColumn: 1,
sourceLine: 1,
sourceColumn: 1,
emittedLine: 0,
emittedColumn: 0,
sourceLine: 0,
sourceColumn: 0,
sourceIndex: 0
};
@@ -99,10 +99,6 @@ namespace ts {
let sourceMapDataList: SourceMapData[] | undefined;
let disabled: boolean = !(compilerOptions.sourceMap || compilerOptions.inlineSourceMap);
let completedSections: SourceMapSectionDefinition[];
let sectionStartLine: number;
let sectionStartColumn: number;
return {
initialize,
reset,
@@ -150,9 +146,6 @@ namespace ts {
lastEncodedNameIndex = 0;
// Initialize source map data
completedSections = [];
sectionStartLine = 1;
sectionStartColumn = 1;
sourceMapData = {
sourceMapFilePath,
jsSourceMappingURL: !compilerOptions.inlineSourceMap ? getBaseFileName(normalizeSlashes(sourceMapFilePath)) : undefined!, // TODO: GH#18217
@@ -221,9 +214,6 @@ namespace ts {
lastEncodedNameIndex = undefined;
sourceMapData = undefined!;
sourceMapDataList = undefined!;
completedSections = undefined!;
sectionStartLine = undefined!;
sectionStartColumn = undefined!;
}
interface SourceMapSection {
@@ -233,7 +223,7 @@ namespace ts {
sources: string[];
names?: string[];
mappings: string;
sourcesContent?: string[];
sourcesContent?: (string | null)[];
sections?: undefined;
}
@@ -261,26 +251,6 @@ namespace ts {
};
}
function resetSectionalData(): void {
sourceMapData.sourceMapSources = [];
sourceMapData.sourceMapNames = [];
sourceMapData.sourceMapMappings = "";
sourceMapData.sourceMapSourcesContent = compilerOptions.inlineSources ? [] : undefined;
}
function generateMap(): SourceMap {
if (completedSections.length) {
captureSectionalSpanIfNeeded(/*reset*/ false);
return {
version: 3,
file: sourceMapData.sourceMapFile,
sections: completedSections
};
}
else {
return captureSection();
}
}
// Encoding for sourcemap span
function encodeLastRecordedSourceMapSpan() {
@@ -288,6 +258,11 @@ namespace ts {
return;
}
Debug.assert(lastRecordedSourceMapSpan.emittedColumn >= 0, "lastEncodedSourceMapSpan.emittedColumn was negative");
Debug.assert(lastRecordedSourceMapSpan.sourceIndex >= 0, "lastEncodedSourceMapSpan.sourceIndex was negative");
Debug.assert(lastRecordedSourceMapSpan.sourceLine >= 0, "lastEncodedSourceMapSpan.sourceLine was negative");
Debug.assert(lastRecordedSourceMapSpan.sourceColumn >= 0, "lastEncodedSourceMapSpan.sourceColumn was negative");
let prevEncodedEmittedColumn = lastEncodedSourceMapSpan!.emittedColumn;
// Line/Comma delimiters
if (lastEncodedSourceMapSpan!.emittedLine === lastRecordedSourceMapSpan.emittedLine) {
@@ -301,7 +276,7 @@ namespace ts {
for (let encodedLine = lastEncodedSourceMapSpan!.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) {
sourceMapData.sourceMapMappings += ";";
}
prevEncodedEmittedColumn = 1;
prevEncodedEmittedColumn = 0;
}
// 1. Relative Column 0 based
@@ -346,12 +321,8 @@ namespace ts {
const sourceLinePos = getLineAndCharacterOfPosition(currentSource, pos);
// Convert the location to be one-based.
sourceLinePos.line++;
sourceLinePos.character++;
const emittedLine = writer.getLine() - sectionStartLine + 1;
const emittedColumn = emittedLine === 0 ? (writer.getColumn() - sectionStartColumn + 1) : writer.getColumn();
const emittedLine = writer.getLine();
const emittedColumn = writer.getColumn();
// If this location wasn't recorded or the location in source is going backwards, record the span
if (!lastRecordedSourceMapSpan ||
@@ -386,13 +357,8 @@ namespace ts {
}
}
function captureSectionalSpanIfNeeded(reset: boolean) {
if (lastRecordedSourceMapSpan && lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { // If we've recorded some spans, save them
completedSections.push({ offset: { line: sectionStartLine - 1, column: sectionStartColumn - 1 }, map: captureSection() });
if (reset) {
resetSectionalData();
}
}
function isPossiblySourceMap(x: {}): x is SourceMapSection {
return typeof x === "object" && !!(x as any).mappings && typeof (x as any).mappings === "string" && !!(x as any).sources;
}
/**
@@ -409,7 +375,6 @@ namespace ts {
if (node) {
if (isUnparsedSource(node) && node.sourceMapText !== undefined) {
captureSectionalSpanIfNeeded(/*reset*/ true);
const text = node.sourceMapText;
let parsed: {} | undefined;
try {
@@ -418,24 +383,46 @@ namespace ts {
catch {
// empty
}
const offset = { line: writer.getLine() - 1, column: writer.getColumn() - 1 };
completedSections.push(parsed
? {
offset,
map: parsed as SourceMap
if (!parsed || !isPossiblySourceMap(parsed)) {
return emitCallback(hint, node);
}
const offsetLine = writer.getLine();
const firstLineColumnOffset = writer.getColumn();
// First, decode the old component sourcemap
const originalMap = parsed;
const sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
const resolvedPathCache = createMap<string>();
sourcemaps.calculateDecodedMappings(originalMap, (raw): void => {
// Apply offsets to each position and fixup source entries
const rawPath = originalMap.sources[raw.sourceIndex];
const relativePath = originalMap.sourceRoot ? combinePaths(originalMap.sourceRoot, rawPath) : rawPath;
const combinedPath = combinePaths(getDirectoryPath(node.sourceMapPath!), relativePath);
if (!resolvedPathCache.has(combinedPath)) {
resolvedPathCache.set(combinedPath, getRelativePathToDirectoryOrUrl(
sourcesDirectoryPath,
combinedPath,
host.getCurrentDirectory(),
host.getCanonicalFileName,
/*isAbsolutePathAnUrl*/ true
));
}
: {
offset,
// This is just passes the buck on sourcemaps we don't really understand, instead of issuing an error (which would be difficult this late)
url: `data:application/json;charset=utf-8;base64,${base64encode(sys, text)}`
}
);
const emitResult = emitCallback(hint, node);
sectionStartLine = writer.getLine();
sectionStartColumn = writer.getColumn();
lastRecordedSourceMapSpan = undefined!;
lastEncodedSourceMapSpan = defaultLastEncodedSourceMapSpan;
return emitResult;
const resolvedPath = resolvedPathCache.get(combinedPath)!;
const absolutePath = getNormalizedAbsolutePath(resolvedPath, sourcesDirectoryPath);
// tslint:disable-next-line:no-null-keyword
setupSourceEntry(absolutePath, originalMap.sourcesContent ? originalMap.sourcesContent[raw.sourceIndex] : null); // TODO: Lookup content for inlining?
const newIndex = sourceMapData.sourceMapSources.indexOf(resolvedPath);
// Then reencode all the updated spans into the overall map
encodeLastRecordedSourceMapSpan();
lastRecordedSourceMapSpan = {
...raw,
emittedLine: raw.emittedLine + offsetLine,
emittedColumn: raw.emittedLine === 0 ? (raw.emittedColumn + firstLineColumnOffset) : raw.emittedColumn,
sourceIndex: newIndex,
};
});
// And actually emit the text these sourcemaps are for
return emitCallback(hint, node);
}
const emitNode = node.emitNode;
const emitFlags = emitNode && emitNode.flags || EmitFlags.None;
@@ -529,13 +516,17 @@ namespace ts {
return;
}
setupSourceEntry(sourceFile.fileName, sourceFile.text);
}
function setupSourceEntry(fileName: string, content: string | null) {
// Add the file to tsFilePaths
// If sourceroot option: Use the relative path corresponding to the common directory path
// otherwise source locations relative to map file location
const sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
const source = getRelativePathToDirectoryOrUrl(sourcesDirectoryPath,
currentSource.fileName,
fileName,
host.getCurrentDirectory(),
host.getCanonicalFileName,
/*isAbsolutePathAnUrl*/ true);
@@ -546,10 +537,10 @@ namespace ts {
sourceMapData.sourceMapSources.push(source);
// The one that can be used from program to get the actual source file
sourceMapData.inputSourceFileNames.push(currentSource.fileName);
sourceMapData.inputSourceFileNames.push(fileName);
if (compilerOptions.inlineSources) {
sourceMapData.sourceMapSourcesContent!.push(currentSource.text);
sourceMapData.sourceMapSourcesContent!.push(content);
}
}
}
@@ -564,7 +555,7 @@ namespace ts {
encodeLastRecordedSourceMapSpan();
return JSON.stringify(generateMap());
return JSON.stringify(captureSection());
}
/**
@@ -1,3 +1,33 @@
/* @internal */
namespace ts {
export interface SourceFileLikeCache {
get(path: Path): SourceFileLike | undefined;
}
export function createSourceFileLikeCache(host: { readFile?: (path: string) => string | undefined, fileExists?: (path: string) => boolean }): SourceFileLikeCache {
const cached = createMap<SourceFileLike>();
return {
get(path: Path) {
if (cached.has(path)) {
return cached.get(path);
}
if (!host.fileExists || !host.readFile || !host.fileExists(path)) return;
// And failing that, check the disk
const text = host.readFile(path)!; // TODO: GH#18217
const file = {
text,
lineMap: undefined,
getLineAndCharacterOfPosition(pos: number) {
return computeLineAndCharacterOfPosition(getLineStarts(this), pos);
}
} as SourceFileLike;
cached.set(path, file);
return file;
}
};
}
}
/* @internal */
namespace ts.sourcemaps {
export interface SourceMapData {
@@ -5,7 +35,7 @@ namespace ts.sourcemaps {
file?: string;
sourceRoot?: string;
sources: string[];
sourcesContent?: string[];
sourcesContent?: (string | null)[];
names?: string[];
mappings: string;
}
@@ -42,7 +72,7 @@ namespace ts.sourcemaps {
};
function getGeneratedPosition(loc: SourceMappableLocation): SourceMappableLocation {
const maps = getGeneratedOrderedMappings();
const maps = getSourceOrderedMappings();
if (!length(maps)) return loc;
let targetIndex = binarySearch(maps, { sourcePath: loc.fileName, sourcePosition: loc.position }, identity, compareProcessedPositionSourcePositions);
if (targetIndex < 0 && maps.length > 0) {
@@ -56,7 +86,7 @@ namespace ts.sourcemaps {
}
function getOriginalPosition(loc: SourceMappableLocation): SourceMappableLocation {
const maps = getSourceOrderedMappings();
const maps = getGeneratedOrderedMappings();
if (!length(maps)) return loc;
let targetIndex = binarySearch(maps, { emittedPosition: loc.position }, identity, compareProcessedPositionEmittedPositions);
if (targetIndex < 0 && maps.length > 0) {
@@ -86,7 +116,7 @@ namespace ts.sourcemaps {
}
function getDecodedMappings() {
return decodedMappings || (decodedMappings = calculateDecodedMappings());
return decodedMappings || (decodedMappings = calculateDecodedMappings(map, processPosition, host));
}
function getSourceOrderedMappings() {
@@ -97,30 +127,6 @@ namespace ts.sourcemaps {
return generatedOrderedMappings || (generatedOrderedMappings = getDecodedMappings().slice().sort(compareProcessedPositionEmittedPositions));
}
function calculateDecodedMappings(): ProcessedSourceMapPosition[] {
const state: DecoderState<ProcessedSourceMapPosition> = {
encodedText: map.mappings,
currentNameIndex: undefined,
sourceMapNamesLength: map.names ? map.names.length : undefined,
currentEmittedColumn: 0,
currentEmittedLine: 0,
currentSourceColumn: 0,
currentSourceLine: 0,
currentSourceIndex: 0,
positions: [],
decodingIndex: 0,
processPosition,
};
while (!hasCompletedDecoding(state)) {
decodeSinglePosition(state);
if (state.error) {
host.log(`Encountered error while decoding sourcemap found at ${mapPath}: ${state.error}`);
return [];
}
}
return state.positions;
}
function compareProcessedPositionSourcePositions(a: ProcessedSourceMapPosition, b: ProcessedSourceMapPosition) {
return comparePaths(a.sourcePath, b.sourcePath, sourceRoot) ||
compareValues(a.sourcePosition, b.sourcePosition);
@@ -142,6 +148,60 @@ namespace ts.sourcemaps {
}
}
/*@internal*/
export interface MappingsDecoder extends Iterator<SourceMapSpan> {
readonly decodingIndex: number;
readonly error: string | undefined;
readonly lastSpan: SourceMapSpan;
}
/*@internal*/
export function decodeMappings(map: SourceMapData): MappingsDecoder {
const state: DecoderState = {
encodedText: map.mappings,
currentNameIndex: undefined,
sourceMapNamesLength: map.names ? map.names.length : undefined,
currentEmittedColumn: 0,
currentEmittedLine: 0,
currentSourceColumn: 0,
currentSourceLine: 0,
currentSourceIndex: 0,
decodingIndex: 0
};
function captureSpan(): SourceMapSpan {
return {
emittedColumn: state.currentEmittedColumn,
emittedLine: state.currentEmittedLine,
sourceColumn: state.currentSourceColumn,
sourceIndex: state.currentSourceIndex,
sourceLine: state.currentSourceLine,
nameIndex: state.currentNameIndex
};
}
return {
get decodingIndex() { return state.decodingIndex; },
get error() { return state.error; },
get lastSpan() { return captureSpan(); },
next() {
if (hasCompletedDecoding(state) || state.error) return { done: true, value: undefined as never };
if (!decodeSinglePosition(state)) return { done: true, value: undefined as never };
return { done: false, value: captureSpan() };
}
};
}
export function calculateDecodedMappings<T>(map: SourceMapData, processPosition: (position: RawSourceMapPosition) => T, host?: { log?(s: string): void }): T[] {
const decoder = decodeMappings(map);
const positions = arrayFrom(decoder, processPosition);
if (decoder.error) {
if (host && host.log) {
host.log(`Encountered error while decoding sourcemap: ${decoder.error}`);
}
return [];
}
return positions;
}
interface ProcessedSourceMapPosition {
emittedPosition: number;
sourcePosition: number;
@@ -157,7 +217,7 @@ namespace ts.sourcemaps {
nameIndex?: number;
}
interface DecoderState<T> {
interface DecoderState {
decodingIndex: number;
currentEmittedLine: number;
currentEmittedColumn: number;
@@ -168,15 +228,13 @@ namespace ts.sourcemaps {
encodedText: string;
sourceMapNamesLength?: number;
error?: string;
positions: T[];
processPosition: (position: RawSourceMapPosition) => T;
}
function hasCompletedDecoding(state: DecoderState<any>) {
function hasCompletedDecoding(state: DecoderState) {
return state.decodingIndex === state.encodedText.length;
}
function decodeSinglePosition<T>(state: DecoderState<T>): void {
function decodeSinglePosition(state: DecoderState): boolean {
while (state.decodingIndex < state.encodedText.length) {
const char = state.encodedText.charCodeAt(state.decodingIndex);
if (char === CharacterCodes.semicolon) {
@@ -198,40 +256,40 @@ namespace ts.sourcemaps {
state.currentEmittedColumn += base64VLQFormatDecode();
// Incorrect emittedColumn dont support this map
if (createErrorIfCondition(state.currentEmittedColumn < 0, "Invalid emittedColumn found")) {
return;
return false;
}
// Dont support reading mappings that dont have information about original source and its line numbers
if (createErrorIfCondition(isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: No entries after emitted column")) {
return;
return false;
}
// 2. Relative sourceIndex
state.currentSourceIndex += base64VLQFormatDecode();
// Incorrect sourceIndex dont support this map
if (createErrorIfCondition(state.currentSourceIndex < 0, "Invalid sourceIndex found")) {
return;
return false;
}
// Dont support reading mappings that dont have information about original source position
if (createErrorIfCondition(isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: No entries after sourceIndex")) {
return;
return false;
}
// 3. Relative sourceLine 0 based
state.currentSourceLine += base64VLQFormatDecode();
// Incorrect sourceLine dont support this map
if (createErrorIfCondition(state.currentSourceLine < 0, "Invalid sourceLine found")) {
return;
return false;
}
// Dont support reading mappings that dont have information about original source and its line numbers
if (createErrorIfCondition(isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: No entries after emitted Line")) {
return;
return false;
}
// 4. Relative sourceColumn 0 based
state.currentSourceColumn += base64VLQFormatDecode();
// Incorrect sourceColumn dont support this map
if (createErrorIfCondition(state.currentSourceColumn < 0, "Invalid sourceLine found")) {
return;
return false;
}
// 5. Check if there is name:
if (!isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex)) {
@@ -247,27 +305,15 @@ namespace ts.sourcemaps {
}
// Dont support reading mappings that dont have information about original source and its line numbers
if (createErrorIfCondition(!isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: There are more entries after " + (state.currentNameIndex === undefined ? "sourceColumn" : "nameIndex"))) {
return;
return false;
}
// Entry should be complete
capturePosition();
return;
return true;
}
createErrorIfCondition(/*condition*/ true, "No encoded entry found");
return;
function capturePosition() {
state.positions.push(state.processPosition({
emittedColumn: state.currentEmittedColumn,
emittedLine: state.currentEmittedLine,
sourceColumn: state.currentSourceColumn,
sourceIndex: state.currentSourceIndex,
sourceLine: state.currentSourceLine,
nameIndex: state.currentNameIndex
}));
}
return false;
function createErrorIfCondition(condition: boolean, errormsg: string) {
if (state.error) {
+1 -1
View File
@@ -180,7 +180,7 @@ namespace ts {
}
), mapDefined(node.prepends, prepend => {
if (prepend.kind === SyntaxKind.InputFiles) {
return createUnparsedSourceFile(prepend.declarationText, prepend.declarationMapText);
return createUnparsedSourceFile(prepend.declarationText, prepend.declarationMapPath, prepend.declarationMapText);
}
}));
bundle.syntheticFileReferences = [];
+7 -3
View File
@@ -4067,9 +4067,13 @@ namespace ts {
priority: 0,
text: `
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
+10 -7
View File
@@ -890,13 +890,16 @@ namespace ts {
scoped: false,
priority: 1,
text: `
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};`
};
+1 -1
View File
@@ -100,7 +100,7 @@ namespace ts {
function transformBundle(node: Bundle) {
return createBundle(node.sourceFiles.map(transformSourceFile), mapDefined(node.prepends, prepend => {
if (prepend.kind === SyntaxKind.InputFiles) {
return createUnparsedSourceFile(prepend.javascriptText, prepend.javascriptMapText);
return createUnparsedSourceFile(prepend.javascriptText, prepend.javascriptMapPath, prepend.javascriptMapText);
}
return prepend;
}));
+44 -20
View File
@@ -245,7 +245,7 @@ namespace ts {
}
}
export function createDependencyMapper() {
function createDependencyMapper() {
const childToParents = createFileMap<ResolvedConfigFileName[]>();
const parentToChildren = createFileMap<ResolvedConfigFileName[]>();
const allKeys = createFileMap<true>();
@@ -422,7 +422,7 @@ namespace ts {
}
];
export function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System) {
export function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined {
let verbose = false;
let dry = false;
let force = false;
@@ -455,7 +455,8 @@ namespace ts {
case "--?":
case "-?":
case "--help":
return printHelp(buildOpts, "--build ");
printHelp(buildOpts, "--build ");
return ExitStatus.Success;
}
// Not a flag, parse as filename
addProject(arg);
@@ -463,16 +464,20 @@ namespace ts {
// Nonsensical combinations
if (clean && force) {
return buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force");
buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force");
return ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (clean && verbose) {
return buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose");
buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose");
return ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (clean && watch) {
return buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch");
buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch");
return ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (watch && dry) {
return buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry");
buildHost.error(Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry");
return ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (projects.length === 0) {
@@ -482,16 +487,16 @@ namespace ts {
const builder = createSolutionBuilder(compilerHost, buildHost, projects, { dry, force, verbose }, system);
if (clean) {
builder.cleanAllProjects();
}
else {
builder.buildAllProjects();
return builder.cleanAllProjects();
}
if (watch) {
return builder.startWatching();
builder.startWatching();
return undefined;
}
return builder.buildAllProjects();
function addProject(projectSpecification: string) {
const fileName = resolvePath(compilerHost.getCurrentDirectory(), projectSpecification);
const refPath = resolveProjectReferencePath(compilerHost, { path: fileName });
@@ -503,7 +508,6 @@ namespace ts {
return buildHost.error(Diagnostics.File_0_does_not_exist, fileName);
}
projects.push(refPath);
}
}
@@ -637,7 +641,6 @@ namespace ts {
// Mark all downstream projects of this one needing to be built "later"
function queueBuildForDownstreamReferences(root: ResolvedConfigFileName) {
debugger;
const deps = graph.dependencyMap.getReferencesTo(root);
for (const ref of deps) {
// Can skip circular references
@@ -773,8 +776,11 @@ namespace ts {
}
let pseudoUpToDate = false;
let usesPrepend = false;
let upstreamChangedProject: string | undefined;
if (project.projectReferences) {
for (const ref of project.projectReferences) {
usesPrepend = usesPrepend || !!(ref.prepend);
const resolvedRef = resolveProjectReferencePath(compilerHost, ref) as ResolvedConfigFileName;
const refStatus = getUpToDateStatus(configFileCache.parseConfigFile(resolvedRef));
@@ -804,6 +810,7 @@ namespace ts {
// *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
if (refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
pseudoUpToDate = true;
upstreamChangedProject = ref.path;
continue;
}
@@ -832,6 +839,14 @@ namespace ts {
};
}
if (usesPrepend && pseudoUpToDate) {
return {
type: UpToDateStatusType.OutOfDateWithUpstream,
outOfDateOutputFileName: oldestOutputFileName,
newerProjectName: upstreamChangedProject!
};
}
// Up to date
return {
type: pseudoUpToDate ? UpToDateStatusType.UpToDateWithUpstreamTypes : UpToDateStatusType.UpToDate,
@@ -1048,16 +1063,19 @@ namespace ts {
function cleanAllProjects() {
const resolvedNames: ReadonlyArray<ResolvedConfigFileName> | undefined = getAllProjectsInScope();
if (resolvedNames === undefined) {
return buildHost.message(Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
buildHost.message(Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
return ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
const filesToDelete = getFilesToClean(resolvedNames);
if (filesToDelete === undefined) {
return buildHost.message(Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
buildHost.message(Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
return ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (context.options.dry) {
return buildHost.message(Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(f => `\r\n * ${f}`).join(""));
buildHost.message(Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(f => `\r\n * ${f}`).join(""));
return ExitStatus.Success;
}
// Do this check later to allow --clean --dry to function even if the host can't delete files
@@ -1068,6 +1086,8 @@ namespace ts {
for (const output of filesToDelete) {
compilerHost.deleteFile(output);
}
return ExitStatus.Success;
}
function resolveProjectName(name: string): ResolvedConfigFileName | undefined {
@@ -1095,16 +1115,18 @@ namespace ts {
return resolvedNames;
}
function buildAllProjects() {
function buildAllProjects(): ExitStatus {
const graph = getGlobalDependencyGraph();
if (graph === undefined) return;
if (graph === undefined) return ExitStatus.DiagnosticsPresent_OutputsSkipped;
const queue = graph.buildQueue;
reportBuildQueue(graph);
let anyFailed = false;
for (const next of queue) {
const proj = configFileCache.parseConfigFile(next);
if (proj === undefined) {
anyFailed = true;
break;
}
const status = getUpToDateStatus(proj);
@@ -1136,8 +1158,10 @@ namespace ts {
continue;
}
buildSingleProject(next);
const buildResult = buildSingleProject(next);
anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors);
}
return anyFailed ? ExitStatus.DiagnosticsPresent_OutputsSkipped : ExitStatus.Success;
}
/**
+12 -9
View File
@@ -1,25 +1,30 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"removeComments": true,
"outFile": "../../built/local/tsc.js",
"declaration": true
"outFile": "../../built/local/compiler.js"
},
"references": [],
"files": [
"types.ts",
"performance.ts",
"core.ts",
"performance.ts",
"types.ts",
"sys.ts",
"diagnosticInformationMap.generated.ts",
"scanner.ts",
"utilities.ts",
"parser.ts",
"commandLineParser.ts",
"moduleNameResolver.ts",
"binder.ts",
"symbolWalker.ts",
"moduleNameResolver.ts",
"checker.ts",
"factory.ts",
"visitor.ts",
"sourcemapDecoder.ts",
"transformers/utilities.ts",
"transformers/destructuring.ts",
"transformers/ts.ts",
@@ -46,8 +51,6 @@
"resolutionCache.ts",
"moduleSpecifiers.ts",
"watch.ts",
"commandLineParser.ts",
"tsbuild.ts",
"tsc.ts",
"tsbuild.ts"
]
}
+8
View File
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outFile": "../../built/local/compiler.release.js",
"removeComments": true,
"preserveConstEnums": false
}
}
+20 -68
View File
@@ -1,54 +1,4 @@
namespace ts {
/**
* Type of objects whose values are all of the same type.
* The `in` and `for-in` operators can *not* be safely used,
* since `Object.prototype` may be modified by outside code.
*/
export interface MapLike<T> {
[index: string]: T;
}
/** ES6 Map interface, only read methods included. */
export interface ReadonlyMap<T> {
get(key: string): T | undefined;
has(key: string): boolean;
forEach(action: (value: T, key: string) => void): void;
readonly size: number;
keys(): Iterator<string>;
values(): Iterator<T>;
entries(): Iterator<[string, T]>;
}
/** ES6 Map interface. */
export interface Map<T> extends ReadonlyMap<T> {
set(key: string, value: T): this;
delete(key: string): boolean;
clear(): void;
}
/** ES6 Iterator type. */
export interface Iterator<T> {
next(): { value: T, done: false } | { value: never, done: true };
}
/** Array that is only intended to be pushed to, never read. */
export interface Push<T> {
push(...values: T[]): void;
}
/* @internal */
export type EqualityComparer<T> = (a: T, b: T) => boolean;
/* @internal */
export type Comparer<T> = (a: T, b: T) => Comparison;
/* @internal */
export const enum Comparison {
LessThan = -1,
EqualTo = 0,
GreaterThan = 1
}
// branded string type used to store absolute, normalized and canonicalized paths
// arbitrary file name can be converted to Path via toPath function
export type Path = string & { __pathBrand: any };
@@ -421,6 +371,7 @@ namespace ts {
JSDocCallbackTag,
JSDocParameterTag,
JSDocReturnTag,
JSDocThisTag,
JSDocTypeTag,
JSDocTemplateTag,
JSDocTypedefTag,
@@ -2373,6 +2324,11 @@ namespace ts {
kind: SyntaxKind.JSDocClassTag;
}
export interface JSDocThisTag extends JSDocTag {
kind: SyntaxKind.JSDocThisTag;
typeExpression?: JSDocTypeExpression;
}
export interface JSDocTemplateTag extends JSDocTag {
kind: SyntaxKind.JSDocTemplateTag;
typeParameters: NodeArray<TypeParameterDeclaration>;
@@ -2659,14 +2615,17 @@ namespace ts {
export interface InputFiles extends Node {
kind: SyntaxKind.InputFiles;
javascriptText: string;
javascriptMapPath?: string;
javascriptMapText?: string;
declarationText: string;
declarationMapPath?: string;
declarationMapText?: string;
}
export interface UnparsedSource extends Node {
kind: SyntaxKind.UnparsedSource;
text: string;
sourceMapPath?: string;
sourceMapText?: string;
}
@@ -2851,7 +2810,7 @@ namespace ts {
sourceMapFile: string; // Source map's file field - .js file name
sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not ""
sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map
sourceMapSourcesContent?: string[]; // Source map's sourcesContent field - list of the sources' text to be embedded in the source map
sourceMapSourcesContent?: (string | null)[]; // Source map's sourcesContent field - list of the sources' text to be embedded in the source map
inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list
sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map
sourceMapMappings: string; // Source map's mapping field - encoded source map spans
@@ -3467,7 +3426,7 @@ namespace ts {
ExportHasLocal = Function | Class | Enum | ValueModule,
HasExports = Class | Enum | Module,
HasExports = Class | Enum | Module | Variable,
HasMembers = Class | Interface | TypeLiteral | ObjectLiteral,
BlockScoped = BlockScopedVariable | Class | Enum,
@@ -3619,13 +3578,6 @@ namespace ts {
/** SymbolTable based on ES6 Map interface. */
export type SymbolTable = UnderscoreEscapedMap<Symbol>;
/** Represents a "prefix*suffix" pattern. */
/* @internal */
export interface Pattern {
prefix: string;
suffix: string;
}
/** Used to track a `declare module "foo*"`-like declaration. */
/* @internal */
export interface PatternAmbientModule {
@@ -4241,16 +4193,19 @@ namespace ts {
next?: DiagnosticMessageChain;
}
export interface Diagnostic {
file: SourceFile | undefined;
start: number | undefined;
length: number | undefined;
messageText: string | DiagnosticMessageChain;
export interface Diagnostic extends DiagnosticRelatedInformation {
category: DiagnosticCategory;
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
reportsUnnecessary?: {};
code: number;
source?: string;
relatedInformation?: DiagnosticRelatedInformation[];
}
export interface DiagnosticRelatedInformation {
file: SourceFile | undefined;
start: number | undefined;
length: number | undefined;
messageText: string | DiagnosticMessageChain;
}
export interface DiagnosticWithLocation extends Diagnostic {
file: SourceFile;
@@ -5312,6 +5267,7 @@ namespace ts {
useCaseSensitiveFileNames?(): boolean;
fileExists?(path: string): boolean;
readFile?(path: string): string | undefined;
getSourceFiles?(): ReadonlyArray<SourceFile>; // Used for cached resolutions to find symlinks without traversing the fs (again)
}
/** @deprecated See comment on SymbolWriter */
@@ -5340,10 +5296,6 @@ namespace ts {
newLength: number;
}
export interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
/* @internal */
export interface DiagnosticCollection {
// Adds a diagnostic to this diagnostic collection.
+1602 -21
View File
File diff suppressed because it is too large Load Diff
+19 -25
View File
@@ -1,30 +1,15 @@
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/// <reference path="..\services\services.ts" />
/// <reference path="..\services\shims.ts" />
/// <reference path="harnessLanguageService.ts" />
/// <reference path="harness.ts" />
/// <reference path="fourslashRunner.ts" />
/// <reference path="./compiler.ts" />
namespace FourSlash {
ts.disableIncrementalParsing = false;
import ArrayOrSingle = FourSlashInterface.ArrayOrSingle;
export const enum FourSlashTestType {
Native,
Shims,
ShimsWithPreprocess,
Server
}
// Represents a parsed source file with metadata
interface FourSlashFile {
// The contents of the file (with markers, etc stripped out)
@@ -522,8 +507,17 @@ namespace FourSlash {
}
private getAllDiagnostics(): ts.Diagnostic[] {
return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName =>
ts.isAnySupportedFileExtension(fileName) ? this.getDiagnostics(fileName) : []);
return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName => {
if (!ts.isAnySupportedFileExtension(fileName)) {
return [];
}
const baseName = ts.getBaseFileName(fileName);
if (baseName === "package.json" || baseName === "tsconfig.json" || baseName === "jsconfig.json") {
return [];
}
return this.getDiagnostics(fileName);
});
}
public verifyErrorExistsAfterMarker(markerName: string, shouldExist: boolean, after: boolean) {
@@ -1317,7 +1311,7 @@ Actual: ${stringify(fullActual)}`);
}
private testDiagnostics(expected: ReadonlyArray<FourSlashInterface.Diagnostic>, diagnostics: ReadonlyArray<ts.Diagnostic>, category: string) {
assert.deepEqual(ts.realizeDiagnostics(diagnostics, ts.newLineCharacter), expected.map((e): ts.RealizedDiagnostic => ({
assert.deepEqual(ts.realizeDiagnostics(diagnostics, "\n"), expected.map((e): ts.RealizedDiagnostic => ({
message: e.message,
category,
code: e.code,
+19 -33
View File
@@ -1,31 +1,3 @@
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/// <reference path="..\services\services.ts" />
/// <reference path="..\services\shims.ts" />
/// <reference path="..\server\session.ts" />
/// <reference path="..\server\client.ts" />
/// <reference path="sourceMapRecorder.ts"/>
/// <reference path="runnerbase.ts"/>
/// <reference path="./vfs.ts" />
/// <reference types="node" />
/// <reference types="mocha" />
/// <reference types="chai" />
// Block scoped definitions work poorly for global variables, temporarily enable var
/* tslint:disable:no-var-keyword */
@@ -35,7 +7,7 @@ var assert: typeof _chai.assert = _chai.assert;
{
// chai's builtin `assert.isFalse` is featureful but slow - we don't use those features,
// so we'll just overwrite it as an alterative to migrating a bunch of code off of chai
assert.isFalse = (expr, msg) => { if (expr as any as boolean !== false) throw new Error(msg); };
assert.isFalse = (expr: any, msg: string) => { if (expr !== false) throw new Error(msg); };
const assertDeepImpl = assert.deepEqual;
assert.deepEqual = (a, b, msg) => {
@@ -1136,6 +1108,7 @@ namespace Harness {
{ name: "noImplicitReferences", type: "boolean" },
{ name: "currentDirectory", type: "string" },
{ name: "symlink", type: "string" },
{ name: "link", type: "string" },
// Emitted js baseline will print full paths for every output file
{ name: "fullEmitPaths", type: "boolean" }
];
@@ -1207,7 +1180,9 @@ namespace Harness {
harnessSettings: TestCaseParser.CompilerSettings | undefined,
compilerOptions: ts.CompilerOptions | undefined,
// Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file
currentDirectory: string | undefined): compiler.CompilationResult {
currentDirectory: string | undefined,
symlinks?: vfs.FileSet
): compiler.CompilationResult {
const options: ts.CompilerOptions & HarnessOptions = compilerOptions ? ts.cloneCompilerOptions(compilerOptions) : { noResolve: false };
options.target = options.target || ts.ScriptTarget.ES3;
options.newLine = options.newLine || ts.NewLineKind.CarriageReturnLineFeed;
@@ -1244,6 +1219,9 @@ namespace Harness {
const docs = inputFiles.concat(otherFiles).map(documents.TextDocument.fromTestFile);
const fs = vfs.createFromFileSystem(IO, !useCaseSensitiveFileNames, { documents: docs, cwd: currentDirectory });
if (symlinks) {
fs.apply(symlinks);
}
const host = new fakes.CompilerHost(fs, options);
return compiler.compileFiles(host, programFileNames, options);
}
@@ -1864,6 +1842,7 @@ namespace Harness {
// Regex for parsing options in the format "@Alpha: Value of any sort"
const optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*([^\r\n]*)/gm; // multiple matches on multiple lines
const linkRegex = /^[\/]{2}\s*@link\s*:\s*([^\r\n]*)\s*->\s*([^\r\n]*)/gm; // multiple matches on multiple lines
export function extractCompilerSettings(content: string): CompilerSettings {
const opts: CompilerSettings = {};
@@ -1883,6 +1862,7 @@ namespace Harness {
testUnitData: TestUnitData[];
tsConfig: ts.ParsedCommandLine | undefined;
tsConfigFileUnitData: TestUnitData | undefined;
symlinks?: vfs.FileSet;
}
/** Given a test file containing // @FileName directives, return an array of named units of code to be added to an existing compiler instance */
@@ -1897,10 +1877,16 @@ namespace Harness {
let currentFileOptions: any = {};
let currentFileName: any;
let refs: string[] = [];
let symlinks: vfs.FileSet | undefined;
for (const line of lines) {
const testMetaData = optionRegex.exec(line);
if (testMetaData) {
let testMetaData: RegExpExecArray | null;
const linkMetaData = linkRegex.exec(line);
if (linkMetaData) {
if (!symlinks) symlinks = {};
symlinks[linkMetaData[2].trim()] = new vfs.Symlink(linkMetaData[1].trim());
}
else if (testMetaData = optionRegex.exec(line)) {
// Comment line, check for global/file @options and record them
optionRegex.lastIndex = 0;
const metaDataName = testMetaData[1].toLowerCase();
@@ -1989,7 +1975,7 @@ namespace Harness {
break;
}
}
return { settings, testUnitData, tsConfig, tsConfigFileUnitData };
return { settings, testUnitData, tsConfig, tsConfigFileUnitData, symlinks };
}
}
-5
View File
@@ -1,8 +1,3 @@
/// <reference path="..\services\services.ts" />
/// <reference path="..\services\shims.ts" />
/// <reference path="..\server\client.ts" />
/// <reference path="harness.ts" />
namespace Harness.LanguageService {
export class ScriptInfo {
public version = 1;
-6
View File
@@ -1,9 +1,3 @@
/// <reference path="..\..\src\compiler\sys.ts" />
/// <reference path="..\..\src\harness\harness.ts" />
/// <reference path="..\..\src\harness\harnessLanguageService.ts" />
/// <reference path="..\..\src\harness\runnerbase.ts" />
/// <reference path="..\..\src\harness\typeWriter.ts" />
interface FileInformation {
contents?: string;
contentsPath?: string;
-613
View File
@@ -1,613 +0,0 @@
// tslint:disable no-unnecessary-type-assertion (TODO: tslint can't find node types)
if (typeof describe === "undefined") {
(global as any).describe = undefined; // If launched without mocha for parallel mode, we still need a global describe visible to satisfy the parsing of the unit tests
(global as any).it = undefined;
}
namespace Harness.Parallel.Host {
interface ChildProcessPartial {
send(message: ParallelHostMessage, callback?: (error: Error) => void): boolean;
on(event: "error", listener: (err: Error) => void): this;
on(event: "exit", listener: (code: number, signal: string) => void): this;
on(event: "message", listener: (message: ParallelClientMessage) => void): this;
kill(signal?: string): void;
currentTasks?: {file: string}[]; // Custom monkeypatch onto child process handle
accumulatedOutput: string; // Custom monkeypatch with process output
stderr: PartialStream;
stdout: PartialStream;
}
interface PartialStream {
on(event: "data", listener: (chunk: Buffer) => void): this;
}
interface ProgressBarsOptions {
open: string;
close: string;
complete: string;
incomplete: string;
width: number;
noColors: boolean;
}
interface ProgressBar {
lastN?: number;
title?: string;
progressColor?: string;
text?: string;
}
const perfdataFileNameFragment = ".parallelperf";
function perfdataFileName(target?: string) {
return `${perfdataFileNameFragment}${target ? `.${target}` : ""}.json`;
}
function readSavedPerfData(target?: string): {[testHash: string]: number} | undefined {
const perfDataContents = IO.readFile(perfdataFileName(target));
if (perfDataContents) {
return JSON.parse(perfDataContents);
}
return undefined;
}
function hashName(runner: TestRunnerKind | "unittest", test: string) {
return `tsrunner-${runner}://${test}`;
}
let tasks: { runner: TestRunnerKind | "unittest", file: string, size: number }[] = [];
const newTasks: { runner: TestRunnerKind | "unittest", file: string, size: number }[] = [];
let unknownValue: string | undefined;
export function start() {
const perfData = readSavedPerfData(configOption);
let totalCost = 0;
if (runUnitTests) {
(global as any).describe = (suiteName: string) => {
// Note, sub-suites are not indexed (we assume such granularity is not required)
let size = 0;
if (perfData) {
size = perfData[hashName("unittest", suiteName)];
if (size === undefined) {
newTasks.push({ runner: "unittest", file: suiteName, size: 0 });
unknownValue = suiteName;
return;
}
}
tasks.push({ runner: "unittest", file: suiteName, size });
totalCost += size;
};
}
else {
(global as any).describe = ts.noop;
}
setTimeout(() => startDelayed(perfData, totalCost), 0); // Do real startup on next tick, so all unit tests have been collected
}
function startDelayed(perfData: {[testHash: string]: number} | undefined, totalCost: number) {
initializeProgressBarsDependencies();
console.log(`Discovered ${tasks.length} unittest suites` + (newTasks.length ? ` and ${newTasks.length} new suites.` : "."));
console.log("Discovering runner-based tests...");
const discoverStart = +(new Date());
const { statSync }: { statSync(path: string): { size: number }; } = require("fs");
const path: { join: (...args: string[]) => string } = require("path");
for (const runner of runners) {
for (const test of runner.enumerateTestFiles()) {
const file = typeof test === "string" ? test : test.file;
let size: number;
if (!perfData) {
try {
size = statSync(path.join(runner.workingDirectory, file)).size;
}
catch {
// May be a directory
try {
size = IO.listFiles(path.join(runner.workingDirectory, file), /.*/g, { recursive: true }).reduce((acc, elem) => acc + statSync(elem).size, 0);
}
catch {
// Unknown test kind, just return 0 and let the historical analysis take over after one run
size = 0;
}
}
}
else {
const hashedName = hashName(runner.kind(), file);
size = perfData[hashedName];
if (size === undefined) {
size = 0;
unknownValue = hashedName;
newTasks.push({ runner: runner.kind(), file, size });
continue;
}
}
tasks.push({ runner: runner.kind(), file, size });
totalCost += size;
}
}
tasks.sort((a, b) => a.size - b.size);
tasks = tasks.concat(newTasks);
const batchCount = workerCount;
const packfraction = 0.9;
const chunkSize = 1000; // ~1KB or 1s for sending batches near the end of a test
const batchSize = (totalCost / workerCount) * packfraction; // Keep spare tests for unittest thread in reserve
console.log(`Discovered ${tasks.length} test files in ${+(new Date()) - discoverStart}ms.`);
console.log(`Starting to run tests using ${workerCount} threads...`);
const { fork }: { fork(modulePath: string, args?: string[], options?: {}): ChildProcessPartial; } = require("child_process");
const totalFiles = tasks.length;
let passingFiles = 0;
let failingFiles = 0;
let errorResults: ErrorInfo[] = [];
let passingResults: { name: string[] }[] = [];
let totalPassing = 0;
const startTime = Date.now();
const progressBars = new ProgressBars({ noColors });
const progressUpdateInterval = 1 / progressBars._options.width;
let nextProgress = progressUpdateInterval;
const newPerfData: {[testHash: string]: number} = {};
const workers: ChildProcessPartial[] = [];
const defaultTimeout = globalTimeout !== undefined
? globalTimeout
: mocha && mocha.suite && mocha.suite._timeout
? mocha.suite._timeout
: 20000; // 20 seconds
let closedWorkers = 0;
for (let i = 0; i < workerCount; i++) {
// TODO: Just send the config over the IPC channel or in the command line arguments
const config: TestConfig = { light: lightMode, listenForWork: true, runUnitTests, stackTraceLimit };
const configPath = ts.combinePaths(taskConfigsFolder, `task-config${i}.json`);
IO.writeFile(configPath, JSON.stringify(config));
const child = fork(__filename, [`--config="${configPath}"`], { stdio: ["pipe", "pipe", "pipe", "ipc"] });
child.accumulatedOutput = "";
const appendOutput = (d: Buffer) => {
child.accumulatedOutput += d.toString();
};
child.stderr.on("data", appendOutput);
child.stdout.on("data", appendOutput);
let currentTimeout = defaultTimeout;
const killChild = () => {
child.kill();
console.error(`Worker exceeded ${currentTimeout}ms timeout ${child.currentTasks && child.currentTasks.length ? `while running test '${child.currentTasks[0].file}'.` : `during test setup.`}`);
return process.exit(2);
};
let timer = setTimeout(killChild, currentTimeout);
const timeoutStack: number[] = [];
child.on("error", err => {
console.error("Unexpected error in child process:");
console.error(err);
return process.exit(2);
});
child.on("exit", (code, _signal) => {
clearTimeout(timer);
if (code !== 0) {
console.error(`Test worker process exited with nonzero exit code! Output:
${child.accumulatedOutput}`);
return process.exit(2);
}
});
child.on("message", (data: ParallelClientMessage) => {
switch (data.type) {
case "error": {
console.error(`Test worker encounted unexpected error${data.payload.name ? ` during the execution of test ${data.payload.name}` : ""} and was forced to close:
Message: ${data.payload.error}
Stack: ${data.payload.stack}`);
return process.exit(2);
}
case "timeout": {
clearTimeout(timer);
if (data.payload.duration === "reset") {
currentTimeout = timeoutStack.pop() || defaultTimeout;
}
else {
timeoutStack.push(currentTimeout);
currentTimeout = data.payload.duration;
}
timer = setTimeout(killChild, currentTimeout); // Reset timeout on timeout update, for when a timeout changes while a suite is executing
break;
}
case "progress":
case "result": {
clearTimeout(timer);
timer = setTimeout(killChild, currentTimeout);
if (child.currentTasks) {
child.currentTasks.shift();
}
totalPassing += data.payload.passing;
if (data.payload.errors.length) {
errorResults = errorResults.concat(data.payload.errors);
passingResults = passingResults.concat(data.payload.passes);
failingFiles++;
}
else {
passingResults = passingResults.concat(data.payload.passes);
passingFiles++;
}
newPerfData[hashName(data.payload.runner, data.payload.file)] = data.payload.duration;
const progress = (failingFiles + passingFiles) / totalFiles;
if (progress >= nextProgress) {
while (nextProgress < progress) {
nextProgress += progressUpdateInterval;
}
updateProgress(progress, errorResults.length ? `${errorResults.length} failing` : `${totalPassing} passing`, errorResults.length ? "fail" : undefined);
}
if (data.type === "result") {
if (tasks.length === 0) {
// No more tasks to distribute
child.send({ type: "close" });
closedWorkers++;
clearTimeout(timer);
if (closedWorkers === workerCount) {
outputFinalResult();
}
return;
}
// Send tasks in blocks if the tasks are small
const taskList = [tasks.pop()!];
while (tasks.length && taskList.reduce((p, c) => p + c.size, 0) < chunkSize) {
taskList.push(tasks.pop()!);
}
child.currentTasks = taskList;
if (taskList.length === 1) {
child.send({ type: "test", payload: taskList[0] } as ParallelHostMessage); // TODO: GH#18217
}
else {
child.send({ type: "batch", payload: taskList } as ParallelHostMessage); // TODO: GH#18217
}
}
}
}
});
workers.push(child);
}
// It's only really worth doing an initial batching if there are a ton of files to go through (and they have estimates)
if (totalFiles > 1000 && batchSize > 0) {
console.log("Batching initial test lists...");
const batches: { runner: TestRunnerKind | "unittest", file: string, size: number }[][] = new Array(batchCount);
const doneBatching = new Array(batchCount);
let scheduledTotal = 0;
batcher: while (true) {
for (let i = 0; i < batchCount; i++) {
if (tasks.length <= workerCount) { // Keep a small reserve even in the suboptimally packed case
console.log(`Suboptimal packing detected: no tests remain to be stolen. Reduce packing fraction from ${packfraction} to fix.`);
break batcher;
}
if (doneBatching[i]) {
continue;
}
if (!batches[i]) {
batches[i] = [];
}
const total = batches[i].reduce((p, c) => p + c.size, 0);
if (total >= batchSize) {
doneBatching[i] = true;
continue;
}
const task = tasks.pop()!;
batches[i].push(task);
scheduledTotal += task.size;
}
for (let j = 0; j < batchCount; j++) {
if (!doneBatching[j]) {
continue batcher;
}
}
break;
}
const prefix = `Batched into ${batchCount} groups`;
if (unknownValue) {
console.log(`${prefix}. Unprofiled tests including ${unknownValue} will be run first.`);
}
else {
console.log(`${prefix} with approximate total ${perfData ? "time" : "file sizes"} of ${perfData ? ms(batchSize) : `${Math.floor(batchSize)} bytes`} in each group. (${(scheduledTotal / totalCost * 100).toFixed(1)}% of total tests batched)`);
}
for (const worker of workers) {
const payload = batches.pop();
if (payload) {
worker.currentTasks = payload;
worker.send({ type: "batch", payload });
}
else { // Out of batches, send off just one test
const payload = tasks.pop()!;
ts.Debug.assert(!!payload); // The reserve kept above should ensure there is always an initial task available, even in suboptimal scenarios
worker.currentTasks = [payload];
worker.send({ type: "test", payload });
}
}
}
else {
for (let i = 0; i < workerCount; i++) {
const task = tasks.pop()!;
workers[i].currentTasks = [task];
workers[i].send({ type: "test", payload: task });
}
}
progressBars.enable();
updateProgress(0);
let duration: number;
function completeBar() {
const isPartitionFail = failingFiles !== 0;
const summaryColor = isPartitionFail ? "fail" : "green";
const summarySymbol = isPartitionFail ? base.symbols.err : base.symbols.ok;
const summaryTests = (isPartitionFail ? totalPassing + "/" + (errorResults.length + totalPassing) : totalPassing) + " passing";
const summaryDuration = "(" + ms(duration) + ")";
const savedUseColors = base.useColors;
base.useColors = !noColors;
const summary = color(summaryColor, summarySymbol + " " + summaryTests) + " " + color("light", summaryDuration);
base.useColors = savedUseColors;
updateProgress(1, summary);
}
function updateProgress(percentComplete: number, title?: string, titleColor?: string) {
let progressColor = "pending";
if (failingFiles) {
progressColor = "fail";
}
progressBars.update(
0,
percentComplete,
progressColor,
title,
titleColor
);
}
function outputFinalResult() {
duration = Date.now() - startTime;
completeBar();
progressBars.disable();
const reporter = new base();
const stats = reporter.stats;
const failures = reporter.failures;
stats.passes = totalPassing;
stats.failures = errorResults.length;
stats.tests = totalPassing + errorResults.length;
stats.duration = duration;
for (const failure of errorResults) {
failures.push(makeMochaTest(failure));
}
if (noColors) {
const savedUseColors = base.useColors;
base.useColors = false;
reporter.epilogue();
base.useColors = savedUseColors;
}
else {
reporter.epilogue();
}
IO.writeFile(perfdataFileName(configOption), JSON.stringify(newPerfData, null, 4)); // tslint:disable-line:no-null-keyword
if (Utils.getExecutionEnvironment() !== Utils.ExecutionEnvironment.Browser && process.env.CI === "true") {
const xunitReport = new xunit({ on: ts.noop, once: ts.noop }, { reporterOptions: { output: "./TEST-results.xml" } });
xunitReport.stats = reporter.stats;
xunitReport.failures = reporter.failures;
const rootAttrs: {[index: string]: any} = {
name: "Tests",
tests: stats.tests,
failures: stats.failures,
errors: stats.failures,
skipped: stats.tests - stats.failures - stats.passes,
timestamp: (new Date()).toUTCString(),
time: (stats.duration / 1000) || 0
};
xunitReport.write(`<?xml version="1.0" encoding="UTF-8"?>` + "\n");
xunitReport.write(`<testsuite ${Object.keys(rootAttrs).map(k => `${k}="${escape("" + rootAttrs[k])}"`).join(" ")}>`);
[...failures, ...ts.map(passingResults, makeMochaTest)].forEach(t => {
xunitReport.test(t);
});
xunitReport.write("</testsuite>");
xunitReport.done(failures, (f: any[]) => {
process.exit(f.length);
});
}
else {
process.exit(failures.length);
}
}
function makeMochaTest(test: ErrorInfo | TestInfo) {
return {
state: (test as ErrorInfo).error ? "failed" : "passed",
parent: {
fullTitle: () => {
return test.name.slice(0, test.name.length - 1).join(" ");
}
},
title: test.name[test.name.length - 1],
fullTitle: () => {
return test.name.join(" ");
},
titlePath: () => {
return test.name;
},
isPending: () => false,
err: (test as ErrorInfo).error ? {
message: (test as ErrorInfo).error,
stack: (test as ErrorInfo).stack
} : undefined
};
}
(global as any).describe = ts.noop as any; // Disable unit tests
return;
}
let mocha: any;
let base: any;
let xunit: any;
let color: any;
let cursor: any;
let readline: any;
let os: any;
let tty: { isatty(x: number): boolean };
let isatty: boolean;
const s = 1000;
const m = s * 60;
const h = m * 60;
const d = h * 24;
function ms(ms: number) {
let result = "";
if (ms >= d) {
const count = Math.floor(ms / d);
result += count + "d";
ms -= count * d;
}
if (ms >= h) {
const count = Math.floor(ms / h);
result += count + "h";
ms -= count * h;
}
if (ms >= m) {
const count = Math.floor(ms / m);
result += count + "m";
ms -= count * m;
}
if (ms >= s) {
const count = Math.round(ms / s);
result += count + "s";
return result;
}
if (ms > 0) {
result += Math.round(ms) + "ms";
}
return result;
}
function initializeProgressBarsDependencies() {
mocha = require("mocha");
base = mocha.reporters.Base;
xunit = mocha.reporters.xunit;
color = base.color;
cursor = base.cursor;
readline = require("readline");
os = require("os");
tty = require("tty");
isatty = tty.isatty(1) && tty.isatty(2);
}
class ProgressBars {
public readonly _options: Readonly<ProgressBarsOptions>;
private _enabled: boolean;
private _lineCount: number;
private _progressBars: ProgressBar[];
constructor(options?: Partial<ProgressBarsOptions>) {
if (!options) options = {};
const open = options.open || "[";
const close = options.close || "]";
const complete = options.complete || "▬";
const incomplete = options.incomplete || base.symbols.dot;
const maxWidth = base.window.width - open.length - close.length - 34;
const width = minMax(options.width || maxWidth, 10, maxWidth);
this._options = {
open,
complete,
incomplete,
close,
width,
noColors: options.noColors || false
};
this._progressBars = [];
this._lineCount = 0;
this._enabled = false;
}
enable() {
if (!this._enabled) {
process.stdout.write(os.EOL);
this._enabled = true;
}
}
disable() {
if (this._enabled) {
process.stdout.write(os.EOL);
this._enabled = false;
}
}
update(index: number, percentComplete: number, color: string, title: string | undefined, titleColor?: string) {
percentComplete = minMax(percentComplete, 0, 1);
const progressBar = this._progressBars[index] || (this._progressBars[index] = { });
const width = this._options.width;
const n = Math.floor(width * percentComplete);
const i = width - n;
if (n === progressBar.lastN && title === progressBar.title && color === progressBar.progressColor) {
return;
}
progressBar.lastN = n;
progressBar.title = title;
progressBar.progressColor = color;
let progress = " ";
progress += this._color("progress", this._options.open);
progress += this._color(color, fill(this._options.complete, n));
progress += this._color("progress", fill(this._options.incomplete, i));
progress += this._color("progress", this._options.close);
if (title) {
progress += this._color(titleColor || "progress", " " + title);
}
if (progressBar.text !== progress) {
progressBar.text = progress;
this._render(index);
}
}
private _render(index: number) {
if (!this._enabled || !isatty) {
return;
}
cursor.hide();
readline.moveCursor(process.stdout, -process.stdout.columns!, -this._lineCount);
let lineCount = 0;
const numProgressBars = this._progressBars.length;
for (let i = 0; i < numProgressBars; i++) {
if (i === index) {
readline.clearLine(process.stdout, 1);
process.stdout.write(this._progressBars[i].text + os.EOL);
}
else {
readline.moveCursor(process.stdout, -process.stdout.columns!, +1);
}
lineCount++;
}
this._lineCount = lineCount;
cursor.show();
}
private _color(type: string, text: string) {
return type && !this._options.noColors ? color(type, text) : text;
}
}
function fill(ch: string, size: number) {
let s = "";
while (s.length < size) {
s += ch;
}
return s.length > size ? s.substr(0, size) : s;
}
function minMax(value: number, min: number, max: number) {
if (value < min) return min;
if (value > max) return max;
return value;
}
}
-16
View File
@@ -1,16 +0,0 @@
/// <reference path="./host.ts" />
/// <reference path="./worker.ts" />
namespace Harness.Parallel {
export type ParallelTestMessage = { type: "test", payload: { runner: TestRunnerKind | "unittest", file: string } } | never;
export type ParallelBatchMessage = { type: "batch", payload: ParallelTestMessage["payload"][] } | never;
export type ParallelCloseMessage = { type: "close" } | never;
export type ParallelHostMessage = ParallelTestMessage | ParallelCloseMessage | ParallelBatchMessage;
export type ParallelErrorMessage = { type: "error", payload: { error: string, stack: string, name?: string[] } } | never;
export type TestInfo = { name: string[] } | never;
export type ErrorInfo = ParallelErrorMessage["payload"] & TestInfo;
export type ParallelResultMessage = { type: "result", payload: { passing: number, errors: ErrorInfo[], passes: TestInfo[], duration: number, runner: TestRunnerKind | "unittest", file: string } } | never;
export type ParallelBatchProgressMessage = { type: "progress", payload: ParallelResultMessage["payload"] } | never;
export type ParallelTimeoutChangeMessage = { type: "timeout", payload: { duration: number | "reset" } } | never;
export type ParallelClientMessage = ParallelErrorMessage | ParallelResultMessage | ParallelBatchProgressMessage | ParallelTimeoutChangeMessage;
}
-312
View File
@@ -1,312 +0,0 @@
// tslint:disable no-unnecessary-type-assertion (TODO: tslint can't find node types)
namespace Harness.Parallel.Worker {
let errors: ErrorInfo[] = [];
let passes: TestInfo[] = [];
let passing = 0;
type MochaCallback = (this: Mocha.ISuiteCallbackContext, done: MochaDone) => void;
type Callable = () => void;
type Executor = {name: string, callback: MochaCallback, kind: "suite" | "test"} | never;
function resetShimHarnessAndExecute(runner: RunnerBase) {
errors = [];
passes = [];
passing = 0;
testList.length = 0;
const start = +(new Date());
runner.initializeTests();
testList.forEach(({ name, callback, kind }) => executeCallback(name, callback, kind));
return { errors, passes, passing, duration: +(new Date()) - start };
}
let beforeEachFunc: Callable;
const namestack: string[] = [];
let testList: Executor[] = [];
function shimMochaHarness() {
(global as any).before = undefined;
(global as any).after = undefined;
(global as any).beforeEach = undefined;
(global as any).describe = ((name, callback) => {
testList.push({ name, callback, kind: "suite" });
}) as Mocha.IContextDefinition;
(global as any).describe.skip = ts.noop;
(global as any).it = ((name, callback) => {
if (!testList) {
throw new Error("Tests must occur within a describe block");
}
testList.push({ name, callback: callback!, kind: "test" });
}) as Mocha.ITestDefinition;
(global as any).it.skip = ts.noop;
}
function setTimeoutAndExecute(timeout: number | undefined, f: () => void) {
if (timeout !== undefined) {
const timeoutMsg: ParallelTimeoutChangeMessage = { type: "timeout", payload: { duration: timeout } };
process.send!(timeoutMsg);
}
f();
if (timeout !== undefined) {
// Reset timeout
const timeoutMsg: ParallelTimeoutChangeMessage = { type: "timeout", payload: { duration: "reset" } };
process.send!(timeoutMsg);
}
}
function executeSuiteCallback(name: string, callback: MochaCallback) {
let timeout: number | undefined;
const fakeContext: Mocha.ISuiteCallbackContext = {
retries() { return this; },
slow() { return this; },
timeout(n: number) {
timeout = n;
return this;
},
};
namestack.push(name);
let beforeFunc: Callable | undefined;
(before as any) = (cb: Callable) => beforeFunc = cb;
let afterFunc: Callable | undefined;
(after as any) = (cb: Callable) => afterFunc = cb;
const savedBeforeEach = beforeEachFunc;
(beforeEach as any) = (cb: Callable) => beforeEachFunc = cb;
const savedTestList = testList;
testList = [];
try {
callback.call(fakeContext);
}
catch (e) {
errors.push({ error: `Error executing suite: ${e.message}`, stack: e.stack, name: [...namestack] });
return cleanup();
}
try {
if (beforeFunc) {
beforeFunc();
}
}
catch (e) {
errors.push({ error: `Error executing before function: ${e.message}`, stack: e.stack, name: [...namestack] });
return cleanup();
}
finally {
beforeFunc = undefined;
}
setTimeoutAndExecute(timeout, () => {
testList.forEach(({ name, callback, kind }) => executeCallback(name, callback, kind));
});
try {
if (afterFunc) {
afterFunc();
}
}
catch (e) {
errors.push({ error: `Error executing after function: ${e.message}`, stack: e.stack, name: [...namestack] });
}
finally {
afterFunc = undefined;
cleanup();
}
function cleanup() {
testList.length = 0;
testList = savedTestList;
beforeEachFunc = savedBeforeEach;
namestack.pop();
}
}
function executeCallback(name: string, callback: MochaCallback, kind: "suite" | "test") {
if (kind === "suite") {
executeSuiteCallback(name, callback);
}
else {
executeTestCallback(name, callback);
}
}
function executeTestCallback(name: string, callback: MochaCallback) {
let timeout: number | undefined;
const fakeContext: Mocha.ITestCallbackContext = {
skip() { return this; },
timeout(n: number) {
timeout = n;
const timeoutMsg: ParallelTimeoutChangeMessage = { type: "timeout", payload: { duration: timeout } };
process.send!(timeoutMsg);
return this;
},
retries() { return this; },
slow() { return this; },
};
namestack.push(name);
if (beforeEachFunc) {
try {
beforeEachFunc();
}
catch (error) {
errors.push({ error: error.message, stack: error.stack, name: [...namestack] });
namestack.pop();
return;
}
}
if (callback.length === 0) {
try {
// TODO: If we ever start using async test completions, polyfill promise return handling
callback.call(fakeContext);
passes.push({ name: [...namestack] });
}
catch (error) {
errors.push({ error: error.message, stack: error.stack, name: [...namestack] });
return;
}
finally {
namestack.pop();
if (timeout !== undefined) {
const timeoutMsg: ParallelTimeoutChangeMessage = { type: "timeout", payload: { duration: "reset" } };
process.send!(timeoutMsg);
}
}
passing++;
}
else {
// Uses `done` callback
let completed = false;
try {
callback.call(fakeContext, (err: any) => {
if (completed) {
throw new Error(`done() callback called multiple times; ensure it is only called once.`);
}
if (err) {
errors.push({ error: err.toString(), stack: "", name: [...namestack] });
}
else {
passes.push({ name: [...namestack] });
passing++;
}
completed = true;
});
}
catch (error) {
errors.push({ error: error.message, stack: error.stack, name: [...namestack] });
return;
}
finally {
namestack.pop();
if (timeout !== undefined) {
const timeoutMsg: ParallelTimeoutChangeMessage = { type: "timeout", payload: { duration: "reset" } };
process.send!(timeoutMsg);
}
}
if (!completed) {
errors.push({ error: "Test completes asynchronously, which is unsupported by the parallel harness", stack: "", name: [...namestack] });
}
}
}
export function start() {
let initialized = false;
const runners = ts.createMap<RunnerBase>();
process.on("message", (data: ParallelHostMessage) => {
if (!initialized) {
initialized = true;
shimMochaHarness();
}
switch (data.type) {
case "test":
const { runner, file } = data.payload;
if (!runner) {
console.error(data);
}
const message: ParallelResultMessage = { type: "result", payload: handleTest(runner, file) };
process.send!(message);
break;
case "close":
process.exit(0);
break;
case "batch": {
const items = data.payload;
for (let i = 0; i < items.length; i++) {
const { runner, file } = items[i];
if (!runner) {
console.error(data);
}
let message: ParallelBatchProgressMessage | ParallelResultMessage;
const payload = handleTest(runner, file);
if (i === (items.length - 1)) {
message = { type: "result", payload };
}
else {
message = { type: "progress", payload };
}
process.send!(message);
}
break;
}
}
});
process.on("uncaughtException", error => {
const message: ParallelErrorMessage = { type: "error", payload: { error: error.message, stack: error.stack!, name: [...namestack] } };
try {
process.send!(message);
}
catch (e) {
console.error(error);
throw error;
}
});
if (!runUnitTests) {
// ensure unit tests do not get run
(global as any).describe = ts.noop;
}
else {
initialized = true;
shimMochaHarness();
}
function handleTest(runner: TestRunnerKind | "unittest", file: string) {
collectUnitTestsIfNeeded();
if (runner === unittest) {
return executeUnitTest(file);
}
else {
if (!runners.has(runner)) {
runners.set(runner, createRunner(runner));
}
const instance = runners.get(runner)!;
instance.tests = [file];
return { ...resetShimHarnessAndExecute(instance), runner, file };
}
}
}
const unittest: "unittest" = "unittest";
let unitTests: {[name: string]: MochaCallback};
function collectUnitTestsIfNeeded() {
if (!unitTests && testList.length) {
unitTests = {};
for (const test of testList) {
unitTests[test.name] = test.callback;
}
testList.length = 0;
}
}
function executeUnitTest(name: string) {
if (!unitTests) {
throw new Error(`Asked to run unit test ${name}, but no unit tests were discovered!`);
}
if (unitTests[name]) {
errors = [];
passes = [];
passing = 0;
const start = +(new Date());
executeSuiteCallback(name, unitTests[name]);
delete unitTests[name];
return { file: name, runner: unittest, errors, passes, passing, duration: +(new Date()) - start };
}
throw new Error(`Unit test with name "${name}" was asked to be run, but such a test does not exist!`);
}
}
+36 -192
View File
@@ -1,20 +1,3 @@
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///<reference path="harness.ts"/>
namespace Harness.SourceMapRecorder {
interface SourceMapSpanWithDecodeErrors {
@@ -24,177 +7,38 @@ namespace Harness.SourceMapRecorder {
namespace SourceMapDecoder {
let sourceMapMappings: string;
let sourceMapNames: string[] | undefined;
let decodingIndex: number;
let prevNameIndex: number;
let decodeOfEncodedMapping: ts.SourceMapSpan;
let errorDecodeOfEncodedMapping: string | undefined;
let mappings: ts.sourcemaps.MappingsDecoder | undefined;
export interface DecodedMapping {
sourceMapSpan: ts.SourceMapSpan;
error?: string;
}
export function initializeSourceMapDecoding(sourceMapData: ts.SourceMapData) {
sourceMapMappings = sourceMapData.sourceMapMappings;
sourceMapNames = sourceMapData.sourceMapNames;
decodingIndex = 0;
prevNameIndex = 0;
decodeOfEncodedMapping = {
emittedLine: 1,
emittedColumn: 1,
sourceLine: 1,
sourceColumn: 1,
sourceIndex: 0,
};
errorDecodeOfEncodedMapping = undefined;
sourceMapMappings = sourceMapData.sourceMapMappings;
mappings = ts.sourcemaps.decodeMappings({
version: 3,
file: sourceMapData.sourceMapFile,
sources: sourceMapData.sourceMapSources,
sourceRoot: sourceMapData.sourceMapSourceRoot,
sourcesContent: sourceMapData.sourceMapSourcesContent,
mappings: sourceMapData.sourceMapMappings,
names: sourceMapData.sourceMapNames
});
}
function isSourceMappingSegmentEnd() {
if (decodingIndex === sourceMapMappings.length) {
return true;
}
if (sourceMapMappings.charAt(decodingIndex) === ",") {
return true;
}
if (sourceMapMappings.charAt(decodingIndex) === ";") {
return true;
}
return false;
}
export function decodeNextEncodedSourceMapSpan() {
errorDecodeOfEncodedMapping = undefined;
function createErrorIfCondition(condition: boolean, errormsg: string) {
if (errorDecodeOfEncodedMapping) {
// there was existing error:
return true;
}
if (condition) {
errorDecodeOfEncodedMapping = errormsg;
}
return condition;
}
function base64VLQFormatDecode() {
function base64FormatDecode() {
return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(sourceMapMappings.charAt(decodingIndex));
}
let moreDigits = true;
let shiftCount = 0;
let value = 0;
for (; moreDigits; decodingIndex++) {
if (createErrorIfCondition(decodingIndex >= sourceMapMappings.length, "Error in decoding base64VLQFormatDecode, past the mapping string")) {
return undefined!; // TODO: GH#18217
}
// 6 digit number
const currentByte = base64FormatDecode();
// If msb is set, we still have more bits to continue
moreDigits = (currentByte & 32) !== 0;
// least significant 5 bits are the next msbs in the final value.
value = value | ((currentByte & 31) << shiftCount);
shiftCount += 5;
}
// Least significant bit if 1 represents negative and rest of the msb is actual absolute value
if ((value & 1) === 0) {
// + number
value = value >> 1;
}
else {
// - number
value = value >> 1;
value = -value;
}
return value;
}
while (decodingIndex < sourceMapMappings.length) {
if (sourceMapMappings.charAt(decodingIndex) === ";") {
// New line
decodeOfEncodedMapping.emittedLine++;
decodeOfEncodedMapping.emittedColumn = 1;
decodingIndex++;
continue;
}
if (sourceMapMappings.charAt(decodingIndex) === ",") {
// Next entry is on same line - no action needed
decodingIndex++;
continue;
}
// Read the current span
// 1. Column offset from prev read jsColumn
decodeOfEncodedMapping.emittedColumn += base64VLQFormatDecode();
// Incorrect emittedColumn dont support this map
if (createErrorIfCondition(decodeOfEncodedMapping.emittedColumn < 1, "Invalid emittedColumn found")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// Dont support reading mappings that dont have information about original source and its line numbers
if (createErrorIfCondition(isSourceMappingSegmentEnd(), "Unsupported Error Format: No entries after emitted column")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// 2. Relative sourceIndex
decodeOfEncodedMapping.sourceIndex += base64VLQFormatDecode();
// Incorrect sourceIndex dont support this map
if (createErrorIfCondition(decodeOfEncodedMapping.sourceIndex < 0, "Invalid sourceIndex found")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// Dont support reading mappings that dont have information about original source span
if (createErrorIfCondition(isSourceMappingSegmentEnd(), "Unsupported Error Format: No entries after sourceIndex")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// 3. Relative sourceLine 0 based
decodeOfEncodedMapping.sourceLine += base64VLQFormatDecode();
// Incorrect sourceLine dont support this map
if (createErrorIfCondition(decodeOfEncodedMapping.sourceLine < 1, "Invalid sourceLine found")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// Dont support reading mappings that dont have information about original source and its line numbers
if (createErrorIfCondition(isSourceMappingSegmentEnd(), "Unsupported Error Format: No entries after emitted Line")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// 4. Relative sourceColumn 0 based
decodeOfEncodedMapping.sourceColumn += base64VLQFormatDecode();
// Incorrect sourceColumn dont support this map
if (createErrorIfCondition(decodeOfEncodedMapping.sourceColumn < 1, "Invalid sourceLine found")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// 5. Check if there is name:
if (!isSourceMappingSegmentEnd()) {
prevNameIndex += base64VLQFormatDecode();
decodeOfEncodedMapping.nameIndex = prevNameIndex;
// Incorrect nameIndex dont support this map
if (createErrorIfCondition(decodeOfEncodedMapping.nameIndex < 0 || decodeOfEncodedMapping.nameIndex >= sourceMapNames!.length, "Invalid name index for the source map entry")) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
}
// Dont support reading mappings that dont have information about original source and its line numbers
if (createErrorIfCondition(!isSourceMappingSegmentEnd(), "Unsupported Error Format: There are more entries after " + (decodeOfEncodedMapping.nameIndex === -1 ? "sourceColumn" : "nameIndex"))) {
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
// Populated the entry
return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping };
}
createErrorIfCondition(/*condition*/ true, "No encoded entry found");
return undefined!; // TODO: GH#18217
export function decodeNextEncodedSourceMapSpan(): DecodedMapping {
if (!mappings) return ts.Debug.fail("not initialized");
const result = mappings.next();
if (result.done) return { error: mappings.error || "No encoded entry found", sourceMapSpan: mappings.lastSpan };
return { sourceMapSpan: result.value };
}
export function hasCompletedDecoding() {
return decodingIndex === sourceMapMappings.length;
if (!mappings) return ts.Debug.fail("not initialized");
return mappings.decodingIndex === sourceMapMappings.length;
}
export function getRemainingDecodeString() {
@@ -214,7 +58,7 @@ namespace Harness.SourceMapRecorder {
let spansOnSingleLine: SourceMapSpanWithDecodeErrors[];
let prevWrittenSourcePos: number;
let prevWrittenJsLine: number;
let nextJsLineToWrite: number;
let spanMarkerContinues: boolean;
export function initializeSourceMapSpanWriter(sourceMapRecordWriter: Compiler.WriterAggregator, sourceMapData: ts.SourceMapData, currentJsFile: documents.TextDocument) {
@@ -227,7 +71,7 @@ namespace Harness.SourceMapRecorder {
spansOnSingleLine = [];
prevWrittenSourcePos = 0;
prevWrittenJsLine = 0;
nextJsLineToWrite = 0;
spanMarkerContinues = false;
SourceMapDecoder.initializeSourceMapDecoding(sourceMapData);
@@ -244,7 +88,7 @@ namespace Harness.SourceMapRecorder {
}
function getSourceMapSpanString(mapEntry: ts.SourceMapSpan, getAbsentNameIndex?: boolean) {
let mapString = "Emitted(" + mapEntry.emittedLine + ", " + mapEntry.emittedColumn + ") Source(" + mapEntry.sourceLine + ", " + mapEntry.sourceColumn + ") + SourceIndex(" + mapEntry.sourceIndex + ")";
let mapString = "Emitted(" + (mapEntry.emittedLine + 1) + ", " + (mapEntry.emittedColumn + 1) + ") Source(" + (mapEntry.sourceLine + 1) + ", " + (mapEntry.sourceColumn + 1) + ") + SourceIndex(" + mapEntry.sourceIndex + ")";
if (mapEntry.nameIndex! >= 0 && mapEntry.nameIndex! < sourceMapNames!.length) {
mapString += " name (" + sourceMapNames![mapEntry.nameIndex!] + ")";
}
@@ -261,7 +105,7 @@ namespace Harness.SourceMapRecorder {
// verify the decoded span is same as the new span
const decodeResult = SourceMapDecoder.decodeNextEncodedSourceMapSpan();
let decodeErrors: string[] | undefined;
if (decodeResult.error
if (typeof decodeResult.error === "string"
|| decodeResult.sourceMapSpan.emittedLine !== sourceMapSpan.emittedLine
|| decodeResult.sourceMapSpan.emittedColumn !== sourceMapSpan.emittedColumn
|| decodeResult.sourceMapSpan.sourceLine !== sourceMapSpan.sourceLine
@@ -322,8 +166,8 @@ namespace Harness.SourceMapRecorder {
}
function writeJsFileLines(endJsLine: number) {
for (; prevWrittenJsLine < endJsLine; prevWrittenJsLine++) {
sourceMapRecorder.Write(">>>" + getTextOfLine(prevWrittenJsLine, jsLineMap, jsFile.text));
for (; nextJsLineToWrite < endJsLine; nextJsLineToWrite++) {
sourceMapRecorder.Write(">>>" + getTextOfLine(nextJsLineToWrite, jsLineMap, jsFile.text));
}
}
@@ -348,7 +192,7 @@ namespace Harness.SourceMapRecorder {
let prevEmittedCol!: number;
function iterateSpans(fn: (currentSpan: SourceMapSpanWithDecodeErrors, index: number) => void) {
prevEmittedCol = 1;
prevEmittedCol = 0;
for (let i = 0; i < spansOnSingleLine.length; i++) {
fn(spansOnSingleLine[i], i);
prevEmittedCol = spansOnSingleLine[i].sourceMapSpan.emittedColumn;
@@ -357,7 +201,7 @@ namespace Harness.SourceMapRecorder {
function writeSourceMapIndent(indentLength: number, indentPrefix: string) {
sourceMapRecorder.Write(indentPrefix);
for (let i = 1; i < indentLength; i++) {
for (let i = 0; i < indentLength; i++) {
sourceMapRecorder.Write(" ");
}
}
@@ -379,7 +223,7 @@ namespace Harness.SourceMapRecorder {
}
function writeSourceMapSourceText(currentSpan: SourceMapSpanWithDecodeErrors, index: number) {
const sourcePos = tsLineMap[currentSpan.sourceMapSpan.sourceLine - 1] + (currentSpan.sourceMapSpan.sourceColumn - 1);
const sourcePos = tsLineMap[currentSpan.sourceMapSpan.sourceLine] + (currentSpan.sourceMapSpan.sourceColumn);
let sourceText = "";
if (prevWrittenSourcePos < sourcePos) {
// Position that goes forward, get text
@@ -414,15 +258,15 @@ namespace Harness.SourceMapRecorder {
const currentJsLine = spansOnSingleLine[0].sourceMapSpan.emittedLine;
// Write js line
writeJsFileLines(currentJsLine);
writeJsFileLines(currentJsLine + 1);
// Emit markers
iterateSpans(writeSourceMapMarker);
const jsFileText = getTextOfLine(currentJsLine, jsLineMap, jsFile.text);
if (prevEmittedCol < jsFileText.length) {
const jsFileText = getTextOfLine(currentJsLine + 1, jsLineMap, jsFile.text);
if (prevEmittedCol < jsFileText.length - 1) {
// There is remaining text on this line that will be part of next source span so write marker that continues
writeSourceMapMarker(/*currentSpan*/ undefined!, spansOnSingleLine.length, /*endColumn*/ jsFileText.length, /*endContinues*/ true); // TODO: GH#18217
writeSourceMapMarker(/*currentSpan*/ undefined!, spansOnSingleLine.length, /*endColumn*/ jsFileText.length - 1, /*endContinues*/ true); // TODO: GH#18217
}
// Emit Source text
+13 -148
View File
@@ -1,9 +1,7 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"removeComments": false,
"outFile": "../../built/local/run.js",
"declaration": false,
"outFile": "../../built/local/harness.js",
"types": [
"node", "mocha", "chai"
],
@@ -12,138 +10,15 @@
"scripthost"
]
},
"references": [
{ "path": "../compiler" },
{ "path": "../services" },
{ "path": "../jsTyping" },
{ "path": "../server" },
{ "path": "../typingsInstallerCore" }
],
"files": [
"../compiler/types.ts",
"../compiler/performance.ts",
"../compiler/core.ts",
"../compiler/sys.ts",
"../compiler/diagnosticInformationMap.generated.ts",
"../compiler/scanner.ts",
"../compiler/utilities.ts",
"../compiler/parser.ts",
"../compiler/binder.ts",
"../compiler/symbolWalker.ts",
"../compiler/moduleNameResolver.ts",
"../compiler/checker.ts",
"../compiler/factory.ts",
"../compiler/visitor.ts",
"../compiler/transformers/utilities.ts",
"../compiler/transformers/destructuring.ts",
"../compiler/transformers/ts.ts",
"../compiler/transformers/es2017.ts",
"../compiler/transformers/esnext.ts",
"../compiler/transformers/jsx.ts",
"../compiler/transformers/es2016.ts",
"../compiler/transformers/es2015.ts",
"../compiler/transformers/es5.ts",
"../compiler/transformers/generators.ts",
"../compiler/transformers/module/module.ts",
"../compiler/transformers/module/system.ts",
"../compiler/transformers/module/es2015.ts",
"../compiler/transformers/declarations/diagnostics.ts",
"../compiler/transformers/declarations.ts",
"../compiler/transformer.ts",
"../compiler/sourcemap.ts",
"../compiler/comments.ts",
"../compiler/emitter.ts",
"../compiler/watchUtilities.ts",
"../compiler/program.ts",
"../compiler/builderState.ts",
"../compiler/builder.ts",
"../compiler/resolutionCache.ts",
"../compiler/moduleSpecifiers.ts",
"../compiler/watch.ts",
"../compiler/tsbuild.ts",
"../compiler/commandLineParser.ts",
"../services/types.ts",
"../services/utilities.ts",
"../services/classifier.ts",
"../services/pathCompletions.ts",
"../services/completions.ts",
"../services/documentHighlights.ts",
"../services/documentRegistry.ts",
"../services/importTracker.ts",
"../services/findAllReferences.ts",
"../services/getEditsForFileRename.ts",
"../services/goToDefinition.ts",
"../services/jsDoc.ts",
"../services/semver.ts",
"../services/jsTyping.ts",
"../services/navigateTo.ts",
"../services/navigationBar.ts",
"../services/organizeImports.ts",
"../services/getEditsForFileRename.ts",
"../services/outliningElementsCollector.ts",
"../services/patternMatcher.ts",
"../services/preProcess.ts",
"../services/rename.ts",
"../services/signatureHelp.ts",
"../services/suggestionDiagnostics.ts",
"../services/symbolDisplay.ts",
"../services/transpile.ts",
"../services/formatting/formattingContext.ts",
"../services/formatting/formattingScanner.ts",
"../services/formatting/rule.ts",
"../services/formatting/rules.ts",
"../services/formatting/rulesMap.ts",
"../services/formatting/formatting.ts",
"../services/formatting/smartIndenter.ts",
"../services/textChanges.ts",
"../services/codeFixProvider.ts",
"../services/refactorProvider.ts",
"../services/codefixes/addMissingInvocationForDecorator.ts",
"../services/codefixes/annotateWithTypeFromJSDoc.ts",
"../services/codefixes/convertFunctionToEs6Class.ts",
"../services/codefixes/convertToEs6Module.ts",
"../services/codefixes/correctQualifiedNameToIndexedAccessType.ts",
"../services/codefixes/fixClassIncorrectlyImplementsInterface.ts",
"../services/codefixes/importFixes.ts",
"../services/codefixes/fixSpelling.ts",
"../services/codefixes/fixAddMissingMember.ts",
"../services/codefixes/fixCannotFindModule.ts",
"../services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts",
"../services/codefixes/fixClassSuperMustPrecedeThisAccess.ts",
"../services/codefixes/fixConstructorForDerivedNeedSuperCall.ts",
"../services/codefixes/fixExtendsInterfaceBecomesImplements.ts",
"../services/codefixes/fixForgottenThisPropertyAccess.ts",
"../services/codefixes/fixUnusedIdentifier.ts",
"../services/codefixes/fixUnreachableCode.ts",
"../services/codefixes/fixUnusedLabel.ts",
"../services/codefixes/fixJSDocTypes.ts",
"../services/codefixes/fixAwaitInSyncFunction.ts",
"../services/codefixes/disableJsDiagnostics.ts",
"../services/codefixes/helpers.ts",
"../services/codefixes/inferFromUsage.ts",
"../services/codefixes/fixInvalidImportSyntax.ts",
"../services/codefixes/fixStrictClassInitialization.ts",
"../services/codefixes/requireInTs.ts",
"../services/codefixes/useDefaultImport.ts",
"../services/codefixes/fixAddModuleReferTypeMissingTypeof.ts",
"../services/codefixes/convertToMappedObjectType.ts",
"../services/refactors/convertImport.ts",
"../services/refactors/extractSymbol.ts",
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
"../services/refactors/moveToNewFile.ts",
"../services/sourcemaps.ts",
"../services/services.ts",
"../services/breakpoints.ts",
"../services/transform.ts",
"../services/shims.ts",
"../server/typingsInstaller/typingsInstaller.ts",
"../server/types.ts",
"../server/shared.ts",
"../server/utilities.ts",
"../server/protocol.ts",
"../server/scriptInfo.ts",
"../server/typingsCache.ts",
"../server/project.ts",
"../server/editorServices.ts",
"../server/session.ts",
"../server/scriptVersionCache.ts",
"collections.ts",
"utils.ts",
"documents.ts",
@@ -152,25 +27,15 @@
"compiler.ts",
"evaluator.ts",
"fakes.ts",
"client.ts",
"sourceMapRecorder.ts",
"runnerbase.ts",
"sourceMapRecorder.ts",
"harness.ts",
"harnessLanguageService.ts",
"virtualFileSystemWithWatch.ts",
"fourslashRunner.ts",
"fourslash.ts",
"typeWriter.ts",
"compilerRunner.ts",
"projectsRunner.ts",
"loggedIO.ts",
"rwcRunner.ts",
"externalCompileRunner.ts",
"test262Runner.ts",
"parallel/host.ts",
"parallel/worker.ts",
"parallel/shared.ts",
"runner.ts"
],
"include": ["unittests/**/*.ts"]
"loggedIO.ts"
]
}
+258 -24
View File
@@ -126,6 +126,24 @@ namespace vfs {
return this._shadowRoot;
}
/**
* Snapshots the current file system, effectively shadowing itself. This is useful for
* generating file system patches using `.diff()` from one snapshot to the next. Performs
* no action if this file system is read-only.
*/
public snapshot() {
if (this.isReadonly) return;
const fs = new FileSystem(this.ignoreCase, { time: this._time });
fs._lazy = this._lazy;
fs._cwd = this._cwd;
fs._time = this._time;
fs._shadowRoot = this._shadowRoot;
fs._dirStack = this._dirStack;
fs.makeReadonly();
this._lazy = {};
this._shadowRoot = fs;
}
/**
* Gets a shadow copy of this file system. Changes to the shadow copy do not affect the
* original, allowing multiple copies of the same core file system without multiple copies
@@ -671,6 +689,160 @@ namespace vfs {
node.ctimeMs = time;
}
/**
* Generates a `FileSet` patch containing all the entries in this `FileSystem` that are not in `base`.
* @param base The base file system. If not provided, this file system's `shadowRoot` is used (if present).
*/
public diff(base = this.shadowRoot) {
const differences: FileSet = {};
const hasDifferences = base ? FileSystem.rootDiff(differences, this, base) : FileSystem.trackCreatedInodes(differences, this, this._getRootLinks());
return hasDifferences ? differences : undefined;
}
/**
* Generates a `FileSet` patch containing all the entries in `chagned` that are not in `base`.
*/
public static diff(changed: FileSystem, base: FileSystem) {
const differences: FileSet = {};
return FileSystem.rootDiff(differences, changed, base) ? differences : undefined;
}
private static diffWorker(container: FileSet, changed: FileSystem, changedLinks: ReadonlyMap<string, Inode> | undefined, base: FileSystem, baseLinks: ReadonlyMap<string, Inode> | undefined) {
if (changedLinks && !baseLinks) return FileSystem.trackCreatedInodes(container, changed, changedLinks);
if (baseLinks && !changedLinks) return FileSystem.trackDeletedInodes(container, baseLinks);
if (changedLinks && baseLinks) {
let hasChanges = false;
// track base items missing in changed
baseLinks.forEach((node, basename) => {
if (!changedLinks.has(basename)) {
container[basename] = isDirectory(node) ? new Rmdir() : new Unlink();
hasChanges = true;
}
});
// track changed items missing or differing in base
changedLinks.forEach((changedNode, basename) => {
const baseNode = baseLinks.get(basename);
if (baseNode) {
if (isDirectory(changedNode) && isDirectory(baseNode)) {
return hasChanges = FileSystem.directoryDiff(container, basename, changed, changedNode, base, baseNode) || hasChanges;
}
if (isFile(changedNode) && isFile(baseNode)) {
return hasChanges = FileSystem.fileDiff(container, basename, changed, changedNode, base, baseNode) || hasChanges;
}
if (isSymlink(changedNode) && isSymlink(baseNode)) {
return hasChanges = FileSystem.symlinkDiff(container, basename, changedNode, baseNode) || hasChanges;
}
}
return hasChanges = FileSystem.trackCreatedInode(container, basename, changed, changedNode) || hasChanges;
});
return hasChanges;
}
return false;
}
private static rootDiff(container: FileSet, changed: FileSystem, base: FileSystem) {
while (!changed._lazy.links && changed._shadowRoot) changed = changed._shadowRoot;
while (!base._lazy.links && base._shadowRoot) base = base._shadowRoot;
// no difference if the file systems are the same reference
if (changed === base) return false;
// no difference if the root links are empty and unshadowed
if (!changed._lazy.links && !changed._shadowRoot && !base._lazy.links && !base._shadowRoot) return false;
return FileSystem.diffWorker(container, changed, changed._getRootLinks(), base, base._getRootLinks());
}
private static directoryDiff(container: FileSet, basename: string, changed: FileSystem, changedNode: DirectoryInode, base: FileSystem, baseNode: DirectoryInode) {
while (!changedNode.links && changedNode.shadowRoot) changedNode = changedNode.shadowRoot;
while (!baseNode.links && baseNode.shadowRoot) baseNode = baseNode.shadowRoot;
// no difference if the nodes are the same reference
if (changedNode === baseNode) return false;
// no difference if both nodes are non shadowed and have no entries
if (isEmptyNonShadowedDirectory(changedNode) && isEmptyNonShadowedDirectory(baseNode)) return false;
// no difference if both nodes are unpopulated and point to the same mounted file system
if (!changedNode.links && !baseNode.links &&
changedNode.resolver && changedNode.source !== undefined &&
baseNode.resolver === changedNode.resolver && baseNode.source === changedNode.source) return false;
// no difference if both nodes have identical children
const children: FileSet = {};
if (!FileSystem.diffWorker(children, changed, changed._getLinks(changedNode), base, base._getLinks(baseNode))) {
return false;
}
container[basename] = new Directory(children);
return true;
}
private static fileDiff(container: FileSet, basename: string, changed: FileSystem, changedNode: FileInode, base: FileSystem, baseNode: FileInode) {
while (!changedNode.buffer && changedNode.shadowRoot) changedNode = changedNode.shadowRoot;
while (!baseNode.buffer && baseNode.shadowRoot) baseNode = baseNode.shadowRoot;
// no difference if the nodes are the same reference
if (changedNode === baseNode) return false;
// no difference if both nodes are non shadowed and have no entries
if (isEmptyNonShadowedFile(changedNode) && isEmptyNonShadowedFile(baseNode)) return false;
// no difference if both nodes are unpopulated and point to the same mounted file system
if (!changedNode.buffer && !baseNode.buffer &&
changedNode.resolver && changedNode.source !== undefined &&
baseNode.resolver === changedNode.resolver && baseNode.source === changedNode.source) return false;
const changedBuffer = changed._getBuffer(changedNode);
const baseBuffer = base._getBuffer(baseNode);
// no difference if both buffers are the same reference
if (changedBuffer === baseBuffer) return false;
// no difference if both buffers are identical
if (Buffer.compare(changedBuffer, baseBuffer) === 0) return false;
container[basename] = new File(changedBuffer);
return true;
}
private static symlinkDiff(container: FileSet, basename: string, changedNode: SymlinkInode, baseNode: SymlinkInode) {
// no difference if the nodes are the same reference
if (changedNode.symlink === baseNode.symlink) return false;
container[basename] = new Symlink(changedNode.symlink);
return true;
}
private static trackCreatedInode(container: FileSet, basename: string, changed: FileSystem, node: Inode) {
if (isDirectory(node)) {
const children: FileSet = {};
FileSystem.trackCreatedInodes(children, changed, changed._getLinks(node));
container[basename] = new Directory(children);
}
else if (isSymlink(node)) {
container[basename] = new Symlink(node.symlink);
}
else {
container[basename] = new File(node.buffer || "");
}
return true;
}
private static trackCreatedInodes(container: FileSet, changed: FileSystem, changedLinks: ReadonlyMap<string, Inode>) {
// no difference if links are empty
if (!changedLinks.size) return false;
changedLinks.forEach((node, basename) => { FileSystem.trackCreatedInode(container, basename, changed, node); });
return true;
}
private static trackDeletedInodes(container: FileSet, baseLinks: ReadonlyMap<string, Inode>) {
// no difference if links are empty
if (!baseLinks.size) return false;
baseLinks.forEach((node, basename) => { container[basename] = isDirectory(node) ? new Rmdir() : new Unlink(); });
return true;
}
private _mknod(dev: number, type: typeof S_IFREG, mode: number, time?: number): FileInode;
private _mknod(dev: number, type: typeof S_IFDIR, mode: number, time?: number): DirectoryInode;
private _mknod(dev: number, type: typeof S_IFLNK, mode: number, time?: number): SymlinkInode;
@@ -911,7 +1083,7 @@ namespace vfs {
if (this.stringComparer(vpath.dirname(path), path) === 0) {
throw new TypeError("Roots cannot be symbolic links.");
}
this.symlinkSync(entry.symlink, path);
this.symlinkSync(vpath.resolve(dirname, entry.symlink), path);
this._applyFileExtendedOptions(path, entry);
}
else if (entry instanceof Link) {
@@ -940,10 +1112,10 @@ namespace vfs {
private _applyFilesWorker(files: FileSet, dirname: string, deferred: [Symlink | Link | Mount, string][]) {
for (const key of Object.keys(files)) {
const value = this._normalizeFileSetEntry(files[key]);
const value = normalizeFileSetEntry(files[key]);
const path = dirname ? vpath.resolve(dirname, key) : key;
vpath.validate(path, vpath.ValidationFlags.Absolute);
if (value === null || value === undefined) {
if (value === null || value === undefined || value instanceof Rmdir || value instanceof Unlink) {
if (this.stringComparer(vpath.dirname(path), path) === 0) {
throw new TypeError("Roots cannot be deleted.");
}
@@ -967,19 +1139,6 @@ namespace vfs {
}
}
}
private _normalizeFileSetEntry(value: FileSet[string]) {
if (value === undefined ||
value === null ||
value instanceof Directory ||
value instanceof File ||
value instanceof Link ||
value instanceof Symlink ||
value instanceof Mount) {
return value;
}
return typeof value === "string" || Buffer.isBuffer(value) ? new File(value) : new Directory(value);
}
}
export interface FileSystemOptions {
@@ -997,12 +1156,9 @@ namespace vfs {
meta?: Record<string, any>;
}
export interface FileSystemCreateOptions {
export interface FileSystemCreateOptions extends FileSystemOptions {
// Sets the documents to add to the file system.
documents?: ReadonlyArray<documents.TextDocument>;
// Sets the initial working directory for the file system.
cwd?: string;
}
export type Axis = "ancestors" | "ancestors-or-self" | "self" | "descendants-or-self" | "descendants";
@@ -1062,8 +1218,16 @@ namespace vfs {
*
* Unless overridden, `/.src` will be the current working directory for the virtual file system.
*/
export function createFromFileSystem(host: FileSystemResolverHost, ignoreCase: boolean, { documents, cwd }: FileSystemCreateOptions = {}) {
export function createFromFileSystem(host: FileSystemResolverHost, ignoreCase: boolean, { documents, files, cwd, time, meta }: FileSystemCreateOptions = {}) {
const fs = getBuiltLocal(host, ignoreCase).shadow();
if (meta) {
for (const key of Object.keys(meta)) {
fs.meta.set(key, meta[key]);
}
}
if (time) {
fs.time(time);
}
if (cwd) {
fs.mkdirpSync(cwd);
fs.chdir(cwd);
@@ -1078,12 +1242,14 @@ namespace vfs {
if (symlink) {
for (const link of symlink.split(",").map(link => link.trim())) {
fs.mkdirpSync(vpath.dirname(link));
fs.symlinkSync(document.file, link);
fs.filemeta(link).set("document", document);
fs.symlinkSync(vpath.resolve(fs.cwd(), document.file), link);
}
}
}
}
if (files) {
fs.apply(files);
}
return fs;
}
@@ -1166,7 +1332,7 @@ namespace vfs {
* A template used to populate files, directories, links, etc. in a virtual file system.
*/
export interface FileSet {
[name: string]: DirectoryLike | FileLike | Link | Symlink | Mount | null | undefined;
[name: string]: DirectoryLike | FileLike | Link | Symlink | Mount | Rmdir | Unlink | null | undefined;
}
export type DirectoryLike = FileSet | Directory;
@@ -1202,6 +1368,16 @@ namespace vfs {
}
}
/** Removes a directory in a `FileSet` */
export class Rmdir {
public _rmdirBrand?: never; // brand necessary for proper type guards
}
/** Unlinks a file in a `FileSet` */
export class Unlink {
public _unlinkBrand?: never; // brand necessary for proper type guards
}
/** Extended options for a symbolic link in a `FileSet` */
export class Symlink {
public readonly symlink: string;
@@ -1274,6 +1450,14 @@ namespace vfs {
meta?: collections.Metadata;
}
function isEmptyNonShadowedDirectory(node: DirectoryInode) {
return !node.links && !node.shadowRoot && !node.resolver && !node.source;
}
function isEmptyNonShadowedFile(node: FileInode) {
return !node.buffer && !node.shadowRoot && !node.resolver && !node.source;
}
function isFile(node: Inode | undefined): node is FileInode {
return node !== undefined && (node.mode & S_IFMT) === S_IFREG;
}
@@ -1325,5 +1509,55 @@ namespace vfs {
}
return builtLocalCS;
}
function normalizeFileSetEntry(value: FileSet[string]) {
if (value === undefined ||
value === null ||
value instanceof Directory ||
value instanceof File ||
value instanceof Link ||
value instanceof Symlink ||
value instanceof Mount ||
value instanceof Rmdir ||
value instanceof Unlink) {
return value;
}
return typeof value === "string" || Buffer.isBuffer(value) ? new File(value) : new Directory(value);
}
export function formatPatch(patch: FileSet) {
return formatPatchWorker("", patch);
}
function formatPatchWorker(dirname: string, container: FileSet): string {
let text = "";
for (const name of Object.keys(container)) {
const entry = normalizeFileSetEntry(container[name]);
const file = dirname ? vpath.combine(dirname, name) : name;
if (entry === null || entry === undefined || entry instanceof Unlink || entry instanceof Rmdir) {
text += `//// [${file}] unlink\r\n`;
}
else if (entry instanceof Rmdir) {
text += `//// [${vpath.addTrailingSeparator(file)}] rmdir\r\n`;
}
else if (entry instanceof Directory) {
text += formatPatchWorker(file, entry.files);
}
else if (entry instanceof File) {
const content = typeof entry.data === "string" ? entry.data : entry.data.toString("utf8");
text += `//// [${file}]\r\n${content}\r\n\r\n`;
}
else if (entry instanceof Link) {
text += `//// [${file}] link(${entry.path})\r\n`;
}
else if (entry instanceof Symlink) {
text += `//// [${file}] symlink(${entry.symlink})\r\n`;
}
else if (entry instanceof Mount) {
text += `//// [${file}] mount(${entry.source})\r\n`;
}
}
return text;
}
}
// tslint:enable:no-null-keyword
@@ -1,5 +1,3 @@
/// <reference path="harness.ts" />
namespace ts.TestFSWithWatch {
export const libFile: File = {
path: "/a/lib/lib.d.ts",

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