mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge branch 'master' into refactorEmitter
Conflicts: src/compiler/emitter.ts src/compiler/parser.ts src/compiler/types.ts
This commit is contained in:
@@ -137,10 +137,12 @@ module ts {
|
||||
SetKeyword,
|
||||
StringKeyword,
|
||||
TypeKeyword,
|
||||
|
||||
// Parse tree nodes
|
||||
Missing,
|
||||
|
||||
// Names
|
||||
QualifiedName,
|
||||
ComputedPropertyName,
|
||||
// Signature elements
|
||||
TypeParameter,
|
||||
Parameter,
|
||||
@@ -162,29 +164,31 @@ module ts {
|
||||
ArrayType,
|
||||
TupleType,
|
||||
UnionType,
|
||||
ParenType,
|
||||
ParenthesizedType,
|
||||
// Expression
|
||||
ArrayLiteral,
|
||||
ObjectLiteral,
|
||||
PropertyAssignment,
|
||||
ShorthandPropertyAssignment,
|
||||
PropertyAccess,
|
||||
IndexedAccess,
|
||||
ArrayLiteralExpression,
|
||||
ObjectLiteralExpression,
|
||||
PropertyAccessExpression,
|
||||
ElementAccessExpression,
|
||||
CallExpression,
|
||||
NewExpression,
|
||||
TaggedTemplateExpression,
|
||||
TypeAssertion,
|
||||
ParenExpression,
|
||||
TypeAssertionExpression,
|
||||
ParenthesizedExpression,
|
||||
FunctionExpression,
|
||||
ArrowFunction,
|
||||
PrefixOperator,
|
||||
PostfixOperator,
|
||||
DeleteExpression,
|
||||
TypeOfExpression,
|
||||
VoidExpression,
|
||||
PrefixUnaryExpression,
|
||||
PostfixUnaryExpression,
|
||||
BinaryExpression,
|
||||
ConditionalExpression,
|
||||
TemplateExpression,
|
||||
TemplateSpan,
|
||||
YieldExpression,
|
||||
OmittedExpression,
|
||||
// Misc
|
||||
TemplateSpan,
|
||||
// Element
|
||||
Block,
|
||||
VariableStatement,
|
||||
@@ -200,13 +204,10 @@ module ts {
|
||||
ReturnStatement,
|
||||
WithStatement,
|
||||
SwitchStatement,
|
||||
CaseClause,
|
||||
DefaultClause,
|
||||
LabeledStatement,
|
||||
ThrowStatement,
|
||||
TryStatement,
|
||||
TryBlock,
|
||||
CatchBlock,
|
||||
FinallyBlock,
|
||||
DebuggerStatement,
|
||||
VariableDeclaration,
|
||||
@@ -220,11 +221,25 @@ module ts {
|
||||
ModuleBlock,
|
||||
ImportDeclaration,
|
||||
ExportAssignment,
|
||||
|
||||
// Module references
|
||||
ExternalModuleReference,
|
||||
|
||||
// Clauses
|
||||
CaseClause,
|
||||
DefaultClause,
|
||||
HeritageClause,
|
||||
CatchClause,
|
||||
|
||||
// Property assignments
|
||||
PropertyAssignment,
|
||||
ShorthandPropertyAssignment,
|
||||
// Enum
|
||||
EnumMember,
|
||||
// Top-level nodes
|
||||
SourceFile,
|
||||
Program,
|
||||
|
||||
// Synthesized list
|
||||
SyntaxList,
|
||||
// Enum value count
|
||||
@@ -239,7 +254,7 @@ module ts {
|
||||
FirstFutureReservedWord = ImplementsKeyword,
|
||||
LastFutureReservedWord = YieldKeyword,
|
||||
FirstTypeNode = TypeReference,
|
||||
LastTypeNode = ParenType,
|
||||
LastTypeNode = ParenthesizedType,
|
||||
FirstPunctuation = OpenBraceToken,
|
||||
LastPunctuation = CaretEqualsToken,
|
||||
FirstToken = EndOfFileToken,
|
||||
@@ -253,14 +268,13 @@ module ts {
|
||||
FirstOperator = SemicolonToken,
|
||||
LastOperator = CaretEqualsToken,
|
||||
FirstBinaryOperator = LessThanToken,
|
||||
LastBinaryOperator = CaretEqualsToken
|
||||
LastBinaryOperator = CaretEqualsToken,
|
||||
FirstNode = QualifiedName,
|
||||
}
|
||||
|
||||
export const enum NodeFlags {
|
||||
Export = 0x00000001, // Declarations
|
||||
Ambient = 0x00000002, // Declarations
|
||||
QuestionMark = 0x00000004, // Parameter/Property/Method
|
||||
Rest = 0x00000008, // Parameter
|
||||
Public = 0x00000010, // Property/Method
|
||||
Private = 0x00000020, // Property/Method
|
||||
Protected = 0x00000040, // Property/Method
|
||||
@@ -271,8 +285,6 @@ module ts {
|
||||
Let = 0x00000800, // Variable declaration
|
||||
Const = 0x00001000, // Variable declaration
|
||||
OctalLiteral = 0x00002000,
|
||||
Generator = 0x00004000,
|
||||
YieldStar = 0x00008000,
|
||||
|
||||
Modifier = Export | Ambient | Public | Private | Protected | Static,
|
||||
AccessibilityModifier = Public | Private | Protected,
|
||||
@@ -307,11 +319,11 @@ module ts {
|
||||
hasTrailingComma?: boolean;
|
||||
}
|
||||
|
||||
export interface ModifiersArray extends Array<Node> {
|
||||
export interface ModifiersArray extends NodeArray<Node> {
|
||||
flags: number;
|
||||
}
|
||||
|
||||
export interface Identifier extends Node {
|
||||
export interface Identifier extends PrimaryExpression {
|
||||
text: string; // Text of identifier (with escapes converted to characters)
|
||||
}
|
||||
|
||||
@@ -332,6 +344,7 @@ module ts {
|
||||
export type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName;
|
||||
|
||||
export interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
name?: DeclarationName;
|
||||
}
|
||||
|
||||
@@ -347,7 +360,8 @@ module ts {
|
||||
expression?: Expression;
|
||||
}
|
||||
|
||||
export interface SignatureDeclaration extends Declaration, ParsedSignature { }
|
||||
export interface SignatureDeclaration extends Declaration, ParsedSignature {
|
||||
}
|
||||
|
||||
export interface VariableDeclaration extends Declaration {
|
||||
name: Identifier;
|
||||
@@ -355,49 +369,72 @@ module ts {
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export interface PropertyDeclaration extends Declaration {
|
||||
export interface ParameterDeclaration extends Declaration {
|
||||
dotDotDotToken?: Node;
|
||||
name: Identifier;
|
||||
questionToken?: Node;
|
||||
type?: TypeNode | StringLiteralExpression;
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export interface PropertyDeclaration extends Declaration, ClassElement {
|
||||
questionToken?: Node;
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export type VariableOrParameterDeclaration = VariableDeclaration | ParameterDeclaration;
|
||||
export type VariableOrParameterOrPropertyDeclaration = VariableOrParameterDeclaration | PropertyDeclaration;
|
||||
|
||||
export interface ShorthandPropertyDeclaration extends Declaration {
|
||||
name: Identifier;
|
||||
questionToken?: Node;
|
||||
}
|
||||
|
||||
export interface ParameterDeclaration extends VariableDeclaration { }
|
||||
|
||||
/**
|
||||
* Several node kinds share function-like features such as a signature,
|
||||
* a name, and a body. These nodes should extend FunctionLikeDeclaration.
|
||||
* Examples:
|
||||
* FunctionDeclaration
|
||||
* MethodDeclaration
|
||||
* ConstructorDeclaration
|
||||
* AccessorDeclaration
|
||||
* FunctionExpression
|
||||
*/
|
||||
export interface FunctionLikeDeclaration extends Declaration, ParsedSignature {
|
||||
export interface FunctionLikeDeclaration extends SignatureDeclaration {
|
||||
_functionLikeDeclarationBrand: any;
|
||||
|
||||
asteriskToken?: Node;
|
||||
questionToken?: Node;
|
||||
body?: Block | Expression;
|
||||
}
|
||||
|
||||
export interface FunctionDeclaration extends FunctionLikeDeclaration {
|
||||
export interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
|
||||
name: Identifier;
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface MethodDeclaration extends FunctionLikeDeclaration {
|
||||
export interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement {
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface ConstructorDeclaration extends FunctionLikeDeclaration {
|
||||
export interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement {
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface AccessorDeclaration extends FunctionLikeDeclaration {
|
||||
export interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement {
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface TypeNode extends Node { }
|
||||
export interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement {
|
||||
_indexSignatureDeclarationBrand: any;
|
||||
}
|
||||
|
||||
export interface TypeNode extends Node {
|
||||
_typeNodeBrand: any;
|
||||
}
|
||||
|
||||
export interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration {
|
||||
_functionOrConstructorTypeNodeBrand: any;
|
||||
}
|
||||
|
||||
export interface TypeReferenceNode extends TypeNode {
|
||||
typeName: EntityName;
|
||||
@@ -408,7 +445,8 @@ module ts {
|
||||
exprName: EntityName;
|
||||
}
|
||||
|
||||
export interface TypeLiteralNode extends TypeNode {
|
||||
// A TypeLiteral is the declaration node for an anonymous symbol.
|
||||
export interface TypeLiteralNode extends TypeNode, Declaration {
|
||||
members: NodeArray<Node>;
|
||||
}
|
||||
|
||||
@@ -424,24 +462,66 @@ module ts {
|
||||
types: NodeArray<TypeNode>;
|
||||
}
|
||||
|
||||
export interface ParenTypeNode extends TypeNode {
|
||||
export interface ParenthesizedTypeNode extends TypeNode {
|
||||
type: TypeNode;
|
||||
}
|
||||
|
||||
export interface StringLiteralTypeNode extends TypeNode {
|
||||
text: string;
|
||||
}
|
||||
// Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing.
|
||||
// Consider 'Expression'. Without the brand, 'Expression' is actually no different
|
||||
// (structurally) than 'Node'. Because of this you can pass any Node to a function that
|
||||
// takes an Expression without any error. By using the 'brands' we ensure that the type
|
||||
// checker actually thinks you have something of the right type. Note: the brands are
|
||||
// never actually given values. At runtime they have zero cost.
|
||||
|
||||
export interface Expression extends Node {
|
||||
_expressionBrand: any;
|
||||
contextualType?: Type; // Used to temporarily assign a contextual type during overload resolution
|
||||
}
|
||||
|
||||
export interface UnaryExpression extends Expression {
|
||||
_unaryExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface PrefixUnaryExpression extends UnaryExpression {
|
||||
operator: SyntaxKind;
|
||||
operand: Expression;
|
||||
operand: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface PostfixUnaryExpression extends PostfixExpression {
|
||||
operand: LeftHandSideExpression;
|
||||
operator: SyntaxKind;
|
||||
}
|
||||
|
||||
export interface PostfixExpression extends UnaryExpression {
|
||||
_postfixExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface LeftHandSideExpression extends PostfixExpression {
|
||||
_leftHandSideExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface MemberExpression extends LeftHandSideExpression {
|
||||
_memberExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface PrimaryExpression extends MemberExpression {
|
||||
_primaryExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface DeleteExpression extends UnaryExpression {
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface TypeOfExpression extends UnaryExpression {
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface VoidExpression extends UnaryExpression {
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface YieldExpression extends Expression {
|
||||
asteriskToken?: Node;
|
||||
expression: Expression;
|
||||
}
|
||||
|
||||
@@ -457,7 +537,7 @@ module ts {
|
||||
whenFalse: Expression;
|
||||
}
|
||||
|
||||
export interface FunctionExpression extends Expression, FunctionLikeDeclaration {
|
||||
export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
|
||||
name?: Identifier;
|
||||
body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional
|
||||
}
|
||||
@@ -465,11 +545,16 @@ module ts {
|
||||
// The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral,
|
||||
// or any literal of a template, this means quotes have been removed and escapes have been converted to actual characters.
|
||||
// For a NumericLiteral, the stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1".
|
||||
export interface LiteralExpression extends Expression {
|
||||
export interface LiteralExpression extends PrimaryExpression {
|
||||
text: string;
|
||||
isUnterminated?: boolean;
|
||||
}
|
||||
|
||||
export interface TemplateExpression extends Expression {
|
||||
export interface StringLiteralExpression extends LiteralExpression {
|
||||
_stringLiteralExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface TemplateExpression extends PrimaryExpression {
|
||||
head: LiteralExpression;
|
||||
templateSpans: NodeArray<TemplateSpan>;
|
||||
}
|
||||
@@ -481,49 +566,52 @@ module ts {
|
||||
literal: LiteralExpression;
|
||||
}
|
||||
|
||||
export interface ParenExpression extends Expression {
|
||||
export interface ParenthesizedExpression extends PrimaryExpression {
|
||||
expression: Expression;
|
||||
}
|
||||
|
||||
export interface ArrayLiteral extends Expression {
|
||||
export interface ArrayLiteralExpression extends PrimaryExpression {
|
||||
elements: NodeArray<Expression>;
|
||||
}
|
||||
|
||||
export interface ObjectLiteral extends Expression {
|
||||
properties: NodeArray<Node>;
|
||||
|
||||
// An ObjectLiteralExpression is the declaration node for an anonymous symbol.
|
||||
export interface ObjectLiteralExpression extends PrimaryExpression, Declaration {
|
||||
properties: NodeArray<Declaration>;
|
||||
}
|
||||
|
||||
export interface PropertyAccess extends Expression {
|
||||
left: Expression;
|
||||
right: Identifier;
|
||||
export interface PropertyAccessExpression extends MemberExpression {
|
||||
expression: LeftHandSideExpression;
|
||||
name: Identifier;
|
||||
}
|
||||
|
||||
export interface IndexedAccess extends Expression {
|
||||
object: Expression;
|
||||
index: Expression;
|
||||
export interface ElementAccessExpression extends MemberExpression {
|
||||
expression: LeftHandSideExpression;
|
||||
argumentExpression?: Expression;
|
||||
}
|
||||
|
||||
export interface CallExpression extends Expression {
|
||||
func: Expression;
|
||||
export interface CallExpression extends LeftHandSideExpression {
|
||||
expression: LeftHandSideExpression;
|
||||
typeArguments?: NodeArray<TypeNode>;
|
||||
arguments: NodeArray<Expression>;
|
||||
}
|
||||
|
||||
export interface NewExpression extends CallExpression { }
|
||||
export interface NewExpression extends CallExpression, PrimaryExpression { }
|
||||
|
||||
export interface TaggedTemplateExpression extends Expression {
|
||||
tag: Expression;
|
||||
export interface TaggedTemplateExpression extends MemberExpression {
|
||||
tag: LeftHandSideExpression;
|
||||
template: LiteralExpression | TemplateExpression;
|
||||
}
|
||||
|
||||
export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression;
|
||||
|
||||
export interface TypeAssertion extends Expression {
|
||||
export interface TypeAssertion extends UnaryExpression {
|
||||
type: TypeNode;
|
||||
operand: Expression;
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface Statement extends Node { }
|
||||
export interface Statement extends Node, ModuleElement {
|
||||
_statementBrand: any;
|
||||
}
|
||||
|
||||
export interface Block extends Statement {
|
||||
statements: NodeArray<Statement>;
|
||||
@@ -586,11 +674,17 @@ module ts {
|
||||
clauses: NodeArray<CaseOrDefaultClause>;
|
||||
}
|
||||
|
||||
export interface CaseOrDefaultClause extends Node {
|
||||
export interface CaseClause extends Node {
|
||||
expression?: Expression;
|
||||
statements: NodeArray<Statement>;
|
||||
}
|
||||
|
||||
export interface DefaultClause extends Node {
|
||||
statements: NodeArray<Statement>;
|
||||
}
|
||||
|
||||
export type CaseOrDefaultClause = CaseClause | DefaultClause;
|
||||
|
||||
export interface LabeledStatement extends Statement {
|
||||
label: Identifier;
|
||||
statement: Statement;
|
||||
@@ -602,57 +696,82 @@ module ts {
|
||||
|
||||
export interface TryStatement extends Statement {
|
||||
tryBlock: Block;
|
||||
catchBlock?: CatchBlock;
|
||||
catchClause?: CatchClause;
|
||||
finallyBlock?: Block;
|
||||
}
|
||||
|
||||
export interface CatchBlock extends Block {
|
||||
variable: Identifier;
|
||||
export interface CatchClause extends Declaration {
|
||||
name: Identifier;
|
||||
type?: TypeNode;
|
||||
block: Block;
|
||||
}
|
||||
|
||||
export interface ClassDeclaration extends Declaration {
|
||||
export interface ModuleElement extends Node {
|
||||
_moduleElementBrand: any;
|
||||
}
|
||||
|
||||
export interface ClassDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
baseType?: TypeReferenceNode;
|
||||
implementedTypes?: NodeArray<TypeReferenceNode>;
|
||||
members: NodeArray<Node>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
members: NodeArray<ClassElement>;
|
||||
}
|
||||
|
||||
export interface InterfaceDeclaration extends Declaration {
|
||||
export interface ClassElement extends Declaration {
|
||||
_classElementBrand: any;
|
||||
}
|
||||
|
||||
export interface InterfaceDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
baseTypes?: NodeArray<TypeReferenceNode>;
|
||||
members: NodeArray<Node>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
members: NodeArray<Declaration>;
|
||||
}
|
||||
|
||||
export interface TypeAliasDeclaration extends Declaration {
|
||||
export interface HeritageClause extends Node {
|
||||
token: SyntaxKind;
|
||||
types?: NodeArray<TypeReferenceNode>;
|
||||
}
|
||||
|
||||
export interface TypeAliasDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
type: TypeNode;
|
||||
}
|
||||
|
||||
export interface EnumMember extends Declaration {
|
||||
name: Identifier | LiteralExpression;
|
||||
// This does include ComputedPropertyName, but the parser will give an error
|
||||
// if it parses a ComputedPropertyName in an EnumMember
|
||||
name: DeclarationName;
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export interface EnumDeclaration extends Declaration {
|
||||
export interface EnumDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
members: NodeArray<EnumMember>;
|
||||
}
|
||||
|
||||
export interface ModuleDeclaration extends Declaration {
|
||||
export interface ModuleDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier | LiteralExpression;
|
||||
body: Block | ModuleDeclaration;
|
||||
body: ModuleBlock | ModuleDeclaration;
|
||||
}
|
||||
|
||||
export interface ImportDeclaration extends Declaration {
|
||||
export interface ModuleBlock extends Node, ModuleElement {
|
||||
statements: NodeArray<ModuleElement>
|
||||
}
|
||||
|
||||
export interface ImportDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
entityName?: EntityName;
|
||||
externalModuleName?: LiteralExpression;
|
||||
|
||||
// 'EntityName' for an internal module reference, 'ExternalModuleReference' for an external
|
||||
// module reference.
|
||||
moduleReference: EntityName | ExternalModuleReference;
|
||||
}
|
||||
|
||||
export interface ExportAssignment extends Statement {
|
||||
export interface ExternalModuleReference extends Node {
|
||||
expression?: Expression;
|
||||
}
|
||||
|
||||
export interface ExportAssignment extends Statement, ModuleElement {
|
||||
exportName: Identifier;
|
||||
}
|
||||
|
||||
@@ -664,7 +783,10 @@ module ts {
|
||||
hasTrailingNewLine?: boolean;
|
||||
}
|
||||
|
||||
export interface SourceFile extends Block {
|
||||
// Source files are declarations when they are external modules.
|
||||
export interface SourceFile extends Declaration {
|
||||
statements: NodeArray<ModuleElement>;
|
||||
|
||||
filename: string;
|
||||
text: string;
|
||||
getLineAndCharacterFromPosition(position: number): LineAndCharacter;
|
||||
@@ -752,7 +874,6 @@ module ts {
|
||||
getIdentifierCount(): number;
|
||||
getSymbolCount(): number;
|
||||
getTypeCount(): number;
|
||||
checkProgram(): void;
|
||||
emitFiles(targetSourceFile?: SourceFile): EmitResult;
|
||||
getParentOfSymbol(symbol: Symbol): Symbol;
|
||||
getNarrowedTypeOfSymbol(symbol: Symbol, node: Node): Type;
|
||||
@@ -781,7 +902,7 @@ module ts {
|
||||
isEmitBlocked(sourceFile?: SourceFile): boolean;
|
||||
// Returns the constant value of this enum member, or 'undefined' if the enum member has a computed value.
|
||||
getEnumMemberValue(node: EnumMember): number;
|
||||
isValidPropertyAccess(node: PropertyAccess, propertyName: string): boolean;
|
||||
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
|
||||
getAliasedSymbol(symbol: Symbol): Symbol;
|
||||
}
|
||||
|
||||
@@ -864,15 +985,15 @@ module ts {
|
||||
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
|
||||
getNodeCheckFlags(node: Node): NodeCheckFlags;
|
||||
getEnumMemberValue(node: EnumMember): number;
|
||||
hasSemanticErrors(): boolean;
|
||||
hasSemanticErrors(sourceFile?: SourceFile): boolean;
|
||||
isDeclarationVisible(node: Declaration): boolean;
|
||||
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
|
||||
writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
|
||||
writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableOrParameterDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
|
||||
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
|
||||
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
|
||||
getConstantValue(node: PropertyAccess | IndexedAccess): number;
|
||||
getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isEmitBlocked(sourceFile?: SourceFile): boolean;
|
||||
}
|
||||
|
||||
@@ -1182,12 +1303,6 @@ module ts {
|
||||
* Early error - any error (can be produced at parsing\binding\typechecking step) that blocks emit
|
||||
*/
|
||||
isEarly?: boolean;
|
||||
/**
|
||||
* Parse error - error produced by parser when it scanner returns a token
|
||||
* that parser does not understand in its current state
|
||||
* (as opposed to grammar error when parser can interpret the token but interpretation is not legal from the grammar perespective)
|
||||
*/
|
||||
isParseError?: boolean;
|
||||
}
|
||||
|
||||
export enum DiagnosticCategory {
|
||||
@@ -1221,6 +1336,7 @@ module ts {
|
||||
version?: boolean;
|
||||
watch?: boolean;
|
||||
preserveConstEnums?: boolean;
|
||||
allowNonTsExtensions?: boolean;
|
||||
[option: string]: string | number | boolean;
|
||||
}
|
||||
|
||||
@@ -1255,7 +1371,7 @@ module ts {
|
||||
export interface CommandLineOption {
|
||||
name: string;
|
||||
type: string | Map<number>; // "string", "number", "boolean", or an object literal mapping named values to actual values
|
||||
shortName?: string; // A short pneumonic for convenience - for instance, 'h' can be used in place of 'help'.
|
||||
shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help'.
|
||||
description?: DiagnosticMessage; // The message describing what the command line switch does
|
||||
paramName?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter.
|
||||
error?: DiagnosticMessage; // The error given when the argument does not fit a customized 'type'.
|
||||
@@ -1402,7 +1518,7 @@ module ts {
|
||||
|
||||
export interface CompilerHost {
|
||||
getSourceFile(filename: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile;
|
||||
getDefaultLibFilename(): string;
|
||||
getDefaultLibFilename(options: CompilerOptions): string;
|
||||
getCancellationToken? (): CancellationToken;
|
||||
writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
|
||||
getCurrentDirectory(): string;
|
||||
|
||||
Reference in New Issue
Block a user