From 875ac73f1e8459ecec3d0d7b275546740bfe007e Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Mon, 12 Apr 2021 17:27:38 +0800 Subject: feat(runtime): stabilize Deno.fstat and Deno.fstatSync (#10108) This commit stabilizes Deno.fstat and Deno.fstatSync which are well known system calls and have a stable interface. --- cli/diagnostics.rs | 2 -- cli/dts/lib.deno.ns.d.ts | 22 ++++++++++++++++++++++ cli/dts/lib.deno.unstable.d.ts | 22 ---------------------- 3 files changed, 22 insertions(+), 24 deletions(-) (limited to 'cli') diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index f24a2e21d..b7327d72c 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -48,8 +48,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[ "createHttpClient", "emit", "formatDiagnostics", - "fstat", - "fstatSync", "futime", "futimeSync", "hostname", diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 931d28877..7d248e4b2 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -2386,4 +2386,26 @@ declare namespace Deno { * ``` */ export function ftruncate(rid: number, len?: number): Promise; + + /** + * Synchronously returns a `Deno.FileInfo` for the given file stream. + * + * ```ts + * const file = Deno.openSync("file.txt", { read: true }); + * const fileInfo = Deno.fstatSync(file.rid); + * assert(fileInfo.isFile); + * ``` + */ + export function fstatSync(rid: number): FileInfo; + + /** + * Returns a `Deno.FileInfo` for the given file stream. + * + * ```ts + * const file = await Deno.open("file.txt", { read: true }); + * const fileInfo = await Deno.fstat(file.rid); + * assert(fileInfo.isFile); + * ``` + */ + export function fstat(rid: number): Promise; } diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 612ebeccc..508e1ca6c 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1042,28 +1042,6 @@ declare namespace Deno { */ export function hostname(): string; - /** **UNSTABLE**: New API, yet to be vetted. - * Synchronously returns a `Deno.FileInfo` for the given file stream. - * - * ```ts - * const file = Deno.openSync("file.txt", { read: true }); - * const fileInfo = Deno.fstatSync(file.rid); - * assert(fileInfo.isFile); - * ``` - */ - export function fstatSync(rid: number): FileInfo; - - /** **UNSTABLE**: New API, yet to be vetted. - * Returns a `Deno.FileInfo` for the given file stream. - * - * ```ts - * const file = await Deno.open("file.txt", { read: true }); - * const fileInfo = await Deno.fstat(file.rid); - * assert(fileInfo.isFile); - * ``` - */ - export function fstat(rid: number): Promise; - /** **UNSTABLE**: New API, yet to be vetted. * The pid of the current process's parent. */ -- cgit v1.2.3