Package-level declarations

Types

Link copied to clipboard
class ConfirmationPrompt<T : Any>(firstPrompt: Prompt<T>, secondPrompt: Prompt<T>, valueMismatchMessage: String = "Values do not match, try again")

A prompt that requires the user to enter the same value twice.

Link copied to clipboard
sealed class ConversionResult<out T>
Link copied to clipboard
interface CursorMovements
Link copied to clipboard
data class PrintRequest(val text: String, val trailingLinebreak: Boolean, val stderr: Boolean)
Link copied to clipboard
abstract class Prompt<T>(prompt: String, val terminal: Terminal, default: T? = null, showDefault: Boolean = true, showChoices: Boolean = true, hideInput: Boolean = false, choices: Collection<T> = emptyList(), promptSuffix: String = ": ", invalidChoiceMessage: String = "Invalid value, choose from ")

The base class for prompts.

Link copied to clipboard
class StringPrompt(prompt: String, terminal: Terminal, default: String? = null, showDefault: Boolean = false, showChoices: Boolean = true, hideInput: Boolean = false, choices: List<String> = emptyList(), promptSuffix: String = ": ", invalidChoiceMessage: String = "Invalid value, choose from ", allowBlank: Boolean = true) : Prompt<String>

A Prompt that returns the user input unchanged.

Link copied to clipboard
class Terminal

Functions for printing styled text to the terminal.

Link copied to clipboard

TextStyles that are automatically downsampled to the level supported by the current terminal.

Link copied to clipboard
interface TerminalCursor
Link copied to clipboard
data class TerminalInfo(var width: Int, var height: Int, var ansiLevel: AnsiLevel, var ansiHyperLinks: Boolean, val outputInteractive: Boolean, val inputInteractive: Boolean, val crClearsLine: Boolean)

Information about the current terminal

Link copied to clipboard
Link copied to clipboard

A TerminalInterface that records all output and allows you to provide input.

Link copied to clipboard
class YesNoPrompt(prompt: String, terminal: Terminal, default: Boolean? = null, uppercaseDefault: Boolean = true, showChoices: Boolean = true, choiceStrings: List<String> = listOf("y", "n"), promptSuffix: String = ": ", invalidChoiceMessage: String = "Invalid value, choose from ") : Prompt<Boolean>

A boolean prompt that asks for a yes or no response.

Functions

Link copied to clipboard
fun TerminalRecorder.outputAsHtml(includeBodyTag: Boolean = true, includeCodeTag: Boolean = true, backgroundColor: Color? = SRGB("#0c0c0c")): String

Render the contents of this TerminalRecorder as an HTML document.