Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InfoListItem ¶
InfoListItem is the interface for an info list. If an object satisfies this interface, a list prompt can be generated from a slice of these values. Additionally, the value returns from Info will render as markdown.
type InfoListModel ¶
type InfoListModel struct {
// contains filtered or unexported fields
}
InfoListModel contains the state of the info list prompt.
func NewInfoListModel ¶
func NewInfoListModel(input NewInfoListModelInput) (InfoListModel, error)
NewInfoListModel creates a new InfoListModel with defaults.
func (InfoListModel) Init ¶
func (m InfoListModel) Init() tea.Cmd
Init is the first command that is called when the program starts.
func (InfoListModel) Run ¶
func (m InfoListModel) Run() (InfoListItem, error)
Run starts the prompt.
type NewInfoListModelInput ¶
type NewInfoListModelInput struct { Title string Items []InfoListItem NameSingular string NamePlural string DisableFiltering bool DisableDetail bool }
NewInfoListModelInput is the input for the NewInfoListModel function.
type StringItem ¶
type StringItem string
StringItem is a type that satisfies the InfoListItem interface. It's useful when you just want to display a list of strings.
func (StringItem) FilterValue ¶
func (s StringItem) FilterValue() string
FilterValue returns the StringItem's value, which is used for filtering.
func (StringItem) GetName ¶
func (s StringItem) GetName() string
GetName returns the StringItem's value, which is the value that is displayed in the list.
func (StringItem) Info ¶
func (s StringItem) Info() string
Info returns the StringItem's value, which is displayed when the user selects the detail view for the item.