mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
Vendored
+29
-1
@@ -200,7 +200,7 @@ interface ObjectConstructor {
|
||||
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
|
||||
* @param o Object on which to lock the attributes.
|
||||
*/
|
||||
freeze<T>(o: T): T;
|
||||
freeze<T>(o: T): Readonly<T>;
|
||||
|
||||
/**
|
||||
* Prevents the addition of new properties to an object.
|
||||
@@ -1363,6 +1363,34 @@ interface ArrayLike<T> {
|
||||
readonly [n: number]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make all properties in T optional
|
||||
*/
|
||||
type Partial<T> = {
|
||||
[P in keyof T]?: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
* Make all properties in T readonly
|
||||
*/
|
||||
type Readonly<T> = {
|
||||
readonly [P in keyof T]: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
* From T pick a set of properties K
|
||||
*/
|
||||
type Pick<T, K extends keyof T> = {
|
||||
[P in K]: T[P];
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a type with a set of properties K of type T
|
||||
*/
|
||||
type Record<K extends string | number, T> = {
|
||||
[P in K]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a raw buffer of binary data, which is used to store data for the
|
||||
* different typed arrays. ArrayBuffers cannot be read from or written to directly,
|
||||
|
||||
Vendored
+4
-4
@@ -225,13 +225,13 @@ interface NumberConstructor {
|
||||
* number. Only finite values of the type number, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isFinite(value: any): value is number;
|
||||
isFinite(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is an integer, false otherwise.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isInteger(value: any): value is number;
|
||||
isInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
||||
@@ -239,13 +239,13 @@ interface NumberConstructor {
|
||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isNaN(value: any): value is number;
|
||||
isNaN(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is a safe integer.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isSafeInteger(value: any): value is number;
|
||||
isSafeInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
||||
|
||||
Vendored
+29
-1
@@ -200,7 +200,7 @@ interface ObjectConstructor {
|
||||
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
|
||||
* @param o Object on which to lock the attributes.
|
||||
*/
|
||||
freeze<T>(o: T): T;
|
||||
freeze<T>(o: T): Readonly<T>;
|
||||
|
||||
/**
|
||||
* Prevents the addition of new properties to an object.
|
||||
@@ -1363,6 +1363,34 @@ interface ArrayLike<T> {
|
||||
readonly [n: number]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make all properties in T optional
|
||||
*/
|
||||
type Partial<T> = {
|
||||
[P in keyof T]?: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
* Make all properties in T readonly
|
||||
*/
|
||||
type Readonly<T> = {
|
||||
readonly [P in keyof T]: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
* From T pick a set of properties K
|
||||
*/
|
||||
type Pick<T, K extends keyof T> = {
|
||||
[P in K]: T[P];
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a type with a set of properties K of type T
|
||||
*/
|
||||
type Record<K extends string | number, T> = {
|
||||
[P in K]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a raw buffer of binary data, which is used to store data for the
|
||||
* different typed arrays. ArrayBuffers cannot be read from or written to directly,
|
||||
|
||||
Vendored
+33
-5
@@ -200,7 +200,7 @@ interface ObjectConstructor {
|
||||
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
|
||||
* @param o Object on which to lock the attributes.
|
||||
*/
|
||||
freeze<T>(o: T): T;
|
||||
freeze<T>(o: T): Readonly<T>;
|
||||
|
||||
/**
|
||||
* Prevents the addition of new properties to an object.
|
||||
@@ -1363,6 +1363,34 @@ interface ArrayLike<T> {
|
||||
readonly [n: number]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make all properties in T optional
|
||||
*/
|
||||
type Partial<T> = {
|
||||
[P in keyof T]?: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
* Make all properties in T readonly
|
||||
*/
|
||||
type Readonly<T> = {
|
||||
readonly [P in keyof T]: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
* From T pick a set of properties K
|
||||
*/
|
||||
type Pick<T, K extends keyof T> = {
|
||||
[P in K]: T[P];
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a type with a set of properties K of type T
|
||||
*/
|
||||
type Record<K extends string | number, T> = {
|
||||
[P in K]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a raw buffer of binary data, which is used to store data for the
|
||||
* different typed arrays. ArrayBuffers cannot be read from or written to directly,
|
||||
@@ -4362,13 +4390,13 @@ interface NumberConstructor {
|
||||
* number. Only finite values of the type number, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isFinite(value: any): value is number;
|
||||
isFinite(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is an integer, false otherwise.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isInteger(value: any): value is number;
|
||||
isInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
||||
@@ -4376,13 +4404,13 @@ interface NumberConstructor {
|
||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isNaN(value: any): value is number;
|
||||
isNaN(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is a safe integer.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isSafeInteger(value: any): value is number;
|
||||
isSafeInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
||||
|
||||
Vendored
+23
@@ -1400,6 +1400,25 @@ declare namespace ts.server.protocol {
|
||||
body?: ConfigFileDiagnosticEventBody;
|
||||
event: "configFileDiag";
|
||||
}
|
||||
type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
|
||||
interface ProjectLanguageServiceStateEvent extends Event {
|
||||
event: ProjectLanguageServiceStateEventName;
|
||||
body?: ProjectLanguageServiceStateEventBody;
|
||||
}
|
||||
interface ProjectLanguageServiceStateEventBody {
|
||||
/**
|
||||
* Project name that has changes in the state of language service.
|
||||
* For configured projects this will be the config file path.
|
||||
* For external projects this will be the name of the projects specified when project was open.
|
||||
* For inferred projects this event is not raised.
|
||||
*/
|
||||
projectName: string;
|
||||
/**
|
||||
* True if language service state switched from disabled to enabled
|
||||
* and false otherwise.
|
||||
*/
|
||||
languageServiceEnabled: boolean;
|
||||
}
|
||||
/**
|
||||
* Arguments for reload request.
|
||||
*/
|
||||
@@ -1634,6 +1653,10 @@ declare namespace ts.server.protocol {
|
||||
* true if install request succeeded, otherwise - false
|
||||
*/
|
||||
installSuccess: boolean;
|
||||
/**
|
||||
* version of typings installer
|
||||
*/
|
||||
typingsInstallerVersion: string;
|
||||
}
|
||||
interface NavBarResponse extends Response {
|
||||
body?: NavigationBarItem[];
|
||||
|
||||
+2846
-2428
File diff suppressed because it is too large
Load Diff
+3039
-2527
File diff suppressed because it is too large
Load Diff
Vendored
+302
-194
File diff suppressed because one or more lines are too long
+3037
-2526
File diff suppressed because it is too large
Load Diff
Vendored
+32
-20
@@ -333,7 +333,8 @@ declare namespace ts {
|
||||
PartiallyEmittedExpression = 293,
|
||||
MergeDeclarationMarker = 294,
|
||||
EndOfDeclarationMarker = 295,
|
||||
Count = 296,
|
||||
RawExpression = 296,
|
||||
Count = 297,
|
||||
FirstAssignment = 57,
|
||||
LastAssignment = 69,
|
||||
FirstCompoundAssignment = 58,
|
||||
@@ -464,14 +465,14 @@ declare namespace ts {
|
||||
right: Identifier;
|
||||
}
|
||||
type EntityName = Identifier | QualifiedName;
|
||||
type PropertyName = Identifier | LiteralExpression | ComputedPropertyName;
|
||||
type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern;
|
||||
type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName;
|
||||
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
|
||||
interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
name?: DeclarationName;
|
||||
}
|
||||
interface DeclarationStatement extends Declaration, Statement {
|
||||
name?: Identifier | LiteralExpression;
|
||||
name?: Identifier | StringLiteral | NumericLiteral;
|
||||
}
|
||||
interface ComputedPropertyName extends Node {
|
||||
kind: SyntaxKind.ComputedPropertyName;
|
||||
@@ -573,18 +574,16 @@ declare namespace ts {
|
||||
interface PropertyLikeDeclaration extends Declaration {
|
||||
name: PropertyName;
|
||||
}
|
||||
interface BindingPattern extends Node {
|
||||
elements: NodeArray<BindingElement | ArrayBindingElement>;
|
||||
}
|
||||
interface ObjectBindingPattern extends BindingPattern {
|
||||
interface ObjectBindingPattern extends Node {
|
||||
kind: SyntaxKind.ObjectBindingPattern;
|
||||
elements: NodeArray<BindingElement>;
|
||||
}
|
||||
type ArrayBindingElement = BindingElement | OmittedExpression;
|
||||
interface ArrayBindingPattern extends BindingPattern {
|
||||
interface ArrayBindingPattern extends Node {
|
||||
kind: SyntaxKind.ArrayBindingPattern;
|
||||
elements: NodeArray<ArrayBindingElement>;
|
||||
}
|
||||
type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
|
||||
type ArrayBindingElement = BindingElement | OmittedExpression;
|
||||
/**
|
||||
* Several node kinds share function-like features such as a signature,
|
||||
* a name, and a body. These nodes should extend FunctionLikeDeclaration.
|
||||
@@ -809,17 +808,25 @@ declare namespace ts {
|
||||
operatorToken: BinaryOperatorToken;
|
||||
right: Expression;
|
||||
}
|
||||
interface AssignmentExpression extends BinaryExpression {
|
||||
type AssignmentOperatorToken = Token<AssignmentOperator>;
|
||||
interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression {
|
||||
left: LeftHandSideExpression;
|
||||
operatorToken: Token<SyntaxKind.EqualsToken>;
|
||||
operatorToken: TOperator;
|
||||
}
|
||||
interface ObjectDestructuringAssignment extends AssignmentExpression {
|
||||
interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> {
|
||||
left: ObjectLiteralExpression;
|
||||
}
|
||||
interface ArrayDestructuringAssignment extends AssignmentExpression {
|
||||
interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> {
|
||||
left: ArrayLiteralExpression;
|
||||
}
|
||||
type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment;
|
||||
type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression;
|
||||
type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment;
|
||||
type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Expression;
|
||||
type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression;
|
||||
type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression;
|
||||
type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression;
|
||||
type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern;
|
||||
interface ConditionalExpression extends Expression {
|
||||
kind: SyntaxKind.ConditionalExpression;
|
||||
condition: Expression;
|
||||
@@ -1180,7 +1187,7 @@ declare namespace ts {
|
||||
type ModuleName = Identifier | StringLiteral;
|
||||
interface ModuleDeclaration extends DeclarationStatement {
|
||||
kind: SyntaxKind.ModuleDeclaration;
|
||||
name: Identifier | LiteralExpression;
|
||||
name: Identifier | StringLiteral;
|
||||
body?: ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | Identifier;
|
||||
}
|
||||
interface NamespaceDeclaration extends ModuleDeclaration {
|
||||
@@ -1332,7 +1339,7 @@ declare namespace ts {
|
||||
type JSDocTypeReferencingNode = JSDocThisType | JSDocConstructorType | JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType;
|
||||
interface JSDocRecordMember extends PropertySignature {
|
||||
kind: SyntaxKind.JSDocRecordMember;
|
||||
name: Identifier | LiteralExpression;
|
||||
name: Identifier | StringLiteral | NumericLiteral;
|
||||
type?: JSDocType;
|
||||
}
|
||||
interface JSDoc extends Node {
|
||||
@@ -1596,6 +1603,7 @@ declare namespace ts {
|
||||
getJsxIntrinsicTagNames(): Symbol[];
|
||||
isOptionalParameter(node: ParameterDeclaration): boolean;
|
||||
getAmbientModules(): Symbol[];
|
||||
tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
|
||||
}
|
||||
interface SymbolDisplayBuilder {
|
||||
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
|
||||
@@ -1962,7 +1970,7 @@ declare namespace ts {
|
||||
target?: ScriptTarget;
|
||||
traceResolution?: boolean;
|
||||
types?: string[];
|
||||
/** Paths used to used to compute primary types search locations */
|
||||
/** Paths used to compute primary types search locations */
|
||||
typeRoots?: string[];
|
||||
[option: string]: CompilerOptionsValue | undefined;
|
||||
}
|
||||
@@ -2129,6 +2137,10 @@ declare namespace ts {
|
||||
_children: Node[];
|
||||
}
|
||||
}
|
||||
declare namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version = "2.1.3";
|
||||
}
|
||||
declare namespace ts {
|
||||
type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
|
||||
type DirectoryWatcherCallback = (fileName: string) => void;
|
||||
@@ -2260,7 +2272,7 @@ declare namespace ts {
|
||||
*/
|
||||
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
|
||||
function getTypeParameterOwner(d: Declaration): Declaration;
|
||||
function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean;
|
||||
function isParameterPropertyDeclaration(node: Node): boolean;
|
||||
function getCombinedModifierFlags(node: Node): ModifierFlags;
|
||||
function getCombinedNodeFlags(node: Node): NodeFlags;
|
||||
}
|
||||
@@ -2273,6 +2285,7 @@ declare namespace ts {
|
||||
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
}
|
||||
declare namespace ts {
|
||||
function moduleHasNonRelativeName(moduleName: string): boolean;
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: {
|
||||
directoryExists?: (directoryName: string) => boolean;
|
||||
getCurrentDirectory?: () => string;
|
||||
@@ -2297,8 +2310,6 @@ declare namespace ts {
|
||||
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
|
||||
}
|
||||
declare namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version = "2.2.0";
|
||||
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
|
||||
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
@@ -2393,6 +2404,7 @@ declare namespace ts {
|
||||
}
|
||||
interface SourceFile {
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
getLineEndOfPosition(pos: number): number;
|
||||
getLineStarts(): number[];
|
||||
getPositionOfLineAndCharacter(line: number, character: number): number;
|
||||
update(newText: string, textChangeRange: TextChangeRange): SourceFile;
|
||||
|
||||
+4294
-3100
File diff suppressed because it is too large
Load Diff
Vendored
+32
-20
@@ -333,7 +333,8 @@ declare namespace ts {
|
||||
PartiallyEmittedExpression = 293,
|
||||
MergeDeclarationMarker = 294,
|
||||
EndOfDeclarationMarker = 295,
|
||||
Count = 296,
|
||||
RawExpression = 296,
|
||||
Count = 297,
|
||||
FirstAssignment = 57,
|
||||
LastAssignment = 69,
|
||||
FirstCompoundAssignment = 58,
|
||||
@@ -464,14 +465,14 @@ declare namespace ts {
|
||||
right: Identifier;
|
||||
}
|
||||
type EntityName = Identifier | QualifiedName;
|
||||
type PropertyName = Identifier | LiteralExpression | ComputedPropertyName;
|
||||
type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern;
|
||||
type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName;
|
||||
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
|
||||
interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
name?: DeclarationName;
|
||||
}
|
||||
interface DeclarationStatement extends Declaration, Statement {
|
||||
name?: Identifier | LiteralExpression;
|
||||
name?: Identifier | StringLiteral | NumericLiteral;
|
||||
}
|
||||
interface ComputedPropertyName extends Node {
|
||||
kind: SyntaxKind.ComputedPropertyName;
|
||||
@@ -573,18 +574,16 @@ declare namespace ts {
|
||||
interface PropertyLikeDeclaration extends Declaration {
|
||||
name: PropertyName;
|
||||
}
|
||||
interface BindingPattern extends Node {
|
||||
elements: NodeArray<BindingElement | ArrayBindingElement>;
|
||||
}
|
||||
interface ObjectBindingPattern extends BindingPattern {
|
||||
interface ObjectBindingPattern extends Node {
|
||||
kind: SyntaxKind.ObjectBindingPattern;
|
||||
elements: NodeArray<BindingElement>;
|
||||
}
|
||||
type ArrayBindingElement = BindingElement | OmittedExpression;
|
||||
interface ArrayBindingPattern extends BindingPattern {
|
||||
interface ArrayBindingPattern extends Node {
|
||||
kind: SyntaxKind.ArrayBindingPattern;
|
||||
elements: NodeArray<ArrayBindingElement>;
|
||||
}
|
||||
type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
|
||||
type ArrayBindingElement = BindingElement | OmittedExpression;
|
||||
/**
|
||||
* Several node kinds share function-like features such as a signature,
|
||||
* a name, and a body. These nodes should extend FunctionLikeDeclaration.
|
||||
@@ -809,17 +808,25 @@ declare namespace ts {
|
||||
operatorToken: BinaryOperatorToken;
|
||||
right: Expression;
|
||||
}
|
||||
interface AssignmentExpression extends BinaryExpression {
|
||||
type AssignmentOperatorToken = Token<AssignmentOperator>;
|
||||
interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression {
|
||||
left: LeftHandSideExpression;
|
||||
operatorToken: Token<SyntaxKind.EqualsToken>;
|
||||
operatorToken: TOperator;
|
||||
}
|
||||
interface ObjectDestructuringAssignment extends AssignmentExpression {
|
||||
interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> {
|
||||
left: ObjectLiteralExpression;
|
||||
}
|
||||
interface ArrayDestructuringAssignment extends AssignmentExpression {
|
||||
interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> {
|
||||
left: ArrayLiteralExpression;
|
||||
}
|
||||
type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment;
|
||||
type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression;
|
||||
type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment;
|
||||
type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Expression;
|
||||
type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression;
|
||||
type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression;
|
||||
type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression;
|
||||
type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern;
|
||||
interface ConditionalExpression extends Expression {
|
||||
kind: SyntaxKind.ConditionalExpression;
|
||||
condition: Expression;
|
||||
@@ -1180,7 +1187,7 @@ declare namespace ts {
|
||||
type ModuleName = Identifier | StringLiteral;
|
||||
interface ModuleDeclaration extends DeclarationStatement {
|
||||
kind: SyntaxKind.ModuleDeclaration;
|
||||
name: Identifier | LiteralExpression;
|
||||
name: Identifier | StringLiteral;
|
||||
body?: ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | Identifier;
|
||||
}
|
||||
interface NamespaceDeclaration extends ModuleDeclaration {
|
||||
@@ -1332,7 +1339,7 @@ declare namespace ts {
|
||||
type JSDocTypeReferencingNode = JSDocThisType | JSDocConstructorType | JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType;
|
||||
interface JSDocRecordMember extends PropertySignature {
|
||||
kind: SyntaxKind.JSDocRecordMember;
|
||||
name: Identifier | LiteralExpression;
|
||||
name: Identifier | StringLiteral | NumericLiteral;
|
||||
type?: JSDocType;
|
||||
}
|
||||
interface JSDoc extends Node {
|
||||
@@ -1596,6 +1603,7 @@ declare namespace ts {
|
||||
getJsxIntrinsicTagNames(): Symbol[];
|
||||
isOptionalParameter(node: ParameterDeclaration): boolean;
|
||||
getAmbientModules(): Symbol[];
|
||||
tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
|
||||
}
|
||||
interface SymbolDisplayBuilder {
|
||||
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
|
||||
@@ -1962,7 +1970,7 @@ declare namespace ts {
|
||||
target?: ScriptTarget;
|
||||
traceResolution?: boolean;
|
||||
types?: string[];
|
||||
/** Paths used to used to compute primary types search locations */
|
||||
/** Paths used to compute primary types search locations */
|
||||
typeRoots?: string[];
|
||||
[option: string]: CompilerOptionsValue | undefined;
|
||||
}
|
||||
@@ -2129,6 +2137,10 @@ declare namespace ts {
|
||||
_children: Node[];
|
||||
}
|
||||
}
|
||||
declare namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version = "2.1.3";
|
||||
}
|
||||
declare namespace ts {
|
||||
type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
|
||||
type DirectoryWatcherCallback = (fileName: string) => void;
|
||||
@@ -2260,7 +2272,7 @@ declare namespace ts {
|
||||
*/
|
||||
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
|
||||
function getTypeParameterOwner(d: Declaration): Declaration;
|
||||
function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean;
|
||||
function isParameterPropertyDeclaration(node: Node): boolean;
|
||||
function getCombinedModifierFlags(node: Node): ModifierFlags;
|
||||
function getCombinedNodeFlags(node: Node): NodeFlags;
|
||||
}
|
||||
@@ -2273,6 +2285,7 @@ declare namespace ts {
|
||||
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
}
|
||||
declare namespace ts {
|
||||
function moduleHasNonRelativeName(moduleName: string): boolean;
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: {
|
||||
directoryExists?: (directoryName: string) => boolean;
|
||||
getCurrentDirectory?: () => string;
|
||||
@@ -2297,8 +2310,6 @@ declare namespace ts {
|
||||
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
|
||||
}
|
||||
declare namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version = "2.2.0";
|
||||
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
|
||||
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
@@ -2393,6 +2404,7 @@ declare namespace ts {
|
||||
}
|
||||
interface SourceFile {
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
getLineEndOfPosition(pos: number): number;
|
||||
getLineStarts(): number[];
|
||||
getPositionOfLineAndCharacter(line: number, character: number): number;
|
||||
update(newText: string, textChangeRange: TextChangeRange): SourceFile;
|
||||
|
||||
+4294
-3100
File diff suppressed because it is too large
Load Diff
+85
-29
@@ -136,6 +136,9 @@ var ts;
|
||||
})(performance = ts.performance || (ts.performance = {}));
|
||||
})(ts || (ts = {}));
|
||||
var ts;
|
||||
(function (ts) {
|
||||
ts.version = "2.1.3";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
var createObject = Object.create;
|
||||
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
|
||||
@@ -606,7 +609,7 @@ var ts;
|
||||
if (value === undefined)
|
||||
return to;
|
||||
if (to === undefined)
|
||||
to = [];
|
||||
return [value];
|
||||
to.push(value);
|
||||
return to;
|
||||
}
|
||||
@@ -621,6 +624,14 @@ var ts;
|
||||
return to;
|
||||
}
|
||||
ts.addRange = addRange;
|
||||
function stableSort(array, comparer) {
|
||||
if (comparer === void 0) { comparer = compareValues; }
|
||||
return array
|
||||
.map(function (_, i) { return i; })
|
||||
.sort(function (x, y) { return comparer(array[x], array[y]) || compareValues(x, y); })
|
||||
.map(function (i) { return array[i]; });
|
||||
}
|
||||
ts.stableSort = stableSort;
|
||||
function rangeEquals(array1, array2, pos, end) {
|
||||
while (pos < end) {
|
||||
if (array1[pos] !== array2[pos]) {
|
||||
@@ -775,6 +786,15 @@ var ts;
|
||||
}
|
||||
}
|
||||
ts.copyProperties = copyProperties;
|
||||
function appendProperty(map, key, value) {
|
||||
if (key === undefined || value === undefined)
|
||||
return map;
|
||||
if (map === undefined)
|
||||
map = createMap();
|
||||
map[key] = value;
|
||||
return map;
|
||||
}
|
||||
ts.appendProperty = appendProperty;
|
||||
function assign(t) {
|
||||
var args = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
@@ -1227,6 +1247,14 @@ var ts;
|
||||
getEmitScriptTarget(compilerOptions) >= 2 ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;
|
||||
}
|
||||
ts.getEmitModuleKind = getEmitModuleKind;
|
||||
function getEmitModuleResolutionKind(compilerOptions) {
|
||||
var moduleResolution = compilerOptions.moduleResolution;
|
||||
if (moduleResolution === undefined) {
|
||||
moduleResolution = getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic;
|
||||
}
|
||||
return moduleResolution;
|
||||
}
|
||||
ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
|
||||
function hasZeroOrOneAsteriskCharacter(str) {
|
||||
var seenAsterisk = false;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
@@ -1777,6 +1805,16 @@ var ts;
|
||||
}
|
||||
Debug.fail = fail;
|
||||
})(Debug = ts.Debug || (ts.Debug = {}));
|
||||
function orderedRemoveItem(array, item) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (array[i] === item) {
|
||||
orderedRemoveItemAt(array, i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
ts.orderedRemoveItem = orderedRemoveItem;
|
||||
function orderedRemoveItemAt(array, index) {
|
||||
for (var i = index; i < array.length - 1; i++) {
|
||||
array[i] = array[i + 1];
|
||||
@@ -2876,7 +2914,7 @@ var ts;
|
||||
An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." },
|
||||
Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." },
|
||||
Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." },
|
||||
An_object_rest_element_must_be_an_identifier: { code: 2701, category: ts.DiagnosticCategory.Error, key: "An_object_rest_element_must_be_an_identifier_2701", message: "An object rest element must be an identifier." },
|
||||
The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." },
|
||||
Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
|
||||
@@ -3150,6 +3188,7 @@ var ts;
|
||||
type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." },
|
||||
Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." },
|
||||
class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." },
|
||||
Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." },
|
||||
JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." },
|
||||
JSX_elements_cannot_have_multiple_attributes_with_the_same_name: { code: 17001, category: ts.DiagnosticCategory.Error, key: "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", message: "JSX elements cannot have multiple attributes with the same name." },
|
||||
Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." },
|
||||
@@ -3162,7 +3201,7 @@ var ts;
|
||||
super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." },
|
||||
Unknown_typing_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_typing_option_0_17010", message: "Unknown typing option '{0}'." },
|
||||
Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" },
|
||||
The_path_in_an_extends_options_must_be_relative_or_rooted: { code: 18001, category: ts.DiagnosticCategory.Error, key: "The_path_in_an_extends_options_must_be_relative_or_rooted_18001", message: "The path in an 'extends' options must be relative or rooted." },
|
||||
A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." },
|
||||
The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "The 'files' list in config file '{0}' is empty." },
|
||||
No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." },
|
||||
Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." },
|
||||
@@ -3174,6 +3213,9 @@ var ts;
|
||||
Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" },
|
||||
Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" },
|
||||
Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." },
|
||||
Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" },
|
||||
Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" },
|
||||
Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" },
|
||||
};
|
||||
})(ts || (ts = {}));
|
||||
var ts;
|
||||
@@ -5525,7 +5567,7 @@ var ts;
|
||||
};
|
||||
function tryExtendsName(extendedConfig) {
|
||||
if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(ts.normalizeSlashes(extendedConfig), "./") || ts.startsWith(ts.normalizeSlashes(extendedConfig), "../"))) {
|
||||
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.The_path_in_an_extends_options_must_be_relative_or_rooted));
|
||||
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig));
|
||||
return;
|
||||
}
|
||||
var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName);
|
||||
@@ -6057,6 +6099,7 @@ var ts;
|
||||
function moduleHasNonRelativeName(moduleName) {
|
||||
return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName));
|
||||
}
|
||||
ts.moduleHasNonRelativeName = moduleHasNonRelativeName;
|
||||
function tryReadTypesSection(extensions, packageJsonPath, baseDirectory, state) {
|
||||
var jsonContent = readJson(packageJsonPath, state.host);
|
||||
switch (extensions) {
|
||||
@@ -6618,9 +6661,17 @@ var ts;
|
||||
isEnabled: function () { return false; },
|
||||
writeLine: ts.noop
|
||||
};
|
||||
function typingToFileName(cachePath, packageName, installTypingHost) {
|
||||
var result = ts.resolveModuleName(packageName, ts.combinePaths(cachePath, "index.d.ts"), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, installTypingHost);
|
||||
return result.resolvedModule && result.resolvedModule.resolvedFileName;
|
||||
function typingToFileName(cachePath, packageName, installTypingHost, log) {
|
||||
try {
|
||||
var result = ts.resolveModuleName(packageName, ts.combinePaths(cachePath, "index.d.ts"), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, installTypingHost);
|
||||
return result.resolvedModule && result.resolvedModule.resolvedFileName;
|
||||
}
|
||||
catch (e) {
|
||||
if (log.isEnabled()) {
|
||||
log.writeLine("Failed to resolve " + packageName + " in folder '" + cachePath + "': " + e.message);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
var PackageNameValidationResult;
|
||||
(function (PackageNameValidationResult) {
|
||||
@@ -6749,8 +6800,9 @@ var ts;
|
||||
if (!packageName) {
|
||||
continue;
|
||||
}
|
||||
var typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost);
|
||||
var typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost, this.log);
|
||||
if (!typingFile) {
|
||||
this.missingTypingsSet[packageName] = true;
|
||||
continue;
|
||||
}
|
||||
var existingTypingFile = this.packageNameToTypingLocation[packageName];
|
||||
@@ -6781,7 +6833,7 @@ var ts;
|
||||
var result = [];
|
||||
for (var _i = 0, typingsToInstall_1 = typingsToInstall; _i < typingsToInstall_1.length; _i++) {
|
||||
var typing = typingsToInstall_1[_i];
|
||||
if (this.missingTypingsSet[typing]) {
|
||||
if (this.missingTypingsSet[typing] || this.packageNameToTypingLocation[typing]) {
|
||||
continue;
|
||||
}
|
||||
var validationResult = validatePackageName(typing);
|
||||
@@ -6857,7 +6909,8 @@ var ts;
|
||||
_this.sendResponse({
|
||||
kind: server.EventInstall,
|
||||
packagesToInstall: scopedTypings,
|
||||
installSuccess: ok
|
||||
installSuccess: ok,
|
||||
typingsInstallerVersion: ts.version
|
||||
});
|
||||
}
|
||||
if (!ok) {
|
||||
@@ -6871,17 +6924,14 @@ var ts;
|
||||
return;
|
||||
}
|
||||
if (_this.log.isEnabled()) {
|
||||
_this.log.writeLine("Requested to install typings " + JSON.stringify(scopedTypings) + ", installed typings " + JSON.stringify(scopedTypings));
|
||||
_this.log.writeLine("Installed typings " + JSON.stringify(scopedTypings));
|
||||
}
|
||||
var installedTypingFiles = [];
|
||||
for (var _a = 0, scopedTypings_1 = scopedTypings; _a < scopedTypings_1.length; _a++) {
|
||||
var t = scopedTypings_1[_a];
|
||||
var packageName = ts.getBaseFileName(t);
|
||||
if (!packageName) {
|
||||
continue;
|
||||
}
|
||||
var typingFile = typingToFileName(cachePath, packageName, _this.installTypingHost);
|
||||
for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) {
|
||||
var packageName = filteredTypings_2[_a];
|
||||
var typingFile = typingToFileName(cachePath, packageName, _this.installTypingHost, _this.log);
|
||||
if (!typingFile) {
|
||||
_this.missingTypingsSet[packageName] = true;
|
||||
continue;
|
||||
}
|
||||
if (!_this.packageNameToTypingLocation[packageName]) {
|
||||
@@ -7021,14 +7071,13 @@ var ts;
|
||||
_this.log.writeLine("Process id: " + process.pid);
|
||||
}
|
||||
_this.npmPath = getNPMLocation(process.argv[0]);
|
||||
var execSync;
|
||||
(_a = require("child_process"), _this.exec = _a.exec, execSync = _a.execSync, _a);
|
||||
(_this.execSync = require("child_process").execSync);
|
||||
_this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
|
||||
try {
|
||||
if (_this.log.isEnabled()) {
|
||||
_this.log.writeLine("Updating " + TypesRegistryPackageName + " npm package...");
|
||||
}
|
||||
execSync(_this.npmPath + " install " + TypesRegistryPackageName, { cwd: globalTypingsCacheLocation, stdio: "ignore" });
|
||||
_this.execSync(_this.npmPath + " install " + TypesRegistryPackageName, { cwd: globalTypingsCacheLocation, stdio: "ignore" });
|
||||
}
|
||||
catch (e) {
|
||||
if (_this.log.isEnabled()) {
|
||||
@@ -7037,7 +7086,6 @@ var ts;
|
||||
}
|
||||
_this.typesRegistry = loadTypesRegistryFile(getTypesRegistryFileLocation(globalTypingsCacheLocation), _this.installTypingHost, _this.log);
|
||||
return _this;
|
||||
var _a;
|
||||
}
|
||||
NodeTypingsInstaller.prototype.listen = function () {
|
||||
var _this = this;
|
||||
@@ -7061,18 +7109,26 @@ var ts;
|
||||
}
|
||||
};
|
||||
NodeTypingsInstaller.prototype.installWorker = function (requestId, args, cwd, onRequestCompleted) {
|
||||
var _this = this;
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(args) + "'.");
|
||||
}
|
||||
var command = this.npmPath + " install " + args.join(" ") + " --save-dev";
|
||||
var start = Date.now();
|
||||
this.exec(command, { cwd: cwd }, function (err, stdout, stderr) {
|
||||
if (_this.log.isEnabled()) {
|
||||
_this.log.writeLine("npm install #" + requestId + " took: " + (Date.now() - start) + " ms" + ts.sys.newLine + "stdout: " + stdout + ts.sys.newLine + "stderr: " + stderr);
|
||||
}
|
||||
onRequestCompleted(!err);
|
||||
});
|
||||
var stdout;
|
||||
var stderr;
|
||||
var hasError = false;
|
||||
try {
|
||||
stdout = this.execSync(command, { cwd: cwd });
|
||||
}
|
||||
catch (e) {
|
||||
stdout = e.stdout;
|
||||
stderr = e.stderr;
|
||||
hasError = true;
|
||||
}
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine("npm install #" + requestId + " took: " + (Date.now() - start) + " ms" + ts.sys.newLine + "stdout: " + (stdout && stdout.toString()) + ts.sys.newLine + "stderr: " + (stderr && stderr.toString()));
|
||||
}
|
||||
onRequestCompleted(!hasError);
|
||||
};
|
||||
return NodeTypingsInstaller;
|
||||
}(typingsInstaller.TypingsInstaller));
|
||||
|
||||
Reference in New Issue
Block a user