tyrian

package tyrian

Type members

Classlikes

sealed trait Attr[+M]

HTML attribute

HTML attribute

final case class Attribute(name: String, value: String) extends Attr[Nothing]

Attribute of an HTML tag

Attribute of an HTML tag

Attributes are like properties, but can be removed. This is important for attributes like disabled, hidden, selected where there is no value, they are present and therefore set, or absent and unset.

Companion:
object
object Attribute
Companion:
class
object CSS
sealed trait Cmd[+Msg]

A command describes some side-effect to perform.

A command describes some side-effect to perform.

The difference with a Task is that a command never produces error values.

Companion:
object
object Cmd
Companion:
class
sealed trait Elem[+M]

An HTML element can be a tag or a text node

An HTML element can be a tag or a text node

final case class Event[E <: Event, M](name: String, msg: E => M) extends Attr[M]

Event handler

Event handler

Value parameters:
msg

Message to produce when the event is triggered

name

Event name (e.g. "click")

sealed trait Html[+M] extends Elem[M]

Base class for HTML tags

Base class for HTML tags

Companion:
object
object Html extends HtmlTags with HtmlAttributes
Companion:
class
trait HtmlTags
final case class Property(name: String, value: String) extends Attr[Nothing]

Property of a DOM node instance

Property of a DOM node instance

Properties are a type of attribute that can only be set, not removed.

Companion:
object
object Property
Companion:
class
object Style
sealed trait Sub[+Msg]

A subscription describes a resource that an application is interested in.

A subscription describes a resource that an application is interested in.

Examples:

  • a timeout notifies its subscribers when it expires,
  • a video being played notifies its subscribers with subtitles.
Type parameters:
Msg

Type of message produced by the resource

Companion:
object
object Sub
Companion:
class
final case class Tag[+M](name: String, attributes: List[Attr[M]], children: List[Elem[M]]) extends Html[M]

An HTML tag

An HTML tag

sealed trait Task[+Err, +Success]

A task describes some side-effect to perform.

A task describes some side-effect to perform.

Examples:

  • An XHR
Type parameters:
Err

Type of error produced the task

Success

Type of successful value produced by the task

Companion:
object
object Task
Companion:
class
final case class Text(value: String) extends Elem[Nothing]

A text node

A text node

object Tyrian
trait TyrianApp[Msg, Model]

Types

opaque type Style