module ts { export interface Map < T > { [ index ] : T ; } export interface TextRange { pos : number ; end : number ; } export const enum SyntaxKind { Unknown , EndOfFileToken , SingleLineCommentTrivia , MultiLineCommentTrivia , NewLineTrivia , WhitespaceTrivia , NumericLiteral , StringLiteral , RegularExpressionLiteral , NoSubstitutionTemplateLiteral , TemplateHead , TemplateMiddle , TemplateTail , OpenBraceToken , CloseBraceToken , OpenParenToken , CloseParenToken , OpenBracketToken , CloseBracketToken , DotToken , DotDotDotToken , SemicolonToken , CommaToken , LessThanToken , GreaterThanToken , LessThanEqualsToken , GreaterThanEqualsToken , EqualsEqualsToken , ExclamationEqualsToken , EqualsEqualsEqualsToken , ExclamationEqualsEqualsToken , EqualsGreaterThanToken , PlusToken , MinusToken , AsteriskToken , SlashToken , PercentToken , PlusPlusToken , MinusMinusToken , LessThanLessThanToken , GreaterThanGreaterThanToken , GreaterThanGreaterThanGreaterThanToken , AmpersandToken , BarToken , CaretToken , ExclamationToken , TildeToken , AmpersandAmpersandToken , BarBarToken , QuestionToken , ColonToken , EqualsToken , PlusEqualsToken , MinusEqualsToken , AsteriskEqualsToken , SlashEqualsToken , PercentEqualsToken , LessThanLessThanEqualsToken , GreaterThanGreaterThanEqualsToken , GreaterThanGreaterThanGreaterThanEqualsToken , AmpersandEqualsToken , BarEqualsToken , CaretEqualsToken , Identifier , BreakKeyword , CaseKeyword , CatchKeyword , ClassKeyword , ConstKeyword , ContinueKeyword , DebuggerKeyword , DefaultKeyword , DeleteKeyword , DoKeyword , ElseKeyword , EnumKeyword , ExportKeyword , ExtendsKeyword , FalseKeyword , FinallyKeyword , ForKeyword , FunctionKeyword , IfKeyword , ImportKeyword , InKeyword , InstanceOfKeyword , NewKeyword , NullKeyword , ReturnKeyword , SuperKeyword , SwitchKeyword , ThisKeyword , ThrowKeyword , TrueKeyword , TryKeyword , TypeOfKeyword , VarKeyword , VoidKeyword , WhileKeyword , WithKeyword , ImplementsKeyword , InterfaceKeyword , LetKeyword , PackageKeyword , PrivateKeyword , ProtectedKeyword , PublicKeyword , StaticKeyword , YieldKeyword , AnyKeyword , BooleanKeyword , ConstructorKeyword , DeclareKeyword , GetKeyword , ModuleKeyword , RequireKeyword , NumberKeyword , SetKeyword , StringKeyword , TypeKeyword , QualifiedName , ComputedPropertyName , TypeParameter , Parameter , Property , Method , Constructor , GetAccessor , SetAccessor , CallSignature , ConstructSignature , IndexSignature , TypeReference , FunctionType , ConstructorType , TypeQuery , TypeLiteral , ArrayType , TupleType , UnionType , ParenthesizedType , ArrayLiteralExpression , ObjectLiteralExpression , PropertyAccessExpression , ElementAccessExpression , CallExpression , NewExpression , TaggedTemplateExpression , TypeAssertionExpression , ParenthesizedExpression , FunctionExpression , ArrowFunction , DeleteExpression , TypeOfExpression , VoidExpression , PrefixUnaryExpression , PostfixUnaryExpression , BinaryExpression , ConditionalExpression , TemplateExpression , YieldExpression , OmittedExpression , TemplateSpan , Block , VariableStatement , EmptyStatement , ExpressionStatement , IfStatement , DoStatement , WhileStatement , ForStatement , ForInStatement , ContinueStatement , BreakStatement , ReturnStatement , WithStatement , SwitchStatement , LabeledStatement , ThrowStatement , TryStatement , TryBlock , FinallyBlock , DebuggerStatement , VariableDeclaration , FunctionDeclaration , ClassDeclaration , InterfaceDeclaration , TypeAliasDeclaration , EnumDeclaration , ModuleDeclaration , ModuleBlock , ImportDeclaration , ExportAssignment , ExternalModuleReference , CaseClause , DefaultClause , HeritageClause , CatchClause , PropertyAssignment , ShorthandPropertyAssignment , EnumMember , SourceFile , Program , SyntaxList , Count , FirstAssignment = EqualsToken , LastAssignment = CaretEqualsToken , FirstReservedWord = BreakKeyword , LastReservedWord = WithKeyword , FirstKeyword = BreakKeyword , LastKeyword = TypeKeyword , FirstFutureReservedWord = ImplementsKeyword , LastFutureReservedWord = YieldKeyword , FirstTypeNode = TypeReference , LastTypeNode = ParenthesizedType , FirstPunctuation = OpenBraceToken , LastPunctuation = CaretEqualsToken , FirstToken = Unknown , LastToken = TypeKeyword , FirstTriviaToken = SingleLineCommentTrivia , LastTriviaToken = WhitespaceTrivia , FirstLiteralToken = NumericLiteral , LastLiteralToken = NoSubstitutionTemplateLiteral , FirstTemplateToken = NoSubstitutionTemplateLiteral , LastTemplateToken = TemplateTail , FirstOperator = SemicolonToken , LastOperator = CaretEqualsToken , FirstBinaryOperator = LessThanToken , LastBinaryOperator = CaretEqualsToken , FirstNode = QualifiedName } export const enum NodeFlags { Export = 0x00000001 , Ambient = 0x00000002 , Public = 0x00000010 , Private = 0x00000020 , Protected = 0x00000040 , Static = 0x00000080 , MultiLine = 0x00000100 , Synthetic = 0x00000200 , DeclarationFile = 0x00000400 , Let = 0x00000800 , Const = 0x00001000 , OctalLiteral = 0x00002000 , Modifier = Export | Ambient | Public | Private | Protected | Static , AccessibilityModifier = Public | Private | Protected , BlockScoped = Let | Const } export const enum ParserContextFlags { StrictMode = 1 << 0 , DisallowIn = 1 << 1 , Yield = 1 << 2 , GeneratorParameter = 1 << 3 , ContainsError = 1 << 4 , HasPropagatedChildContainsErrorFlag = 1 << 5 } export interface Node extends TextRange { kind : SyntaxKind ; flags : NodeFlags ; parserContextFlags ? : ParserContextFlags ; id ? : number ; parent ? : Node ; symbol ? : Symbol ; locals ? : SymbolTable ; nextContainer ? : Node ; localSymbol ? : Symbol ; modifiers ? : ModifiersArray ; } export interface NodeArray < T > extends Array < T > , TextRange { hasTrailingComma ? : boolean ; } export interface ModifiersArray extends NodeArray < Node > { flags : number ; } export interface Identifier extends PrimaryExpression { text : string ; } export interface QualifiedName extends Node { left : EntityName ; right : Identifier ; } export type EntityName = Identifier | QualifiedName ; export type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName ; export interface Declaration extends Node { _declarationBrand : any ; name ? : DeclarationName ; } export interface ComputedPropertyName extends Node { expression : Expression ; } export interface TypeParameterDeclaration extends Declaration { name : Identifier ; constraint ? : TypeNode ; expression ? : Expression ; } export interface SignatureDeclaration extends Declaration { typeParameters ? : NodeArray < TypeParameterDeclaration > ; parameters : NodeArray < ParameterDeclaration > ; type ? : TypeNode ; } export interface VariableDeclaration extends Declaration { name : Identifier ; type ? : TypeNode ; initializer ? : Expression ; } export interface ParameterDeclaration extends Declaration { dotDotDotToken ? : Node ; name : Identifier ; questionToken ? : Node ; type ? : TypeNode | StringLiteralExpression ; initializer ? : Expression ; } export interface PropertyDeclaration extends Declaration , ClassElement { _propertyDeclarationBrand : any ; questionToken ? : Node ; type ? : TypeNode ; initializer ? : Expression ; } export type VariableOrParameterDeclaration = VariableDeclaration | ParameterDeclaration ; export type VariableOrParameterOrPropertyDeclaration = VariableOrParameterDeclaration | PropertyDeclaration ; export interface ObjectLiteralElement extends Declaration { _objectLiteralBrandBrand : any ; } export interface ShorthandPropertyAssignment extends ObjectLiteralElement { name : Identifier ; questionToken ? : Node ; } export interface PropertyAssignment extends ObjectLiteralElement { _propertyAssignmentBrand : any ; name : DeclarationName ; questionToken ? : Node ; initializer : Expression ; } /**
     * Several node kinds share function-like features such as a signature,
     * a name, and a body. These nodes should extend FunctionLikeDeclaration.
     * Examples:
     *  FunctionDeclaration
     *  MethodDeclaration
     *  AccessorDeclaration
     */ export interface FunctionLikeDeclaration extends SignatureDeclaration { _functionLikeDeclarationBrand : any ; asteriskToken ? : Node ; questionToken ? : Node ; body ? : Block | Expression ; } export interface FunctionDeclaration extends FunctionLikeDeclaration , Statement { name : Identifier ; body ? : Block ; } export interface MethodDeclaration extends FunctionLikeDeclaration , ClassElement , ObjectLiteralElement { body ? : Block ; } export interface ConstructorDeclaration extends FunctionLikeDeclaration , ClassElement { body ? : Block ; } export interface AccessorDeclaration extends FunctionLikeDeclaration , ClassElement , ObjectLiteralElement { _accessorDeclarationBrand : any ; body : Block ; } 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 ; typeArguments ? : NodeArray < TypeNode > ; } export interface TypeQueryNode extends TypeNode { exprName : EntityName ; } export interface TypeLiteralNode extends TypeNode , Declaration { members : NodeArray < Node > ; } export interface ArrayTypeNode extends TypeNode { elementType : TypeNode ; } export interface TupleTypeNode extends TypeNode { elementTypes : NodeArray < TypeNode > ; } export interface UnionTypeNode extends TypeNode { types : NodeArray < TypeNode > ; } export interface ParenthesizedTypeNode extends TypeNode { type : TypeNode ; } export interface Expression extends Node { _expressionBrand : any ; contextualType ? : Type ; } export interface UnaryExpression extends Expression { _unaryExpressionBrand : any ; } export interface PrefixUnaryExpression extends UnaryExpression { operator : SyntaxKind ; 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 ; } export interface BinaryExpression extends Expression { left : Expression ; operator : SyntaxKind ; right : Expression ; } export interface ConditionalExpression extends Expression { condition : Expression ; whenTrue : Expression ; whenFalse : Expression ; } export interface FunctionExpression extends PrimaryExpression , FunctionLikeDeclaration { name ? : Identifier ; body : Block | Expression ; } export interface LiteralExpression extends PrimaryExpression { text : string ; isUnterminated ? : boolean ; } export interface StringLiteralExpression extends LiteralExpression { _stringLiteralExpressionBrand : any ; } export interface TemplateExpression extends PrimaryExpression { head : LiteralExpression ; templateSpans : NodeArray < TemplateSpan > ; } export interface TemplateSpan extends Node { expression : Expression ; literal : LiteralExpression ; } export interface ParenthesizedExpression extends PrimaryExpression { expression : Expression ; } export interface ArrayLiteralExpression extends PrimaryExpression { elements : NodeArray < Expression > ; } export interface ObjectLiteralExpression extends PrimaryExpression , Declaration { properties : NodeArray < ObjectLiteralElement > ; } export interface PropertyAccessExpression extends MemberExpression { expression : LeftHandSideExpression ; name : Identifier ; } export interface ElementAccessExpression extends MemberExpression { expression : LeftHandSideExpression ; argumentExpression ? : Expression ; } export interface CallExpression extends LeftHandSideExpression { expression : LeftHandSideExpression ; typeArguments ? : NodeArray < TypeNode > ; arguments : NodeArray < Expression > ; } export interface NewExpression extends CallExpression , PrimaryExpression { } export interface TaggedTemplateExpression extends MemberExpression { tag : LeftHandSideExpression ; template : LiteralExpression | TemplateExpression ; } export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression ; export interface TypeAssertion extends UnaryExpression { type : TypeNode ; expression : UnaryExpression ; } export interface Statement extends Node , ModuleElement { _statementBrand : any ; } export interface Block extends Statement { statements : NodeArray < Statement > ; } export interface VariableStatement extends Statement { declarations : NodeArray < VariableDeclaration > ; } export interface ExpressionStatement extends Statement { expression : Expression ; } export interface IfStatement extends Statement { expression : Expression ; thenStatement : Statement ; elseStatement ? : Statement ; } export interface IterationStatement extends Statement { statement : Statement ; } export interface DoStatement extends IterationStatement { expression : Expression ; } export interface WhileStatement extends IterationStatement { expression : Expression ; } export interface ForStatement extends IterationStatement { declarations ? : NodeArray < VariableDeclaration > ; initializer ? : Expression ; condition ? : Expression ; iterator ? : Expression ; } export interface ForInStatement extends IterationStatement { declarations ? : NodeArray < VariableDeclaration > ; variable ? : Expression ; expression : Expression ; } export interface BreakOrContinueStatement extends Statement { label ? : Identifier ; } export interface ReturnStatement extends Statement { expression ? : Expression ; } export interface WithStatement extends Statement { expression : Expression ; statement : Statement ; } export interface SwitchStatement extends Statement { expression : Expression ; clauses : NodeArray < CaseOrDefaultClause > ; } 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 ; } export interface ThrowStatement extends Statement { expression : Expression ; } export interface TryStatement extends Statement { tryBlock : Block ; catchClause ? : CatchClause ; finallyBlock ? : Block ; } export interface CatchClause extends Declaration { name : Identifier ; type ? : TypeNode ; block : Block ; } export interface ModuleElement extends Node { _moduleElementBrand : any ; } export interface ClassDeclaration extends Declaration , ModuleElement { name : Identifier ; typeParameters ? : NodeArray < TypeParameterDeclaration > ; heritageClauses ? : NodeArray < HeritageClause > ; members : NodeArray < ClassElement > ; } export interface ClassElement extends Declaration { _classElementBrand : any ; } export interface InterfaceDeclaration extends Declaration , ModuleElement { name : Identifier ; typeParameters ? : NodeArray < TypeParameterDeclaration > ; heritageClauses ? : NodeArray < HeritageClause > ; members : NodeArray < 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 : DeclarationName ; initializer ? : Expression ; } export interface EnumDeclaration extends Declaration , ModuleElement { name : Identifier ; members : NodeArray < EnumMember > ; } export interface ModuleDeclaration extends Declaration , ModuleElement { name : Identifier | LiteralExpression ; body : ModuleBlock | ModuleDeclaration ; } export interface ModuleBlock extends Node , ModuleElement { statements : NodeArray < ModuleElement > ; } export interface ImportDeclaration extends Declaration , ModuleElement { name : Identifier ; moduleReference : EntityName | ExternalModuleReference ; } export interface ExternalModuleReference extends Node { expression ? : Expression ; } export interface ExportAssignment extends Statement , ModuleElement { exportName : Identifier ; } export interface FileReference extends TextRange { filename : string ; } export interface CommentRange extends TextRange { hasTrailingNewLine ? : boolean ; } export interface SourceFile extends Declaration { statements : NodeArray < ModuleElement > ; endOfFileToken : Node ; filename : string ; text : string ; getLineAndCharacterFromPosition ( position ) : LineAndCharacter ; getPositionFromLineAndCharacter ( line , character ) : number ; getLineStarts ( ) : number [ ] ; amdDependencies : string [ ] ; amdModuleName : string ; referencedFiles : FileReference [ ] ; referenceDiagnostics : Diagnostic [ ] ; parseDiagnostics : Diagnostic [ ] ; grammarDiagnostics : Diagnostic [ ] ; getSyntacticDiagnostics ( ) : Diagnostic [ ] ; semanticDiagnostics : Diagnostic [ ] ; hasNoDefaultLib : boolean ; externalModuleIndicator : Node ; nodeCount : number ; identifierCount : number ; symbolCount : number ; isOpen : boolean ; version : string ; languageVersion : ScriptTarget ; identifiers : Map < string > ; } export interface Program { getSourceFile ( filename ) : SourceFile ; getSourceFiles ( ) : SourceFile [ ] ; getCompilerOptions ( ) : CompilerOptions ; getCompilerHost ( ) : CompilerHost ; getDiagnostics ( sourceFile ? ) : Diagnostic [ ] ; getGlobalDiagnostics ( ) : Diagnostic [ ] ; getTypeChecker ( fullTypeCheckMode ) : TypeChecker ; getCommonSourceDirectory ( ) : string ; } export interface SourceMapSpan { emittedLine : number ; emittedColumn : number ; sourceLine : number ; sourceColumn : number ; nameIndex ? : number ; sourceIndex : number ; } export interface SourceMapData { sourceMapFilePath : string ; jsSourceMappingURL : string ; sourceMapFile : string ; sourceMapSourceRoot : string ; sourceMapSources : string [ ] ; inputSourceFileNames : string [ ] ; sourceMapNames ? : string [ ] ; sourceMapMappings : string ; sourceMapDecodedMappings : SourceMapSpan [ ] ; } export enum EmitReturnStatus { Succeeded = 0 , AllOutputGenerationSkipped = 1 , JSGeneratedWithSemanticErrors = 2 , DeclarationGenerationSkipped = 3 , EmitErrorsEncountered = 4 , CompilerOptionsErrors = 5 } export interface EmitResult { emitResultStatus : EmitReturnStatus ; diagnostics : Diagnostic [ ] ; sourceMaps : SourceMapData [ ] ; } export interface TypeChecker { getProgram ( ) : Program ; getDiagnostics ( sourceFile ? ) : Diagnostic [ ] ; getDeclarationDiagnostics ( sourceFile ) : Diagnostic [ ] ; getGlobalDiagnostics ( ) : Diagnostic [ ] ; getNodeCount ( ) : number ; getIdentifierCount ( ) : number ; getSymbolCount ( ) : number ; getTypeCount ( ) : number ; emitFiles ( targetSourceFile ? ) : EmitResult ; getTypeOfSymbolAtLocation ( symbol , node ) : Type ; getDeclaredTypeOfSymbol ( symbol ) : Type ; getPropertiesOfType ( type ) : Symbol [ ] ; getPropertyOfType ( type , propertyName ) : Symbol ; getSignaturesOfType ( type , kind ) : Signature [ ] ; getIndexTypeOfType ( type , kind ) : Type ; getReturnTypeOfSignature ( signature ) : Type ; getSymbolsInScope ( location , meaning ) : Symbol [ ] ; getSymbolAtLocation ( node ) : Symbol ; getShorthandAssignmentValueSymbol ( location ) : Symbol ; getTypeAtLocation ( node ) : Type ; typeToString ( type , enclosingDeclaration ? , flags ? ) : string ; symbolToString ( symbol , enclosingDeclaration ? , meaning ? ) : string ; getSymbolDisplayBuilder ( ) : SymbolDisplayBuilder ; getFullyQualifiedName ( symbol ) : string ; getAugmentedPropertiesOfType ( type ) : Symbol [ ] ; getRootSymbols ( symbol ) : Symbol [ ] ; getContextualType ( node ) : Type ; getResolvedSignature ( node , candidatesOutArray ? ) : Signature ; getSignatureFromDeclaration ( declaration ) : Signature ; isImplementationOfOverload ( node ) : boolean ; isUndefinedSymbol ( symbol ) : boolean ; isArgumentsSymbol ( symbol ) : boolean ; isEmitBlocked ( sourceFile ? ) : boolean ; getEnumMemberValue ( node ) : number ; isValidPropertyAccess ( node , propertyName ) : boolean ; getAliasedSymbol ( symbol ) : Symbol ; checkAndMarkExpression ( node , contextualMapper ? ) : Type ; egretGetResolveSymbol ( node ) : Symbol ; } export interface SymbolDisplayBuilder { buildTypeDisplay ( type , writer , enclosingDeclaration ? , flags ? ) : void ; buildSymbolDisplay ( symbol , writer , enclosingDeclaration ? , meaning ? , flags ? ) : void ; buildSignatureDisplay ( signatures , writer , enclosingDeclaration ? , flags ? ) : void ; buildParameterDisplay ( parameter , writer , enclosingDeclaration ? , flags ? ) : void ; buildTypeParameterDisplay ( tp , writer , enclosingDeclaration ? , flags ? ) : void ; buildTypeParameterDisplayFromSymbol ( symbol , writer , enclosingDeclaraiton ? , flags ? ) : void ; buildDisplayForParametersAndDelimiters ( parameters , writer , enclosingDeclaration ? , flags ? ) : void ; buildDisplayForTypeParametersAndDelimiters ( typeParameters , writer , enclosingDeclaration ? , flags ? ) : void ; buildReturnTypeDisplay ( signature , writer , enclosingDeclaration ? , flags ? ) : void ; } export interface SymbolWriter { writeKeyword ( text ) : void ; writeOperator ( text ) : void ; writePunctuation ( text ) : void ; writeSpace ( text ) : void ; writeStringLiteral ( text ) : void ; writeParameter ( text ) : void ; writeSymbol ( text , symbol ) : void ; writeLine ( ) : void ; increaseIndent ( ) : void ; decreaseIndent ( ) : void ; clear ( ) : void ; trackSymbol ( symbol , enclosingDeclaration ? , meaning ? ) : void ; } export const enum TypeFormatFlags { None = 0x00000000 , WriteArrayAsGenericType = 0x00000001 , UseTypeOfFunction = 0x00000002 , NoTruncation = 0x00000004 , WriteArrowStyleSignature = 0x00000008 , WriteOwnNameForAnyLike = 0x00000010 , WriteTypeArgumentsOfSignature = 0x00000020 , InElementType = 0x00000040 } export const enum SymbolFormatFlags { None = 0x00000000 , WriteTypeParametersOrArguments = 0x00000001 , UseOnlyExternalAliasing = 0x00000002 } export const enum SymbolAccessibility { Accessible , NotAccessible , CannotBeNamed } export interface SymbolVisibilityResult { accessibility : SymbolAccessibility ; aliasesToMakeVisible ? : ImportDeclaration [ ] ; errorSymbolName ? : string ; errorNode ? : Node ; } export interface SymbolAccessiblityResult extends SymbolVisibilityResult { errorModuleName ? : string ; } export interface EmitResolver { getProgram ( ) : Program ; getLocalNameOfContainer ( container ) : string ; getExpressionNamePrefix ( node ) : string ; getExportAssignmentName ( node ) : string ; isReferencedImportDeclaration ( node ) : boolean ; isTopLevelValueImportWithEntityName ( node ) : boolean ; getNodeCheckFlags ( node ) : NodeCheckFlags ; getEnumMemberValue ( node ) : number ; hasSemanticErrors ( sourceFile ? ) : boolean ; isDeclarationVisible ( node ) : boolean ; isImplementationOfOverload ( node ) : boolean ; writeTypeOfDeclaration ( declaration , enclosingDeclaration , flags , writer ) : void ; writeReturnTypeOfSignatureDeclaration ( signatureDeclaration , enclosingDeclaration , flags , writer ) : void ; isSymbolAccessible ( symbol , enclosingDeclaration , meaning ) : SymbolAccessiblityResult ; isEntityNameVisible ( entityName , enclosingDeclaration ) : SymbolVisibilityResult ; getConstantValue ( node ) : number ; isEmitBlocked ( sourceFile ? ) : boolean ; } export const enum SymbolFlags { FunctionScopedVariable = 0x00000001 , BlockScopedVariable = 0x00000002 , Property = 0x00000004 , EnumMember = 0x00000008 , Function = 0x00000010 , Class = 0x00000020 , Interface = 0x00000040 , ConstEnum = 0x00000080 , RegularEnum = 0x00000100 , ValueModule = 0x00000200 , NamespaceModule = 0x00000400 , TypeLiteral = 0x00000800 , ObjectLiteral = 0x00001000 , Method = 0x00002000 , Constructor = 0x00004000 , GetAccessor = 0x00008000 , SetAccessor = 0x00010000 , CallSignature = 0x00020000 , ConstructSignature = 0x00040000 , IndexSignature = 0x00080000 , TypeParameter = 0x00100000 , TypeAlias = 0x00200000 , ExportValue = 0x00400000 , ExportType = 0x00800000 , ExportNamespace = 0x01000000 , Import = 0x02000000 , Instantiated = 0x04000000 , Merged = 0x08000000 , Transient = 0x10000000 , Prototype = 0x20000000 , UnionProperty = 0x40000000 , Enum = RegularEnum | ConstEnum , Variable = FunctionScopedVariable | BlockScopedVariable , Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor , Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias , Namespace = ValueModule | NamespaceModule , Module = ValueModule | NamespaceModule , Accessor = GetAccessor | SetAccessor , Signature = CallSignature | ConstructSignature | IndexSignature , FunctionScopedVariableExcludes = Value & ~ FunctionScopedVariable , BlockScopedVariableExcludes = Value , ParameterExcludes = Value , PropertyExcludes = Value , EnumMemberExcludes = Value , FunctionExcludes = Value & ~ ( Function | ValueModule ) , ClassExcludes = ( Value | Type ) & ~ ValueModule , InterfaceExcludes = Type & ~ Interface , RegularEnumExcludes = ( Value | Type ) & ~ ( RegularEnum | ValueModule ) , ConstEnumExcludes = ( Value | Type ) & ~ ConstEnum , ValueModuleExcludes = Value & ~ ( Function | Class | RegularEnum | ValueModule ) , NamespaceModuleExcludes = 0 , MethodExcludes = Value & ~ Method , GetAccessorExcludes = Value & ~ SetAccessor , SetAccessorExcludes = Value & ~ GetAccessor , TypeParameterExcludes = Type & ~ TypeParameter , TypeAliasExcludes = Type , ImportExcludes = Import , ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Import , ExportHasLocal = Function | Class | Enum | ValueModule , HasLocals = Function | Module | Method | Constructor | Accessor | Signature , HasExports = Class | Enum | Module , HasMembers = Class | Interface | TypeLiteral | ObjectLiteral , IsContainer = HasLocals | HasExports | HasMembers , PropertyOrAccessor = Property | Accessor , Export = ExportNamespace | ExportType | ExportValue } export interface Symbol { flags : SymbolFlags ; name : string ; id ? : number ; mergeId ? : number ; declarations ? : Declaration [ ] ; parent ? : Symbol ; members ? : SymbolTable ; exports ? : SymbolTable ; exportSymbol ? : Symbol ; valueDeclaration ? : Declaration ; constEnumOnlyModule ? : boolean ; } export interface SymbolLinks { target ? : Symbol ; type ? : Type ; declaredType ? : Type ; mapper ? : TypeMapper ; referenced ? : boolean ; exportAssignSymbol ? : Symbol ; unionType ? : UnionType ; } export interface TransientSymbol extends Symbol , SymbolLinks { } export interface SymbolTable { [ index ] : Symbol ; } export const enum NodeCheckFlags { TypeChecked = 0x00000001 , LexicalThis = 0x00000002 , CaptureThis = 0x00000004 , EmitExtends = 0x00000008 , SuperInstance = 0x00000010 , SuperStatic = 0x00000020 , ContextChecked = 0x00000040 , EnumValuesComputed = 0x00000080 } export interface NodeLinks { resolvedType ? : Type ; resolvedSignature ? : Signature ; resolvedSymbol ? : Symbol ; flags ? : NodeCheckFlags ; enumMemberValue ? : number ; isIllegalTypeReferenceInConstraint ? : boolean ; isVisible ? : boolean ; localModuleName ? : string ; assignmentChecks ? : Map < boolean > ; } export const enum TypeFlags { Any = 0x00000001 , String = 0x00000002 , Number = 0x00000004 , Boolean = 0x00000008 , Void = 0x00000010 , Undefined = 0x00000020 , Null = 0x00000040 , Enum = 0x00000080 , StringLiteral = 0x00000100 , TypeParameter = 0x00000200 , Class = 0x00000400 , Interface = 0x00000800 , Reference = 0x00001000 , Tuple = 0x00002000 , Union = 0x00004000 , Anonymous = 0x00008000 , FromSignature = 0x00010000 , Intrinsic = Any | String | Number | Boolean | Void | Undefined | Null , StringLike = String | StringLiteral , NumberLike = Number | Enum , ObjectType = Class | Interface | Reference | Tuple | Anonymous } export interface Type { flags : TypeFlags ; id : number ; symbol ? : Symbol ; } export interface IntrinsicType extends Type { intrinsicName : string ; } export interface StringLiteralType extends Type { text : string ; } export interface ObjectType extends Type { } export interface InterfaceType extends ObjectType { typeParameters : TypeParameter [ ] ; baseTypes : ObjectType [ ] ; declaredProperties : Symbol [ ] ; declaredCallSignatures : Signature [ ] ; declaredConstructSignatures : Signature [ ] ; declaredStringIndexType : Type ; declaredNumberIndexType : Type ; } export interface TypeReference extends ObjectType { target : GenericType ; typeArguments : Type [ ] ; } export interface GenericType extends InterfaceType , TypeReference { instantiations : Map < TypeReference > ; openReferenceTargets : GenericType [ ] ; openReferenceChecks : Map < boolean > ; } export interface TupleType extends ObjectType { elementTypes : Type [ ] ; baseArrayType : TypeReference ; } export interface UnionType extends Type { types : Type [ ] ; resolvedProperties : SymbolTable ; } export interface ResolvedType extends ObjectType , UnionType { members : SymbolTable ; properties : Symbol [ ] ; callSignatures : Signature [ ] ; constructSignatures : Signature [ ] ; stringIndexType : Type ; numberIndexType : Type ; } export interface TypeParameter extends Type { constraint : Type ; target ? : TypeParameter ; mapper ? : TypeMapper ; } export const enum SignatureKind { Call , Construct } export interface Signature { declaration : SignatureDeclaration ; typeParameters : TypeParameter [ ] ; parameters : Symbol [ ] ; resolvedReturnType : Type ; minArgumentCount : number ; hasRestParameter : boolean ; hasStringLiterals : boolean ; target ? : Signature ; mapper ? : TypeMapper ; unionSignatures ? : Signature [ ] ; erasedSignatureCache ? : Signature ; isolatedSignatureType ? : ObjectType ; } export const enum IndexKind { String , Number } export interface TypeMapper { ( t ) : Type ; } export interface TypeInferences { primary : Type [ ] ; secondary : Type [ ] ; } export interface InferenceContext { typeParameters : TypeParameter [ ] ; inferUnionTypes : boolean ; inferences : TypeInferences [ ] ; inferredTypes : Type [ ] ; failedTypeParameterIndex ? : number ; } export interface DiagnosticMessage { key : string ; category : DiagnosticCategory ; code : number ; isEarly ? : boolean ; } export interface DiagnosticMessageChain { messageText : string ; category : DiagnosticCategory ; code : number ; next ? : DiagnosticMessageChain ; } export interface Diagnostic { file : SourceFile ; start : number ; length : number ; messageText : string ; category : DiagnosticCategory ; code : number ; /**
          * Early error - any error (can be produced at parsing\binding\typechecking step) that blocks emit
          */ isEarly ? : boolean ; } export enum DiagnosticCategory { Warning , Error , Message } export interface CompilerOptions { allowNonTsExtensions ? : boolean ; charset ? : string ; codepage ? : number ; declaration ? : boolean ; diagnostics ? : boolean ; emitBOM ? : boolean ; help ? : boolean ; locale ? : string ; mapRoot ? : string ; module ? : ModuleKind ; noEmitOnError ? : boolean ; noErrorTruncation ? : boolean ; noImplicitAny ? : boolean ; noLib ? : boolean ; noLibCheck ? : boolean ; noResolve ? : boolean ; out ? : string ; outDir ? : string ; preserveConstEnums ? : boolean ; removeComments ? : boolean ; sourceMap ? : boolean ; sourceRoot ? : string ; suppressImplicitAnyIndexErrors ? : boolean ; target ? : ScriptTarget ; version ? : boolean ; watch ? : boolean ; [ option ] : string | number | boolean ; } export const enum ModuleKind { None = 0 , CommonJS = 1 , AMD = 2 } export interface LineAndCharacter { line : number ; character : number ; } export const enum ScriptTarget { ES3 = 0 , ES5 = 1 , ES6 = 2 , Latest = ES6 } export interface ParsedCommandLine { options : CompilerOptions ; filenames : string [ ] ; errors : Diagnostic [ ] ; } export interface CommandLineOption { name : string ; type : string | Map < number > ; shortName ? : string ; description ? : DiagnosticMessage ; paramType ? : DiagnosticMessage ; error ? : DiagnosticMessage ; } export const enum CharacterCodes { nullCharacter = 0 , maxAsciiCharacter = 0x7F , lineFeed = 0x0A , carriageReturn = 0x0D , lineSeparator = 0x2028 , paragraphSeparator = 0x2029 , nextLine = 0x0085 , space = 0x0020 , nonBreakingSpace = 0x00A0 , enQuad = 0x2000 , emQuad = 0x2001 , enSpace = 0x2002 , emSpace = 0x2003 , threePerEmSpace = 0x2004 , fourPerEmSpace = 0x2005 , sixPerEmSpace = 0x2006 , figureSpace = 0x2007 , punctuationSpace = 0x2008 , thinSpace = 0x2009 , hairSpace = 0x200A , zeroWidthSpace = 0x200B , narrowNoBreakSpace = 0x202F , ideographicSpace = 0x3000 , mathematicalSpace = 0x205F , ogham = 0x1680 , _ = 0x5F , $ = 0x24 , _0 = 0x30 , _1 = 0x31 , _2 = 0x32 , _3 = 0x33 , _4 = 0x34 , _5 = 0x35 , _6 = 0x36 , _7 = 0x37 , _8 = 0x38 , _9 = 0x39 , a = 0x61 , b = 0x62 , c = 0x63 , d = 0x64 , e = 0x65 , f = 0x66 , g = 0x67 , h = 0x68 , i = 0x69 , j = 0x6A , k = 0x6B , l = 0x6C , m = 0x6D , n = 0x6E , o = 0x6F , p = 0x70 , q = 0x71 , r = 0x72 , s = 0x73 , t = 0x74 , u = 0x75 , v = 0x76 , w = 0x77 , x = 0x78 , y = 0x79 , z = 0x7A , A = 0x41 , B = 0x42 , C = 0x43 , D = 0x44 , E = 0x45 , F = 0x46 , G = 0x47 , H = 0x48 , I = 0x49 , J = 0x4A , K = 0x4B , L = 0x4C , M = 0x4D , N = 0x4E , O = 0x4F , P = 0x50 , Q = 0x51 , R = 0x52 , S = 0x53 , T = 0x54 , U = 0x55 , V = 0x56 , W = 0x57 , X = 0x58 , Y = 0x59 , Z = 0x5a , ampersand = 0x26 , asterisk = 0x2A , at = 0x40 , backslash = 0x5C , backtick = 0x60 , bar = 0x7C , caret = 0x5E , closeBrace = 0x7D , closeBracket = 0x5D , closeParen = 0x29 , colon = 0x3A , comma = 0x2C , dot = 0x2E , doubleQuote = 0x22 , equals = 0x3D , exclamation = 0x21 , greaterThan = 0x3E , lessThan = 0x3C , minus = 0x2D , openBrace = 0x7B , openBracket = 0x5B , openParen = 0x28 , percent = 0x25 , plus = 0x2B , question = 0x3F , semicolon = 0x3B , singleQuote = 0x27 , slash = 0x2F , tilde = 0x7E , backspace = 0x08 , formFeed = 0x0C , byteOrderMark = 0xFEFF , tab = 0x09 , verticalTab = 0x0B } export interface CancellationToken { isCancellationRequested ( ) : boolean ; } export interface CompilerHost { getSourceFile ( filename , languageVersion , onError ? ) : SourceFile ; getDefaultLibFilename ( options ) : string ; getCancellationToken ? ( ) : CancellationToken ; writeFile ( filename , data , writeByteOrderMark , onError ? ) : void ; getCurrentDirectory ( ) : string ; getCanonicalFileName ( fileName ) : string ; useCaseSensitiveFileNames ( ) : boolean ; getNewLine ( ) : string ; } }