common

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelModalCmd added in v1.10.0

func CancelModalCmd() tea.Cmd

func EmitBlockSelectedMsg added in v1.1.1

func EmitBlockSelectedMsg(blockNum uint64) tea.Cmd

func EmitModuleSelectedCmd added in v1.10.0

func EmitModuleSelectedCmd(moduleName, target string) tea.Cmd

func ErrorCmd

func ErrorCmd(err error) tea.Cmd

ErrorCmd returns an ErrorMsg from error.

func SetModalComponentCmd added in v1.10.0

func SetModalComponentCmd(comp Component) tea.Cmd

func SetRequestValueCmd added in v1.10.0

func SetRequestValueCmd(field, value string) tea.Cmd

func ShortToFullHelp added in v1.10.0

func ShortToFullHelp(comp Component) [][]key.Binding

func TruncateString

func TruncateString(s string, max int) string

TruncateString is a convenient wrapper around truncate.TruncateString.

Types

type BlockSelectedMsg added in v1.1.1

type BlockSelectedMsg uint64 // Emitted to inform all components that a new block has been selected.

type CancelModalMsg added in v1.10.0

type CancelModalMsg struct{} // Emitted by components to close itselt

type Common

type Common struct {
	Width  int
	Height int
}

Common is a struct all components should embed.

func (*Common) GetHeight added in v1.10.0

func (c *Common) GetHeight() int

func (*Common) GetWidth added in v1.10.0

func (c *Common) GetWidth() int

func (*Common) SetSize

func (c *Common) SetSize(width, height int)

SetSize sets the width and height of the common struct.

type Component

type Component interface {
	tea.Model
	help.KeyMap
	SetSize(width, height int)
	GetWidth() int
	GetHeight() int
}

Component represents a Bubble Tea model that implements a SetSize function.

type ErrorMsg

type ErrorMsg error

ErrorMsg is a Bubble Tea message that represents an error.

type GoToOutputMsg added in v1.10.0

type GoToOutputMsg struct{}

type IsFullWidthModal added in v1.10.0

type IsFullWidthModal interface {
	IsFullWidthModal()
}

type IsInlineModal added in v1.10.0

type IsInlineModal interface {
	IsInlineModal()
}

type ModuleSelectedMsg added in v1.1.1

type ModuleSelectedMsg struct {
	Target     string
	ModuleName string
}

type SetModalComponentMsg added in v1.10.0

type SetModalComponentMsg Component

type SetRequestValue added in v1.10.0

type SetRequestValue struct {
	Field string
	Value string
}

type SimpleHelp added in v1.10.0

type SimpleHelp struct {
	Bindings []key.Binding
}

func NewSimpleHelp added in v1.10.0

func NewSimpleHelp(bindings ...key.Binding) SimpleHelp

func (SimpleHelp) FullHelp added in v1.10.0

func (h SimpleHelp) FullHelp() [][]key.Binding

func (SimpleHelp) ShortHelp added in v1.10.0

func (h SimpleHelp) ShortHelp() []key.Binding

type UpdateSeenModulesMsg added in v1.1.1

type UpdateSeenModulesMsg []string

Jump to

Keyboard shortcuts

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