mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
[node] Bugfix tty read write stream constructor (#37174)
* Fix constructor for tty.ReadStream * Fix constructor for tty.WriteStream
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
e33970c0fd
commit
cbcae98e13
@@ -1,7 +1,7 @@
|
||||
import * as tty from 'tty';
|
||||
|
||||
const rs: tty.ReadStream = new tty.ReadStream();
|
||||
const ws: tty.WriteStream = new tty.WriteStream();
|
||||
const rs: tty.ReadStream = new tty.ReadStream(0);
|
||||
const ws: tty.WriteStream = new tty.WriteStream(1);
|
||||
|
||||
const rsIsRaw: boolean = rs.isRaw;
|
||||
rs.setRawMode(true);
|
||||
|
||||
Vendored
+2
@@ -3,6 +3,7 @@ declare module "tty" {
|
||||
|
||||
function isatty(fd: number): boolean;
|
||||
class ReadStream extends net.Socket {
|
||||
constructor(fd: number, options?: net.SocketConstructorOpts);
|
||||
isRaw: boolean;
|
||||
setRawMode(mode: boolean): void;
|
||||
isTTY: boolean;
|
||||
@@ -14,6 +15,7 @@ declare module "tty" {
|
||||
*/
|
||||
type Direction = -1 | 0 | 1;
|
||||
class WriteStream extends net.Socket {
|
||||
constructor(fd: number);
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "resize", listener: () => void): this;
|
||||
|
||||
|
||||
@@ -2184,8 +2184,8 @@ async function asyncStreamPipelineFinished() {
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
{
|
||||
const rs: tty.ReadStream = new tty.ReadStream();
|
||||
const ws: tty.WriteStream = new tty.WriteStream();
|
||||
const rs: tty.ReadStream = new tty.ReadStream(0);
|
||||
const ws: tty.WriteStream = new tty.WriteStream(1);
|
||||
|
||||
const rsIsRaw: boolean = rs.isRaw;
|
||||
rs.setRawMode(true);
|
||||
|
||||
Vendored
+2
@@ -3,11 +3,13 @@ declare module "tty" {
|
||||
|
||||
function isatty(fd: number): boolean;
|
||||
class ReadStream extends net.Socket {
|
||||
constructor(fd: number, options?: net.SocketConstructorOpts);
|
||||
isRaw: boolean;
|
||||
setRawMode(mode: boolean): void;
|
||||
isTTY: boolean;
|
||||
}
|
||||
class WriteStream extends net.Socket {
|
||||
constructor(fd: number);
|
||||
columns: number;
|
||||
rows: number;
|
||||
isTTY: boolean;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as tty from 'tty';
|
||||
|
||||
const rs: tty.ReadStream = new tty.ReadStream();
|
||||
const ws: tty.WriteStream = new tty.WriteStream();
|
||||
const rs: tty.ReadStream = new tty.ReadStream(0);
|
||||
const ws: tty.WriteStream = new tty.WriteStream(1);
|
||||
|
||||
const rsIsRaw: boolean = rs.isRaw;
|
||||
rs.setRawMode(true);
|
||||
|
||||
Vendored
+2
@@ -3,6 +3,7 @@ declare module "tty" {
|
||||
|
||||
function isatty(fd: number): boolean;
|
||||
class ReadStream extends net.Socket {
|
||||
constructor(fd: number, options?: net.SocketConstructorOpts);
|
||||
isRaw: boolean;
|
||||
setRawMode(mode: boolean): void;
|
||||
isTTY: boolean;
|
||||
@@ -14,6 +15,7 @@ declare module "tty" {
|
||||
*/
|
||||
type Direction = -1 | 0 | 1;
|
||||
class WriteStream extends net.Socket {
|
||||
constructor(fd: number);
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "resize", listener: () => void): this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user