From 2ac7798a20f34d9e774299c6e538aed96dfb7257 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Fri, 26 Feb 2021 08:13:48 +0800 Subject: feat(runtime): stabilize Deno.symlink and Deno.symlinkSync (#9226) --- cli/diagnostics.rs | 2 -- cli/dts/lib.deno.ns.d.ts | 38 ++++++++++++++++++++++++++++++++++++++ cli/dts/lib.deno.unstable.d.ts | 40 ---------------------------------------- 3 files changed, 38 insertions(+), 42 deletions(-) (limited to 'cli') diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index 5b2ce3641..0ba1a23ae 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -56,8 +56,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[ "signal", "signals", "startTls", - "symlink", - "symlinkSync", "systemMemoryInfo", "systemCpuInfo", "umask", diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index aa10ce3af..cbbf44c84 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -2273,4 +2273,42 @@ declare namespace Deno { /** The URL of the entrypoint module entered from the command-line. */ export const mainModule: string; + + export type SymlinkOptions = { + type: "file" | "dir"; + }; + + /** + * Creates `newpath` as a symbolic link to `oldpath`. + * + * The options.type parameter can be set to `file` or `dir`. This argument is only + * available on Windows and ignored on other platforms. + * + * ```ts + * Deno.symlinkSync("old/name", "new/name"); + * ``` + * + * Requires `allow-write` permission. */ + export function symlinkSync( + oldpath: string, + newpath: string, + options?: SymlinkOptions, + ): void; + + /** + * Creates `newpath` as a symbolic link to `oldpath`. + * + * The options.type parameter can be set to `file` or `dir`. This argument is only + * available on Windows and ignored on other platforms. + * + * ```ts + * await Deno.symlink("old/name", "new/name"); + * ``` + * + * Requires `allow-write` permission. */ + export function symlink( + oldpath: string, + newpath: string, + options?: SymlinkOptions, + ): Promise; } diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 5007d657d..a71e5036d 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -36,46 +36,6 @@ declare namespace Deno { rows: number; }; - export type SymlinkOptions = { - type: "file" | "dir"; - }; - - /** **UNSTABLE**: This API needs a security review. - * - * Creates `newpath` as a symbolic link to `oldpath`. - * - * The options.type parameter can be set to `file` or `dir`. This argument is only - * available on Windows and ignored on other platforms. - * - * ```ts - * Deno.symlinkSync("old/name", "new/name"); - * ``` - * - * Requires `allow-write` permission. */ - export function symlinkSync( - oldpath: string, - newpath: string, - options?: SymlinkOptions, - ): void; - - /** **UNSTABLE**: This API needs a security review. - * - * Creates `newpath` as a symbolic link to `oldpath`. - * - * The options.type parameter can be set to `file` or `dir`. This argument is only - * available on Windows and ignored on other platforms. - * - * ```ts - * await Deno.symlink("old/name", "new/name"); - * ``` - * - * Requires `allow-write` permission. */ - export function symlink( - oldpath: string, - newpath: string, - options?: SymlinkOptions, - ): Promise; - /** **Unstable** There are questions around which permission this needs. And * maybe should be renamed (loadAverage?) * -- cgit v1.2.3