Package-level declarations

Types

Link copied to clipboard
open class Form(val strategy: ValidationStrategy, rules: Rule)

Form is a combination of a ValidationStrategy and a list of rules to use. Use invoke to run a validation and produce an Input.

Link copied to clipboard
sealed interface Input

A user input. An input can have 3 states:

Link copied to clipboard
fun interface Rule

A rule is used by a Form and defines a single validation of that form. If the validation passed, return an empty sequence from invoke

Link copied to clipboard
sealed interface ValidationError

An error that occurred during validation. Presence of ValidationErrors in the resulting Input.Invalid indicates that the value of the input is invalid.

Link copied to clipboard
sealed interface ValidationStrategy

Specifies how to validate the input to a form.