GtBridge.Phlow.List (gt_bridge v0.17.3)

Copy Markdown View Source

A Phlow list view specification.

List views display collections of items in GT's inspector.

Summary

Functions

Convert the list view to a dictionary format for serialization to GT.

Set the format function for displaying items.

Set the items to display. Can be a list or a function that returns a list.

Set the priority of the view.

Set the title of the view.

Types

t()

@type t() :: %GtBridge.Phlow.List{
  item_format: (any() -> String.t()) | nil,
  items_callback: (-> list()) | nil,
  view_priority: integer(),
  view_title: String.t()
}

Functions

as_dict(self)

@spec as_dict(t()) :: map()

Convert the list view to a dictionary format for serialization to GT.

item_format(self, format_fn)

@spec item_format(t(), (any() -> String.t())) :: t()

Set the format function for displaying items.

items(self, items_list)

@spec items(t(), list() | (-> list())) :: t()

Set the items to display. Can be a list or a function that returns a list.

priority(self, priority_value)

@spec priority(t(), integer()) :: t()

Set the priority of the view.

title(self, title_text)

@spec title(t(), String.t()) :: t()

Set the title of the view.