Skip to content

Commit

Permalink
Add tty.WriteStream.moveCursor lib def
Browse files Browse the repository at this point in the history
Summary: https://nodejs.org/api/tty.html#tty_writestream_movecursor_dx_dy_callback

Reviewed By: panagosg7

Differential Revision: D26884315

fbshipit-source-id: d020249bed45f5cced7e47b7aa1daa87569f89ab
  • Loading branch information
mroch authored and facebook-github-bot committed Mar 8, 2021
1 parent 4b30713 commit a769336
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 45 deletions.
6 changes: 6 additions & 0 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
90 changes: 45 additions & 45 deletions tests/node_tests/node_tests.exp
Original file line number Diff line number Diff line change
Expand Up @@ -1636,26 +1636,26 @@ References:
process/emitWarning.js:10:1
10| process.emitWarning(); // error
^^^^^^^^^^^^^^^^^^^^^ [1]
<BUILTINS>/node.js:2670:24
2670| emitWarning(warning: string | Error): void;
<BUILTINS>/node.js:2676:24
2676| emitWarning(warning: string | Error): void;
^^^^^^ [2]
<BUILTINS>/node.js:2670:33
2670| emitWarning(warning: string | Error): void;
<BUILTINS>/node.js:2676:33
2676| emitWarning(warning: string | Error): void;
^^^^^ [3]
<BUILTINS>/node.js:2671:3
2671| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void;
<BUILTINS>/node.js:2677:3
2677| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4]
<BUILTINS>/node.js:2672:3
2672| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void;
<BUILTINS>/node.js:2678:3
2678| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [5]
<BUILTINS>/node.js:2673:3
<BUILTINS>/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]


Expand All @@ -1674,14 +1674,14 @@ References:
process/emitWarning.js:11:21
11| process.emitWarning(42); // error
^^ [1]
<BUILTINS>/node.js:2671:24
2671| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void;
<BUILTINS>/node.js:2677:24
2677| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void;
^^^^^^ [2]
<BUILTINS>/node.js:2672:24
2672| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void;
<BUILTINS>/node.js:2678:24
2678| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void;
^^^^^^ [3]
<BUILTINS>/node.js:2674:14
2674| warning: string,
<BUILTINS>/node.js:2680:14
2680| warning: string,
^^^^^^ [4]


Expand All @@ -1699,11 +1699,11 @@ References:
process/emitWarning.js:12:29
12| process.emitWarning("blah", 42); // error
^^ [1]
<BUILTINS>/node.js:2672:38
2672| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void;
<BUILTINS>/node.js:2678:38
2678| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void;
^^^^^^ [2]
<BUILTINS>/node.js:2675:11
2675| type: string,
<BUILTINS>/node.js:2681:11
2681| type: string,
^^^^^^ [3]


Expand All @@ -1719,8 +1719,8 @@ References:
process/emitWarning.js:13:37
13| process.emitWarning("blah", "blah", 42); // error
^^ [1]
<BUILTINS>/node.js:2676:11
2676| code: string,
<BUILTINS>/node.js:2682:11
2682| code: string,
^^^^^^ [2]


Expand All @@ -1734,8 +1734,8 @@ Cannot cast `process.emitWarning(...)` to string because undefined [1] is incomp
^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2670:41
2670| emitWarning(warning: string | Error): void;
<BUILTINS>/node.js:2676:41
2676| emitWarning(warning: string | Error): void;
^^^^ [1]
process/emitWarning.js:14:31
14| (process.emitWarning("blah"): string); // error
Expand Down Expand Up @@ -1800,8 +1800,8 @@ References:
process/nextTick.js:27:3
27| (a: string, b: number, c: boolean) => {} // Error: too few arguments
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]
<BUILTINS>/node.js:2699:21
2699| nextTick: <T>(cb: (...T) => mixed, ...T) => void;
<BUILTINS>/node.js:2705:21
2705| nextTick: <T>(cb: (...T) => mixed, ...T) => void;
^^^^^^^^^^^^^^^ [2]


Expand All @@ -1815,8 +1815,8 @@ Cannot cast `process.allowedNodeEnvironmentFlags` to string because `Set` [1] is
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2659:32
2659| allowedNodeEnvironmentFlags: Set<string>;
<BUILTINS>/node.js:2665:32
2665| allowedNodeEnvironmentFlags: Set<string>;
^^^^^^^^^^^ [1]
process/process.js:5:39
5| (process.allowedNodeEnvironmentFlags: string); // error
Expand Down Expand Up @@ -2007,8 +2007,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2238:12
2238| query: string | null
<BUILTINS>/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
Expand All @@ -2024,8 +2024,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2238:21
2238| query: string | null
<BUILTINS>/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
Expand All @@ -2041,8 +2041,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2243:12
2243| query: { [string]: string, ... }
<BUILTINS>/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
Expand All @@ -2058,8 +2058,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2230:12
2230| query: string | null | { [string]: string, ... },
<BUILTINS>/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
Expand All @@ -2075,8 +2075,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2230:21
2230| query: string | null | { [string]: string, ... },
<BUILTINS>/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
Expand All @@ -2092,8 +2092,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/node.js:2230:28
2230| query: string | null | { [string]: string, ... },
<BUILTINS>/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
Expand Down

0 comments on commit a769336

Please sign in to comment.