diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-24 23:40:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 23:40:29 +0200 |
commit | 824329f0daa4dfada11ccc4c15a7db6c1886c45f (patch) | |
tree | 9cd2ca59c99ab6aaa781528fd91e0638d9024713 /cli/js/lib.deno.ns.d.ts | |
parent | 6a37e4426e686028c38d5e915d91e587c5966804 (diff) |
BREAKING CHANGE: rename Deno.fsEvents() to Deno.watchFs() (#4886)
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index b12a2bf71..696844f94 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -2169,15 +2169,12 @@ declare namespace Deno { */ export function resources(): ResourceMap; - /** **UNSTABLE**: new API. Needs docs. */ export interface FsEvent { kind: "any" | "access" | "create" | "modify" | "remove"; paths: string[]; } - /** **UNSTABLE**: new API, yet to be vetted. - * - * Watch for file system events against one or more `paths`, which can be files + /** Watch for file system events against one or more `paths`, which can be files * or directories. These paths must exist already. One user action (e.g. * `touch test.file`) can generate multiple file system events. Likewise, * one user action can result in multiple file paths in one event (e.g. `mv @@ -2185,14 +2182,15 @@ declare namespace Deno { * for directories, will watch the specified directory and all sub directories. * Note that the exact ordering of the events can vary between operating systems. * - * const iter = Deno.fsEvents("/"); - * for await (const event of iter) { - * console.log(">>>> event", event); // e.g. { kind: "create", paths: [ "/foo.txt" ] } + * const watcher = Deno.watchFs("/"); + * for await (const event of watcher) { + * console.log(">>>> event", event); + * // { kind: "create", paths: [ "/foo.txt" ] } * } * * Requires `allow-read` permission. */ - export function fsEvents( + export function watchFs( paths: string | string[], options?: { recursive: boolean } ): AsyncIterableIterator<FsEvent>; |