ui

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OkButtonExecute = OkButton("Execute")
	OkButtonPrint   = OkButton("Print")
)

Variables

View Source
var (
	ErrInvalidTheme = errors.New("invalid theme")
)

Functions

func ApplyConfig

func ApplyConfig(cfg Config, system *system.System)

Types

type Config

type Config struct {
	Theme      string `` /* 130-byte string literal not displayed */
	HideKeyMap bool   `yaml:"hideKeyMap,omitempty" head_comment:"If set to true, the key map won't be displayed. Default value: false"`
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) GetSelectedTheme

func (c *Config) GetSelectedTheme(system *system.System) style.ThemeValues

type NamedTheme

type NamedTheme struct {
	Name   string            `yaml:"name"`
	Values style.ThemeValues `yaml:"values" head_comment:"A color can be created from a color name (W3C name) or by a hex value in the format #ffffff."`
}

type OkButton

type OkButton string

type TUI added in v1.0.0

type TUI interface {
	ApplyConfig(cfg Config, system *system.System)
	Print(m uimsg.Printable)
	PrintMessage(message string)
	PrintError(message string)
	Confirmation(confirm uimsg.Confirm, options ...confirm.Option) bool
	OpenEditor(path string, preferredEditor string)
	ShowLookup(snippets []model.Snippet, fuzzySearch bool) int
	ShowParameterForm(parameters []model.Parameter, okButton OkButton) ([]string, bool)
	ShowPicker(items []picker.Item, options ...tea.ProgramOption) (int, bool)
	ShowSync() sync.Screen
}

func NewTUI added in v1.0.0

func NewTUI(options ...TUIOption) TUI

type TUIOption added in v1.0.0

type TUIOption interface {
	// contains filtered or unexported methods
}

TUIOption configures a TUI.

func WithScreen

func WithScreen(screen tcell.Screen) TUIOption

WithScreen sets the screen for tview.

func WithStdio

func WithStdio(stdio termutil.Stdio) TUIOption

WithStdio sets the stdio for the terminal.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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