summaryrefslogtreecommitdiff
path: root/cli/js/lib.deno_runtime.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/lib.deno_runtime.d.ts')
-rw-r--r--cli/js/lib.deno_runtime.d.ts12
1 files changed, 12 insertions, 0 deletions
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<File>;
+ /** 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<File>;
/** Read synchronously from a file ID into an array buffer.
*
* Return `number | EOF` for the operation.