state

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCursor

func WithCursor(row, col int) option

func WithInput

func WithInput(input textinput.Model, title string) option

func WithMode

func WithMode(mode Mode) option

func WithTiers

func WithTiers(tiers []core.Tier) option

func WithWindowWidth

func WithWindowWidth(width int) option

Types

type Mode

type Mode int
const (
	NavigationMode Mode = iota
	InputMode
	HelpMode
)

type State

type State interface {
	Mode() Mode
	Tiers() []core.Tier
	CursorRow() int
	CursorCol() int
	Dragging() bool
	SetStatus(msg string)
	StatusMsg() string
	WindowWidth() int
	WindowHeight() int
	SetWindowSize(width int, height int)
	InputTitle() string
	Input() textinput.Model
	UpdateInput(msg tea.Msg) tea.Cmd
	StartInputMode(title string, callback func(string, State) tea.Cmd) tea.Cmd
	ExitInputMode()
	SubmitInput() tea.Cmd
	DeleteItem() tea.Cmd
	ClampCursor()
	AddItem() tea.Cmd
	AddItemToPool(item core.Item)
	UpdateItem() tea.Cmd
	UpdateCurrentItem(newItem core.Item)
	SelectItem()
	MoveItem()
	MoveRight()
	MoveUp()
	MoveDown()
	MoveLeft()
	Save() core.SaveState
	Load(data core.SaveState)
	ToggleHelp()
}

func New

func New(opts ...option) State

Jump to

Keyboard shortcuts

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