Documentation
¶
Index ¶
- Constants
- func NewNoChildrenError() error
- func NewNotABoxerError(b Boxer) error
- func NewProporationError(b Boxer) error
- func NewWrongSizeError(isWidth, isHeight, shallWidth, shallHeight int) error
- func NewWrongTypeError(got interface{}, want ...string) error
- type BoxSize
- type Boxer
- type Leave
- type Model
- type MultipleErrors
- type NoChildrenError
- type NodePos
- type NotABoxerError
- type PathMsg
- type ProportionError
- type WrongSizeError
- type WrongTypeError
Constants ¶
const ( // SPACE is used to fill up lines SPACE = " " //NEWLINE is the newline string NEWLINE = "\n" // TODO make windows compatible )
Variables ¶
This section is empty.
Functions ¶
func NewNoChildrenError ¶
func NewNoChildrenError() error
NewNoChildrenError returns a NoChildrenError
func NewNotABoxerError ¶
NewNotABoxerError returns a new NotABoxerError.
func NewProporationError ¶
NewProporationError returns a uniform string for this error
func NewWrongSizeError ¶
NewWrongSizeError returns a WrongSizeError if the is[Width/Height] is grater then the corresponding shall[Width/Height] other nil is returned.
func NewWrongTypeError ¶
NewWrongTypeError returns a new WrongTypeError
Types ¶
type Boxer ¶
type Boxer interface {
tea.Model
InitAll() []tea.Cmd
UpdateAll(tea.Msg) (Boxer, []tea.Cmd)
Lines() ([]string, error)
}
Boxer is a interface to render multiple bubbles (within a tree) to the terminal screen.
type Leave ¶
type Leave struct {
Content tea.Model
Border bool
BorderStyle termenv.Style
Width int
Heigth int
N, NW, W, SW, S, SO, O, NO string
// contains filtered or unexported fields
}
Leave are the Boxers which holds the content Models
func (Leave) InitAll ¶
InitAll calls the Init of the Content and returns the cmd embedded in a array to satisfiy the Boxer-interface
func (Leave) Lines ¶
Lines returns the fully rendert (maybe with borders) lines and fullfills the Boxer Interface. Error may be of type ProporationError.
func (Leave) Update ¶
Update takes care about the seting of the id of this leave and the changing of the WindowSizeMsg depending on the border and the focus style of the border.
type Model ¶
type Model struct {
Height, Width int
Vertical bool
Sizer func(childLenght int, vertical bool, msg tea.WindowSizeMsg) ([]tea.WindowSizeMsg, error)
// contains filtered or unexported fields
}
Model is a bubble to manage/bundle other bubbles into boxes on the screen
func (*Model) AddChildren ¶
AddChildren adds the given BoxerSize's as children If one provided BoxerSize.Box is 'nil' an NotABoxerError is returned and NO child is added!
func (Model) Init ¶
Init call the Init methods of the Children and returns the batched/collected returned Cmd's of them
func (Model) InitAll ¶
InitAll call the Init methods of the Children and returns the batched/collected returned Cmd's of them
func (Model) Update ¶
Update handles the ratios between the different Boxers through the according fanning of the WindowSizeMsg's
type MultipleErrors ¶
type MultipleErrors []error
MultipleErrors is used to collect multiple errors from different sources
func (MultipleErrors) Error ¶
func (me MultipleErrors) Error() string
type NoChildrenError ¶
type NoChildrenError error
NoChildrenError is an error used to signal that a Boxer can not render itself when it has no Children to render.
type NodePos ¶
NodePos is used to hold the information about position of a child relative to its siblings within this layout-tree.
type NotABoxerError ¶
type NotABoxerError error
NotABoxerError is used when something should satisfy the Boxer interface but does not (like 'nil').
type PathMsg ¶
PathMsg is used to transport the information about the position and the Msg to every leave-content.
type ProportionError ¶
type ProportionError error
ProportionError is for signaling that the string return by the View or Lines function has wrong proportions(width/height)
type WrongSizeError ¶
type WrongSizeError error
WrongSizeError shall be used to signal that a string exceeds the necessary Width or hight.
type WrongTypeError ¶
type WrongTypeError error
WrongTypeError is used to show when the type provided does not match any of the acceptable types.