Documentation
¶
Index ¶
- Constants
- func EncodeLayout(node Node) (string, error)
- func HasLeaf(node Node, leafID string) bool
- func HasPane(node Node, paneID string) bool
- func HasTile(node Node, tileID string) bool
- func LayoutEmpty(node Node) bool
- func LeafIDs(node Node) []string
- func LeftNeighbour(tree Node, leafID string, surviving map[string]bool) string
- func PaneIDs(node Node) []string
- func TileFractionByID(node Node, tileID string) (float64, bool)
- func TileIDs(node Node) []string
- func TileParamsByID(node Node, tileID string) (string, bool)
- func TileSessionIDByID(node Node, tileID string) (string, bool)
- func Validate(node Node) error
- type Direction
- type MoveBetweenLayoutsResult
- type Node
- func DecodeLayout(layoutJSON string) (Node, error)
- func DefaultLayout(paneID string) Node
- func DockTile(node Node, anchorID string, direction Direction, before bool, splitID string, ...) (Node, bool)
- func MoveLeaf(node Node, leafID, anchorID, splitID string, direction Direction, before bool, ...) (Node, bool)
- func NormalizeLayout[P any](node Node, panesByID map[string]P) Node
- func Rebalance(node Node) Node
- func Remove(node Node, paneID string) (Node, bool)
- func SetSplitRatio(node Node, splitID string, ratio float64) (Node, bool)
- func Split(node Node, targetLeafID, newPaneID, splitID string, direction Direction, ...) (Node, bool)
- func UndockTile(node Node, tileID string) (Node, bool)
- func UpdateTileParams(node Node, tileID, tileParams string) (Node, bool)
- func UpdateTileSessionID(node Node, tileID string, sessionID protocol.SessionID) (Node, bool)
- type RatioMode
- type TileKind
- type TileLeaf
- type ValidationError
Constants ¶
View Source
const (
DefaultSplitRatio = 0.5
)
Variables ¶
This section is empty.
Functions ¶
func EncodeLayout ¶
func LayoutEmpty ¶
Types ¶
type MoveBetweenLayoutsResult ¶
type MoveBetweenLayoutsResult struct {
SourceLayout Node
TargetLayout Node
Leaf Node
FinalLeafID string
}
func MoveLeafBetweenLayouts ¶
type Node ¶
type Node struct {
Type string `json:"type"`
PaneID string `json:"pane_id,omitempty"`
TileID string `json:"tile_id,omitempty"`
TileKind string `json:"tile_kind,omitempty"`
TileParams string `json:"tile_params,omitempty"`
TileSessionID protocol.SessionID `json:"tile_session_id,omitempty"`
SplitID string `json:"split_id,omitempty"`
Direction Direction `json:"direction,omitempty"`
Ratio float64 `json:"ratio,omitempty"`
RatioLocked bool `json:"ratio_locked,omitempty"`
RatioMode RatioMode `json:"ratio_mode,omitempty"`
Children []Node `json:"children,omitempty"`
}
func DecodeLayout ¶
func DefaultLayout ¶
type TileLeaf ¶
type TileLeaf struct {
TileID string
TileKind string
TileParams string
TileSessionID protocol.SessionID
}
func TileLeaves ¶
type ValidationError ¶
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.