Package-level declarations

Types

Link copied to clipboard
class InvalidOption<T>(val label: String, val disabled: String, var hint: String? = null, val keyOptions: Map<String, KeyOption>? = null, val onHover: suspend SelectOption<out T>.() -> Unit? = null) : SelectOption<T>
Link copied to clipboard
open class KeyOptionContext(coroutine: Job, animation: Animation<*>)
Link copied to clipboard
class KeyPattern(keyPattern: String)
Link copied to clipboard
class MultiSelectState<T>(optionsSupplier: () -> List<Option<T>>, defaultCursor: Int?, defaultOptions: Collection<T>, pageSize: Int, onHover: (selected: IndexedValue<Option<T>>?) -> Unit) : SelectState<T, Option<T>>
Link copied to clipboard
data class Option<T>(val data: T, val label: String = data.toString(), var hint: String? = null, val keyOptions: Map<String, KeyOption>? = null, val disabled: String? = null, val onHover: suspend SelectOption<out T>.() -> Unit? = null) : SelectOption<T>

Select Option class

Link copied to clipboard
typealias SelectDetails<T> = SelectDetailsContext.(data: T, index: Int) -> Widget?
Link copied to clipboard
class SelectDetailsContext(update: () -> Unit)
Link copied to clipboard
class Selected(val value: Any?) : Throwable
Link copied to clipboard
data class SelectKeyOption(val message: String, val color: TextStyle = gray, val label: String? = null, val action: KeyOptionContext.() -> Unit)

Select Key Option

Link copied to clipboard
interface SelectOption<T>

Select Option interface

Link copied to clipboard
open class SelectState<T, O : SelectOption<T>>(optionsSupplier: () -> List<O>, defaultCursor: Int?, val pageSize: Int, val onHover: (selected: IndexedValue<O>?) -> Unit)

Properties

Link copied to clipboard
var selectColor: TextStyle

Functions

Link copied to clipboard
operator fun <T> SelectOption<T>.component1(): String
Link copied to clipboard
operator fun <T> SelectOption<T>.component2(): String?
Link copied to clipboard
operator fun <T> SelectOption<T>.component3(): String?
Link copied to clipboard
fun <T> Terminal.multiselect(title: String, options: () -> List<Option<T>>, keyOptions: Map<String, KeyOption>? = null, defaultCursor: Int? = null, defaultOptions: List<T> = emptyList(), details: (data: T, index: Int) -> Widget?? = null, onHover: suspend (option: Option<T>, index: Int) -> Unit? = null, onSelect: suspend (opion: Option<T>, index: Int) -> Unit? = null, onAnimate: (widget: Widget) -> Unit? = null, onDone: (animation: Animation<*>, throwable: Throwable?) -> Unit? = null, pageSize: Int = 10, maxPages: Int = 20): List<T>
Link copied to clipboard
fun <T, O : SelectOption<T>> Terminal.select(title: String, options: () -> List<O>, keyOptions: Map<String, KeyOption>? = null, defaultCursor: Int? = null, onHover: suspend (option: O, index: Int) -> Unit? = null, onAnimate: (widget: Widget) -> Unit? = null, onDone: (animation: Animation<*>, throwable: Throwable?) -> Unit? = null, onDisabled: (key: KeyPattern) -> Unit? = null, details: (data: T, index: Int) -> Widget?? = null, pageSize: Int = 10, maxPages: Int = 20): T
Link copied to clipboard
fun <T, O : SelectOption<T>> Terminal.select_old(message: String, options: Iterable<O>, sortedSelector: (SelectOption<out T>) -> Comparable<Any>?? = null, invalidOption: InvalidOption<T>? = null, keyOptions: Map<String, SelectKeyOption>? = null, defaultCursor: Int? = null, onHover: suspend (option: O, index: Int) -> Unit? = null, onSelect: (animation: Animation<*>) -> Unit? = null, onUpdate: (animation: Animation<*>) -> Unit? = null, onAnimate: (widget: Widget) -> Unit? = null, filterKey: String = "f", details: SelectDetails<T>? = null, pageSize: Int = 10): T