From 70bc0eb72b01249b4c1ccc92b51bf5c442b3edc9 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 28 Sep 2022 15:03:56 +0200 Subject: feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- cli/dts/lib.deno.ns.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'cli/dts/lib.deno.ns.d.ts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 095ae139a..f3e6b1376 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -1331,6 +1331,13 @@ declare namespace Deno { readonly writable: WritableStream; } + /** **UNSTABLE**: new API, yet to be vetted. + * + * @category I/O */ + export interface SetRawOptions { + cbreak: boolean; + } + /** A handle for `stdin`. * * @category I/O @@ -1338,6 +1345,26 @@ declare namespace Deno { export const stdin: Reader & ReaderSync & Closer & { readonly rid: number; readonly readable: ReadableStream; + /** **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. + * + * The `cbreak` option can be used to indicate that characters that + * correspond to a signal should still be generated. When disabling raw + * mode, this option is ignored. This functionality currently only works on + * Linux and Mac OS. + * + * ```ts + * Deno.stdin.setRaw(true, { cbreak: true }); + * ``` + * + * @category I/O + */ + setRaw(mode: boolean, options?: SetRawOptions): void; }; /** A handle for `stdout`. * -- cgit v1.2.3