1- /// <reference path="core.ts"/>
2-
31module ts {
42 export interface Map < T > {
53 [ index : string ] : T ;
@@ -248,7 +246,6 @@ module ts {
248246 EnumMember ,
249247 // Top-level nodes
250248 SourceFile ,
251- Program ,
252249
253250 // Synthesized list
254251 SyntaxList ,
@@ -925,15 +922,33 @@ module ts {
925922 identifiers : Map < string > ;
926923 }
927924
928- export interface Program {
925+ export interface ScriptReferenceHost {
926+ getCompilerOptions ( ) : CompilerOptions ;
929927 getSourceFile ( filename : string ) : SourceFile ;
928+ getCurrentDirectory ( ) : string ;
929+ }
930+
931+ export interface Program extends ScriptReferenceHost {
930932 getSourceFiles ( ) : SourceFile [ ] ;
931- getCompilerOptions ( ) : CompilerOptions ;
932933 getCompilerHost ( ) : CompilerHost ;
934+
933935 getDiagnostics ( sourceFile ?: SourceFile ) : Diagnostic [ ] ;
934936 getGlobalDiagnostics ( ) : Diagnostic [ ] ;
935- getTypeChecker ( fullTypeCheckMode : boolean ) : TypeChecker ;
937+ getDeclarationDiagnostics ( sourceFile : SourceFile ) : Diagnostic [ ] ;
938+
939+ // Gets a type checker that can be used to semantically analyze source fils in the program.
940+ // The 'produceDiagnostics' flag determines if the checker will produce diagnostics while
941+ // analyzing the code. It can be set to 'false' to make many type checking operaitons
942+ // faster. With this flag set, the checker can avoid codepaths only necessary to produce
943+ // diagnostics, but not necessary to answer semantic questions about the code.
944+ //
945+ // If 'produceDiagnostics' is false, then any calls to get diagnostics from the TypeChecker
946+ // will throw an invalid operation exception.
947+ getTypeChecker ( produceDiagnostics : boolean ) : TypeChecker ;
936948 getCommonSourceDirectory ( ) : string ;
949+
950+ emitFiles ( targetSourceFile ?: SourceFile ) : EmitResult ;
951+ isEmitBlocked ( sourceFile ?: SourceFile ) : boolean ;
937952 }
938953
939954 export interface SourceMapSpan {
@@ -973,16 +988,22 @@ module ts {
973988 sourceMaps : SourceMapData [ ] ; // Array of sourceMapData if compiler emitted sourcemaps
974989 }
975990
991+ export interface TypeCheckerHost {
992+ getCompilerOptions ( ) : CompilerOptions ;
993+ getCompilerHost ( ) : CompilerHost ;
994+
995+ getSourceFiles ( ) : SourceFile [ ] ;
996+ getSourceFile ( filename : string ) : SourceFile ;
997+ }
998+
976999 export interface TypeChecker {
977- getProgram ( ) : Program ;
1000+ getEmitResolver ( ) : EmitResolver ;
9781001 getDiagnostics ( sourceFile ?: SourceFile ) : Diagnostic [ ] ;
979- getDeclarationDiagnostics ( sourceFile : SourceFile ) : Diagnostic [ ] ;
9801002 getGlobalDiagnostics ( ) : Diagnostic [ ] ;
9811003 getNodeCount ( ) : number ;
9821004 getIdentifierCount ( ) : number ;
9831005 getSymbolCount ( ) : number ;
9841006 getTypeCount ( ) : number ;
985- emitFiles ( targetSourceFile ?: SourceFile ) : EmitResult ;
9861007 getTypeOfSymbolAtLocation ( symbol : Symbol , node : Node ) : Type ;
9871008 getDeclaredTypeOfSymbol ( symbol : Symbol ) : Type ;
9881009 getPropertiesOfType ( type : Type ) : Symbol [ ] ;
@@ -1006,7 +1027,7 @@ module ts {
10061027 isImplementationOfOverload ( node : FunctionLikeDeclaration ) : boolean ;
10071028 isUndefinedSymbol ( symbol : Symbol ) : boolean ;
10081029 isArgumentsSymbol ( symbol : Symbol ) : boolean ;
1009- isEmitBlocked ( sourceFile ?: SourceFile ) : boolean ;
1030+
10101031 // Returns the constant value of this enum member, or 'undefined' if the enum member has a computed value.
10111032 getEnumMemberValue ( node : EnumMember ) : number ;
10121033 isValidPropertyAccess ( node : PropertyAccessExpression | QualifiedName , propertyName : string ) : boolean ;
@@ -1088,7 +1109,6 @@ module ts {
10881109 }
10891110
10901111 export interface EmitResolver {
1091- getProgram ( ) : Program ;
10921112 getLocalNameOfContainer ( container : ModuleDeclaration | EnumDeclaration ) : string ;
10931113 getExpressionNamePrefix ( node : Identifier ) : string ;
10941114 getExportAssignmentName ( node : SourceFile ) : string ;
@@ -1105,7 +1125,6 @@ module ts {
11051125 isEntityNameVisible ( entityName : EntityName , enclosingDeclaration : Node ) : SymbolVisibilityResult ;
11061126 // Returns the constant value this property access resolves to, or 'undefined' for a non-constant
11071127 getConstantValue ( node : PropertyAccessExpression | ElementAccessExpression ) : number ;
1108- isEmitBlocked ( sourceFile ?: SourceFile ) : boolean ;
11091128 isUnknownIdentifier ( location : Node , name : string ) : boolean ;
11101129 }
11111130
0 commit comments