common

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitBlockSelectedMsg added in v1.1.1

func EmitBlockSelectedMsg(blockNum uint64) tea.Cmd

func EmitModuleSelectedMsg added in v1.1.1

func EmitModuleSelectedMsg(moduleName string) tea.Cmd

func ErrorCmd

func ErrorCmd(err error) tea.Cmd

ErrorCmd returns an ErrorMsg from error.

func StyleConfig

func StyleConfig() gansi.StyleConfig

StyleConfig returns the default Glamour style configuration.

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 Common

type Common struct {
	Styles *styles.Styles
	Width  int
	Height int
}

Common is a struct all components should embed.

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)
}

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 ModalUpdateFunc added in v1.1.1

type ModalUpdateFunc func(msg tea.Msg) (tea.Model, tea.Cmd)

type ModuleSelectedMsg added in v1.1.1

type ModuleSelectedMsg string // Emitted to inform all components that a new module has been selected.

type SetModalUpdateFuncMsg added in v1.1.1

type SetModalUpdateFuncMsg ModalUpdateFunc

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