File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ class NoopWatcher extends EventEmitter implements FSWatcher {
4545 return { }
4646 }
4747
48+ ref ( ) {
49+ return this
50+ }
51+
52+ unref ( ) {
53+ return this
54+ }
55+
4856 async close ( ) {
4957 // noop
5058 }
Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher {
4040 */
4141 constructor ( options ?: WatchOptions )
4242
43+ /**
44+ * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
45+ * Calling watcher.ref() multiple times will have no effect.
46+ */
47+ ref ( ) : this
48+
49+ /**
50+ * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
51+ * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
52+ * Calling watcher.unref() multiple times will have no effect.
53+ */
54+ unref ( ) : this
55+
4356 /**
4457 * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
4558 * string.
You can’t perform that action at this time.
0 commit comments