mirror of
https://gitee.com/openharmony/third_party_typescript
synced 2024-11-23 06:50:54 +00:00
LKG update
This commit is contained in:
parent
3212c1e502
commit
88cf310dee
2
lib/.gitattributes
vendored
2
lib/.gitattributes
vendored
@ -1 +1 @@
|
||||
* text eol=lf
|
||||
* text eol=lf
|
@ -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) {
|
||||
|
610
lib/tsc.js
610
lib/tsc.js
File diff suppressed because it is too large
Load Diff
602
lib/tsserver.js
602
lib/tsserver.js
File diff suppressed because it is too large
Load Diff
8700
lib/tsserverlibrary.d.ts
vendored
8700
lib/tsserverlibrary.d.ts
vendored
File diff suppressed because one or more lines are too long
332
lib/typescript.d.ts
vendored
332
lib/typescript.d.ts
vendored
@ -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
|
329
lib/typescriptServices.d.ts
vendored
329
lib/typescriptServices.d.ts
vendored
@ -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
|
61267
lib/typingsInstaller.js
61267
lib/typingsInstaller.js
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user