mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 20:21:46 +00:00
committed by
Masahiro Wakame
parent
e41aa98022
commit
5b670ebf34
@@ -138,6 +138,22 @@ fs.mkdtemp('/tmp/foo-', (err, folder) => {
|
||||
var tempDir: string;
|
||||
tempDir = fs.mkdtempSync('/tmp/foo-');
|
||||
|
||||
fs.watch('/tmp/foo-', (event, filename) => {
|
||||
console.log(event, filename);
|
||||
});
|
||||
|
||||
fs.watch('/tmp/foo-', 'utf8', (event, filename) => {
|
||||
console.log(event, filename);
|
||||
});
|
||||
|
||||
fs.watch('/tmp/foo-', {
|
||||
recursive: true,
|
||||
persistent: true,
|
||||
encoding: 'utf8'
|
||||
}, (event, filename) => {
|
||||
console.log(event, filename);
|
||||
});
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
/// Buffer tests : https://nodejs.org/api/buffer.html
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+2
-1
@@ -1599,7 +1599,8 @@ declare module "fs" {
|
||||
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;
|
||||
export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;
|
||||
export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function watch(filename: string, encoding: string, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void;
|
||||
export function existsSync(path: string | Buffer): boolean;
|
||||
/** Constant for fs.access(). File is visible to the calling process. */
|
||||
|
||||
Reference in New Issue
Block a user