@@ -432,6 +432,7 @@ namespace ts {
432432 readFile ( path : string , encoding ?: string ) : string | undefined ;
433433 getFileSize ?( path : string ) : number ;
434434 writeFile ( path : string , data : string , writeByteOrderMark ?: boolean ) : void ;
435+
435436 /**
436437 * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
437438 * use native OS file watching
@@ -447,6 +448,8 @@ namespace ts {
447448 getDirectories ( path : string ) : string [ ] ;
448449 readDirectory ( path : string , extensions ?: ReadonlyArray < string > , exclude ?: ReadonlyArray < string > , include ?: ReadonlyArray < string > , depth ?: number ) : string [ ] ;
449450 getModifiedTime ?( path : string ) : Date ;
451+ setModifiedTime ?( path : string , time : Date ) : void ;
452+ deleteFile ?( path : string ) : void ;
450453 /**
451454 * This should be cryptographically secure.
452455 * A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
@@ -589,6 +592,8 @@ namespace ts {
589592 } ,
590593 readDirectory,
591594 getModifiedTime,
595+ setModifiedTime,
596+ deleteFile,
592597 createHash : _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash ,
593598 getMemoryUsage ( ) {
594599 if ( global . gc ) {
@@ -1063,6 +1068,22 @@ namespace ts {
10631068 }
10641069 }
10651070
1071+ function setModifiedTime ( path : string , time : Date ) {
1072+ try {
1073+ _fs . utimesSync ( path , time , time ) ;
1074+ }
1075+ catch ( e ) {
1076+ }
1077+ }
1078+
1079+ function deleteFile ( path : string ) {
1080+ try {
1081+ return _fs . unlinkSync ( path ) ;
1082+ }
1083+ catch ( e ) {
1084+ }
1085+ }
1086+
10661087 /**
10671088 * djb2 hashing algorithm
10681089 * http://www.cse.yorku.ca/~oz/hash.html
0 commit comments