mirror of
https://github.com/denoland/deno.git
synced 2025-09-24 19:32:30 +00:00
feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
fa9e7aab6d
commit
70bc0eb72b
12 changed files with 43 additions and 50 deletions
27
cli/dts/lib.deno.ns.d.ts
vendored
27
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -1331,6 +1331,13 @@ declare namespace Deno {
|
|||
readonly writable: WritableStream<Uint8Array>;
|
||||
}
|
||||
|
||||
/** **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<Uint8Array>;
|
||||
/** **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`.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue