layout.go 424 B

123456789101112131415161718192021222324252627
  1. package layout
  2. import (
  3. "github.com/charmbracelet/bubbles/v2/key"
  4. tea "github.com/charmbracelet/bubbletea/v2"
  5. )
  6. // TODO: move this to core
  7. type Focusable interface {
  8. Focus() tea.Cmd
  9. Blur() tea.Cmd
  10. IsFocused() bool
  11. }
  12. type Sizeable interface {
  13. SetSize(width, height int) tea.Cmd
  14. GetSize() (int, int)
  15. }
  16. type Help interface {
  17. Bindings() []key.Binding
  18. }
  19. type Positional interface {
  20. SetPosition(x, y int) tea.Cmd
  21. }