Documentation ¶
Index ¶
- func Kill(status int)
- func Version() string
- type FilePath
- type KeyMap
- type Model
- func (m *Model) AsField(options ...Option[*field]) *field
- func (m *Model) Exit()
- func (m *Model) Field() *field
- func (m *Model) Init() tea.Cmd
- func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Model) Value() string
- func (m *Model) View() string
- func (m *Model) With(options ...Option[*Model]) *Model
- func (m *Model) WithCommand(cmd string) *Model
- func (m *Model) WithIcons() *Model
- func (m *Model) WithKeys(keys *KeyMap) *Model
- func (m *Model) WithPath(path string) *Model
- func (m *Model) WithSize(width, height int) *Model
- func (m *Model) WithStyle(styles *Styles) *Model
- type Option
- func Caption(caption string) Option[*field]
- func Command(cmd string) Option[*Model]
- func Field(options ...Option[*field]) Option[*Model]
- func Heading(heading string) Option[*field]
- func Icons() Option[*Model]
- func Key(key string) Option[*field]
- func Keys(keys *KeyMap) Option[*Model]
- func Path(path string) Option[*Model]
- func Prompt(prompt string) Option[*field]
- func Size(width, height int) Option[*Model]
- func Style(styles *Styles) Option[*Model]
- func Validate(validate func(FilePath) error) Option[*field]
- func Value(value string) Option[*field]
- type Optional
- type RunError
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KeyMap ¶ added in v2.2.0
type KeyMap struct { ForceQuit key.Binding Quit key.Binding QuitQ key.Binding Open key.Binding Back key.Binding Up key.Binding Down key.Binding Left key.Binding Right key.Binding Top key.Binding Bottom key.Binding Leftmost key.Binding Rightmost key.Binding PageUp key.Binding PageDown key.Binding Home key.Binding End key.Binding VimUp key.Binding VimDown key.Binding VimLeft key.Binding VimRight key.Binding VimTop key.Binding VimBottom key.Binding Search key.Binding Preview key.Binding Delete key.Binding Undo key.Binding Yank key.Binding }
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) Exit ¶
func (m *Model) Exit()
Exit exits the program with the receiver's current exit status.
func (*Model) Field ¶ added in v2.3.0
func (m *Model) Field() *field
Field returns the receiver's field used in a form.
func (*Model) Init ¶
Init initializes the receiver.
Init is a required method of the Bubble Tea framework's Model interface.
func (*Model) Update ¶
Update updates the receiver with the given message and returns the updated Model and any command to pass on to the Bubble Tea runtime.
Update is a required method of the Bubble Tea framework's Model interface.
func (*Model) View ¶
View returns a string representation of the receiver's current state including all markup, styling, terminal escape sequences, etc.
View is a required method of the Bubble Tea framework's Model interface.
func (*Model) WithCommand ¶ added in v2.1.0
WithCommand returns the receiver with the given "open file" command set.
func (*Model) WithKeys ¶ added in v2.2.0
WithKeys returns the receiver with the given key bindings set.
type Option ¶
type Option[O Optional] func(O) O
func Command ¶ added in v2.1.0
Command returns an Option that sets the "open file" command with for a Model.
func Field ¶ added in v2.3.0
Field returns an Option that configures Model as a form field.
This Option must be provided to initialize Model as a form field.
func Style ¶ added in v2.1.0
Style returns an Option that sets the rendering attributes for a Model.
type Optional ¶ added in v2.3.0
type Optional interface{ *Model | *field }
Optional is a type with which Option arguments and methods can be applied.