Documentation ¶
Index ¶
- Constants
- type ModelManager
- func (manager *ModelManager) PopScreen()
- func (manager *ModelManager) PushScreen(screen Screen) tea.Cmd
- func (manager *ModelManager) ReplaceScreen(screen Screen) tea.Cmd
- func (manager *ModelManager) ResolveOperation()
- func (manager *ModelManager) Update(msg tea.Msg) tea.Cmd
- func (manager ModelManager) View() string
- type Operation
- type Screen
- type ScreenRefocusedMsg
Constants ¶
View Source
const ( OperationNone = iota OperationPush OperationPop OperationReplace )
Operations
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelManager ¶
type ModelManager struct {
// contains filtered or unexported fields
}
Model manager
func (*ModelManager) PopScreen ¶
func (manager *ModelManager) PopScreen()
Pops the top screen from the stack
func (*ModelManager) PushScreen ¶
func (manager *ModelManager) PushScreen(screen Screen) tea.Cmd
Adds a new screen on the stack
func (*ModelManager) ReplaceScreen ¶
func (manager *ModelManager) ReplaceScreen(screen Screen) tea.Cmd
Replaces the current screen with a new screen on the stack
func (*ModelManager) ResolveOperation ¶
func (manager *ModelManager) ResolveOperation()
Resolves the operation
func (*ModelManager) Update ¶
func (manager *ModelManager) Update(msg tea.Msg) tea.Cmd
Calls the update method on the current screen
func (ModelManager) View ¶
func (manager ModelManager) View() string
Calls the View() function on the current screen with center aligned to the screen
type Screen ¶
type Screen interface { Init() tea.Cmd Update(tea.Msg, *ModelManager) (Screen, tea.Cmd) View() string }
A tea.Model-ish interface but for model manager
type ScreenRefocusedMsg ¶
type ScreenRefocusedMsg struct{}
Message represeting that the screenw as refocused after popping
Click to show internal directories.
Click to hide internal directories.