models

package
v0.0.0-...-aeffa93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSelectAction = func(d DetailList) tea.Cmd { return nil }
)

Functions

func DownloadEpisodeAction

func DownloadEpisodeAction(d DetailList) tea.Cmd
func MenuSetActiveCmd(index int) tea.Cmd

func NewAdd

func NewAdd() tea.Model

func NewDetailList

func NewDetailList(items []list.Item, width int, height int, action DetailListAction, extraActions ActionMap) tea.Model

func NewMenu

func NewMenu(items []MenuItem) tea.Model

Types

type ActionMap

type ActionMap map[string]DetailListAction

type Add

type Add struct {
	// contains filtered or unexported fields
}

func (Add) Focused

func (a Add) Focused() bool

func (Add) Init

func (a Add) Init() tea.Cmd

func (*Add) PromptClosed

func (a *Add) PromptClosed(finished bool) (tea.Model, tea.Cmd)

func (*Add) SetDimensions

func (a *Add) SetDimensions(msg tea.WindowSizeMsg) tea.WindowSizeMsg

func (Add) Update

func (a Add) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Add) View

func (a Add) View() string

type AddContext

type AddContext func(input string) tea.Cmd

type DetailList

type DetailList struct {
	// contains filtered or unexported fields
}

func (DetailList) Init

func (d DetailList) Init() tea.Cmd

func (DetailList) SelectedItem

func (d DetailList) SelectedItem() list.Item

func (*DetailList) SetDimensions

func (d *DetailList) SetDimensions(msg tea.WindowSizeMsg)

func (DetailList) Update

func (d DetailList) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*DetailList) UpdateDetails

func (d *DetailList) UpdateDetails()

func (DetailList) UpdatePanels

func (d DetailList) UpdatePanels(msg tea.Msg, extra tea.Cmd) (tea.Model, tea.Cmd)

func (DetailList) View

func (d DetailList) View() string

type DetailListAction

type DetailListAction func(d DetailList) tea.Cmd

type DetailListItem

type DetailListItem interface {
	Name() string
	Details() string
	FilterValue() string
}

type DetailListItemDelegate

type DetailListItemDelegate struct{}

func (DetailListItemDelegate) Height

func (d DetailListItemDelegate) Height() int

Height is the height of the list item.

func (DetailListItemDelegate) Render

func (d DetailListItemDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

Render renders the item's view.

func (DetailListItemDelegate) Spacing

func (d DetailListItemDelegate) Spacing() int

Spacing is the size of the horizontal gap between list items in cells.

func (DetailListItemDelegate) Update

func (d DetailListItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update is the update loop for items. All messages in the list's update loop will pass through here except when the user is setting a filter. Use this method to perform item-level updates appropriate to this delegate.

type DownloadEpisode

type DownloadEpisode struct {
	Url      string
	Filename string
}

type FocusAdd

type FocusAdd struct {
	Prompt  string
	Context tea.Msg
}

type FocusRemove

type FocusRemove struct {
	Value    string
	Complete bool
	Context  tea.Msg
}
type Menu struct {
	// contains filtered or unexported fields
}
func (m Menu) Active() int
func (m Menu) Init() tea.Cmd
func (m *Menu) SetDimensions(msg tea.WindowSizeMsg) tea.WindowSizeMsg
func (m Menu) Update(msg tea.Msg) (tea.Model, tea.Cmd)
func (m Menu) View() string
type MenuItem struct {
	Action tea.Cmd
	Name   string
}
type MenuSetActive struct {
	Index int
}

type MessageCmd

type MessageCmd struct {
	Msg    string
	Active bool
}

type SpinnerCmd

type SpinnerCmd struct{ Active bool }

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL