mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-05-25 05:34:36 +00:00
[@types/node] Fix cursorTo requiring a y parameter (#37630)
* Fix `cursorTo` requiring a `y` parameter When `y` is omitted, `cursorTo` moves the cursor to the first character of the current line. When `y` is required, there is no way to use this capability of `cursorTo`. * Re-add `cursorTo` test when not passing down `y` parameter
This commit is contained in:
committed by
Pranav Senthilnathan
parent
4e846ad5af
commit
df430a582d
2
types/node/readline.d.ts
vendored
2
types/node/readline.d.ts
vendored
@@ -142,7 +142,7 @@ declare module "readline" {
|
||||
/**
|
||||
* Moves this WriteStream's cursor to the specified position.
|
||||
*/
|
||||
function cursorTo(stream: NodeJS.WritableStream, x: number, y: number, callback?: () => void): boolean;
|
||||
function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
|
||||
/**
|
||||
* Moves this WriteStream's cursor relative to its current position.
|
||||
*/
|
||||
|
||||
@@ -76,6 +76,7 @@ const rl: readline.ReadLine = readline.createInterface(new stream.Readable());
|
||||
const x = 1;
|
||||
const y = 1;
|
||||
|
||||
readline.cursorTo(strm, x);
|
||||
readline.cursorTo(strm, x, y);
|
||||
readline.cursorTo(strm, x, y, () => {}); // $ExpectType boolean
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user