API
prompt
import "github.com/aschey/bubbleprompt"
Index
- func Blur() tea.Cmd
- func Focus() tea.Cmd
- func MsgFilter(_ tea.Model, msg tea.Msg) tea.Msg
- func SetRenderer(r renderer.Renderer, retainHistory bool) tea.Cmd
- type ExecutorFinishedMsg
- type InputHandler
- type Model
- func New[T any](inputHandler InputHandler[T], textInput input.Input[T], opts ...Option[T]) Model[T]
- func (m Model[T]) Init() tea.Cmd
- func (m Model[T]) Renderer() renderer.Renderer
- func (m *Model[T]) SuggestionManager() suggestion.Manager[T]
- func (m Model[T]) SuggestionOffset() int
- func (m Model[T]) TextInput() input.Input[T]
- func (m Model[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model[T]) View() string
- type Option
- func WithFocusOnStart[T any](focusOnStart bool) Option[T]
- func WithFormatters[T any](formatters suggestion.Formatters) Option[T]
- func WithRenderer[T any](r renderer.Renderer) Option[T]
- func WithSuggestionManager[T any](manager suggestion.Manager[T]) Option[T]
- func WithUnmanagedRenderer[T any](opts ...renderer.Option) Option[T]
- func WithViewportRenderer[T any](opts ...renderer.Option) Option[T]
func Blur
func Blur() tea.Cmd
func Focus
func Focus() tea.Cmd
func MsgFilter
func MsgFilter(_ tea.Model, msg tea.Msg) tea.Msg
func SetRenderer
func SetRenderer(r renderer.Renderer, retainHistory bool) tea.Cmd
type ExecutorFinishedMsg
type ExecutorFinishedMsg tea.Model
type InputHandler
type InputHandler[T any] interface {
Init() tea.Cmd
Update(msg tea.Msg) (InputHandler[T], tea.Cmd)
Execute(input string, prompt *Model[T]) (tea.Model, error)
Complete(prompt Model[T]) ([]suggestion.Suggestion[T], error)
}
type Model
type Model[T any] struct {
// contains filtered or unexported fields
}
func New
func New[T any](inputHandler InputHandler[T], textInput input.Input[T], opts ...Option[T]) Model[T]
func (Model[T]) Init
func (m Model[T]) Init() tea.Cmd
func (Model[T]) Renderer
func (m Model[T]) Renderer() renderer.Renderer
func (*Model[T]) SuggestionManager
func (m *Model[T]) SuggestionManager() suggestion.Manager[T]
func (Model[T]) SuggestionOffset
func (m Model[T]) SuggestionOffset() int
func (Model[T]) TextInput
func (m Model[T]) TextInput() input.Input[T]
func (Model[T]) Update
func (m Model[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)
func (Model[T]) View
func (m Model[T]) View() string
type Option
type Option[T any] func(model *Model[T])
func WithFocusOnStart
func WithFocusOnStart[T any](focusOnStart bool) Option[T]
func WithFormatters
func WithFormatters[T any](formatters suggestion.Formatters) Option[T]
func WithRenderer
func WithRenderer[T any](r renderer.Renderer) Option[T]
func WithSuggestionManager
func WithSuggestionManager[T any](manager suggestion.Manager[T]) Option[T]
func WithUnmanagedRenderer
func WithUnmanagedRenderer[T any](opts ...renderer.Option) Option[T]
func WithViewportRenderer
func WithViewportRenderer[T any](opts ...renderer.Option) Option[T]
Generated by gomarkdoc