From f9557a4ff6b73a4af37e713bb6b2294253c7b230 Mon Sep 17 00:00:00 2001 From: dubiousjim Date: Mon, 16 Mar 2020 15:02:41 -0400 Subject: Add mode option to open/create (#4289) --- cli/js/lib.deno.ns.d.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 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 e700c286e..6453b4ab8 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -515,7 +515,7 @@ declare namespace Deno { * * const file = Deno.openSync("/foo/bar.txt", { read: true, write: true }); * - * Requires `allow-read` and `allow-write` permissions depending on mode. + * Requires `allow-read` and `allow-write` permissions depending on openMode. */ export function openSync(path: string, options?: OpenOptions): File; @@ -523,15 +523,15 @@ declare namespace Deno { * * const file = Deno.openSync("/foo/bar.txt", "r"); * - * Requires `allow-read` and `allow-write` permissions depending on mode. + * Requires `allow-read` and `allow-write` permissions depending on openMode. */ - export function openSync(path: string, mode?: OpenMode): File; + export function openSync(path: string, openMode?: OpenMode): File; /** Open a file and resolve to an instance of the `File` object. * * const file = await Deno.open("/foo/bar.txt", { read: true, write: true }); * - * Requires `allow-read` and `allow-write` permissions depending on mode. + * Requires `allow-read` and `allow-write` permissions depending on openMode. */ export function open(path: string, options?: OpenOptions): Promise; @@ -539,9 +539,9 @@ declare namespace Deno { * * const file = await Deno.open("/foo/bar.txt, "w+"); * - * Requires `allow-read` and `allow-write` permissions depending on mode. + * Requires `allow-read` and `allow-write` permissions depending on openMode. */ - export function open(path: string, mode?: OpenMode): Promise; + export function open(path: string, openMode?: OpenMode): Promise; /** Creates a file if none exists or truncates an existing file and returns * an instance of `Deno.File`. @@ -686,9 +686,13 @@ declare namespace Deno { * access to be used. When createNew is set to `true`, create and truncate * are ignored. */ createNew?: boolean; + /** Permissions to use if creating the file (defaults to `0o666`, before + * the process's umask). + * Ignored on Windows. */ + mode?: number; } - /** A set of string literals which specify the open mode of a file. + /** A set of string literals which specify how to open a file. * * |Value |Description | * |------|--------------------------------------------------------------------------------------------------| -- cgit v1.2.3