From a769336e08aafb1f3cfcccc6f5602ba2c2a829e7 Mon Sep 17 00:00:00 2001 From: Marshall Roch Date: Mon, 8 Mar 2021 12:57:11 -0800 Subject: [PATCH] Add tty.WriteStream.moveCursor lib def Summary: https://nodejs.org/api/tty.html#tty_writestream_movecursor_dx_dy_callback Reviewed By: panagosg7 Differential Revision: D26884315 fbshipit-source-id: d020249bed45f5cced7e47b7aa1daa87569f89ab --- lib/node.js | 6 +++ tests/node_tests/node_tests.exp | 90 ++++++++++++++++----------------- 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/lib/node.js b/lib/node.js index 9f36e14edb3..24983fd028b 100644 --- a/lib/node.js +++ b/lib/node.js @@ -2084,6 +2084,12 @@ declare class tty$WriteStream extends net$Socket { y?: number ): void; isTTY : true; + /** + * Moves this WriteStream's cursor relative to its current position + * + * TODO: takes a callback and returns `boolean` in v12+ + */ + moveCursor(dx: number, dy: number): void; rows : number; } diff --git a/tests/node_tests/node_tests.exp b/tests/node_tests/node_tests.exp index 489d71fc50a..12ddbebacf2 100644 --- a/tests/node_tests/node_tests.exp +++ b/tests/node_tests/node_tests.exp @@ -1636,26 +1636,26 @@ References: process/emitWarning.js:10:1 10| process.emitWarning(); // error ^^^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2670:24 - 2670| emitWarning(warning: string | Error): void; + /node.js:2676:24 + 2676| emitWarning(warning: string | Error): void; ^^^^^^ [2] - /node.js:2670:33 - 2670| emitWarning(warning: string | Error): void; + /node.js:2676:33 + 2676| emitWarning(warning: string | Error): void; ^^^^^ [3] - /node.js:2671:3 - 2671| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; + /node.js:2677:3 + 2677| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] - /node.js:2672:3 - 2672| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2678:3 + 2678| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [5] - /node.js:2673:3 + /node.js:2679:3 v----------- - 2673| emitWarning( - 2674| warning: string, - 2675| type: string, - 2676| code: string, - 2677| ctor?: (...empty) => mixed - 2678| ): void; + 2679| emitWarning( + 2680| warning: string, + 2681| type: string, + 2682| code: string, + 2683| ctor?: (...empty) => mixed + 2684| ): void; ------^ [6] @@ -1674,14 +1674,14 @@ References: process/emitWarning.js:11:21 11| process.emitWarning(42); // error ^^ [1] - /node.js:2671:24 - 2671| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; + /node.js:2677:24 + 2677| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [2] - /node.js:2672:24 - 2672| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2678:24 + 2678| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [3] - /node.js:2674:14 - 2674| warning: string, + /node.js:2680:14 + 2680| warning: string, ^^^^^^ [4] @@ -1699,11 +1699,11 @@ References: process/emitWarning.js:12:29 12| process.emitWarning("blah", 42); // error ^^ [1] - /node.js:2672:38 - 2672| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2678:38 + 2678| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [2] - /node.js:2675:11 - 2675| type: string, + /node.js:2681:11 + 2681| type: string, ^^^^^^ [3] @@ -1719,8 +1719,8 @@ References: process/emitWarning.js:13:37 13| process.emitWarning("blah", "blah", 42); // error ^^ [1] - /node.js:2676:11 - 2676| code: string, + /node.js:2682:11 + 2682| code: string, ^^^^^^ [2] @@ -1734,8 +1734,8 @@ Cannot cast `process.emitWarning(...)` to string because undefined [1] is incomp ^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2670:41 - 2670| emitWarning(warning: string | Error): void; + /node.js:2676:41 + 2676| emitWarning(warning: string | Error): void; ^^^^ [1] process/emitWarning.js:14:31 14| (process.emitWarning("blah"): string); // error @@ -1800,8 +1800,8 @@ References: process/nextTick.js:27:3 27| (a: string, b: number, c: boolean) => {} // Error: too few arguments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2699:21 - 2699| nextTick: (cb: (...T) => mixed, ...T) => void; + /node.js:2705:21 + 2705| nextTick: (cb: (...T) => mixed, ...T) => void; ^^^^^^^^^^^^^^^ [2] @@ -1815,8 +1815,8 @@ Cannot cast `process.allowedNodeEnvironmentFlags` to string because `Set` [1] is ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2659:32 - 2659| allowedNodeEnvironmentFlags: Set; + /node.js:2665:32 + 2665| allowedNodeEnvironmentFlags: Set; ^^^^^^^^^^^ [1] process/process.js:5:39 5| (process.allowedNodeEnvironmentFlags: string); // error @@ -2007,8 +2007,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2238:12 - 2238| query: string | null + /node.js:2244:12 + 2244| query: string | null ^^^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -2024,8 +2024,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2238:21 - 2238| query: string | null + /node.js:2244:21 + 2244| query: string | null ^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -2041,8 +2041,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2243:12 - 2243| query: { [string]: string, ... } + /node.js:2249:12 + 2249| query: { [string]: string, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:5:56 5| (url.parse('http://example.com/?foo=bar', true).query: empty); // error, object @@ -2058,8 +2058,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2230:12 - 2230| query: string | null | { [string]: string, ... }, + /node.js:2236:12 + 2236| query: string | null | { [string]: string, ... }, ^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2075,8 +2075,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2230:21 - 2230| query: string | null | { [string]: string, ... }, + /node.js:2236:21 + 2236| query: string | null | { [string]: string, ... }, ^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2092,8 +2092,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2230:28 - 2230| query: string | null | { [string]: string, ... }, + /node.js:2236:28 + 2236| query: string | null | { [string]: string, ... }, ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object