From b71d5708c603b09714a1f539f92f82392b6ee33d Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 8 Jan 2020 23:07:03 +0100 Subject: feat: Deno.create (#3629) --- cli/js/lib.deno_runtime.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cli/js/lib.deno_runtime.d.ts') diff --git a/cli/js/lib.deno_runtime.d.ts b/cli/js/lib.deno_runtime.d.ts index afecc9b75..f65c9650d 100644 --- a/cli/js/lib.deno_runtime.d.ts +++ b/cli/js/lib.deno_runtime.d.ts @@ -306,6 +306,18 @@ declare namespace Deno { * })(); */ export function open(filename: string, mode?: OpenMode): Promise; + /** Creates a file if none exists or truncates an existing file and returns + * an instance of the `File` object synchronously. + * + * const file = Deno.createSync("/foo/bar.txt"); + */ + export function createSync(filename: string): File; + /** Creates a file if none exists or truncates an existing file and returns + * an instance of the `File` object. + * + * const file = await Deno.create("/foo/bar.txt"); + */ + export function create(filename: string): Promise; /** Read synchronously from a file ID into an array buffer. * * Return `number | EOF` for the operation. -- cgit v1.2.3