Merge pull request #24938 from RyanCavanaugh/esau-squash

Modernize Jakefile + fix project references breaks
This commit is contained in:
Ryan Cavanaugh 2018-06-16 06:39:44 +12:00 committed by GitHub
commit 94ee765567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 82290 additions and 38410 deletions

1
.gitignore vendored
View File

@ -46,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

File diff suppressed because it is too large Load Diff

2
lib/.gitattributes vendored
View File

@ -1 +1 @@
* text eol=lf
* text eol=lf

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) {

View File

@ -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,7 +213,7 @@
"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": "Cannot find lib definition for '{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}'.",
@ -304,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.",
@ -354,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.",
@ -615,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",
@ -666,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}'.",
@ -780,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.",
@ -957,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",
@ -1017,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.",

40326
lib/tsc.js

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

8700
lib/tsserverlibrary.d.ts vendored

File diff suppressed because one or more lines are too long

View File

@ -2712,7 +2712,7 @@ var ts;
SymbolFlags[SymbolFlags["AliasExcludes"] = 2097152] = "AliasExcludes";
SymbolFlags[SymbolFlags["ModuleMember"] = 2623475] = "ModuleMember";
SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal";
SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports";
SymbolFlags[SymbolFlags["HasExports"] = 1955] = "HasExports";
SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers";
SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped";
SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor";
@ -25533,7 +25533,7 @@ var ts;
symbol.flags |= symbolFlags;
node.symbol = symbol;
symbol.declarations = ts.append(symbol.declarations, node);
if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) {
if (symbolFlags & 1955 /* HasExports */ && !symbol.exports) {
symbol.exports = ts.createSymbolTable();
}
if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) {
@ -28902,7 +28902,7 @@ var ts;
}
var t = getTypeOfSymbol(symbol);
visitType(t); // Should handle members on classes and such
if (symbol.flags & 1952 /* HasExports */) {
if (symbol.flags & 1955 /* HasExports */) {
symbol.exports.forEach(visitSymbol);
}
ts.forEach(symbol.declarations, function (d) {
@ -31200,7 +31200,7 @@ var ts;
// The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,
// module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error.
function visit(symbol) {
if (!(symbol && symbol.flags & 1952 /* HasExports */ && ts.pushIfUnique(visitedSymbols, symbol))) {
if (!(symbol && symbol.flags & 1955 /* HasExports */ && ts.pushIfUnique(visitedSymbols, symbol))) {
return;
}
var symbols = ts.cloneMap(symbol.exports);

332
lib/typescript.d.ts vendored
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;
};
@ -2071,7 +2082,7 @@ declare namespace ts {
AliasExcludes = 2097152,
ModuleMember = 2623475,
ExportHasLocal = 944,
HasExports = 1952,
HasExports = 1955,
HasMembers = 6240,
BlockScoped = 418,
PropertyOrAccessor = 98308,
@ -2906,9 +2917,6 @@ declare namespace ts {
span: TextSpan;
newLength: number;
}
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
interface SyntaxList extends Node {
_children: Node[];
}
@ -2978,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 {
@ -3099,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;
@ -3484,6 +3488,79 @@ declare namespace ts {
function isExternalModule(file: SourceFile): boolean;
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
}
declare namespace ts {
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;
/**
@ -4311,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 {
@ -5346,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

View File

@ -2727,7 +2727,7 @@ var ts;
SymbolFlags[SymbolFlags["AliasExcludes"] = 2097152] = "AliasExcludes";
SymbolFlags[SymbolFlags["ModuleMember"] = 2623475] = "ModuleMember";
SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal";
SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports";
SymbolFlags[SymbolFlags["HasExports"] = 1955] = "HasExports";
SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers";
SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped";
SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor";
@ -25548,7 +25548,7 @@ var ts;
symbol.flags |= symbolFlags;
node.symbol = symbol;
symbol.declarations = ts.append(symbol.declarations, node);
if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) {
if (symbolFlags & 1955 /* HasExports */ && !symbol.exports) {
symbol.exports = ts.createSymbolTable();
}
if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) {
@ -28917,7 +28917,7 @@ var ts;
}
var t = getTypeOfSymbol(symbol);
visitType(t); // Should handle members on classes and such
if (symbol.flags & 1952 /* HasExports */) {
if (symbol.flags & 1955 /* HasExports */) {
symbol.exports.forEach(visitSymbol);
}
ts.forEach(symbol.declarations, function (d) {
@ -31215,7 +31215,7 @@ var ts;
// The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,
// module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error.
function visit(symbol) {
if (!(symbol && symbol.flags & 1952 /* HasExports */ && ts.pushIfUnique(visitedSymbols, symbol))) {
if (!(symbol && symbol.flags & 1955 /* HasExports */ && ts.pushIfUnique(visitedSymbols, symbol))) {
return;
}
var symbols = ts.cloneMap(symbol.exports);

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;
};
@ -2071,7 +2082,7 @@ declare namespace ts {
AliasExcludes = 2097152,
ModuleMember = 2623475,
ExportHasLocal = 944,
HasExports = 1952,
HasExports = 1955,
HasMembers = 6240,
BlockScoped = 418,
PropertyOrAccessor = 98308,
@ -2906,9 +2917,6 @@ declare namespace ts {
span: TextSpan;
newLength: number;
}
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
interface SyntaxList extends Node {
_children: Node[];
}
@ -2978,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 {
@ -3099,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;
@ -3484,6 +3488,79 @@ declare namespace ts {
function isExternalModule(file: SourceFile): boolean;
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
}
declare namespace ts {
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;
/**
@ -4311,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 {
@ -5346,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

View File

@ -2727,7 +2727,7 @@ var ts;
SymbolFlags[SymbolFlags["AliasExcludes"] = 2097152] = "AliasExcludes";
SymbolFlags[SymbolFlags["ModuleMember"] = 2623475] = "ModuleMember";
SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal";
SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports";
SymbolFlags[SymbolFlags["HasExports"] = 1955] = "HasExports";
SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers";
SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped";
SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor";
@ -25548,7 +25548,7 @@ var ts;
symbol.flags |= symbolFlags;
node.symbol = symbol;
symbol.declarations = ts.append(symbol.declarations, node);
if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) {
if (symbolFlags & 1955 /* HasExports */ && !symbol.exports) {
symbol.exports = ts.createSymbolTable();
}
if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) {
@ -28917,7 +28917,7 @@ var ts;
}
var t = getTypeOfSymbol(symbol);
visitType(t); // Should handle members on classes and such
if (symbol.flags & 1952 /* HasExports */) {
if (symbol.flags & 1955 /* HasExports */) {
symbol.exports.forEach(visitSymbol);
}
ts.forEach(symbol.declarations, function (d) {
@ -31215,7 +31215,7 @@ var ts;
// The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,
// module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error.
function visit(symbol) {
if (!(symbol && symbol.flags & 1952 /* HasExports */ && ts.pushIfUnique(visitedSymbols, symbol))) {
if (!(symbol && symbol.flags & 1955 /* HasExports */ && ts.pushIfUnique(visitedSymbols, symbol))) {
return;
}
var symbols = ts.cloneMap(symbol.exports);

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,19 @@
/*! *****************************************************************************
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.
***************************************************************************** */
"use strict";
if (process.argv.length < 3) {
process.exit(1);

View File

@ -45,7 +45,7 @@
"@types/minimatch": "latest",
"@types/minimist": "latest",
"@types/mkdirp": "latest",
"@types/mocha": "latest",
"@types/mocha": "^5.2.2",
"@types/node": "8.5.5",
"@types/q": "latest",
"@types/run-sequence": "latest",
@ -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",

View File

@ -55,7 +55,7 @@ class DeclarationsWalker {
if (declarations) {
for (const decl of declarations) {
const sourceFile = decl.getSourceFile();
if (sourceFile === this.protocolFile || /lib\.(.*)\.d.ts/.test(path.basename(sourceFile.fileName))) {
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,14 +121,14 @@ 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;
const emitResult = program.emit(program.getSourceFile(protocolTs), (file, content) => {

100
scripts/produceLKG.ts Normal file
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 + "\r\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
scripts/tsconfig.json Normal file
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"
]
}

View File

@ -19,21 +19,7 @@ namespace ts {
export interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
}
/* @internal */
namespace ts {
/* @internal */
export type EqualityComparer<T> = (a: T, b: T) => boolean;
/* @internal */
export type Comparer<T> = (a: T, b: T) => Comparison;
export const enum Comparison {
LessThan = -1,
EqualTo = 0,
GreaterThan = 1
}
/** ES6 Map interface, only read methods included. */
export interface ReadonlyMap<T> {
@ -63,6 +49,23 @@ namespace ts {
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
}
}
/* @internal */
namespace ts {
/** Create a MapLike with good performance. */
function createDictionaryObject<T>(): MapLike<T> {
const map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword

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,10 @@ namespace ts {
}
let pseudoUpToDate = false;
let usesPrepend = false;
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));
@ -832,6 +837,10 @@ namespace ts {
};
}
if (usesPrepend) {
pseudoUpToDate = false;
}
// Up to date
return {
type: pseudoUpToDate ? UpToDateStatusType.UpToDateWithUpstreamTypes : UpToDateStatusType.UpToDate,
@ -1048,16 +1057,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 +1080,8 @@ namespace ts {
for (const output of filesToDelete) {
compilerHost.deleteFile(output);
}
return ExitStatus.Success;
}
function resolveProjectName(name: string): ResolvedConfigFileName | undefined {
@ -1095,16 +1109,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 +1152,10 @@ namespace ts {
continue;
}
buildSingleProject(next);
const buildResult = buildSingleProject(next);
anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors);
}
return anyFailed ? ExitStatus.DiagnosticsPresent_OutputsSkipped : ExitStatus.Success;
}
/**

View File

@ -3,7 +3,22 @@
"compilerOptions": {
"outFile": "../../built/local/compiler.js"
},
"references": [],
"files": [
"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",
"checker.ts",
@ -37,9 +52,5 @@
"moduleSpecifiers.ts",
"watch.ts",
"tsbuild.ts"
],
"references": [
{ "path": "../core" },
{ "path": "../parser" }
]
}

View File

@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outFile": "../../built/local/compiler.release.js",
"removeComments": true,
"preserveConstEnums": false
}
}

View File

@ -1,10 +1,5 @@
/** Non-internal stuff goes here */
namespace ts {
export const emptyArray: never[] = [] as never[];
export function closeFileWatcher(watcher: FileWatcher) {
watcher.close();
}
export function isExternalModuleNameRelative(moduleName: string): boolean {
// TypeScript 1.0 spec (April 2014): 11.2.1
// An external module name is "relative" if the first term is "." or "..".
@ -15,21 +10,11 @@ namespace ts {
export function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[] {
return sortAndDeduplicate<T>(diagnostics, compareDiagnostics);
}
export function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path {
const nonCanonicalizedPath = isRootedDiskPath(fileName)
? normalizePath(fileName)
: getNormalizedAbsolutePath(fileName, basePath);
return <Path>getCanonicalFileName(nonCanonicalizedPath);
}
export function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any> {
return !!map && !!map.size;
}
}
/* @internal */
namespace ts {
export const emptyArray: never[] = [] as never[];
export const resolvingEmptyArray: never[] = [] as never[];
export const emptyMap: ReadonlyMap<never> = createMap<never>();
export const emptyUnderscoreEscapedMap: ReadonlyUnderscoreEscapedMap<never> = emptyMap as ReadonlyUnderscoreEscapedMap<never>;
@ -54,6 +39,10 @@ namespace ts {
return new MapCtr<T>() as UnderscoreEscapedMap<T>;
}
export function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any> {
return !!map && !!map.size;
}
export function createSymbolTable(symbols?: ReadonlyArray<Symbol>): SymbolTable {
const result = createMap<Symbol>() as SymbolTable;
if (symbols) {
@ -103,6 +92,13 @@ namespace ts {
};
}
export function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path {
const nonCanonicalizedPath = isRootedDiskPath(fileName)
? normalizePath(fileName)
: getNormalizedAbsolutePath(fileName, basePath);
return <Path>getCanonicalFileName(nonCanonicalizedPath);
}
export function changesAffectModuleResolution(oldOptions: CompilerOptions, newOptions: CompilerOptions): boolean {
return !oldOptions ||
(oldOptions.module !== newOptions.module) ||
@ -4101,6 +4097,10 @@ namespace ts {
return options.watch && options.hasOwnProperty("watch");
}
export function closeFileWatcher(watcher: FileWatcher) {
watcher.close();
}
export function getCheckFlags(symbol: Symbol): CheckFlags {
return symbol.flags & SymbolFlags.Transient ? (<TransientSymbol>symbol).checkFlags : 0;
}
@ -6670,7 +6670,11 @@ namespace ts {
export function isStringLiteralLike(node: Node): node is StringLiteralLike {
return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral;
}
}
/* @internal */
namespace ts {
/** @internal */
export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports {
return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports;
@ -6735,6 +6739,7 @@ namespace ts {
getSourceMapSourceConstructor: () => <any>SourceMapSource,
};
/* @internal */
export function formatStringFromArgs(text: string, args: ArrayLike<string>, baseIndex = 0): string {
return text.replace(/{(\d+)}/g, (_match, index: string) => Debug.assertDefined(args[+index + baseIndex]));
}
@ -6745,6 +6750,7 @@ namespace ts {
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
}
/* @internal */
export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticWithLocation;
export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage): DiagnosticWithLocation {
Debug.assertGreaterThanOrEqual(start, 0);
@ -6784,6 +6790,7 @@ namespace ts {
return text;
}
/* @internal */
export function createCompilerDiagnostic(message: DiagnosticMessage, ...args: (string | number | undefined)[]): Diagnostic;
export function createCompilerDiagnostic(message: DiagnosticMessage): Diagnostic {
let text = getLocaleSpecificMessage(message);
@ -6804,6 +6811,7 @@ namespace ts {
};
}
/* @internal */
export function createCompilerDiagnosticFromMessageChain(chain: DiagnosticMessageChain): Diagnostic {
return {
file: undefined,
@ -6816,6 +6824,7 @@ namespace ts {
};
}
/* @internal */
export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | undefined)[]): DiagnosticMessageChain;
export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage): DiagnosticMessageChain {
let text = getLocaleSpecificMessage(message);
@ -6847,6 +6856,7 @@ namespace ts {
return diagnostic.file ? diagnostic.file.path : undefined;
}
/* @internal */
export function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison {
return compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) ||
compareValues(d1.start, d2.start) ||
@ -7145,6 +7155,7 @@ namespace ts {
return rootLength > 0 && rootLength === path.length;
}
/* @internal */
export function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string {
return !isRootedDiskPath(absoluteOrRelativePath)
? absoluteOrRelativePath
@ -7222,7 +7233,11 @@ namespace ts {
return root + pathComponents.slice(1).join(directorySeparator);
}
function getPathComponentsRelativeTo(from: string, to: string, stringEqualityComparer: (a: string, b: string) => boolean, getCanonicalFileName: GetCanonicalFileName) {
}
/* @internal */
namespace ts {
export function getPathComponentsRelativeTo(from: string, to: string, stringEqualityComparer: (a: string, b: string) => boolean, getCanonicalFileName: GetCanonicalFileName) {
const fromComponents = reducePathComponents(getPathComponents(from));
const toComponents = reducePathComponents(getPathComponents(to));
@ -8069,4 +8084,5 @@ namespace ts {
}
return findBestPatternMatch(patterns, _ => _, candidate);
}}
}
}

View File

@ -1,11 +0,0 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outFile": "../../built/local/core.js"
},
"files": [
"performance.ts",
"core.ts"
],
"references": [ ]
}

View File

@ -11,8 +11,6 @@
]
},
"references": [
{ "path": "../core" },
{ "path": "../parser" },
{ "path": "../compiler" },
{ "path": "../services" },
{ "path": "../jsTyping" },

View File

@ -1,3 +1,4 @@
/* @internal */
namespace ts.server {
// tslint:disable variable-name
export const ActionSet: ActionSet = "action::set";

View File

@ -11,8 +11,7 @@
]
},
"references": [
{ "path": "../core" },
{ "path": "../parser" }
{ "path": "../compiler" }
],
"files": [
"shared.ts",

View File

@ -1,3 +1,4 @@
/* @internal */
declare namespace ts.server {
export type ActionSet = "action::set";
export type ActionInvalidate = "action::invalidate";

View File

@ -1,19 +0,0 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outFile": "../../built/local/parser.js"
},
"files": [
"types.ts",
"sys.ts",
"diagnosticInformationMap.generated.ts",
"scanner.ts",
"utilities.ts",
"parser.ts",
"commandLineParser.ts",
"moduleNameResolver.ts"
],
"references": [
{ "path": "../core" }
]
}

View File

@ -9,8 +9,6 @@
]
},
"references": [
{ "path": "../core" },
{ "path": "../parser" },
{ "path": "../compiler" },
{ "path": "../jsTyping" },
{ "path": "../services" }

View File

@ -4,10 +4,8 @@
"outFile": "../../built/local/services.js"
},
"references": [
{ "path": "../core" },
{ "path": "../parser" },
{ "path": "../compiler" },
{ "path": "../jsTyping" },
{ "path": "../jsTyping" }
],
"files": [
"types.ts",

View File

@ -14,8 +14,6 @@
]
},
"references": [
{ "path": "../core", "prepend": true },
{ "path": "../parser", "prepend": true },
{ "path": "../compiler", "prepend": true },
{ "path": "../services", "prepend": true },
{ "path": "../jsTyping", "prepend": true },

View File

@ -5,6 +5,7 @@ describe("Public APIs", () => {
let fileContent: string;
before(() => {
fileContent = Harness.IO.readFile(builtFile)!;
if (!fileContent) throw new Error(`File ${fileName} was not present in built/local`);
fileContent = fileContent.replace(/\r\n/g, "\n");
});

View File

@ -197,7 +197,7 @@ and grew 1cm per day`;
before(() => {
// Use scanner.ts, decent size, does not change frequently
const testFileName = "src/parser/scanner.ts";
const testFileName = "src/compiler/scanner.ts";
testContent = Harness.IO.readFile(testFileName)!;
const totalChars = testContent.length;
assert.isTrue(totalChars > 0, "Failed to read test file.");

View File

@ -58,7 +58,14 @@ namespace ts {
message: report,
errorDiagnostic: d => reportDiag(d)
};
return performBuild(args.slice(1), createCompilerHost({}), buildHost, sys);
const result = performBuild(args.slice(1), createCompilerHost({}), buildHost, sys);
// undefined = in watch mode, do not exit
if (result !== undefined) {
return sys.exit(result);
}
else {
return;
}
}
const commandLine = parseCommandLine(args);

View File

@ -7,8 +7,6 @@
"tsc.ts"
],
"references": [
{ "path": "../core", "prepend": true },
{ "path": "../parser", "prepend": true },
{ "path": "../compiler", "prepend": true }
]
}

View File

@ -0,0 +1,18 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outFile": "../../lib/tsc.js",
"stripInternal": true,
"preserveConstEnums": false,
"declaration": false,
"declarationMap": false,
"sourceMap": false,
"composite": false
},
"files": [
"tsc.ts"
],
"references": [
{ "path": "../compiler/tsconfig.release.json", "prepend": true }
]
}

View File

@ -16,6 +16,8 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"alwaysStrict": true,
"preserveConstEnums": true,
"newLine": "lf",

View File

@ -4,7 +4,6 @@
"references": [
{ "path": "./tsc" },
{ "path": "./tsserver" },
{ "path": "./tsserverLibrary" },
{ "path": "./typingsInstaller" },
{ "path": "./watchGuard" },
{ "path": "./cancellationToken" },

View File

@ -11,8 +11,6 @@
"server.ts"
],
"references": [
{ "path": "../core", "prepend": true },
{ "path": "../parser", "prepend": true },
{ "path": "../compiler", "prepend": true },
{ "path": "../services", "prepend": true },
{ "path": "../jsTyping", "prepend": true },

View File

@ -1 +0,0 @@
// Workaround file, please delete once tsbuild understands it's not safe to skip this container

View File

@ -1,19 +0,0 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outFile": "../../built/local/tsserverlibrary.js",
"types": [
"node"
]
},
"files": ["empty.ts"],
"references": [
{ "path": "../core", "prepend": true },
{ "path": "../parser", "prepend": true },
{ "path": "../compiler", "prepend": true },
{ "path": "../services", "prepend": true },
{ "path": "../jsTyping", "prepend": true },
{ "path": "../server", "prepend": true }
]
}

View File

@ -1 +0,0 @@
// Delete soon

View File

@ -1,20 +0,0 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outFile": "../../built/local/typescriptServices.js",
"types": [
"node"
]
},
"files": [
"empty.ts"
],
"references": [
{ "path": "../core", "prepend": true },
{ "path": "../parser", "prepend": true },
{ "path": "../compiler", "prepend": true },
{ "path": "../jsTyping", "prepend": true },
{ "path": "../services", "prepend": true },
]
}

View File

@ -12,8 +12,7 @@
]
},
"references": [
{ "path": "../core", "prepend": true },
{ "path": "../parser", "prepend": true },
{ "path": "../compiler", "prepend": true },
{ "path": "../jsTyping", "prepend": true },
{ "path": "../typingsInstallerCore", "prepend": true }
],

View File

@ -11,8 +11,7 @@
]
},
"references": [
{ "path": "../core" },
{ "path": "../parser" },
{ "path": "../compiler" },
{ "path": "../jsTyping" }
],
"files": [

View File

@ -1,63 +1,4 @@
/*! *****************************************************************************
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.
***************************************************************************** */
declare namespace ts {
/** Gets a timestamp with (at least) ms resolution */
const timestamp: () => number;
}
/** Performance measurements for the compiler. */
declare namespace ts.performance {
/**
* Marks a performance event.
*
* @param markName The name of the mark.
*/
function mark(markName: string): void;
/**
* Adds a performance measurement with the specified name.
*
* @param measureName The name of the performance measurement.
* @param startMarkName The name of the starting mark. If not supplied, the point at which the
* profiler was enabled is used.
* @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
* used.
*/
function measure(measureName: string, startMarkName?: string, endMarkName?: string): void;
/**
* Gets the number of times a marker was encountered.
*
* @param markName The name of the mark.
*/
function getCount(markName: string): number;
/**
* Gets the total duration of all measurements with the supplied name.
*
* @param measureName The name of the measure whose durations should be accumulated.
*/
function getDuration(measureName: string): number;
/**
* Iterate over each measure, performing some action
*
* @param cb The action to perform for each measure
*/
function forEachMeasure(cb: (measureName: string, duration: number) => void): void;
/** Enables (and resets) performance measurements for the compiler. */
function enable(): void;
/** Disables performance measurements for the compiler. */
function disable(): void;
}
declare namespace ts {
const versionMajorMinor = "3.0";
/** The version of the TypeScript compiler release */
@ -75,15 +16,6 @@ declare namespace ts {
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
}
declare namespace ts {
type EqualityComparer<T> = (a: T, b: T) => boolean;
type Comparer<T> = (a: T, b: T) => Comparison;
enum Comparison {
LessThan = -1,
EqualTo = 0,
GreaterThan = 1
}
/** ES6 Map interface, only read methods included. */
interface ReadonlyMap<T> {
get(key: string): T | undefined;
@ -114,6 +46,15 @@ declare namespace ts {
interface Push<T> {
push(...values: T[]): void;
}
type EqualityComparer<T> = (a: T, b: T) => boolean;
type Comparer<T> = (a: T, b: T) => Comparison;
enum Comparison {
LessThan = -1,
EqualTo = 0,
GreaterThan = 1
}
}
declare namespace ts {
/** Create a new map. If a template object is provided, the map will copy entries from it. */
function createMap<T>(): Map<T>;
function createMapFromEntries<T>(entries: [string, T][]): Map<T>;
@ -581,7 +522,51 @@ declare namespace ts {
function singleElementArray<T>(t: T | undefined): T[] | undefined;
function enumerateInsertsAndDeletes<T, U>(newItems: ReadonlyArray<T>, oldItems: ReadonlyArray<U>, comparer: (a: T, b: U) => Comparison, inserted: (newItem: T) => void, deleted: (oldItem: U) => void, unchanged?: (oldItem: U, newItem: T) => void): void;
}
//# sourceMappingURL=core.d.ts.map
declare namespace ts {
/** Gets a timestamp with (at least) ms resolution */
const timestamp: () => number;
}
/** Performance measurements for the compiler. */
declare namespace ts.performance {
/**
* Marks a performance event.
*
* @param markName The name of the mark.
*/
function mark(markName: string): void;
/**
* Adds a performance measurement with the specified name.
*
* @param measureName The name of the performance measurement.
* @param startMarkName The name of the starting mark. If not supplied, the point at which the
* profiler was enabled is used.
* @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
* used.
*/
function measure(measureName: string, startMarkName?: string, endMarkName?: string): void;
/**
* Gets the number of times a marker was encountered.
*
* @param markName The name of the mark.
*/
function getCount(markName: string): number;
/**
* Gets the total duration of all measurements with the supplied name.
*
* @param measureName The name of the measure whose durations should be accumulated.
*/
function getDuration(measureName: string): number;
/**
* Iterate over each measure, performing some action
*
* @param cb The action to perform for each measure
*/
function forEachMeasure(cb: (measureName: string, duration: number) => void): void;
/** Enables (and resets) performance measurements for the compiler. */
function enable(): void;
/** Disables performance measurements for the compiler. */
function disable(): void;
}
declare namespace ts {
type Path = string & {
__pathBrand: any;
@ -5985,14 +5970,11 @@ declare namespace ts {
}
/** Non-internal stuff goes here */
declare namespace ts {
const emptyArray: never[];
function closeFileWatcher(watcher: FileWatcher): void;
function isExternalModuleNameRelative(moduleName: string): boolean;
function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[];
function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path;
function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any>;
}
declare namespace ts {
const emptyArray: never[];
const resolvingEmptyArray: never[];
const emptyMap: ReadonlyMap<never>;
const emptyUnderscoreEscapedMap: ReadonlyUnderscoreEscapedMap<never>;
@ -6000,7 +5982,9 @@ declare namespace ts {
function getDeclarationOfKind<T extends Declaration>(symbol: Symbol, kind: T["kind"]): T | undefined;
/** Create a new escaped identifier map. */
function createUnderscoreEscapedMap<T>(): UnderscoreEscapedMap<T>;
function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any>;
function createSymbolTable(symbols?: ReadonlyArray<Symbol>): SymbolTable;
function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path;
function changesAffectModuleResolution(oldOptions: CompilerOptions, newOptions: CompilerOptions): boolean;
/**
* Iterates through the parent chain of a node and performs the callback on each parent until the callback
@ -6561,6 +6545,7 @@ declare namespace ts {
function isDeclarationNameOfEnumOrNamespace(node: Identifier): boolean;
function getInitializedVariables(node: VariableDeclarationList): ReadonlyArray<VariableDeclaration>;
function isWatchSet(options: CompilerOptions): boolean | undefined;
function closeFileWatcher(watcher: FileWatcher): void;
function getCheckFlags(symbol: Symbol): CheckFlags;
function getDeclarationModifierFlagsFromSymbol(s: Symbol): ModifierFlags;
function skipAlias(symbol: Symbol, checker: TypeChecker): Symbol;
@ -7050,6 +7035,8 @@ declare namespace ts {
function isTypeReferenceType(node: Node): node is TypeReferenceType;
function guessIndentation(lines: string[]): number | undefined;
function isStringLiteralLike(node: Node): node is StringLiteralLike;
}
declare namespace ts {
/** @internal */
function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports;
interface ObjectAllocator {
@ -7187,6 +7174,9 @@ declare namespace ts {
* segments (at indices > 0).
*/
function getPathFromPathComponents(pathComponents: ReadonlyArray<string>): string;
}
declare namespace ts {
function getPathComponentsRelativeTo(from: string, to: string, stringEqualityComparer: (a: string, b: string) => boolean, getCanonicalFileName: GetCanonicalFileName): string[];
function getRelativePathFromFile(from: string, to: string, getCanonicalFileName: GetCanonicalFileName): string;
/**
* Gets a relative path that can be used to traverse between `from` and `to`.
@ -7642,7 +7632,6 @@ declare namespace ts {
*/
function loadModuleFromGlobalCache(moduleName: string, projectName: string | undefined, compilerOptions: CompilerOptions, host: ModuleResolutionHost, globalCache: string): ResolvedModuleWithFailedLookupLocations;
}
//# sourceMappingURL=parser.d.ts.map
declare namespace ts {
enum ModuleInstanceState {
NonInstantiated = 0,
@ -7666,7 +7655,7 @@ declare namespace ts {
* For performance reasons, `computeTransformFlagsForNode` uses local constant values rather
* than calling this function.
*/
function getTransformFlagsSubtreeExclusions(kind: SyntaxKind): TransformFlags.OuterExpressionExcludes | TransformFlags.PropertyAccessExcludes | TransformFlags.NodeExcludes | TransformFlags.ArrowFunctionExcludes | TransformFlags.FunctionExcludes | TransformFlags.ConstructorExcludes | TransformFlags.ClassExcludes | TransformFlags.ModuleExcludes | TransformFlags.TypeExcludes | TransformFlags.ObjectLiteralExcludes | TransformFlags.ArrayLiteralOrCallOrNewExcludes | TransformFlags.VariableDeclarationListExcludes | TransformFlags.CatchClauseExcludes;
function getTransformFlagsSubtreeExclusions(kind: SyntaxKind): TransformFlags;
}
/** @internal */
declare namespace ts {
@ -7774,7 +7763,7 @@ declare namespace ts {
function updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
function createIntersectionTypeNode(types: ReadonlyArray<TypeNode>): IntersectionTypeNode;
function updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode;
function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray<TypeNode>): UnionTypeNode | IntersectionTypeNode;
function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray<TypeNode>): UnionOrIntersectionTypeNode;
function createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
function updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
function createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode;
@ -9572,16 +9561,16 @@ declare namespace ts {
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
};
function createBuildContext(options: BuildOptions): BuildContext;
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): void;
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
/**
* 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 createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
buildAllProjects: () => void;
buildAllProjects: () => ExitStatus;
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
cleanAllProjects: () => void;
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
resetBuildContext: (opts?: BuildOptions) => void;
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
invalidateProject: (configFileName: string) => void;
@ -9592,6 +9581,186 @@ declare namespace ts {
};
}
//# sourceMappingURL=compiler.d.ts.map
declare namespace ts.server {
const ActionSet: ActionSet;
const ActionInvalidate: ActionInvalidate;
const ActionPackageInstalled: ActionPackageInstalled;
const EventTypesRegistry: EventTypesRegistry;
const EventBeginInstallTypes: EventBeginInstallTypes;
const EventEndInstallTypes: EventEndInstallTypes;
const EventInitializationFailed: EventInitializationFailed;
namespace Arguments {
const GlobalCacheLocation = "--globalTypingsCacheLocation";
const LogFile = "--logFile";
const EnableTelemetry = "--enableTelemetry";
const TypingSafeListLocation = "--typingSafeListLocation";
const TypesMapLocation = "--typesMapLocation";
/**
* This argument specifies the location of the NPM executable.
* typingsInstaller will run the command with `${npmLocation} install ...`.
*/
const NpmLocation = "--npmLocation";
}
function hasArgument(argumentName: string): boolean;
function findArgument(argumentName: string): string | undefined;
function nowString(): string;
}
declare namespace ts.server {
type ActionSet = "action::set";
type ActionInvalidate = "action::invalidate";
type ActionPackageInstalled = "action::packageInstalled";
type EventTypesRegistry = "event::typesRegistry";
type EventBeginInstallTypes = "event::beginInstallTypes";
type EventEndInstallTypes = "event::endInstallTypes";
type EventInitializationFailed = "event::initializationFailed";
interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
" __sortedArrayBrand": any;
}
interface TypingInstallerResponse {
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
}
interface TypingInstallerRequestWithProjectName {
readonly projectName: string;
}
type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest;
interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
readonly fileNames: string[];
readonly projectRootPath: Path;
readonly compilerOptions: CompilerOptions;
readonly typeAcquisition: TypeAcquisition;
readonly unresolvedImports: SortedReadonlyArray<string>;
readonly cachePath?: string;
readonly kind: "discover";
}
interface CloseProject extends TypingInstallerRequestWithProjectName {
readonly kind: "closeProject";
}
interface TypesRegistryRequest {
readonly kind: "typesRegistry";
}
interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
readonly kind: "installPackage";
readonly fileName: Path;
readonly packageName: string;
readonly projectRootPath: Path;
}
interface TypesRegistryResponse extends TypingInstallerResponse {
readonly kind: EventTypesRegistry;
readonly typesRegistry: MapLike<MapLike<string>>;
}
interface PackageInstalledResponse extends ProjectResponse {
readonly kind: ActionPackageInstalled;
readonly success: boolean;
readonly message: string;
}
interface InitializationFailedResponse extends TypingInstallerResponse {
readonly kind: EventInitializationFailed;
readonly message: string;
}
interface ProjectResponse extends TypingInstallerResponse {
readonly projectName: string;
}
interface InvalidateCachedTypings extends ProjectResponse {
readonly kind: ActionInvalidate;
}
interface InstallTypes extends ProjectResponse {
readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
readonly eventId: number;
readonly typingsInstallerVersion: string;
readonly packagesToInstall: ReadonlyArray<string>;
}
interface BeginInstallTypes extends InstallTypes {
readonly kind: EventBeginInstallTypes;
}
interface EndInstallTypes extends InstallTypes {
readonly kind: EventEndInstallTypes;
readonly installSuccess: boolean;
}
interface InstallTypingHost extends JsTyping.TypingResolutionHost {
useCaseSensitiveFileNames: boolean;
writeFile(path: string, content: string): void;
createDirectory(path: string): void;
watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher;
watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher;
}
interface SetTypings extends ProjectResponse {
readonly typeAcquisition: TypeAcquisition;
readonly compilerOptions: CompilerOptions;
readonly typings: string[];
readonly unresolvedImports: SortedReadonlyArray<string>;
readonly kind: ActionSet;
}
type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InstallTypes | InitializationFailedResponse;
}
declare namespace ts.JsTyping {
interface TypingResolutionHost {
directoryExists(path: string): boolean;
fileExists(fileName: string): boolean;
readFile(path: string, encoding?: string): string | undefined;
readDirectory(rootDir: string, extensions: ReadonlyArray<string>, excludes: ReadonlyArray<string> | undefined, includes: ReadonlyArray<string> | undefined, depth?: number): string[];
}
interface CachedTyping {
typingLocation: string;
version: Semver;
}
function isTypingUpToDate(cachedTyping: CachedTyping, availableTypingVersions: MapLike<string>): boolean;
const nodeCoreModuleList: ReadonlyArray<string>;
const nodeCoreModules: Map<true>;
/**
* A map of loose file names to library names that we are confident require typings
*/
type SafeList = ReadonlyMap<string>;
function loadSafeList(host: TypingResolutionHost, safeListPath: Path): SafeList;
function loadTypesMap(host: TypingResolutionHost, typesMapPath: Path): SafeList | undefined;
/**
* @param host is the object providing I/O related operations.
* @param fileNames are the file names that belong to the same project
* @param projectRootPath is the path to the project root directory
* @param safeListPath is the path used to retrieve the safe list
* @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions
* @param typeAcquisition is used to customize the typing acquisition process
* @param compilerOptions are used as a source for typing inference
*/
function discoverTypings(host: TypingResolutionHost, log: ((message: string) => void) | undefined, fileNames: string[], projectRootPath: Path, safeList: SafeList, packageNameToTypingLocation: ReadonlyMap<CachedTyping>, typeAcquisition: TypeAcquisition, unresolvedImports: ReadonlyArray<string>, typesRegistry: ReadonlyMap<MapLike<string>>): {
cachedTypingPaths: string[];
newTypingNames: string[];
filesToWatch: string[];
};
enum PackageNameValidationResult {
Ok = 0,
ScopedPackagesNotSupported = 1,
EmptyName = 2,
NameTooLong = 3,
NameStartsWithDot = 4,
NameStartsWithUnderscore = 5,
NameContainsNonURISafeCharacters = 6
}
/**
* Validates package name using rules defined at https://docs.npmjs.com/files/package.json
*/
function validatePackageName(packageName: string): PackageNameValidationResult;
function renderPackageNameValidationFailure(result: PackageNameValidationResult, typing: string): string;
}
declare namespace ts {
class Semver {
readonly major: number;
readonly minor: number;
readonly patch: number;
/**
* If true, this is `major.minor.0-next.patch`.
* If false, this is `major.minor.patch`.
*/
readonly isPrerelease: boolean;
static parse(semver: string): Semver;
static fromRaw({ major, minor, patch, isPrerelease }: Semver): Semver;
private static tryParse;
private constructor();
readonly versionString: string;
equals(sem: Semver): boolean;
greaterThan(sem: Semver): boolean;
}
}
//# sourceMappingURL=jsTyping.d.ts.map
declare namespace ts {
interface Node {
getSourceFile(): SourceFile;
@ -11878,186 +12047,6 @@ declare namespace TypeScript.Services {
}
declare const toolsVersion = "3.0";
//# sourceMappingURL=services.d.ts.map
declare namespace ts.server {
const ActionSet: ActionSet;
const ActionInvalidate: ActionInvalidate;
const ActionPackageInstalled: ActionPackageInstalled;
const EventTypesRegistry: EventTypesRegistry;
const EventBeginInstallTypes: EventBeginInstallTypes;
const EventEndInstallTypes: EventEndInstallTypes;
const EventInitializationFailed: EventInitializationFailed;
namespace Arguments {
const GlobalCacheLocation = "--globalTypingsCacheLocation";
const LogFile = "--logFile";
const EnableTelemetry = "--enableTelemetry";
const TypingSafeListLocation = "--typingSafeListLocation";
const TypesMapLocation = "--typesMapLocation";
/**
* This argument specifies the location of the NPM executable.
* typingsInstaller will run the command with `${npmLocation} install ...`.
*/
const NpmLocation = "--npmLocation";
}
function hasArgument(argumentName: string): boolean;
function findArgument(argumentName: string): string | undefined;
function nowString(): string;
}
declare namespace ts.server {
type ActionSet = "action::set";
type ActionInvalidate = "action::invalidate";
type ActionPackageInstalled = "action::packageInstalled";
type EventTypesRegistry = "event::typesRegistry";
type EventBeginInstallTypes = "event::beginInstallTypes";
type EventEndInstallTypes = "event::endInstallTypes";
type EventInitializationFailed = "event::initializationFailed";
interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
" __sortedArrayBrand": any;
}
interface TypingInstallerResponse {
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
}
interface TypingInstallerRequestWithProjectName {
readonly projectName: string;
}
type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest;
interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
readonly fileNames: string[];
readonly projectRootPath: Path;
readonly compilerOptions: CompilerOptions;
readonly typeAcquisition: TypeAcquisition;
readonly unresolvedImports: SortedReadonlyArray<string>;
readonly cachePath?: string;
readonly kind: "discover";
}
interface CloseProject extends TypingInstallerRequestWithProjectName {
readonly kind: "closeProject";
}
interface TypesRegistryRequest {
readonly kind: "typesRegistry";
}
interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
readonly kind: "installPackage";
readonly fileName: Path;
readonly packageName: string;
readonly projectRootPath: Path;
}
interface TypesRegistryResponse extends TypingInstallerResponse {
readonly kind: EventTypesRegistry;
readonly typesRegistry: MapLike<MapLike<string>>;
}
interface PackageInstalledResponse extends ProjectResponse {
readonly kind: ActionPackageInstalled;
readonly success: boolean;
readonly message: string;
}
interface InitializationFailedResponse extends TypingInstallerResponse {
readonly kind: EventInitializationFailed;
readonly message: string;
}
interface ProjectResponse extends TypingInstallerResponse {
readonly projectName: string;
}
interface InvalidateCachedTypings extends ProjectResponse {
readonly kind: ActionInvalidate;
}
interface InstallTypes extends ProjectResponse {
readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
readonly eventId: number;
readonly typingsInstallerVersion: string;
readonly packagesToInstall: ReadonlyArray<string>;
}
interface BeginInstallTypes extends InstallTypes {
readonly kind: EventBeginInstallTypes;
}
interface EndInstallTypes extends InstallTypes {
readonly kind: EventEndInstallTypes;
readonly installSuccess: boolean;
}
interface InstallTypingHost extends JsTyping.TypingResolutionHost {
useCaseSensitiveFileNames: boolean;
writeFile(path: string, content: string): void;
createDirectory(path: string): void;
watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher;
watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher;
}
interface SetTypings extends ProjectResponse {
readonly typeAcquisition: TypeAcquisition;
readonly compilerOptions: CompilerOptions;
readonly typings: string[];
readonly unresolvedImports: SortedReadonlyArray<string>;
readonly kind: ActionSet;
}
type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InstallTypes | InitializationFailedResponse;
}
declare namespace ts.JsTyping {
interface TypingResolutionHost {
directoryExists(path: string): boolean;
fileExists(fileName: string): boolean;
readFile(path: string, encoding?: string): string | undefined;
readDirectory(rootDir: string, extensions: ReadonlyArray<string>, excludes: ReadonlyArray<string> | undefined, includes: ReadonlyArray<string> | undefined, depth?: number): string[];
}
interface CachedTyping {
typingLocation: string;
version: Semver;
}
function isTypingUpToDate(cachedTyping: CachedTyping, availableTypingVersions: MapLike<string>): boolean;
const nodeCoreModuleList: ReadonlyArray<string>;
const nodeCoreModules: Map<true>;
/**
* A map of loose file names to library names that we are confident require typings
*/
type SafeList = ReadonlyMap<string>;
function loadSafeList(host: TypingResolutionHost, safeListPath: Path): SafeList;
function loadTypesMap(host: TypingResolutionHost, typesMapPath: Path): SafeList | undefined;
/**
* @param host is the object providing I/O related operations.
* @param fileNames are the file names that belong to the same project
* @param projectRootPath is the path to the project root directory
* @param safeListPath is the path used to retrieve the safe list
* @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions
* @param typeAcquisition is used to customize the typing acquisition process
* @param compilerOptions are used as a source for typing inference
*/
function discoverTypings(host: TypingResolutionHost, log: ((message: string) => void) | undefined, fileNames: string[], projectRootPath: Path, safeList: SafeList, packageNameToTypingLocation: ReadonlyMap<CachedTyping>, typeAcquisition: TypeAcquisition, unresolvedImports: ReadonlyArray<string>, typesRegistry: ReadonlyMap<MapLike<string>>): {
cachedTypingPaths: string[];
newTypingNames: string[];
filesToWatch: string[];
};
enum PackageNameValidationResult {
Ok = 0,
ScopedPackagesNotSupported = 1,
EmptyName = 2,
NameTooLong = 3,
NameStartsWithDot = 4,
NameStartsWithUnderscore = 5,
NameContainsNonURISafeCharacters = 6
}
/**
* Validates package name using rules defined at https://docs.npmjs.com/files/package.json
*/
function validatePackageName(packageName: string): PackageNameValidationResult;
function renderPackageNameValidationFailure(result: PackageNameValidationResult, typing: string): string;
}
declare namespace ts {
class Semver {
readonly major: number;
readonly minor: number;
readonly patch: number;
/**
* If true, this is `major.minor.0-next.patch`.
* If false, this is `major.minor.patch`.
*/
readonly isPrerelease: boolean;
static parse(semver: string): Semver;
static fromRaw({ major, minor, patch, isPrerelease }: Semver): Semver;
private static tryParse;
private constructor();
readonly versionString: string;
equals(sem: Semver): boolean;
greaterThan(sem: Semver): boolean;
}
}
//# sourceMappingURL=jsTyping.d.ts.map
declare namespace ts.server {
interface CompressedData {
length: number;
@ -14172,6 +14161,5 @@ declare namespace ts.server {
}
}
//# sourceMappingURL=server.d.ts.map
//# sourceMappingURL=tsserverlibrary.d.ts.map
export = ts;
export as namespace ts;

File diff suppressed because it is too large Load Diff