decks

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDeck

func AddDeck(name string) tea.Cmd

func SelectDeck

func SelectDeck(selectedDeck *ListItem) tea.Cmd

func UpdateDeck

func UpdateDeck(updatedName string) tea.Cmd

Types

type AddDeckMsg

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

type DeckSelectedMsg

type DeckSelectedMsg struct {
	DeckItem ListItem
}

type ListItem added in v0.3.2

type ListItem struct {
	DBItem flashcard.Deck
}

ListItem to represent deck in decks list.

It contains name of deck as Title and has no Description.

Also it keeps dbItem that helps to manipulatie corresponding deck object in repository.

func (ListItem) DeckName added in v0.3.22

func (i ListItem) DeckName() string

func (ListItem) Description added in v0.3.2

func (i ListItem) Description() string

Description that doesn't exist.

func (ListItem) FilterValue added in v0.3.2

func (i ListItem) FilterValue() string

FilterValue by deck's name.

func (ListItem) GetDBItem added in v0.3.2

func (i ListItem) GetDBItem() flashcard.Deck

GetDBItem to operate corresponding object in repository.

func (ListItem) Title added in v0.3.2

func (i ListItem) Title() string

Title of the item, that is actually a deck's name.

type Model

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

Model represents state of decks pane.

Decks pane manages all decks in the app.

func New

func New(deckManager flashcard.DeckManager) *Model

func (*Model) Focus

func (m *Model) Focus()

Focus changes style of borders from '--' to '=='.

func (*Model) GetHeight added in v0.3.2

func (m *Model) GetHeight() int

func (*Model) GetWidth added in v0.3.2

func (m *Model) GetWidth() int

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) IsTyping

func (m *Model) IsTyping() bool

func (*Model) SelectedDeck added in v0.3.2

func (m *Model) SelectedDeck() (int, *ListItem)

func (*Model) SetHeight

func (m *Model) SetHeight(height int)

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

func (*Model) Unfocus

func (m *Model) Unfocus()

Unfocus changes style of borders from '==' to '--'.

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type NoDeckSelectedMsg added in v0.3.4

type NoDeckSelectedMsg struct{}

type UpdateDeckMsg

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

Jump to

Keyboard shortcuts

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