From ffff814540394a6a958897b38f4944954773cf74 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Tue, 25 Oct 2022 14:03:05 -0400 Subject: feat: stabilize Deno.futime() and Deno.futimeSync() (#16415) --- cli/dts/lib.deno.ns.d.ts | 36 ++++++++++++++++++++++++++++++++++++ cli/dts/lib.deno.unstable.d.ts | 42 ------------------------------------------ 2 files changed, 36 insertions(+), 42 deletions(-) (limited to 'cli/dts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index ed6e8ad4f..86be40c67 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -3962,6 +3962,42 @@ declare namespace Deno { */ export function ftruncate(rid: number, len?: number): Promise; + /** + * Synchronously changes the access (`atime`) and modification (`mtime`) times + * of a file stream resource referenced by `rid`. Given times are either in + * seconds (UNIX epoch time) or as `Date` objects. + * + * ```ts + * const file = Deno.openSync("file.txt", { create: true, write: true }); + * Deno.futimeSync(file.rid, 1556495550, new Date()); + * ``` + * + * @category File System + */ + export function futimeSync( + rid: number, + atime: number | Date, + mtime: number | Date, + ): void; + + /** + * Changes the access (`atime`) and modification (`mtime`) times of a file + * stream resource referenced by `rid`. Given times are either in seconds + * (UNIX epoch time) or as `Date` objects. + * + * ```ts + * const file = await Deno.open("file.txt", { create: true, write: true }); + * await Deno.futime(file.rid, 1556495550, new Date()); + * ``` + * + * @category File System + */ + export function futime( + rid: number, + atime: number | Date, + mtime: number | Date, + ): Promise; + /** * Synchronously returns a `Deno.FileInfo` for the given file stream. * diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 1085c7039..1b26cdd33 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -980,48 +980,6 @@ declare namespace Deno { options: CreateHttpClientOptions, ): HttpClient; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Synchronously changes the access (`atime`) and modification (`mtime`) times - * of a file stream resource referenced by `rid`. Given times are either in - * seconds (UNIX epoch time) or as `Date` objects. - * - * ```ts - * const file = Deno.openSync("file.txt", { create: true, write: true }); - * Deno.futimeSync(file.rid, 1556495550, new Date()); - * ``` - * - * Needs investigation into high precision time. - * - * @category File System - */ - export function futimeSync( - rid: number, - atime: number | Date, - mtime: number | Date, - ): void; - - /** **UNSTABLE**: New API, yet to be vetted. - * - * Changes the access (`atime`) and modification (`mtime`) times of a file - * stream resource referenced by `rid`. Given times are either in seconds - * (UNIX epoch time) or as `Date` objects. - * - * ```ts - * const file = await Deno.open("file.txt", { create: true, write: true }); - * await Deno.futime(file.rid, 1556495550, new Date()); - * ``` - * - * Needs investigation into high precision time. - * - * @category File System - */ - export function futime( - rid: number, - atime: number | Date, - mtime: number | Date, - ): Promise; - /** **UNSTABLE**: New API, yet to be vetted. * * A generic transport listener for message-oriented protocols. -- cgit v1.2.3