refactor(fs)!: return Watcher from watch and watchImmediate (#3610)

* refactor(fs)!: return Watcher from watch and watchImmediate

Both resolve to a `Watcher` resource instead of an `UnwatchFn` callback;
call `await watcher.close()` to stop watching. `UnwatchFn` is removed and
`Watcher` is now exported.

* fix change file

* fmt
This commit is contained in:
Lucas Fernandes Nogueira
2026-09-22 06:06:50 -03:00
committed by GitHub
parent 8083107a0a
commit fdfb35e531
4 changed files with 42 additions and 27 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"fs": major
"fs-js": major
---
**Breaking:** `watch` and `watchImmediate` now resolve to a `Watcher` resource instead of an `UnwatchFn` callback. Call `await watcher.close()` to stop watching. The `UnwatchFn` type has been removed and `Watcher` is now exported.