Update LKG

This commit is contained in:
Cyrus Najmabadi 2015-03-07 13:59:18 -08:00
parent 21627384a8
commit 04d373ab9b
8 changed files with 8436 additions and 4405 deletions

2234
bin/tsc.js

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

129
bin/typescript.d.ts vendored
View file

@ -124,28 +124,28 @@ declare module "typescript" {
WhileKeyword = 99, WhileKeyword = 99,
WithKeyword = 100, WithKeyword = 100,
AsKeyword = 101, AsKeyword = 101,
FromKeyword = 102, ImplementsKeyword = 102,
ImplementsKeyword = 103, InterfaceKeyword = 103,
InterfaceKeyword = 104, LetKeyword = 104,
LetKeyword = 105, PackageKeyword = 105,
PackageKeyword = 106, PrivateKeyword = 106,
PrivateKeyword = 107, ProtectedKeyword = 107,
ProtectedKeyword = 108, PublicKeyword = 108,
PublicKeyword = 109, StaticKeyword = 109,
StaticKeyword = 110, YieldKeyword = 110,
YieldKeyword = 111, AnyKeyword = 111,
AnyKeyword = 112, BooleanKeyword = 112,
BooleanKeyword = 113, ConstructorKeyword = 113,
ConstructorKeyword = 114, DeclareKeyword = 114,
DeclareKeyword = 115, GetKeyword = 115,
GetKeyword = 116, ModuleKeyword = 116,
ModuleKeyword = 117, RequireKeyword = 117,
RequireKeyword = 118, NumberKeyword = 118,
NumberKeyword = 119, SetKeyword = 119,
SetKeyword = 120, StringKeyword = 120,
StringKeyword = 121, SymbolKeyword = 121,
SymbolKeyword = 122, TypeKeyword = 122,
TypeKeyword = 123, FromKeyword = 123,
OfKeyword = 124, OfKeyword = 124,
QualifiedName = 125, QualifiedName = 125,
ComputedPropertyName = 126, ComputedPropertyName = 126,
@ -251,8 +251,8 @@ declare module "typescript" {
LastReservedWord = 100, LastReservedWord = 100,
FirstKeyword = 65, FirstKeyword = 65,
LastKeyword = 124, LastKeyword = 124,
FirstFutureReservedWord = 103, FirstFutureReservedWord = 102,
LastFutureReservedWord = 111, LastFutureReservedWord = 110,
FirstTypeNode = 139, FirstTypeNode = 139,
LastTypeNode = 147, LastTypeNode = 147,
FirstPunctuation = 14, FirstPunctuation = 14,
@ -276,15 +276,16 @@ declare module "typescript" {
Private = 32, Private = 32,
Protected = 64, Protected = 64,
Static = 128, Static = 128,
MultiLine = 256, Default = 256,
Synthetic = 512, MultiLine = 512,
DeclarationFile = 1024, Synthetic = 1024,
Let = 2048, DeclarationFile = 2048,
Const = 4096, Let = 4096,
OctalLiteral = 8192, Const = 8192,
Modifier = 243, OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112, AccessibilityModifier = 112,
BlockScoped = 6144, BlockScoped = 12288,
} }
const enum ParserContextFlags { const enum ParserContextFlags {
StrictMode = 1, StrictMode = 1,
@ -412,7 +413,7 @@ declare module "typescript" {
body?: Block | Expression; body?: Block | Expression;
} }
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier; name?: Identifier;
body?: Block; body?: Block;
} }
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@ -505,7 +506,9 @@ declare module "typescript" {
} }
interface ConditionalExpression extends Expression { interface ConditionalExpression extends Expression {
condition: Expression; condition: Expression;
questionToken: Node;
whenTrue: Expression; whenTrue: Expression;
colonToken: Node;
whenFalse: Expression; whenFalse: Expression;
} }
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
@ -515,6 +518,7 @@ declare module "typescript" {
interface LiteralExpression extends PrimaryExpression { interface LiteralExpression extends PrimaryExpression {
text: string; text: string;
isUnterminated?: boolean; isUnterminated?: boolean;
hasExtendedUnicodeEscape?: boolean;
} }
interface StringLiteralExpression extends LiteralExpression { interface StringLiteralExpression extends LiteralExpression {
_stringLiteralExpressionBrand: any; _stringLiteralExpressionBrand: any;
@ -541,6 +545,7 @@ declare module "typescript" {
} }
interface PropertyAccessExpression extends MemberExpression { interface PropertyAccessExpression extends MemberExpression {
expression: LeftHandSideExpression; expression: LeftHandSideExpression;
dotToken: Node;
name: Identifier; name: Identifier;
} }
interface ElementAccessExpression extends MemberExpression { interface ElementAccessExpression extends MemberExpression {
@ -636,16 +641,15 @@ declare module "typescript" {
catchClause?: CatchClause; catchClause?: CatchClause;
finallyBlock?: Block; finallyBlock?: Block;
} }
interface CatchClause extends Declaration { interface CatchClause extends Node {
name: Identifier; variableDeclaration: VariableDeclaration;
type?: TypeNode;
block: Block; block: Block;
} }
interface ModuleElement extends Node { interface ModuleElement extends Node {
_moduleElementBrand: any; _moduleElementBrand: any;
} }
interface ClassDeclaration extends Declaration, ModuleElement { interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier; name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>; typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>; heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>; members: NodeArray<ClassElement>;
@ -675,10 +679,7 @@ declare module "typescript" {
name: Identifier; name: Identifier;
members: NodeArray<EnumMember>; members: NodeArray<EnumMember>;
} }
interface ExportContainer { interface ModuleDeclaration extends Declaration, ModuleElement {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
name: Identifier | LiteralExpression; name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration; body: ModuleBlock | ModuleDeclaration;
} }
@ -703,7 +704,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration { interface NamespaceImport extends Declaration {
name: Identifier; name: Identifier;
} }
interface ExportDeclaration extends Statement, ModuleElement { interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports; exportClause?: NamedExports;
moduleSpecifier?: Expression; moduleSpecifier?: Expression;
} }
@ -718,8 +719,9 @@ declare module "typescript" {
} }
type ImportSpecifier = ImportOrExportSpecifier; type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier; type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement { interface ExportAssignment extends Declaration, ModuleElement {
exportName: Identifier; isExportEquals?: boolean;
expression: Expression;
} }
interface FileReference extends TextRange { interface FileReference extends TextRange {
fileName: string; fileName: string;
@ -727,7 +729,7 @@ declare module "typescript" {
interface CommentRange extends TextRange { interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean; hasTrailingNewLine?: boolean;
} }
interface SourceFile extends Declaration, ExportContainer { interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>; statements: NodeArray<ModuleElement>;
endOfFileToken: Node; endOfFileToken: Node;
fileName: string; fileName: string;
@ -832,6 +834,7 @@ declare module "typescript" {
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
getAliasedSymbol(symbol: Symbol): Symbol; getAliasedSymbol(symbol: Symbol): Symbol;
getExportsOfExternalModule(node: ImportDeclaration): Symbol[];
} }
interface SymbolDisplayBuilder { interface SymbolDisplayBuilder {
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
@ -889,10 +892,10 @@ declare module "typescript" {
errorModuleName?: string; errorModuleName?: string;
} }
interface EmitResolver { interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string; getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string; getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string; hasExportDefaultValue(node: SourceFile): boolean;
isReferencedImportDeclaration(node: Node): boolean; isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags; getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean; isDeclarationVisible(node: Declaration): boolean;
@ -903,6 +906,7 @@ declare module "typescript" {
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
isUnknownIdentifier(location: Node, name: string): boolean; isUnknownIdentifier(location: Node, name: string): boolean;
getBlockScopedVariableId(node: Identifier): number;
} }
const enum SymbolFlags { const enum SymbolFlags {
FunctionScopedVariable = 1, FunctionScopedVariable = 1,
@ -928,13 +932,14 @@ declare module "typescript" {
ExportValue = 1048576, ExportValue = 1048576,
ExportType = 2097152, ExportType = 2097152,
ExportNamespace = 4194304, ExportNamespace = 4194304,
Import = 8388608, Alias = 8388608,
Instantiated = 16777216, Instantiated = 16777216,
Merged = 33554432, Merged = 33554432,
Transient = 67108864, Transient = 67108864,
Prototype = 134217728, Prototype = 134217728,
UnionProperty = 268435456, UnionProperty = 268435456,
Optional = 536870912, Optional = 536870912,
ExportStar = 1073741824,
Enum = 384, Enum = 384,
Variable = 3, Variable = 3,
Value = 107455, Value = 107455,
@ -959,7 +964,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687, SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912, TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056, TypeAliasExcludes = 793056,
ImportExcludes = 8388608, AliasExcludes = 8388608,
ModuleMember = 8914931, ModuleMember = 8914931,
ExportHasLocal = 944, ExportHasLocal = 944,
HasLocals = 255504, HasLocals = 255504,
@ -988,10 +993,9 @@ declare module "typescript" {
declaredType?: Type; declaredType?: Type;
mapper?: TypeMapper; mapper?: TypeMapper;
referenced?: boolean; referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType; unionType?: UnionType;
resolvedExports?: SymbolTable; resolvedExports?: SymbolTable;
exportsChecked?: boolean;
} }
interface TransientSymbol extends Symbol, SymbolLinks { interface TransientSymbol extends Symbol, SymbolLinks {
} }
@ -1007,6 +1011,7 @@ declare module "typescript" {
SuperStatic = 32, SuperStatic = 32,
ContextChecked = 64, ContextChecked = 64,
EnumValuesComputed = 128, EnumValuesComputed = 128,
BlockScopedBindingInLoop = 256,
} }
interface NodeLinks { interface NodeLinks {
resolvedType?: Type; resolvedType?: Type;
@ -1383,6 +1388,7 @@ declare module "typescript" {
getTokenPos(): number; getTokenPos(): number;
getTokenText(): string; getTokenText(): string;
getTokenValue(): string; getTokenValue(): string;
hasExtendedUnicodeEscape(): boolean;
hasPrecedingLineBreak(): boolean; hasPrecedingLineBreak(): boolean;
isIdentifier(): boolean; isIdentifier(): boolean;
isReservedWord(): boolean; isReservedWord(): boolean;
@ -1479,9 +1485,6 @@ declare module "typescript" {
getDocumentationComment(): SymbolDisplayPart[]; getDocumentationComment(): SymbolDisplayPart[];
} }
interface SourceFile { interface SourceFile {
version: string;
scriptSnapshot: IScriptSnapshot;
nameTable: Map<string>;
getNamedDeclarations(): Declaration[]; getNamedDeclarations(): Declaration[];
getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
getLineStarts(): number[]; getLineStarts(): number[];
@ -1835,25 +1838,17 @@ declare module "typescript" {
acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
/** /**
* Request an updated version of an already existing SourceFile with a given fileName * Request an updated version of an already existing SourceFile with a given fileName
* and compilationSettings. The update will intern call updateLanguageServiceSourceFile * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
* to get an updated SourceFile. * to get an updated SourceFile.
* *
* Note: It is not allowed to call update on a SourceFile that was not acquired from this
* registry originally.
*
* @param sourceFile The original sourceFile object to update
* @param fileName The name of the file requested * @param fileName The name of the file requested
* @param compilationSettings Some compilation settings like target affects the * @param compilationSettings Some compilation settings like target affects the
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. * multiple copies of the same file for different compilation settings.
* @parm scriptSnapshot Text of the file. Only used if the file was not found * @param scriptSnapshot Text of the file.
* in the registry and a new one was created. * @param version Current version of the file.
* @parm version Current version of the file. Only used if the file was not found
* in the registry and a new one was created.
* @parm textChangeRange Change ranges since the last snapshot. Only used if the file
* was not found in the registry and a new one was created.
*/ */
updateDocument(sourceFile: SourceFile, fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange): SourceFile; updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
/** /**
* Informs the DocumentRegistry that a file is not needed any longer. * Informs the DocumentRegistry that a file is not needed any longer.
* *

File diff suppressed because it is too large Load diff

View file

@ -124,28 +124,28 @@ declare module ts {
WhileKeyword = 99, WhileKeyword = 99,
WithKeyword = 100, WithKeyword = 100,
AsKeyword = 101, AsKeyword = 101,
FromKeyword = 102, ImplementsKeyword = 102,
ImplementsKeyword = 103, InterfaceKeyword = 103,
InterfaceKeyword = 104, LetKeyword = 104,
LetKeyword = 105, PackageKeyword = 105,
PackageKeyword = 106, PrivateKeyword = 106,
PrivateKeyword = 107, ProtectedKeyword = 107,
ProtectedKeyword = 108, PublicKeyword = 108,
PublicKeyword = 109, StaticKeyword = 109,
StaticKeyword = 110, YieldKeyword = 110,
YieldKeyword = 111, AnyKeyword = 111,
AnyKeyword = 112, BooleanKeyword = 112,
BooleanKeyword = 113, ConstructorKeyword = 113,
ConstructorKeyword = 114, DeclareKeyword = 114,
DeclareKeyword = 115, GetKeyword = 115,
GetKeyword = 116, ModuleKeyword = 116,
ModuleKeyword = 117, RequireKeyword = 117,
RequireKeyword = 118, NumberKeyword = 118,
NumberKeyword = 119, SetKeyword = 119,
SetKeyword = 120, StringKeyword = 120,
StringKeyword = 121, SymbolKeyword = 121,
SymbolKeyword = 122, TypeKeyword = 122,
TypeKeyword = 123, FromKeyword = 123,
OfKeyword = 124, OfKeyword = 124,
QualifiedName = 125, QualifiedName = 125,
ComputedPropertyName = 126, ComputedPropertyName = 126,
@ -251,8 +251,8 @@ declare module ts {
LastReservedWord = 100, LastReservedWord = 100,
FirstKeyword = 65, FirstKeyword = 65,
LastKeyword = 124, LastKeyword = 124,
FirstFutureReservedWord = 103, FirstFutureReservedWord = 102,
LastFutureReservedWord = 111, LastFutureReservedWord = 110,
FirstTypeNode = 139, FirstTypeNode = 139,
LastTypeNode = 147, LastTypeNode = 147,
FirstPunctuation = 14, FirstPunctuation = 14,
@ -276,15 +276,16 @@ declare module ts {
Private = 32, Private = 32,
Protected = 64, Protected = 64,
Static = 128, Static = 128,
MultiLine = 256, Default = 256,
Synthetic = 512, MultiLine = 512,
DeclarationFile = 1024, Synthetic = 1024,
Let = 2048, DeclarationFile = 2048,
Const = 4096, Let = 4096,
OctalLiteral = 8192, Const = 8192,
Modifier = 243, OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112, AccessibilityModifier = 112,
BlockScoped = 6144, BlockScoped = 12288,
} }
const enum ParserContextFlags { const enum ParserContextFlags {
StrictMode = 1, StrictMode = 1,
@ -412,7 +413,7 @@ declare module ts {
body?: Block | Expression; body?: Block | Expression;
} }
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier; name?: Identifier;
body?: Block; body?: Block;
} }
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@ -505,7 +506,9 @@ declare module ts {
} }
interface ConditionalExpression extends Expression { interface ConditionalExpression extends Expression {
condition: Expression; condition: Expression;
questionToken: Node;
whenTrue: Expression; whenTrue: Expression;
colonToken: Node;
whenFalse: Expression; whenFalse: Expression;
} }
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
@ -515,6 +518,7 @@ declare module ts {
interface LiteralExpression extends PrimaryExpression { interface LiteralExpression extends PrimaryExpression {
text: string; text: string;
isUnterminated?: boolean; isUnterminated?: boolean;
hasExtendedUnicodeEscape?: boolean;
} }
interface StringLiteralExpression extends LiteralExpression { interface StringLiteralExpression extends LiteralExpression {
_stringLiteralExpressionBrand: any; _stringLiteralExpressionBrand: any;
@ -541,6 +545,7 @@ declare module ts {
} }
interface PropertyAccessExpression extends MemberExpression { interface PropertyAccessExpression extends MemberExpression {
expression: LeftHandSideExpression; expression: LeftHandSideExpression;
dotToken: Node;
name: Identifier; name: Identifier;
} }
interface ElementAccessExpression extends MemberExpression { interface ElementAccessExpression extends MemberExpression {
@ -636,16 +641,15 @@ declare module ts {
catchClause?: CatchClause; catchClause?: CatchClause;
finallyBlock?: Block; finallyBlock?: Block;
} }
interface CatchClause extends Declaration { interface CatchClause extends Node {
name: Identifier; variableDeclaration: VariableDeclaration;
type?: TypeNode;
block: Block; block: Block;
} }
interface ModuleElement extends Node { interface ModuleElement extends Node {
_moduleElementBrand: any; _moduleElementBrand: any;
} }
interface ClassDeclaration extends Declaration, ModuleElement { interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier; name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>; typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>; heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>; members: NodeArray<ClassElement>;
@ -675,10 +679,7 @@ declare module ts {
name: Identifier; name: Identifier;
members: NodeArray<EnumMember>; members: NodeArray<EnumMember>;
} }
interface ExportContainer { interface ModuleDeclaration extends Declaration, ModuleElement {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
name: Identifier | LiteralExpression; name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration; body: ModuleBlock | ModuleDeclaration;
} }
@ -703,7 +704,7 @@ declare module ts {
interface NamespaceImport extends Declaration { interface NamespaceImport extends Declaration {
name: Identifier; name: Identifier;
} }
interface ExportDeclaration extends Statement, ModuleElement { interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports; exportClause?: NamedExports;
moduleSpecifier?: Expression; moduleSpecifier?: Expression;
} }
@ -718,8 +719,9 @@ declare module ts {
} }
type ImportSpecifier = ImportOrExportSpecifier; type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier; type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement { interface ExportAssignment extends Declaration, ModuleElement {
exportName: Identifier; isExportEquals?: boolean;
expression: Expression;
} }
interface FileReference extends TextRange { interface FileReference extends TextRange {
fileName: string; fileName: string;
@ -727,7 +729,7 @@ declare module ts {
interface CommentRange extends TextRange { interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean; hasTrailingNewLine?: boolean;
} }
interface SourceFile extends Declaration, ExportContainer { interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>; statements: NodeArray<ModuleElement>;
endOfFileToken: Node; endOfFileToken: Node;
fileName: string; fileName: string;
@ -832,6 +834,7 @@ declare module ts {
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
getAliasedSymbol(symbol: Symbol): Symbol; getAliasedSymbol(symbol: Symbol): Symbol;
getExportsOfExternalModule(node: ImportDeclaration): Symbol[];
} }
interface SymbolDisplayBuilder { interface SymbolDisplayBuilder {
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
@ -889,10 +892,10 @@ declare module ts {
errorModuleName?: string; errorModuleName?: string;
} }
interface EmitResolver { interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string; getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string; getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string; hasExportDefaultValue(node: SourceFile): boolean;
isReferencedImportDeclaration(node: Node): boolean; isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags; getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean; isDeclarationVisible(node: Declaration): boolean;
@ -903,6 +906,7 @@ declare module ts {
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
isUnknownIdentifier(location: Node, name: string): boolean; isUnknownIdentifier(location: Node, name: string): boolean;
getBlockScopedVariableId(node: Identifier): number;
} }
const enum SymbolFlags { const enum SymbolFlags {
FunctionScopedVariable = 1, FunctionScopedVariable = 1,
@ -928,13 +932,14 @@ declare module ts {
ExportValue = 1048576, ExportValue = 1048576,
ExportType = 2097152, ExportType = 2097152,
ExportNamespace = 4194304, ExportNamespace = 4194304,
Import = 8388608, Alias = 8388608,
Instantiated = 16777216, Instantiated = 16777216,
Merged = 33554432, Merged = 33554432,
Transient = 67108864, Transient = 67108864,
Prototype = 134217728, Prototype = 134217728,
UnionProperty = 268435456, UnionProperty = 268435456,
Optional = 536870912, Optional = 536870912,
ExportStar = 1073741824,
Enum = 384, Enum = 384,
Variable = 3, Variable = 3,
Value = 107455, Value = 107455,
@ -959,7 +964,7 @@ declare module ts {
SetAccessorExcludes = 74687, SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912, TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056, TypeAliasExcludes = 793056,
ImportExcludes = 8388608, AliasExcludes = 8388608,
ModuleMember = 8914931, ModuleMember = 8914931,
ExportHasLocal = 944, ExportHasLocal = 944,
HasLocals = 255504, HasLocals = 255504,
@ -988,10 +993,9 @@ declare module ts {
declaredType?: Type; declaredType?: Type;
mapper?: TypeMapper; mapper?: TypeMapper;
referenced?: boolean; referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType; unionType?: UnionType;
resolvedExports?: SymbolTable; resolvedExports?: SymbolTable;
exportsChecked?: boolean;
} }
interface TransientSymbol extends Symbol, SymbolLinks { interface TransientSymbol extends Symbol, SymbolLinks {
} }
@ -1007,6 +1011,7 @@ declare module ts {
SuperStatic = 32, SuperStatic = 32,
ContextChecked = 64, ContextChecked = 64,
EnumValuesComputed = 128, EnumValuesComputed = 128,
BlockScopedBindingInLoop = 256,
} }
interface NodeLinks { interface NodeLinks {
resolvedType?: Type; resolvedType?: Type;
@ -1383,6 +1388,7 @@ declare module ts {
getTokenPos(): number; getTokenPos(): number;
getTokenText(): string; getTokenText(): string;
getTokenValue(): string; getTokenValue(): string;
hasExtendedUnicodeEscape(): boolean;
hasPrecedingLineBreak(): boolean; hasPrecedingLineBreak(): boolean;
isIdentifier(): boolean; isIdentifier(): boolean;
isReservedWord(): boolean; isReservedWord(): boolean;
@ -1479,9 +1485,6 @@ declare module ts {
getDocumentationComment(): SymbolDisplayPart[]; getDocumentationComment(): SymbolDisplayPart[];
} }
interface SourceFile { interface SourceFile {
version: string;
scriptSnapshot: IScriptSnapshot;
nameTable: Map<string>;
getNamedDeclarations(): Declaration[]; getNamedDeclarations(): Declaration[];
getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
getLineStarts(): number[]; getLineStarts(): number[];
@ -1835,25 +1838,17 @@ declare module ts {
acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
/** /**
* Request an updated version of an already existing SourceFile with a given fileName * Request an updated version of an already existing SourceFile with a given fileName
* and compilationSettings. The update will intern call updateLanguageServiceSourceFile * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
* to get an updated SourceFile. * to get an updated SourceFile.
* *
* Note: It is not allowed to call update on a SourceFile that was not acquired from this
* registry originally.
*
* @param sourceFile The original sourceFile object to update
* @param fileName The name of the file requested * @param fileName The name of the file requested
* @param compilationSettings Some compilation settings like target affects the * @param compilationSettings Some compilation settings like target affects the
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings. * multiple copies of the same file for different compilation settings.
* @parm scriptSnapshot Text of the file. Only used if the file was not found * @param scriptSnapshot Text of the file.
* in the registry and a new one was created. * @param version Current version of the file.
* @parm version Current version of the file. Only used if the file was not found
* in the registry and a new one was created.
* @parm textChangeRange Change ranges since the last snapshot. Only used if the file
* was not found in the registry and a new one was created.
*/ */
updateDocument(sourceFile: SourceFile, fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange): SourceFile; updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
/** /**
* Informs the DocumentRegistry that a file is not needed any longer. * Informs the DocumentRegistry that a file is not needed any longer.
* *

File diff suppressed because it is too large Load diff

View file

@ -87,12 +87,6 @@ declare module ts {
function combinePaths(path1: string, path2: string): string; function combinePaths(path1: string, path2: string): string;
function fileExtensionIs(path: string, extension: string): boolean; function fileExtensionIs(path: string, extension: string): boolean;
function removeFileExtension(path: string): string; function removeFileExtension(path: string): string;
/**
* Based heavily on the abstract 'Quote' operation from ECMA-262 (24.3.2.2),
* but augmented for a few select characters.
* Note that this doesn't actually wrap the input in double quotes.
*/
function escapeString(s: string): string;
function getDefaultLibFileName(options: CompilerOptions): string; function getDefaultLibFileName(options: CompilerOptions): string;
interface ObjectAllocator { interface ObjectAllocator {
getNodeConstructor(kind: SyntaxKind): new () => Node; getNodeConstructor(kind: SyntaxKind): new () => Node;
@ -143,6 +137,11 @@ declare module ts {
diagnosticMessage?: DiagnosticMessage; diagnosticMessage?: DiagnosticMessage;
isNoDefaultLib?: boolean; isNoDefaultLib?: boolean;
} }
interface SynthesizedNode extends Node {
leadingCommentRanges?: CommentRange[];
trailingCommentRanges?: CommentRange[];
startsOnNewLine: boolean;
}
function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration; function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration;
interface StringSymbolWriter extends SymbolWriter { interface StringSymbolWriter extends SymbolWriter {
string(): string; string(): string;
@ -171,10 +170,12 @@ declare module ts {
function escapeIdentifier(identifier: string): string; function escapeIdentifier(identifier: string): string;
function unescapeIdentifier(identifier: string): string; function unescapeIdentifier(identifier: string): string;
function makeIdentifierFromModuleName(moduleName: string): string; function makeIdentifierFromModuleName(moduleName: string): string;
function isBlockOrCatchScoped(declaration: Declaration): boolean;
function isCatchClauseVariableDeclaration(declaration: Declaration): boolean;
function declarationNameToString(name: DeclarationName): string; function declarationNameToString(name: DeclarationName): string;
function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic; function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic;
function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic; function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic;
function getErrorSpanForNode(node: Node): Node; function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan;
function isExternalModule(file: SourceFile): boolean; function isExternalModule(file: SourceFile): boolean;
function isDeclarationFile(file: SourceFile): boolean; function isDeclarationFile(file: SourceFile): boolean;
function isConstEnumDeclaration(node: Node): boolean; function isConstEnumDeclaration(node: Node): boolean;
@ -186,7 +187,7 @@ declare module ts {
function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[];
var fullTripleSlashReferencePathRegEx: RegExp; var fullTripleSlashReferencePathRegEx: RegExp;
function forEachReturnStatement<T>(body: Block, visitor: (stmt: ReturnStatement) => T): T; function forEachReturnStatement<T>(body: Block, visitor: (stmt: ReturnStatement) => T): T;
function isAnyFunction(node: Node): boolean; function isFunctionLike(node: Node): boolean;
function isFunctionBlock(node: Node): boolean; function isFunctionBlock(node: Node): boolean;
function isObjectLiteralMethod(node: Node): boolean; function isObjectLiteralMethod(node: Node): boolean;
function getContainingFunction(node: Node): FunctionLikeDeclaration; function getContainingFunction(node: Node): FunctionLikeDeclaration;
@ -209,7 +210,7 @@ declare module ts {
function isInAmbientContext(node: Node): boolean; function isInAmbientContext(node: Node): boolean;
function isDeclaration(node: Node): boolean; function isDeclaration(node: Node): boolean;
function isStatement(n: Node): boolean; function isStatement(n: Node): boolean;
function isDeclarationOrFunctionExpressionOrCatchVariableName(name: Node): boolean; function isDeclarationName(name: Node): boolean;
function getClassBaseTypeNode(node: ClassDeclaration): TypeReferenceNode; function getClassBaseTypeNode(node: ClassDeclaration): TypeReferenceNode;
function getClassImplementedTypeNodes(node: ClassDeclaration): NodeArray<TypeReferenceNode>; function getClassImplementedTypeNodes(node: ClassDeclaration): NodeArray<TypeReferenceNode>;
function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray<TypeReferenceNode>; function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray<TypeReferenceNode>;
@ -265,6 +266,18 @@ declare module ts {
* Vn. * Vn.
*/ */
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
function nodeStartsNewLexicalEnvironment(n: Node): boolean;
function nodeIsSynthesized(node: Node): boolean;
function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node;
function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string;
function createDiagnosticCollection(): DiagnosticCollection;
/**
* Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2),
* but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine)
* Note that this doesn't actually wrap the input in double quotes.
*/
function escapeString(s: string): string;
function escapeNonAsciiCharacters(s: string): string;
} }
declare module ts { declare module ts {
var optionDeclarations: CommandLineOption[]; var optionDeclarations: CommandLineOption[];

View file

@ -87,12 +87,6 @@ declare module "typescript" {
function combinePaths(path1: string, path2: string): string; function combinePaths(path1: string, path2: string): string;
function fileExtensionIs(path: string, extension: string): boolean; function fileExtensionIs(path: string, extension: string): boolean;
function removeFileExtension(path: string): string; function removeFileExtension(path: string): string;
/**
* Based heavily on the abstract 'Quote' operation from ECMA-262 (24.3.2.2),
* but augmented for a few select characters.
* Note that this doesn't actually wrap the input in double quotes.
*/
function escapeString(s: string): string;
function getDefaultLibFileName(options: CompilerOptions): string; function getDefaultLibFileName(options: CompilerOptions): string;
interface ObjectAllocator { interface ObjectAllocator {
getNodeConstructor(kind: SyntaxKind): new () => Node; getNodeConstructor(kind: SyntaxKind): new () => Node;
@ -143,6 +137,11 @@ declare module "typescript" {
diagnosticMessage?: DiagnosticMessage; diagnosticMessage?: DiagnosticMessage;
isNoDefaultLib?: boolean; isNoDefaultLib?: boolean;
} }
interface SynthesizedNode extends Node {
leadingCommentRanges?: CommentRange[];
trailingCommentRanges?: CommentRange[];
startsOnNewLine: boolean;
}
function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration; function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration;
interface StringSymbolWriter extends SymbolWriter { interface StringSymbolWriter extends SymbolWriter {
string(): string; string(): string;
@ -171,10 +170,12 @@ declare module "typescript" {
function escapeIdentifier(identifier: string): string; function escapeIdentifier(identifier: string): string;
function unescapeIdentifier(identifier: string): string; function unescapeIdentifier(identifier: string): string;
function makeIdentifierFromModuleName(moduleName: string): string; function makeIdentifierFromModuleName(moduleName: string): string;
function isBlockOrCatchScoped(declaration: Declaration): boolean;
function isCatchClauseVariableDeclaration(declaration: Declaration): boolean;
function declarationNameToString(name: DeclarationName): string; function declarationNameToString(name: DeclarationName): string;
function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic; function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic;
function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic; function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic;
function getErrorSpanForNode(node: Node): Node; function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan;
function isExternalModule(file: SourceFile): boolean; function isExternalModule(file: SourceFile): boolean;
function isDeclarationFile(file: SourceFile): boolean; function isDeclarationFile(file: SourceFile): boolean;
function isConstEnumDeclaration(node: Node): boolean; function isConstEnumDeclaration(node: Node): boolean;
@ -186,7 +187,7 @@ declare module "typescript" {
function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[];
var fullTripleSlashReferencePathRegEx: RegExp; var fullTripleSlashReferencePathRegEx: RegExp;
function forEachReturnStatement<T>(body: Block, visitor: (stmt: ReturnStatement) => T): T; function forEachReturnStatement<T>(body: Block, visitor: (stmt: ReturnStatement) => T): T;
function isAnyFunction(node: Node): boolean; function isFunctionLike(node: Node): boolean;
function isFunctionBlock(node: Node): boolean; function isFunctionBlock(node: Node): boolean;
function isObjectLiteralMethod(node: Node): boolean; function isObjectLiteralMethod(node: Node): boolean;
function getContainingFunction(node: Node): FunctionLikeDeclaration; function getContainingFunction(node: Node): FunctionLikeDeclaration;
@ -209,7 +210,7 @@ declare module "typescript" {
function isInAmbientContext(node: Node): boolean; function isInAmbientContext(node: Node): boolean;
function isDeclaration(node: Node): boolean; function isDeclaration(node: Node): boolean;
function isStatement(n: Node): boolean; function isStatement(n: Node): boolean;
function isDeclarationOrFunctionExpressionOrCatchVariableName(name: Node): boolean; function isDeclarationName(name: Node): boolean;
function getClassBaseTypeNode(node: ClassDeclaration): TypeReferenceNode; function getClassBaseTypeNode(node: ClassDeclaration): TypeReferenceNode;
function getClassImplementedTypeNodes(node: ClassDeclaration): NodeArray<TypeReferenceNode>; function getClassImplementedTypeNodes(node: ClassDeclaration): NodeArray<TypeReferenceNode>;
function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray<TypeReferenceNode>; function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray<TypeReferenceNode>;
@ -265,6 +266,18 @@ declare module "typescript" {
* Vn. * Vn.
*/ */
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
function nodeStartsNewLexicalEnvironment(n: Node): boolean;
function nodeIsSynthesized(node: Node): boolean;
function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node;
function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string;
function createDiagnosticCollection(): DiagnosticCollection;
/**
* Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2),
* but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine)
* Note that this doesn't actually wrap the input in double quotes.
*/
function escapeString(s: string): string;
function escapeNonAsciiCharacters(s: string): string;
} }
declare module "typescript" { declare module "typescript" {
var optionDeclarations: CommandLineOption[]; var optionDeclarations: CommandLineOption[];