timer

package
v0.0.0-...-c5feec6 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	Tab:  key.NewBinding(key.WithKeys("tab"), key.WithHelp("tab", "switch")),
	Quit: key.NewBinding(key.WithKeys("q", "esc", "ctrl+c"), key.WithHelp("q", "quit")),
}

The default keybindings for the timer program

Functions

func Run

func Run()

Types

type KeyMap

type KeyMap struct {
	Tab  key.Binding
	Quit key.Binding
}

KeyMap is a collection of keybindings

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns a slice of keybindings that are used in the full help

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns a slice of keybindings that are used in the short help

type Model

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

A model representing the state of the timer program

func New

func New() Model

Creates a new timer program model

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) SetFocus

func (m *Model) SetFocus(f focused)

Set the focus to the given model enumeration

func (Model) Update

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

Handles events and messages for the timer application

func (Model) View

func (m Model) View() string

Returns the view for the timer application

Directories

Path Synopsis
components

Jump to

Keyboard shortcuts

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