@@ -1795,12 +1795,12 @@ declare module "fs" {
1795
1795
* Asynchronously append data to a file, creating the file if it does not yet exist. `data` can be a string or a buffer.
1796
1796
*/
1797
1797
export function appendFile ( file : string | Buffer | number , data : string | Buffer , callback : ( err : NodeJS . ErrnoException | null ) => void ) : void ;
1798
- export function appendFile ( file : string | Buffer | number , data : string | Buffer , options : buffer . Encoding | AppendFileOptions , callback : ( err : NodeJS . ErrnoException | null ) => void ) : void ;
1798
+ export function appendFile ( file : string | Buffer | number , data : string | Buffer , options : buffer . Encoding | AppendFileOptions | null , callback : ( err : NodeJS . ErrnoException | null ) => void ) : void ;
1799
1799
1800
1800
/**
1801
1801
* The synchronous version of `fs.appendFile()`.
1802
1802
*/
1803
- export function appendFileSync ( file : string | Buffer | number , data : string | Buffer , options ?: AppendFileOptions ) : void ;
1803
+ export function appendFileSync ( file : string | Buffer | number , data : string | Buffer , options ?: AppendFileOptions | null ) : void ;
1804
1804
1805
1805
/**
1806
1806
* Asynchronous chmod(2).
@@ -1847,7 +1847,7 @@ declare module "fs" {
1847
1847
*
1848
1848
* Be aware that, unlike the default value set for `highWaterMark` on a readable stream (16 kb), the stream returned by this method has a default value of 64 kb for the same parameter.
1849
1849
*/
1850
- export function createReadStream ( path : string | Buffer , options ?: ReadStreamOptions ) : ReadStream ;
1850
+ export function createReadStream ( path : string | Buffer , options ?: ReadStreamOptions | null ) : ReadStream ;
1851
1851
1852
1852
export interface WriteStreamOptions {
1853
1853
flags ?: string ;
@@ -1862,7 +1862,7 @@ declare module "fs" {
1862
1862
/**
1863
1863
* Returns a new WriteStream object.
1864
1864
*/
1865
- export function createWriteStream ( path : string | Buffer , options ?: WriteStreamOptions ) : WriteStream ;
1865
+ export function createWriteStream ( path : string | Buffer , options ?: WriteStreamOptions | null ) : WriteStream ;
1866
1866
1867
1867
/**
1868
1868
* Test whether or not the given path exists by checking with the file system. Then call the `callback` argument with either true or false.
@@ -2023,12 +2023,12 @@ declare module "fs" {
2023
2023
* The created folder path is passed as a string to the callback's second parameter.
2024
2024
*/
2025
2025
export function mkdtemp ( prefix : string , callback : ( err : NodeJS . ErrnoException | null , dir : string ) => void ) : void ;
2026
- export function mkdtemp ( prefix : string , options : buffer . Encoding | MkdtempOptions , callback : ( err : NodeJS . ErrnoException | null , dir : string ) => void ) : void ;
2026
+ export function mkdtemp ( prefix : string , options : buffer . Encoding | MkdtempOptions | null , callback : ( err : NodeJS . ErrnoException | null , dir : string ) => void ) : void ;
2027
2027
2028
2028
/**
2029
2029
* The synchronous version of fs.mkdtemp(). Returns the created folder path.
2030
2030
*/
2031
- export function mkdtempSync ( prefix : string , options ?: buffer . Encoding | MkdtempOptions ) : string ;
2031
+ export function mkdtempSync ( prefix : string , options ?: buffer . Encoding | MkdtempOptions | null ) : string ;
2032
2032
2033
2033
/**
2034
2034
* Asynchronous file open. See open(2). `flags` can be:
@@ -2090,14 +2090,14 @@ declare module "fs" {
2090
2090
*/
2091
2091
export function readdir ( path : string | Buffer , callback : ( err : NodeJS . ErrnoException | null , files : string [ ] ) => void ) : void ;
2092
2092
export function readdir ( path : string | Buffer , options : 'buffer' | ( ReadFileOptions & { encoding : 'buffer' } ) , callback : ( err : NodeJS . ErrnoException | null , files : Buffer [ ] ) => void ) : void ;
2093
- export function readdir ( path : string | Buffer , options : buffer . Encoding | ReaddirOptions , callback : ( err : NodeJS . ErrnoException | null , files : string [ ] ) => void ) : void ;
2093
+ export function readdir ( path : string | Buffer , options : buffer . Encoding | ReaddirOptions | null , callback : ( err : NodeJS . ErrnoException | null , files : string [ ] ) => void ) : void ;
2094
2094
2095
2095
/**
2096
2096
* Synchronous readdir(3). Returns an array of filenames excluding '.' and '..'.
2097
2097
*/
2098
2098
export function readdirSync ( path : string | Buffer ) : string [ ] ;
2099
2099
export function readdirSync ( path : string | Buffer , options : 'buffer' | ( ReaddirOptions & { encoding : 'buffer' } ) ) : Buffer [ ] ;
2100
- export function readdirSync ( path : string | Buffer , options : buffer . Encoding | ReaddirOptions ) : string [ ] ;
2100
+ export function readdirSync ( path : string | Buffer , options : buffer . Encoding | ReaddirOptions | null ) : string [ ] ;
2101
2101
2102
2102
export interface ReadFileOptions {
2103
2103
encoding ?: buffer . Encoding | 'buffer' ;
@@ -2109,14 +2109,14 @@ declare module "fs" {
2109
2109
*/
2110
2110
export function readFile ( file : string | Buffer | number , callback : ( err : NodeJS . ErrnoException | null , data : Buffer ) => void ) : void ;
2111
2111
export function readFile ( file : string | Buffer | number , options : buffer . Encoding | ( ReadFileOptions & { encoding : buffer . Encoding } ) , callback : ( err : NodeJS . ErrnoException | null , data : string ) => void ) : void ;
2112
- export function readFile ( file : string | Buffer | number , options : 'buffer' | ReadFileOptions , callback : ( err : NodeJS . ErrnoException | null , data : Buffer ) => void ) : void ;
2112
+ export function readFile ( file : string | Buffer | number , options : 'buffer' | ReadFileOptions | null , callback : ( err : NodeJS . ErrnoException | null , data : Buffer ) => void ) : void ;
2113
2113
2114
2114
/**
2115
2115
* Synchronous version of `fs.readFile`.
2116
2116
*/
2117
2117
export function readFileSync ( file : string | Buffer | number ) : Buffer ;
2118
2118
export function readFileSync ( file : string | Buffer | number , options : buffer . Encoding | ( ReadFileOptions & { encoding : buffer . Encoding } ) ) : string ;
2119
- export function readFileSync ( file : string | Buffer | number , options : 'buffer' | ReadFileOptions ) : Buffer ;
2119
+ export function readFileSync ( file : string | Buffer | number , options : 'buffer' | ReadFileOptions | null ) : Buffer ;
2120
2120
2121
2121
export interface ReadlinkOptions {
2122
2122
encoding ?: buffer . Encoding | 'buffer' ;
@@ -2127,14 +2127,14 @@ declare module "fs" {
2127
2127
*/
2128
2128
export function readlink ( path : string | Buffer , callback : ( err : NodeJS . ErrnoException | null , linkString : string ) => void ) : void ;
2129
2129
export function readlink ( path : string | Buffer , options : 'buffer' | ( ReadlinkOptions & { encoding : 'buffer' } ) , callback : ( err : NodeJS . ErrnoException | null , linkString : Buffer ) => void ) : void ;
2130
- export function readlink ( path : string | Buffer , options : buffer . Encoding | ReadlinkOptions , callback : ( err : NodeJS . ErrnoException | null , linkString : Buffer ) => void ) : void ;
2130
+ export function readlink ( path : string | Buffer , options : buffer . Encoding | ReadlinkOptions | null , callback : ( err : NodeJS . ErrnoException | null , linkString : Buffer ) => void ) : void ;
2131
2131
2132
2132
/**
2133
2133
* Synchronous readlink(2).
2134
2134
*/
2135
2135
export function readlinkSync ( path : string | Buffer ) : string ;
2136
2136
export function readlinkSync ( path : string | Buffer , options : 'buffer' | ( ReadlinkOptions & { encoding : 'buffer' } ) ) : Buffer ;
2137
- export function readlinkSync ( path : string | Buffer , options : buffer . Encoding | ReadlinkOptions ) : string ;
2137
+ export function readlinkSync ( path : string | Buffer , options : buffer . Encoding | ReadlinkOptions | null ) : string ;
2138
2138
2139
2139
/**
2140
2140
* Synchronous version of `fs.read()`.
@@ -2152,7 +2152,7 @@ declare module "fs" {
2152
2152
*/
2153
2153
export function realpath ( path : string | Buffer , callback : ( err : NodeJS . ErrnoException | null , resolvedPath : string ) => void ) : void ;
2154
2154
export function realpath ( path : string | Buffer , options : 'buffer' | ( RealpathOptions & { encoding : 'buffer' } ) , callback : ( err : NodeJS . ErrnoException | null , resolvedPath : Buffer ) => void ) : void ;
2155
- export function realpath ( path : string | Buffer , options : buffer . Encoding | RealpathOptions , callback : ( err : NodeJS . ErrnoException | null , resolvedPath : Buffer ) => void ) : void ;
2155
+ export function realpath ( path : string | Buffer , options : buffer . Encoding | RealpathOptions | null , callback : ( err : NodeJS . ErrnoException | null , resolvedPath : Buffer ) => void ) : void ;
2156
2156
2157
2157
/**
2158
2158
* Synchronous realpath(3). Returns the resolved path.
@@ -2161,7 +2161,7 @@ declare module "fs" {
2161
2161
*/
2162
2162
export function realpathSync ( path : string | Buffer ) : string ;
2163
2163
export function realpathSync ( path : string | Buffer , options : 'buffer' | ( RealpathOptions & { encoding : 'buffer' } ) ) : Buffer ;
2164
- export function realpathSync ( path : string | Buffer , options : buffer . Encoding | RealpathOptions ) : string ;
2164
+ export function realpathSync ( path : string | Buffer , options : buffer . Encoding | RealpathOptions | null ) : string ;
2165
2165
2166
2166
/**
2167
2167
* Asynchronous rename(2).
@@ -2276,9 +2276,9 @@ declare module "fs" {
2276
2276
* Please note the listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but they are not the same thing.
2277
2277
*/
2278
2278
export function watch ( filename : string | Buffer ) : FSWatcher ;
2279
- export function watch ( filename : string | Buffer , options : buffer . Encoding | WatchOptions ) : FSWatcher ;
2279
+ export function watch ( filename : string | Buffer , options : buffer . Encoding | WatchOptions | null ) : FSWatcher ;
2280
2280
export function watch ( filename : string | Buffer , listener : WatchListener ) : FSWatcher ;
2281
- export function watch ( filename : string | Buffer , options : buffer . Encoding | WatchOptions , listener : WatchListener ) : FSWatcher ;
2281
+ export function watch ( filename : string | Buffer , options : buffer . Encoding | WatchOptions | null , listener : WatchListener ) : FSWatcher ;
2282
2282
2283
2283
export interface WatchFileOptions {
2284
2284
/**
@@ -2299,7 +2299,7 @@ declare module "fs" {
2299
2299
* Note: `fs.watch()` is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible.
2300
2300
*/
2301
2301
export function watchFile ( filename : string | Buffer , listener : ( curr : Stats , prev : Stats ) => void ) : void ;
2302
- export function watchFile ( filename : string | Buffer , options : WatchFileOptions , listener : ( curr : Stats , prev : Stats ) => void ) : void ;
2302
+ export function watchFile ( filename : string | Buffer , options : WatchFileOptions | null , listener : ( curr : Stats , prev : Stats ) => void ) : void ;
2303
2303
2304
2304
/**
2305
2305
* Write `buffer` to the file specified by `fd`.
@@ -2332,12 +2332,12 @@ declare module "fs" {
2332
2332
* Note: If a file descriptor is specified as the `file`, it will not be closed automatically.
2333
2333
*/
2334
2334
export function writeFile ( file : string | Buffer | number , data : string | Buffer , callback : ( err : NodeJS . ErrnoException | null ) => void ) : void ;
2335
- export function writeFile ( file : string | Buffer | number , data : string | Buffer , options : buffer . Encoding | WriteFileOptions , callback : ( err : NodeJS . ErrnoException | null ) => void ) : void ;
2335
+ export function writeFile ( file : string | Buffer | number , data : string | Buffer , options : buffer . Encoding | WriteFileOptions | null , callback : ( err : NodeJS . ErrnoException | null ) => void ) : void ;
2336
2336
2337
2337
/**
2338
2338
* The synchronous version of `fs.writeFile()`.
2339
2339
*/
2340
- export function writeFileSync ( file : string | Buffer | number , data : string | Buffer , options ?: buffer . Encoding | WriteFileOptions ) : void ;
2340
+ export function writeFileSync ( file : string | Buffer | number , data : string | Buffer , options ?: buffer . Encoding | WriteFileOptions | null ) : void ;
2341
2341
2342
2342
/**
2343
2343
* Synchronous `fs.write`.
0 commit comments