summaryrefslogtreecommitdiff
path: root/doc/api/tty.md
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-07-16 11:46:59 -0400
committercjihrig <cjihrig@gmail.com>2019-07-18 17:20:45 -0400
commitd0894773a404b04ffd2a050131e73a5622a591c6 (patch)
tree40c12e9e218e50e6f23e536f7663d000ecc6544c /doc/api/tty.md
parent3da44b0b52617556a1c3816a0ae9167a1848655f (diff)
downloadandroid-node-v8-d0894773a404b04ffd2a050131e73a5622a591c6.tar.gz
android-node-v8-d0894773a404b04ffd2a050131e73a5622a591c6.tar.bz2
android-node-v8-d0894773a404b04ffd2a050131e73a5622a591c6.zip
tty: expose stream API from readline methods
This commit exposes the return value and callback of the underlying readline APIs from the tty module. PR-URL: https://github.com/nodejs/node/pull/28721 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc/api/tty.md')
-rw-r--r--doc/api/tty.md41
1 files changed, 37 insertions, 4 deletions
diff --git a/doc/api/tty.md b/doc/api/tty.md
index a48d316853..e19e8160a0 100644
--- a/doc/api/tty.md
+++ b/doc/api/tty.md
@@ -99,24 +99,41 @@ process.stdout.on('resize', () => {
});
```
-### writeStream.clearLine(dir)
+### writeStream.clearLine(dir[, callback])
<!-- YAML
added: v0.7.7
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/28721
+ description: The stream's write() callback and return value are exposed.
-->
* `dir` {number}
* `-1` - to the left from cursor
* `1` - to the right from cursor
* `0` - the entire line
+* `callback` {Function} Invoked once the operation completes.
+* Returns: {boolean} `false` if the stream wishes for the calling code to wait
+ for the `'drain'` event to be emitted before continuing to write additional
+ data; otherwise `true`.
`writeStream.clearLine()` clears the current line of this `WriteStream` in a
direction identified by `dir`.
-### writeStream.clearScreenDown()
+### writeStream.clearScreenDown([callback])
<!-- YAML
added: v0.7.7
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/28721
+ description: The stream's write() callback and return value are exposed.
-->
+* `callback` {Function} Invoked once the operation completes.
+* Returns: {boolean} `false` if the stream wishes for the calling code to wait
+ for the `'drain'` event to be emitted before continuing to write additional
+ data; otherwise `true`.
+
`writeStream.clearScreenDown()` clears this `WriteStream` from the current
cursor down.
@@ -128,13 +145,21 @@ added: v0.7.7
A `number` specifying the number of columns the TTY currently has. This property
is updated whenever the `'resize'` event is emitted.
-### writeStream.cursorTo(x, y)
+### writeStream.cursorTo(x, y[, callback])
<!-- YAML
added: v0.7.7
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/28721
+ description: The stream's write() callback and return value are exposed.
-->
* `x` {number}
* `y` {number}
+* `callback` {Function} Invoked once the operation completes.
+* Returns: {boolean} `false` if the stream wishes for the calling code to wait
+ for the `'drain'` event to be emitted before continuing to write additional
+ data; otherwise `true`.
`writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified
position.
@@ -220,13 +245,21 @@ added: v0.5.8
A `boolean` that is always `true`.
-### writeStream.moveCursor(dx, dy)
+### writeStream.moveCursor(dx, dy[, callback])
<!-- YAML
added: v0.7.7
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/28721
+ description: The stream's write() callback and return value are exposed.
-->
* `dx` {number}
* `dy` {number}
+* `callback` {Function} Invoked once the operation completes.
+* Returns: {boolean} `false` if the stream wishes for the calling code to wait
+ for the `'drain'` event to be emitted before continuing to write additional
+ data; otherwise `true`.
`writeStream.moveCursor()` moves this `WriteStream`'s cursor *relative* to its
current position.