layout.go

 1package layout
 2
 3import (
 4	"reflect"
 5
 6	"github.com/charmbracelet/bubbles/v2/key"
 7	tea "github.com/charmbracelet/bubbletea/v2"
 8)
 9
10type Focusable interface {
11	Focus() tea.Cmd
12	Blur() tea.Cmd
13	IsFocused() bool
14}
15
16type Sizeable interface {
17	SetSize(width, height int) tea.Cmd
18	GetSize() (int, int)
19}
20
21type Help interface {
22	Bindings() []key.Binding
23}
24
25type Positionable interface {
26	SetPosition(x, y int) tea.Cmd
27}
28
29// KeyMapProvider defines an interface for types that can provide their key bindings as a slice
30type KeyMapProvider interface {
31	KeyBindings() []key.Binding
32}