@@ -2677,9 +2677,6 @@ declare namespace ts {
2677
2677
resolveTypeReferenceDirectives ?( typeReferenceDirectiveNames : string [ ] , containingFile : string ) : ResolvedTypeReferenceDirective [ ] ;
2678
2678
getEnvironmentVariable ?( name : string ) : string | undefined ;
2679
2679
createHash ?( data : string ) : string ;
2680
- getModifiedTime ?( fileName : string ) : Date ;
2681
- setModifiedTime ?( fileName : string , date : Date ) : void ;
2682
- deleteFile ?( fileName : string ) : void ;
2683
2680
}
2684
2681
interface SourceMapRange extends TextRange {
2685
2682
source ?: SourceMapSource ;
@@ -4295,15 +4292,26 @@ declare namespace ts {
4295
4292
type WatchStatusReporter = ( diagnostic : Diagnostic , newLine : string , options : CompilerOptions ) => void ;
4296
4293
/** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */
4297
4294
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 {
4299
4309
/**
4300
4310
* Used to create the program when need for program creation or recreation detected
4301
4311
*/
4302
4312
createProgram : CreateProgram < T > ;
4303
4313
/** If provided, callback to invoke after every new program creation */
4304
4314
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 ;
4307
4315
useCaseSensitiveFileNames ( ) : boolean ;
4308
4316
getNewLine ( ) : string ;
4309
4317
getCurrentDirectory ( ) : string ;
@@ -4336,14 +4344,6 @@ declare namespace ts {
4336
4344
resolveModuleNames ?( moduleNames : string [ ] , containingFile : string , reusedNames ?: string [ ] ) : ResolvedModule [ ] ;
4337
4345
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
4338
4346
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 ;
4347
4347
}
4348
4348
/**
4349
4349
* Host to create watch with root files and options
0 commit comments