diff --git a/cli/js/deno.ts b/cli/js/deno.ts index c563d5112c..ab11444960 100644 --- a/cli/js/deno.ts +++ b/cli/js/deno.ts @@ -73,7 +73,7 @@ export { MakeTempOptions } from "./make_temp.ts"; export { metrics, Metrics } from "./metrics.ts"; -export { mkdirSync, mkdir } from "./mkdir.ts"; +export { mkdirSync, mkdir, MkdirOptions } from "./mkdir.ts"; export { Addr, connect, @@ -115,7 +115,7 @@ export { readDirSync, readDir } from "./read_dir.ts"; export { readFileSync, readFile } from "./read_file.ts"; export { readlinkSync, readlink } from "./read_link.ts"; export { realpathSync, realpath } from "./realpath.ts"; -export { removeSync, remove, RemoveOption } from "./remove.ts"; +export { removeSync, remove, RemoveOptions } from "./remove.ts"; export { renameSync, rename } from "./rename.ts"; export { resources } from "./resources.ts"; export { signal, signals, SignalStream } from "./signals.ts"; diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 55cca78cff..4a13bafb6d 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -721,7 +721,7 @@ declare namespace Deno { // @url js/mkdir.d.ts - export interface MkdirOption { + export interface MkdirOptions { /** Defaults to `false`. If set to `true`, means that any intermediate * directories will also be created (as with the shell command `mkdir -p`). * Intermediate directories are created with the same permissions. @@ -740,7 +740,7 @@ declare namespace Deno { * Deno.mkdirSync("nested/directories", { recursive: true }); * * Requires `allow-write` permission. */ - export function mkdirSync(path: string, options?: MkdirOption): void; + export function mkdirSync(path: string, options?: MkdirOptions): void; /** @deprecated */ export function mkdirSync( @@ -755,7 +755,7 @@ declare namespace Deno { * await Deno.mkdir("nested/directories", { recursive: true }); * * Requires `allow-write` permission. */ - export function mkdir(path: string, options?: MkdirOption): Promise; + export function mkdir(path: string, options?: MkdirOptions): Promise; /** @deprecated */ export function mkdir( @@ -920,8 +920,7 @@ declare namespace Deno { // @url js/remove.d.ts - /** UNSTABLE: rename to RemoveOptions */ - export interface RemoveOption { + export interface RemoveOptions { /** Defaults to `false`. If set to `true`, path will be removed even if * it's a non-empty directory. */ recursive?: boolean; @@ -934,7 +933,7 @@ declare namespace Deno { * Deno.removeSync("/path/to/dir/or/file", { recursive: false }); * * Requires `allow-write` permission. */ - export function removeSync(path: string, options?: RemoveOption): void; + export function removeSync(path: string, options?: RemoveOptions): void; /** Removes the named file or directory. Throws error if permission denied, * path not found, or path is a non-empty directory and the `recursive` @@ -943,7 +942,7 @@ declare namespace Deno { * await Deno.remove("/path/to/dir/or/file", { recursive: false }); * * Requires `allow-write` permission. */ - export function remove(path: string, options?: RemoveOption): Promise; + export function remove(path: string, options?: RemoveOptions): Promise; // @url js/rename.d.ts diff --git a/cli/js/mkdir.ts b/cli/js/mkdir.ts index ecb15a9c59..4d15d9a44c 100644 --- a/cli/js/mkdir.ts +++ b/cli/js/mkdir.ts @@ -5,7 +5,7 @@ import { sendSync, sendAsync } from "./dispatch_json.ts"; // mkdir and mkdirSync. function mkdirArgs( path: string, - optionsOrRecursive?: MkdirOption | boolean, + optionsOrRecursive?: MkdirOptions | boolean, mode?: number ): { path: string; recursive: boolean; mode: number } { const args = { path, recursive: false, mode: 0o777 }; @@ -25,7 +25,7 @@ function mkdirArgs( return args; } -export interface MkdirOption { +export interface MkdirOptions { /** Defaults to `false`. If set to `true`, means that any intermediate * directories will also be created (as with the shell command `mkdir -p`). * Intermediate directories are created with the same permissions. @@ -46,7 +46,7 @@ export interface MkdirOption { * Requires `allow-write` permission. */ export function mkdirSync( path: string, - optionsOrRecursive?: MkdirOption | boolean, + optionsOrRecursive?: MkdirOptions | boolean, mode?: number ): void { sendSync("op_mkdir", mkdirArgs(path, optionsOrRecursive, mode)); @@ -60,7 +60,7 @@ export function mkdirSync( * Requires `allow-write` permission. */ export async function mkdir( path: string, - optionsOrRecursive?: MkdirOption | boolean, + optionsOrRecursive?: MkdirOptions | boolean, mode?: number ): Promise { await sendAsync("op_mkdir", mkdirArgs(path, optionsOrRecursive, mode)); diff --git a/cli/js/remove.ts b/cli/js/remove.ts index 4d15cf241f..89e5850ab5 100644 --- a/cli/js/remove.ts +++ b/cli/js/remove.ts @@ -1,7 +1,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendSync, sendAsync } from "./dispatch_json.ts"; -export interface RemoveOption { +export interface RemoveOptions { /** Defaults to `false`. If set to `true`, path will be removed even if * it's a non-empty directory. */ recursive?: boolean; @@ -14,7 +14,7 @@ export interface RemoveOption { * Deno.removeSync("/path/to/dir/or/file", { recursive: false }); * * Requires `allow-write` permission. */ -export function removeSync(path: string, options: RemoveOption = {}): void { +export function removeSync(path: string, options: RemoveOptions = {}): void { sendSync("op_remove", { path, recursive: !!options.recursive }); } @@ -27,7 +27,7 @@ export function removeSync(path: string, options: RemoveOption = {}): void { * Requires `allow-write` permission. */ export async function remove( path: string, - options: RemoveOption = {} + options: RemoveOptions = {} ): Promise { await sendAsync("op_remove", { path, recursive: !!options.recursive }); }