Skip to content

Commit

Permalink
Merge pull request paulmillr#1157 from alan-agius4/fix-chain-return
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Oct 8, 2021
2 parents 5c70fe3 + 30ea58d commit b37688a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher {
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
* string.
*/
add(paths: string | ReadonlyArray<string>): void;
add(paths: string | ReadonlyArray<string>): this;

/**
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
* string.
*/
unwatch(paths: string | ReadonlyArray<string>): void;
unwatch(paths: string | ReadonlyArray<string>): this;

/**
* Returns an object representing all the paths on the file system being watched by this
Expand Down
2 changes: 2 additions & 0 deletions types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const watcher = chokidar.watch("file, dir, or glob", {
const log = console.log.bind(console);

watcher
.add('./foo.js')
.unwatch('./bar.js')
.on("add", (path: string) => {
log("File", path, "has been added");
})
Expand Down

0 comments on commit b37688a

Please sign in to comment.