File tree 2 files changed +21
-0
lines changed
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 {
45
45
return { }
46
46
}
47
47
48
+ ref ( ) {
49
+ return this
50
+ }
51
+
52
+ unref ( ) {
53
+ return this
54
+ }
55
+
48
56
async close ( ) {
49
57
// noop
50
58
}
Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher {
40
40
*/
41
41
constructor ( options ?: WatchOptions )
42
42
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
+
43
56
/**
44
57
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
45
58
* string.
You can’t perform that action at this time.
0 commit comments