Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultDelegate ¶
type DefaultDelegate struct {
Styles DefaultItemStyles
// contains filtered or unexported fields
}
func NewDefaultDelegate ¶
func NewDefaultDelegate() *DefaultDelegate
func (*DefaultDelegate) Height ¶
func (d *DefaultDelegate) Height() int
func (*DefaultDelegate) Spacing ¶
func (d *DefaultDelegate) Spacing() int
type DefaultItemStyles ¶
type DefaultItemStyles struct {
NormalTitle lipgloss.Style
NormalDesc lipgloss.Style
SelectedTitle lipgloss.Style
SelectedDesc lipgloss.Style
MarkAsReadTitle lipgloss.Style
MarkAsReadDesc lipgloss.Style
SelectedTitleAddToFavorites lipgloss.Style
SelectedDescAddToFavorites lipgloss.Style
SelectedTitleRemoveFromFavorites lipgloss.Style
SelectedDescRemoveFromFavorites lipgloss.Style
}
func NewDefaultItemStyles ¶
func NewDefaultItemStyles() (s DefaultItemStyles)
type ItemDelegate ¶
type ItemDelegate interface {
Render(w io.Writer, m *Model, index int, item *hn.Story)
Height() int
Spacing() int
// 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.
Update(msg tea.Msg, m *Model) tea.Cmd
}
ItemDelegate — if it also implements help.KeyMap, delegate-related help items will be added to the help view.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func New ¶
func New(delegate ItemDelegate, config *settings.Config, cat *categories.Categories, favorites *favorites.Favorites, width, height int) *Model
func (*Model) CancelFetch ¶
CancelFetch cancels an in-progress fetch and returns the resulting command. Returns nil if no fetch is active.
func (*Model) FetchStoriesForFirstCategory ¶
func (*Model) SelectedItem ¶
func (*Model) VisibleItems ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.