From 824329f0daa4dfada11ccc4c15a7db6c1886c45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 24 Apr 2020 23:40:29 +0200 Subject: BREAKING CHANGE: rename Deno.fsEvents() to Deno.watchFs() (#4886) --- cli/js/lib.deno.ns.d.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cli/js/lib.deno.ns.d.ts') 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; -- cgit v1.2.3