@@ -11,7 +11,7 @@ namespace ts {
11
11
write ( s : string ) : void ;
12
12
readFile ( path : string , encoding ?: string ) : string ;
13
13
writeFile ( path : string , data : string , writeByteOrderMark ?: boolean ) : void ;
14
- watchFile ?( path : string , callback : FileWatcherCallback ) : FileWatcher ;
14
+ watchFile ?( path : Path , callback : FileWatcherCallback ) : FileWatcher ;
15
15
watchDirectory ?( path : string , callback : DirectoryWatcherCallback , recursive ?: boolean ) : FileWatcher ;
16
16
resolvePath ( path : string ) : string ;
17
17
fileExists ( path : string ) : boolean ;
@@ -500,13 +500,13 @@ namespace ts {
500
500
} ,
501
501
readFile,
502
502
writeFile,
503
- watchFile : ( fileName , callback ) => {
503
+ watchFile : ( filePath , callback ) => {
504
504
// Node 4.0 stablized the `fs.watch` function on Windows which avoids polling
505
505
// and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649
506
506
// and https://github.com/Microsoft/TypeScript/issues/4643), therefore
507
507
// if the current node.js version is newer than 4, use `fs.watch` instead.
508
508
const watchSet = isNode4OrLater ( ) ? watchedFileSet : pollingWatchedFileSet ;
509
- const watchedFile = watchSet . addFile ( < Path > fileName , callback ) ;
509
+ const watchedFile = watchSet . addFile ( filePath , callback ) ;
510
510
return {
511
511
close : ( ) => watchSet . removeFile ( watchedFile )
512
512
} ;
0 commit comments