Documentation
¶
Index ¶
- func ChangeView(view View) tea.Cmd
- func ChangeViewWithMsgs(view View, msgs ...tea.Msg) tea.Cmd
- func KeyHandled(key tea.KeyPressMsg) tea.Cmd
- func ViewEnter(from View) tea.Cmd
- func WrapError(err error) tea.Cmd
- type MsgError
- type MsgKeyHandled
- type MsgViewChange
- type MsgViewEnter
- type View
- type ViewModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeView ¶
func KeyHandled ¶
func KeyHandled(key tea.KeyPressMsg) tea.Cmd
Types ¶
type MsgKeyHandled ¶
type MsgKeyHandled struct {
Key tea.KeyPressMsg
}
sent when the view has handled a key input
type MsgViewChange ¶
send to change the current state; Msgs are optional messages to forward to the destination view
type MsgViewEnter ¶
type MsgViewEnter View
sent to a state when it is entered, with the view we're leaving
type ViewModel ¶
type ViewModel interface {
Init() tea.Cmd
Update(tea.Msg) (ViewModel, tea.Cmd)
// The view's header
Header(width int) string
// The view's main content, which is given given height to render into
Content(width, height int, errors string) string
Footer(width int) string
}
An analogue to tea.Model with separate header, content, and footer view handlers
Click to show internal directories.
Click to hide internal directories.