mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 18:12:39 +00:00
tty: Deno.setRaw(rid, mode) to turn on/off raw mode (#3958)
This commit is contained in:
parent
e53064c4f2
commit
5946808f66
19 changed files with 429 additions and 49 deletions
25
cli/js/lib.deno.ns.d.ts
vendored
25
cli/js/lib.deno.ns.d.ts
vendored
|
@ -30,16 +30,6 @@ declare namespace Deno {
|
|||
|
||||
export function runTests(opts?: RunTestsOptions): Promise<void>;
|
||||
|
||||
/** Check if running in terminal.
|
||||
*
|
||||
* console.log(Deno.isTTY().stdout);
|
||||
*/
|
||||
export function isTTY(): {
|
||||
stdin: boolean;
|
||||
stdout: boolean;
|
||||
stderr: boolean;
|
||||
};
|
||||
|
||||
/** Get the loadavg. Requires the `--allow-env` flag.
|
||||
*
|
||||
* console.log(Deno.loadavg());
|
||||
|
@ -492,6 +482,7 @@ declare namespace Deno {
|
|||
seekSync(offset: number, whence: SeekMode): void;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
/** An instance of `File` for stdin. */
|
||||
export const stdin: File;
|
||||
/** An instance of `File` for stdout. */
|
||||
|
@ -555,6 +546,20 @@ declare namespace Deno {
|
|||
/** Read-write. Behaves like `x` and allows to read from file. */
|
||||
| "x+";
|
||||
|
||||
// @url js/tty.d.ts
|
||||
|
||||
/** UNSTABLE: newly added API
|
||||
*
|
||||
* Check if a given resource is TTY
|
||||
*/
|
||||
export function isatty(rid: number): boolean;
|
||||
|
||||
/** UNSTABLE: newly added API
|
||||
*
|
||||
* Set TTY to be under raw mode or not.
|
||||
*/
|
||||
export function setRaw(rid: number, mode: boolean): void;
|
||||
|
||||
// @url js/buffer.d.ts
|
||||
|
||||
/** A Buffer is a variable-sized buffer of bytes with read() and write()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue