@@ -2677,9 +2677,6 @@ declare namespace ts {
26772677 resolveTypeReferenceDirectives ?( typeReferenceDirectiveNames : string [ ] , containingFile : string ) : ResolvedTypeReferenceDirective [ ] ;
26782678 getEnvironmentVariable ?( name : string ) : string | undefined ;
26792679 createHash ?( data : string ) : string ;
2680- getModifiedTime ?( fileName : string ) : Date ;
2681- setModifiedTime ?( fileName : string , date : Date ) : void ;
2682- deleteFile ?( fileName : string ) : void ;
26832680 }
26842681 interface SourceMapRange extends TextRange {
26852682 source ?: SourceMapSource ;
@@ -4295,15 +4292,26 @@ declare namespace ts {
42954292 type WatchStatusReporter = ( diagnostic : Diagnostic , newLine : string , options : CompilerOptions ) => void ;
42964293 /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */
42974294 type CreateProgram < T extends BuilderProgram > = ( rootNames : ReadonlyArray < string > | undefined , options : CompilerOptions | undefined , host ?: CompilerHost , oldProgram ?: T , configFileParsingDiagnostics ?: ReadonlyArray < Diagnostic > ) => T ;
4298- interface WatchCompilerHost < T extends BuilderProgram > {
4295+ /** Host that has watch functionality used in --watch mode */
4296+ interface WatchHost {
4297+ /** If provided, called with Diagnostic message that informs about change in watch status */
4298+ onWatchStatusChange ?( diagnostic : Diagnostic , newLine : string , options : CompilerOptions ) : void ;
4299+ /** Used to watch changes in source files, missing files needed to update the program or config file */
4300+ watchFile ( path : string , callback : FileWatcherCallback , pollingInterval ?: number ) : FileWatcher ;
4301+ /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
4302+ watchDirectory ( path : string , callback : DirectoryWatcherCallback , recursive ?: boolean ) : FileWatcher ;
4303+ /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
4304+ setTimeout ?( callback : ( ...args : any [ ] ) => void , ms : number , ...args : any [ ] ) : any ;
4305+ /** If provided, will be used to reset existing delayed compilation */
4306+ clearTimeout ?( timeoutId : any ) : void ;
4307+ }
4308+ interface WatchCompilerHost < T extends BuilderProgram > extends WatchHost {
42994309 /**
43004310 * Used to create the program when need for program creation or recreation detected
43014311 */
43024312 createProgram : CreateProgram < T > ;
43034313 /** If provided, callback to invoke after every new program creation */
43044314 afterProgramCreate ?( program : T ) : void ;
4305- /** If provided, called with Diagnostic message that informs about change in watch status */
4306- onWatchStatusChange ?( diagnostic : Diagnostic , newLine : string , options : CompilerOptions ) : void ;
43074315 useCaseSensitiveFileNames ( ) : boolean ;
43084316 getNewLine ( ) : string ;
43094317 getCurrentDirectory ( ) : string ;
@@ -4336,14 +4344,6 @@ declare namespace ts {
43364344 resolveModuleNames ?( moduleNames : string [ ] , containingFile : string , reusedNames ?: string [ ] ) : ResolvedModule [ ] ;
43374345 /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
43384346 resolveTypeReferenceDirectives ?( typeReferenceDirectiveNames : string [ ] , containingFile : string ) : ResolvedTypeReferenceDirective [ ] ;
4339- /** Used to watch changes in source files, missing files needed to update the program or config file */
4340- watchFile ( path : string , callback : FileWatcherCallback , pollingInterval ?: number ) : FileWatcher ;
4341- /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
4342- watchDirectory ( path : string , callback : DirectoryWatcherCallback , recursive ?: boolean ) : FileWatcher ;
4343- /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
4344- setTimeout ?( callback : ( ...args : any [ ] ) => void , ms : number , ...args : any [ ] ) : any ;
4345- /** If provided, will be used to reset existing delayed compilation */
4346- clearTimeout ?( timeoutId : any ) : void ;
43474347 }
43484348 /**
43494349 * Host to create watch with root files and options
0 commit comments