diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-06-22 20:58:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 08:58:52 -0400 |
commit | 6b3be01a00d9eaa134a5e58570239d6c1cd3bf54 (patch) | |
tree | efa06fcb35a67a1481fbd6d48c8e2d18cc43381b /cli/js/lib.deno.unstable.d.ts | |
parent | 79adc7b000a807caff01a3639b18cb91aef9bd9c (diff) |
feat(unstable): add Deno.fstatSync and fstat (#6425)
Diffstat (limited to 'cli/js/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/js/lib.deno.unstable.d.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cli/js/lib.deno.unstable.d.ts b/cli/js/lib.deno.unstable.d.ts index daecf6604..cc7dea987 100644 --- a/cli/js/lib.deno.unstable.d.ts +++ b/cli/js/lib.deno.unstable.d.ts @@ -1142,4 +1142,26 @@ declare namespace Deno { * ``` */ export function fsync(rid: number): Promise<void>; + + /** **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<FileInfo>; } |