bubbles

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Batch

func Batch(cmds ...tea.Cmd) tea.Cmd

Batch returns a tea.Cmd that represents a batch of tea.Cmd.

func Cmd

func Cmd(m CmdModel) tea.Cmd

Cmd returns a tea.Cmd that represents a command from the channel.

func Filter

func Filter(m tea.Model, msg tea.Msg) tea.Msg

Filter filters out SequenceMsg and BatchMsg and transforms them to official Sequence and Batch tea.Msg. This brings support to nested models.

func InitNested

func InitNested(m NestedModel) tea.Cmd

InitNested initializes nested models.

func Nest

func Nest(model IDModel, cmd tea.Cmd) tea.Cmd

Nest nests a tea.Cmd to a specific model.

func Sequence

func Sequence(cmds ...tea.Cmd) tea.Cmd

Sequence returns a tea.Cmd that represents a sequence of tea.Cmd.

func Tick

func Tick(m TickModel) tea.Cmd

Tick returns a tea.Cmd that represents a tick.

func UpdateTickModel

func UpdateTickModel(m TickModel, msg tea.Msg) tea.Cmd

TickUpdate updates the model with a tick.

Types

type BatchMsg

type BatchMsg []tea.Cmd

BatchMsg is a message that represents a batch of tea.Cmd.

type CmdModel

type CmdModel interface {
	CmdChan() <-chan tea.Cmd

	tea.Model
}

CmdModel is a model that has a channel of tea.Cmd.

type FocusModel

type FocusModel interface {
	IDModel

	Focused() bool
	Focus() tea.Cmd
	Blur() tea.Cmd
}

FocusModel is a model that can be focused.

type FrameMsg

type FrameMsg struct{}

FrameMsg is a message that force to refresh a frame.

type IDModel

type IDModel interface {
	ID() uuid.UUID

	tea.Model
}

IDModel is a model that has an UUID.

type IDMsg

type IDMsg struct{}

type NestedModel

type NestedModel interface {
	IDModels() []IDModel
	UpdateNestedMsg(NestedMsg) (NestedModel, tea.Cmd)

	tea.Model
}

NestedModel is a model that has nested models.

func UpdateNestedModel

func UpdateNestedModel(m NestedModel, msg tea.Msg) (NestedModel, tea.Cmd)

UpdateNested passed the dedicated tea.Msg to nested model.

type NestedMsg

type NestedMsg struct {
	ID  uuid.UUID
	Msg tea.Msg
}

NestedMsg is a message that represents a nested tea.Msg.

type SequenceMsg

type SequenceMsg []tea.Cmd

SequenceMsg is a message that represents a sequence of tea.Cmd.

type TickModel

type TickModel interface {
	tea.Model

	FrameDuration() time.Duration
}

TickModel is a model that updates on a tick.

type TickMsg

type TickMsg time.Time

TickMsg is a message that represents a tick.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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