Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cursorTo & clearLine to streams #7082

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,12 @@ declare class stream$Writable extends stream$Stream {
encoding: string,
callback: (error: ?Error, data?: Buffer | string) => void
): boolean;
cursorTo(
stream: Buffer,
x: number,
y?: number
): void;
clearLine(stream: Buffer, dir?: -1 | 0 | 1): void
}

//According to the NodeJS docs:
Expand Down Expand Up @@ -1688,13 +1694,23 @@ declare class tty$ReadStream extends net$Socket {
constructor(fd: number, options?: Object): void;
isRaw : boolean;
setRawMode(mode : boolean) : void;
isTTY : true
isTTY : true;
cursorTo(
x: number,
y?: number
): void;
clearLine(dir?: -1 | 0 | 1): void
}
declare class tty$WriteStream extends net$Socket {
constructor(fd: number) : void;
columns : number;
rows : number;
isTTY : true
isTTY : true;
cursorTo(
x: number,
y?: number
): void;
clearLine(dir?: -1 | 0 | 1): void
}

declare module "tty" {
Expand Down