ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = keymap{
	Up: key.NewBinding(
		key.WithKeys("k", "up"),
		key.WithHelp("↑/k", "add dice"),
	),
	Down: key.NewBinding(
		key.WithKeys("j", "down"),
		key.WithHelp("↓/j", "remove dice"),
	),
	Left: key.NewBinding(
		key.WithKeys("h", "left"),
		key.WithHelp("🡠/h", "prev die"),
	),
	Right: key.NewBinding(
		key.WithKeys("l", "right"),
		key.WithHelp("🡢/l", "next die"),
	),
	Roll: key.NewBinding(
		key.WithKeys("e", "enter"),
		key.WithHelp("e/enter", "roll dice"),
	),
	Clear: key.NewBinding(
		key.WithKeys("c", "ctrl+l"),
		key.WithHelp("c", "clear"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "help"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "ctrl+c", "esc"),
		key.WithHelp("q", "quit"),
	),
}

Functions

func StyleErr

func StyleErr(s string) string

func StyleHeader

func StyleHeader(s string) string

func StyleKey

func StyleKey(s string) string

func StyleResult

func StyleResult(s string) string

func StyleStatus

func StyleStatus(s string) string

Types

type Model

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

func New

func New() Model

func (Model) DecreaseQuantity

func (m Model) DecreaseQuantity() (tea.Model, tea.Cmd)

func (Model) IncreaseQuantity

func (m Model) IncreaseQuantity() (tea.Model, tea.Cmd)

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) IsValid

func (m Model) IsValid() (bool, error)

func (Model) NextDie

func (m Model) NextDie() (tea.Model, tea.Cmd)

func (Model) PrevDie

func (m Model) PrevDie() (tea.Model, tea.Cmd)

func (Model) Roll

func (m Model) Roll() (tea.Model, tea.Cmd)

func (Model) Selection

func (m Model) Selection() string

func (Model) SetStatus

func (m Model) SetStatus() (tea.Model, tea.Cmd)

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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