Aurora.Uix.TreePath (Aurora UIX v0.1.0)

Represents a node in the Uix tree.

This struct holds information about a specific element in the Uix tree, including its tag, name, configuration, and any nested elements. It is used to build a hierarchical representation of the Uix components.

Fields

  • tag: The type of the node (e.g., :section, :field).
  • name: A unique identifier for the node within its level.
  • config: A list of configuration options for the node.
  • opts: A list of additional options for the node.
  • inner_elements: A list of child t/0 nodes.

Summary

Types

t()

@type t() :: %Aurora.Uix.TreePath{
  config: list(),
  inner_elements: [t()],
  name: atom(),
  opts: list(),
  tag: atom()
}

Functions

change(tree_path, attrs \\ %{})

@spec change(t() | map(), map()) :: t()

Changes the attributes of a t/0 struct.

It can take a t/0 struct or a map and a set of attributes to change.

Parameters

  • tree_path (t/0 | map()) - The struct or map to be changed.

  • attrs (map()) - A map of attributes to change.

Returns

t/0 - A new t/0 struct with the updated attributes.

delete(struct, key)

get(struct, key, default \\ nil)

new(attrs)

@spec new(list() | map()) :: t()

Creates a new t/0 struct.

Parameters

  • attrs (list() | map()) - A list of attributes to initialize the struct with.

Returns

t/0 - A new t/0 struct.

put(struct, key, val)