Documentation
¶
Index ¶
- type Application
- type ApplicationOption
- type BackHandler
- type Container
- func (c *Container) ContentHeight() int
- func (c *Container) ContentWidth() int
- func (c *Container) CurrentView() View
- func (c *Container) HandleError(err error)
- func (c *Container) Height() int
- func (c *Container) Init() tea.Cmd
- func (c *Container) NextView() View
- func (c *Container) PopView() error
- func (c *Container) PreviousView() View
- func (c *Container) Program() *Program
- func (c *Container) Ready() bool
- func (c *Container) RenderState() *types.RenderState
- func (c *Container) Send(msg tea.Msg, delay time.Duration)
- func (c *Container) SetNextView(v View)
- func (c *Container) SetNotice(notice string, lvl themes.OutputLevel)
- func (c *Container) SetSendFunc(f func(msg tea.Msg))
- func (c *Container) SetState(key, val string)
- func (c *Container) SetStateValue(val string)
- func (c *Container) SetView(v View) error
- func (c *Container) Shutdown(finalizers ...func())
- func (c *Container) SizeSet() bool
- func (c *Container) Start() error
- func (c *Container) State() (string, string)
- func (c *Container) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (c *Container) View() tea.View
- func (c *Container) WaitForExit()
- func (c *Container) Width() int
- type ContainerOptions
- type InputCapturer
- type Program
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
func NewApplication ¶
func NewApplication(name string, opts ...ApplicationOption) *Application
type ApplicationOption ¶
type ApplicationOption func(*Application)
func WithLoadingMsg ¶
func WithLoadingMsg(msg string) ApplicationOption
func WithState ¶
func WithState(key, val string) ApplicationOption
func WithStateKey ¶
func WithStateKey(key string) ApplicationOption
func WithStateVal ¶
func WithStateVal(val string) ApplicationOption
func WithVersion ¶ added in v0.3.0
func WithVersion(version string) ApplicationOption
type BackHandler ¶ added in v0.3.1
type BackHandler interface {
HandleBack() bool
}
BackHandler is an optional interface views can implement to intercept back navigation events before the Container forcefully pops the view stack.
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer( ctx context.Context, app *Application, opts ...ContainerOptions, ) (*Container, error)
func (*Container) ContentHeight ¶
func (*Container) ContentWidth ¶
func (*Container) CurrentView ¶
func (*Container) HandleError ¶
func (*Container) PreviousView ¶
func (*Container) RenderState ¶
func (c *Container) RenderState() *types.RenderState
func (*Container) SetNextView ¶
func (*Container) SetSendFunc ¶
func (*Container) SetStateValue ¶
func (*Container) WaitForExit ¶
func (c *Container) WaitForExit()
type ContainerOptions ¶
type ContainerOptions func(*Container)
func WithInitialTermSize ¶
func WithInitialTermSize(width, height int) ContainerOptions
func WithInput ¶
func WithInput(in io.Reader) ContainerOptions
func WithOutput ¶
func WithOutput(out io.Writer) ContainerOptions
func WithTheme ¶
func WithTheme(theme themes.Theme) ContainerOptions
type InputCapturer ¶ added in v0.3.0
type InputCapturer interface {
CapturingInput() bool
}
InputCapturer is an optional interface views can implement to signal that they are actively capturing keyboard input (e.g. a filter field). When CapturingInput returns true, the Container forwards all keys to the view instead of handling them globally.
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func NewProgram ¶
func (*Program) SetTeaProgram ¶ added in v0.2.3
Click to show internal directories.
Click to hide internal directories.