glum/element

Types

pub type Children(msg) {
  None
  One(Element(msg))
  Many(List(Element(msg)))
}

Constructors

  • None
  • One(Element(msg))
  • Many(List(Element(msg)))
pub type Element(msg) {
  Element(
    tag: String,
    shape: Shape,
    attributes: Attributes,
    on: Option(On(msg)),
    children: Children(msg),
  )
}

Constructors

  • Element(
      tag: String,
      shape: Shape,
      attributes: Attributes,
      on: Option(On(msg)),
      children: Children(msg),
    )
pub type On(msg) =
  fn(gesture.Gesture) -> event.Event(msg)
pub type Shape {
  Rect
  Text(content: String)
}

Constructors

  • Rect
  • Text(content: String)

Values

pub fn map(
  element element: Element(a),
  with with: fn(a) -> b,
) -> Element(b)
Search Document