GPUI.Element (gpui v0.2.0-rc.1)

Copy Markdown View Source

Serializable element tree produced by GPUI.View modules.

Summary

Functions

Appends one child to an immutable element value.

Adds or replaces one explicit style value on an immutable element.

Converts an element tree into plain serializable maps/lists.

Types

child()

@type child() :: t() | primitive()

primitive()

@type primitive() :: String.t() | number() | atom()

t()

@type t() :: %GPUI.Element{attrs: keyword(), children: [child()], type: atom()}

Functions

append_child(element, child)

@spec append_child(t(), child()) :: t()

Appends one child to an immutable element value.

put_style(element, key, value)

@spec put_style(t(), atom(), term()) :: t()

Adds or replaces one explicit style value on an immutable element.

to_payload(element)

@spec to_payload(t() | child()) :: map() | String.t()

Converts an element tree into plain serializable maps/lists.