Package-level declarations

Types

Link copied to clipboard
data class ErrorBoundaryContext(var title: String, var errorDetails: Widget? = null)
Link copied to clipboard
data class ErrorBoundaryState(var state: ErrorState = ERROR, var attempts: Int = 1, var showStackTrace: Boolean = false)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class ExtractException(label: String, url: String, message: String) : FriendlyException
Link copied to clipboard
Link copied to clipboard
open class FriendlyException(message: String) : KnownException
Link copied to clipboard
data class InfoAnimationState(var state: InfoState = ACTIVE, var exception: Exception? = null, var print: Boolean = false)
Link copied to clipboard
class InfoContext(val update: () -> Unit)
Link copied to clipboard
Link copied to clipboard
data class KeyOption(val message: String, val color: TextStyle = gray, val label: String? = null, val disabled: String? = null, val hidden: Boolean = false, val priority: Int = 0)

Select Key Option

Link copied to clipboard
open class KnownException(message: String, val details: Widget? = null) : Exception
Link copied to clipboard
Link copied to clipboard
class StepState(var status: StepStatus, val title: () -> String)

Step state

Link copied to clipboard

Step status

Properties

Link copied to clipboard
val Terminal.coroutine: (block: suspend CoroutineScope.() -> Unit) -> Job
Link copied to clipboard
val Terminal.coroutineHandler: CoroutineExceptionHandler
Link copied to clipboard

Debug

Link copied to clipboard
var debugColor: TextStyle
Link copied to clipboard
Link copied to clipboard
var onErrorBoundary: () -> Unit?
Link copied to clipboard

Functions

Link copied to clipboard
fun Terminal.asynchronous(block: suspend CoroutineScope.() -> Unit): Job

Runs asynchronously

Link copied to clipboard
fun Terminal.debug(message: String, content: String? = null, color: TextStyle = debugColor)
Link copied to clipboard
fun Terminal.debugError(message: String, content: String? = null)
Link copied to clipboard
fun Terminal.debugException(exception: Throwable)
Link copied to clipboard
fun Terminal.error(message: String, content: String? = null)
Link copied to clipboard
fun <T> Terminal.errorBoundary(title: String = "Untitled", keyOptions: Map<String, KeyOption>? = null, block: ErrorBoundaryContext.() -> T, onAnimate: (widget: Widget, initial: Boolean) -> Unit?): T
Link copied to clipboard
fun Terminal.info(message: String, content: String? = null)
fun <T> Terminal.info(message: (active: InfoState) -> String, content: (active: InfoState) -> Widget? = { null }, onKeyInput: InfoContext.(event: KeyboardEvent, animation: Animation<*>) -> Unit? = null, errorHandling: Map<String, String>? = null, block: InfoContext.() -> T): T
Link copied to clipboard
fun Terminal.intro(text: String, persist: Boolean = true)
Link copied to clipboard
fun KeyOption(message: String, color: TextStyle = gray, label: String? = null, disabled: String? = null, hidden: Boolean = false, priority: Int = 0, action: KeyOptionContext.() -> Unit): KeyOption
Link copied to clipboard
fun Terminal.persist(persist: Boolean = true, block: PrintWriter.() -> Unit)
Link copied to clipboard
fun readEventOrNull(rawMode: RawModeScope, timeout: Duration = Duration.INFINITE): InputEvent?

Hotfix readEventOrNull() https://github.com/ajalt/mordant/issues/276

Link copied to clipboard
context(scope: CoroutineScope)
fun Terminal.step(title: () -> String, activeIcon: () -> String, inactiveIcon: String, color: TextStyle, footer: String = "│", keyOptions: Map<String, KeyOption> = emptyMap(), onAnimate: (widget: Widget) -> Unit? = null, onDone: (animation: Animation<Unit>, throwable: Throwable?) -> Unit? = null, content: (status: StepStatus) -> Widget? = { null }): Pair<Animation<Unit>, Job>
context(scope: CoroutineScope)
fun Terminal.step(title: () -> String, activeIcon: () -> String, inactiveIcon: String, color: TextStyle, footer: String? = null, keyOptions: () -> Map<String, KeyOption> = { emptyMap() }, onAnimate: (widget: Widget) -> Unit? = null, onDone: (animation: Animation<Unit>, throwable: Throwable?) -> Unit? = null, onDisabled: (key: KeyPattern) -> Unit? = null, content: (status: StepStatus) -> Widget? = { null }): Pair<Animation<Unit>, Job>
Link copied to clipboard
fun Terminal.synchronous(block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
fun Terminal.warn(message: String, content: String? = null)