summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/layout/layout.go
blob: dce27ac683831b703069d66e84eed9b89007449e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package layout

import (
	tea "github.com/charmbracelet/bubbletea/v2"
)

var Current *LayoutInfo

func init() {
	Current = &LayoutInfo{
		Viewport:  Dimensions{Width: 80, Height: 25},
		Container: Dimensions{Width: 80, Height: 25},
	}
}

type LayoutSize string

type Dimensions struct {
	Width  int
	Height int
}

type LayoutInfo struct {
	Viewport  Dimensions
	Container Dimensions
}

type Modal interface {
	tea.Model
	Render(background string) string
	Close() tea.Cmd
}