From c1fac11dfaf9d656b7361708d9faab1916eac846 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Mon, 19 Feb 2024 01:27:44 +1100 Subject: feat(fs): `Deno.FsFile.{isTerminal,setRaw}()` (#22234) Closes #22229. --------- Signed-off-by: Asher Gomez --- cli/tsc/dts/lib.deno.ns.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'cli') diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 720f7fc94..787c1a225 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -2666,6 +2666,31 @@ declare namespace Deno { * @category File System */ utimeSync(atime: number | Date, mtime: number | Date): void; + /** **UNSTABLE**: New API, yet to be vetted. + * + * Checks if the file resource is a TTY (terminal). + * + * ```ts + * // This example is system and context specific + * using file = await Deno.open("/dev/tty6"); + * file.isTerminal(); // true + * ``` + */ + isTerminal(): boolean; + /** **UNSTABLE**: New API, yet to be vetted. + * + * Set TTY to be under raw mode or not. In raw mode, characters are read and + * returned as is, without being processed. All special processing of + * characters by the terminal is disabled, including echoing input + * characters. Reading from a TTY device in raw mode is faster than reading + * from a TTY device in canonical mode. + * + * ```ts + * using file = await Deno.open("/dev/tty6"); + * file.setRaw(true, { cbreak: true }); + * ``` + */ + setRaw(mode: boolean, options?: SetRawOptions): void; /** **UNSTABLE**: New API, yet to be vetted. * * Acquire an advisory file-system lock for the file. -- cgit v1.2.3