toast

package
v0.0.0-...-56f1d57 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProgress = 0.01
	DefaultDuration = 55 * time.Millisecond
)

Variables

This section is empty.

Functions

func NewToastCmd

func NewToastCmd(t ToastType, m string) tea.Cmd

Types

type FrameMsg

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

type Model

type Model struct {
	Message string
	Type    ToastType
	Icon    rune
	Height  int
	Width   int
	// contains filtered or unexported fields
}

func New

func New(t ToastType, message string) *Model

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) SetCompletionCommand

func (m *Model) SetCompletionCommand(cmd tea.Cmd) *Model

func (*Model) SetProgressSpeed

func (m *Model) SetProgressSpeed(speed float64) *Model

func (*Model) SetTickDuration

func (m *Model) SetTickDuration(duration time.Duration) *Model

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type NewToastMsg

type NewToastMsg struct {
	Type    ToastType
	Message string
}

type TickMsg

type TickMsg time.Time

type ToastType

type ToastType int
const (
	Info ToastType = iota
	Success
	Warning
	Error
)

Jump to

Keyboard shortcuts

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