Skip to content

ReadLineOptions

[<Interface>]
type ReadLineOptions =
    abstract member completer: U2<AsyncCompleter,Completer> option with get, set
    abstract member crlfDelay: float option with get, set
    abstract member escapeCodeTimeout: float option with get, set
    abstract member history: string array option with get, set
    abstract member historySize: float option with get, set
    abstract member input: ReadableStream with get, set
    abstract member output: WritableStream option with get, set
    abstract member prompt: string option with get, set
    abstract member removeHistoryDuplicates: bool option with get, set
    abstract member signal: AbortSignal option with get, set
    abstract member tabSize: float option with get, set
    abstract member terminal: bool option with get, set
    static member Create (input: ReadableStream, ?output: WritableStream, ?completer: U2<AsyncCompleter,Completer>, ?terminal: bool, ?history: string array, ?historySize: float, ?removeHistoryDuplicates: bool, ?prompt: string, ?crlfDelay: float, ?escapeCodeTimeout: float, ?tabSize: float, ?signal: AbortSignal) : ReadLineOptions
AssemblyXantham.Fable.Node
Attributes[<Interface>]

Properties

abstract member completer: U2<AsyncCompleter,Completer> option with get, set

An optional function used for Tab autocompletion.

abstract member crlfDelay: float option with get, set

If the delay between \r and \n exceeds crlfDelay milliseconds, both \r and \n will be treated as separate end-of-line input. crlfDelay will be coerced to a number no less than 100. It can be set to Infinity, in which case \r followed by \n will always be considered a single newline (which may be reasonable for reading files with \r\n line delimiter).

abstract member escapeCodeTimeout: float option with get, set

The duration readline will wait for a character (when reading an ambiguous key sequence in milliseconds one that can both form a complete key sequence using the input read so far and can take additional input to complete a longer key sequence).

abstract member history: string array option with get, set

Initial list of history lines. This option makes sense only if terminal is set to true by the user or by an internal output check, otherwise the history caching mechanism is not initialized at all.

abstract member historySize: float option with get, set

Maximum number of history lines retained. To disable the history set this value to 0. This option makes sense only if terminal is set to true by the user or by an internal output check, otherwise the history caching mechanism is not initialized at all.

abstract member input: ReadableStream with get, set

The Readable stream to listen to

abstract member output: WritableStream option with get, set

The Writable stream to write readline data to.

abstract member prompt: string option with get, set

The prompt string to use.

abstract member removeHistoryDuplicates: bool option with get, set

If true, when a new input line added to the history list duplicates an older one, this removes the older line from the list.

abstract member signal: AbortSignal option with get, set

Allows closing the interface using an AbortSignal. Aborting the signal will internally call close on the interface.

abstract member tabSize: float option with get, set

The number of spaces a tab is equal to (minimum 1).

abstract member terminal: bool option with get, set

true if the input and output streams should be treated like a TTY, and have ANSI/VT100 escape codes written to it. Default: checking isTTY on the output stream upon instantiation.

Methods

static member Create (input: ReadableStream, ?output: WritableStream, ?completer: U2<AsyncCompleter,Completer>, ?terminal: bool, ?history: string array, ?historySize: float, ?removeHistoryDuplicates: bool, ?prompt: string, ?crlfDelay: float, ?escapeCodeTimeout: float, ?tabSize: float, ?signal: AbortSignal) : ReadLineOptions