common

package
v0.0.0-...-0d1901a Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Available   = "✅"
	Unavailable = "❌"

	Selected   = "☑"
	Unselected = "☐"
)
View Source
const Ellipsis = "…"

Variables

This section is empty.

Functions

func GetRandomLoadingMessage

func GetRandomLoadingMessage() string

GetRandomLoadingMessage returns a random loading message.

func GetRandomPlaceholder

func GetRandomPlaceholder() string

func Title

func Title(s string) string

Types

type EmbedableModel

type EmbedableModel struct {
	Width  int
	Height int

	IsQuit bool
	IsBack bool
}

EmbedableModel is a model that can be embedded in other models. It provides some basic functionality that is common to all models.

func (EmbedableModel) Back

func (m EmbedableModel) Back() bool

func (EmbedableModel) Quit

func (m EmbedableModel) Quit() bool

type Spinner

type Spinner struct {
	spinner.Model
	Message string
}

func NewSpinner

func NewSpinner() Spinner

func (Spinner) View

func (s Spinner) View() string

type SubModel

type SubModel interface {
	SubModelBase

	Update(msg tea.Msg) (SubModel, tea.Cmd)
}

type SubModelBase

type SubModelBase interface {
	// some bubbleteaish Model methods
	Init() tea.Cmd
	View() string

	// some custom methods
	// SetSize sets the width and height of the model
	SetSize(width, height int)

	// Quit returns true if the model should quit
	Quit() bool

	// Back returns true if the model should go back
	Back() bool
}

type TabModel

type TabModel interface {
	SubModelBase

	Title() string
	Update(msg tea.Msg) (TabModel, tea.Cmd)
}

Jump to

Keyboard shortcuts

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