summaryrefslogtreecommitdiff
path: root/cli/dts/lib.deno.ns.d.ts
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-04-12 17:27:38 +0800
committerGitHub <noreply@github.com>2021-04-12 11:27:38 +0200
commit875ac73f1e8459ecec3d0d7b275546740bfe007e (patch)
tree6dba077c5e8a50599e1d6ed9837cdb54ea5198ce /cli/dts/lib.deno.ns.d.ts
parentbf99039ea944c32f0247ad8b3d1057f20f921b40 (diff)
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.
Diffstat (limited to 'cli/dts/lib.deno.ns.d.ts')
-rw-r--r--cli/dts/lib.deno.ns.d.ts22
1 files changed, 22 insertions, 0 deletions
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<void>;
+
+ /**
+ * 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<FileInfo>;
}