mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 13:14:48 +00:00
feat(unstable): add Deno.futime and Deno.futimeSync (#7266)
This commit is contained in:
parent
c82c3b982e
commit
32de714dc7
8 changed files with 179 additions and 2 deletions
34
cli/dts/lib.deno.unstable.d.ts
vendored
34
cli/dts/lib.deno.unstable.d.ts
vendored
|
@ -1247,6 +1247,40 @@ declare namespace Deno {
|
|||
export function createHttpClient(
|
||||
options: CreateHttpClientOptions,
|
||||
): HttpClient;
|
||||
|
||||
/** **UNSTABLE**: needs investigation into high precision time.
|
||||
*
|
||||
* 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 });
|
||||
* Deno.futimeSync(file.rid, 1556495550, new Date());
|
||||
* ```
|
||||
*/
|
||||
export function futimeSync(
|
||||
rid: number,
|
||||
atime: number | Date,
|
||||
mtime: number | Date,
|
||||
): void;
|
||||
|
||||
/** **UNSTABLE**: needs investigation into high precision time.
|
||||
*
|
||||
* 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 });
|
||||
* await Deno.futime(file.rid, 1556495550, new Date());
|
||||
* ```
|
||||
*/
|
||||
export function futime(
|
||||
rid: number,
|
||||
atime: number | Date,
|
||||
mtime: number | Date,
|
||||
): Promise<void>;
|
||||
}
|
||||
|
||||
declare function fetch(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue