Package-level declarations

Types

Link copied to clipboard
open external class _Interface : EventEmitter

Instances of the readline.Interface class are constructed using the readline.createInterface() method. Every instance is associated with a single input Readable stream and a single output Writable stream. The output stream is used to print prompts for user input that arrives on, and is read from, the input stream.

Link copied to clipboard
typealias AsyncCompleter = (line: String, callback: (err: JsError?, result: CompleterResult?) -> Unit) -> Unit
Link copied to clipboard
typealias Completer = (line: String) -> CompleterResult
Link copied to clipboard
Link copied to clipboard
sealed external interface CursorPos
Link copied to clipboard
typealias Direction = Int
Link copied to clipboard
external class Interface : _Interface

Instances of the readlinePromises.Interface class are constructed using the readlinePromises.createInterface() method. Every instance is associated with a single input Readable stream and a single output Writable stream. The output stream is used to print prompts for user input that arrives on, and is read from, the input stream.

Link copied to clipboard
sealed external interface Key
Link copied to clipboard
typealias ReadLine = Interface
Link copied to clipboard
external class Readline
Link copied to clipboard
sealed external interface ReadLineOptions
Link copied to clipboard
sealed external interface ReadlineOptions

Functions

Link copied to clipboard
external fun clearLine(stream: WritableStream, dir: Direction, callback: () -> Unit = definedExternally): Boolean

The readline.clearLine() method clears current line of given TTY stream in a specified direction identified by dir.

Link copied to clipboard
external fun clearScreenDown(stream: WritableStream, callback: () -> Unit = definedExternally): Boolean

The readline.clearScreenDown() method clears the given TTY stream from the current position of the cursor down.

Link copied to clipboard
external fun createInterface(options: ReadLineOptions): Interface

external fun createInterface(input: ReadableStream, output: WritableStream = definedExternally, completer: Completer = definedExternally, terminal: Boolean = definedExternally): Interface
external fun createInterface(input: ReadableStream, output: WritableStream = definedExternally, completer: AsyncCompleter = definedExternally, terminal: Boolean = definedExternally): Interface

The readlinePromises.createInterface() method creates a new readlinePromises.Interface instance.

Link copied to clipboard
external fun cursorTo(stream: WritableStream, x: Number, y: Number = definedExternally, callback: () -> Unit = definedExternally): Boolean

The readline.cursorTo() method moves cursor to the specified position in a given TTY stream.

Link copied to clipboard
external fun emitKeypressEvents(stream: ReadableStream, readlineInterface: Interface = definedExternally)

The readline.emitKeypressEvents() method causes the given Readable stream to begin emitting 'keypress' events corresponding to received input.

Link copied to clipboard
external fun moveCursor(stream: WritableStream, dx: Number, dy: Number, callback: () -> Unit = definedExternally): Boolean

The readline.moveCursor() method moves the cursor relative to its current position in a given TTY stream.