terminal

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultView added in v0.5.0

func DefaultView(m *Model) string

func NewLongAnswerField

func NewLongAnswerField() *longAnswerField

func NewShortAnswerField

func NewShortAnswerField(p string) *shortAnswerField

func StartInteractiveTerminal

func StartInteractiveTerminal(questions []ProjectQuestion)

Types

type CheckBoxField added in v0.5.0

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

func NewCheckBoxField added in v0.5.0

func NewCheckBoxField(t string, choices []string) *CheckBoxField
func (m *CheckBoxField) Blink() tea.Msg

func (*CheckBoxField) Blur added in v0.5.0

func (a *CheckBoxField) Blur() tea.Msg

func (*CheckBoxField) Exited added in v0.6.3

func (a *CheckBoxField) Exited() bool

func (*CheckBoxField) Focus added in v0.5.0

func (m *CheckBoxField) Focus() tea.Cmd

func (*CheckBoxField) Init added in v0.5.0

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

func (*CheckBoxField) Selected added in v0.5.0

func (a *CheckBoxField) Selected() map[int]any

func (*CheckBoxField) SetExited added in v0.6.3

func (a *CheckBoxField) SetExited()

func (*CheckBoxField) SetValue added in v0.5.0

func (a *CheckBoxField) SetValue(s string)

func (*CheckBoxField) Update added in v0.5.0

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

func (*CheckBoxField) Value added in v0.5.0

func (a *CheckBoxField) Value() string

func (*CheckBoxField) View added in v0.5.0

func (m *CheckBoxField) View() string

type Input

type Input interface {
	Blink() tea.Msg
	Blur() tea.Msg
	Focus() tea.Cmd
	SetValue(string)
	Value() string
	Update(tea.Msg) (Input, tea.Cmd)
	View() string
	Selected() map[int]any
	SetExited()
	Exited() bool
}

type Model

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

func New

func New(questions []ProjectQuestion) *Model

func (*Model) Init

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

func (*Model) Next

func (m *Model) Next()

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type ProjectQuestion

type ProjectQuestion struct {
	Input       Input
	Key         string
	PlaceHolder string
	Question    string
	Answer      string
}

func NewCheckboxQuestion added in v0.5.0

func NewCheckboxQuestion(k, t string, items []string) ProjectQuestion

func NewLongQuestion

func NewLongQuestion(k, q, p string) ProjectQuestion

func NewQuestion

func NewQuestion(k, q, p string) ProjectQuestion

func NewShortQuestion

func NewShortQuestion(k, q, p string) ProjectQuestion

type Styles

type Styles struct {
	BorderColor lipgloss.Color
	InputField  lipgloss.Style
}

func DefaultStyles

func DefaultStyles() *Styles

Jump to

Keyboard shortcuts

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