Documentation
¶
Index ¶
- func DebugModifier(m Modifier) string
- func Fold[T any](c ModifierChain, initial T, operation func(T, Modifier) T) T
- func FoldIn[T any](c ModifierChain, initial T, operation func(T, Modifier) T) T
- func FoldOut[T any](c ModifierChain, initial T, operation func(T, Modifier) T) T
- type Chain
- type ChainNode
- type Element
- type ElementStore
- type InspectableModifier
- type InspectorInfo
- type Modifier
- type ModifierAwareComposer
- type ModifierChain
- type ModifierElement
- type ModifierElementChain
- type Node
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugModifier ¶
DebugModifier returns a formatted string representation of the Modifier chain for debugging purposes.
func Fold ¶
func Fold[T any](c ModifierChain, initial T, operation func(T, Modifier) T) T
Fold Alias for FoldIn, FoldIn processes elements from right to left (tail to head)
func FoldIn ¶
func FoldIn[T any](c ModifierChain, initial T, operation func(T, Modifier) T) T
FoldIn processes elements from right to left (tail to head)
func FoldOut ¶
func FoldOut[T any](c ModifierChain, initial T, operation func(T, Modifier) T) T
FoldOut processes elements from left to right (head to tail)
Types ¶
type Chain ¶
type Chain interface {
// Fold folds the modifier chain, alias for FoldIn
Fold(initial interface{}, operation func(interface{}, Modifier) interface{}) interface{}
FoldIn(initial interface{}, operation func(interface{}, Modifier) interface{}) interface{}
FoldOut(initial interface{}, operation func(interface{}, Modifier) interface{}) interface{}
// Any returns true if any element matches the predicate
Any(predicate func(Modifier) bool) bool
}
type Element ¶
type Element interface {
// Create creates a new Chain Node instance
Create() Node
// Update updates an existing Chain node for efficiency
Update(node Node)
// Equals checks if this element is equivalent to another
// used during filter operations like Modifier.Any
Equals(other Element) bool
}
Element represents a modifier that can be applied to create a Node
type ElementStore ¶
type ElementStore interface {
SetElement(string, Element) ElementStore
GetElement(string) maybe.Maybe[Element]
}
var EmptyElementStore ElementStore = NewElementStore()
func NewElementStore ¶
func NewElementStore() ElementStore
type InspectableModifier ¶
type InspectableModifier interface {
Modifier
InspectorInfo() *InspectorInfo
Unwrap() Modifier
}
func NewInspectableModifier ¶
func NewInspectableModifier(m Modifier, inspectorInfo *InspectorInfo) InspectableModifier
type InspectorInfo ¶
func NewInspectorInfo ¶
func NewInspectorInfo(name string, props map[string]any) *InspectorInfo
type Modifier ¶
type Modifier interface {
// Then chains this modifier with another
Then(other Modifier) Modifier
AsChain() ModifierChain
}
The base type of the NodeModifiers Modifier represents a chain of modifier elements
var EmptyModifier Modifier = &emptyModifier{}
EmptyModifier is the empty modifier that does nothing.
func NewModifier ¶
func UnwrapModifier ¶
UnwrapModifier extracts the underlying Modifier from wrapper types
type ModifierAwareComposer ¶
type ModifierChain ¶
type ModifierElement ¶
type ModifierElementChain ¶
Click to show internal directories.
Click to hide internal directories.