Documentation
¶
Overview ¶
Package appshotlex renders prepared, handle-free native appshot rows. Unicode facts must be supplied by the qualified Swift preparer.
Example ¶
package main
import (
"fmt"
"github.com/tmc/axmcp/internal/appshotlex"
)
func main() {
n := appshotlex.NativeNode{State: appshotlex.NativeState{Context: 2, Kind: 8, Enabled: true, RoleDescription: appshotlex.Text{Present: true}}}
row, err := appshotlex.Row(n)
fmt.Println(row, err)
}
Output: row <nil>
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalid = errors.New("invalid native lexical state")
ErrInvalid reports malformed scalar or prepared state.
Functions ¶
func Row ¶
func Row(n NativeNode) (string, error)
Row renders the source lexical row before subset detail or indentation. Empty output means render omission; descendants are admitted independently.
Example ¶
package main
import (
"fmt"
"github.com/tmc/axmcp/internal/appshotlex"
)
func main() {
row, err := appshotlex.Row(appshotlex.NativeNode{State: appshotlex.NativeState{Context: 2, Kind: 8, RoleDescription: appshotlex.Text{Present: true}}})
fmt.Println(row, err)
}
Output: row <nil>
func Validate ¶
func Validate(n NativeNode) error
Validate checks prepared shape. It cannot authenticate Swift facts; capture's private preparer is responsible for equality, prefix and Character semantics.
Example ¶
package main
import (
"fmt"
"github.com/tmc/axmcp/internal/appshotlex"
)
func main() {
fmt.Println(appshotlex.Validate(appshotlex.NativeNode{State: appshotlex.NativeState{Context: 2}}))
}
Output: <nil>
func ValidateState ¶
func ValidateState(s NativeState) error
ValidateState checks scalar shape, not provenance or capture resource limits.
Example ¶
package main
import (
"fmt"
"github.com/tmc/axmcp/internal/appshotlex"
)
func main() {
fmt.Println(appshotlex.ValidateState(appshotlex.NativeState{Context: 2}))
}
Output: <nil>
Types ¶
type NativeNode ¶
type NativeNode struct {
State NativeState
Payload []PayloadFact
ValueTypeIsString, IdentifierExcluded bool
}
NativeNode is the immutable result of qualified preparation after transforms.
type NativeState ¶
type NativeState struct {
Context, Kind uint8
Group, StaticText bool
RoleDescription Text
Title, Description, Help, Value, ValueDescription, Placeholder, Identifier Text
ValueType Text
Selected, Selectable, Enabled, Disclosable, Disclosing, ValueSettable, SentByCurrentUser bool
Rows, Columns Range
SecondaryActions []string
URLDetail Text
}
NativeState contains current constructor scalars before Unicode preparation.
type PayloadFact ¶
type PayloadFact struct {
Kind PayloadKind
Text string
FirstEqual int
SortClass bool
}
PayloadFact preserves original spelling and qualified Swift comparison facts. FirstEqual is the earliest equal candidate index, or this candidate itself. SortClass is Character count below 101 or Foundation Swift LF containment.
func Candidates ¶
func Candidates(s NativeState, excluded bool) ([]PayloadFact, error)
Candidates returns source-order payloads before Unicode deduplication and sort. excluded must be the qualified Swift Identifier prefix result.
Example ¶
package main
import (
"fmt"
"github.com/tmc/axmcp/internal/appshotlex"
)
func main() {
p, err := appshotlex.Candidates(appshotlex.NativeState{Context: 2, Title: appshotlex.Text{Value: "Hello", Present: true}}, false)
fmt.Println(p[0].Text, err)
}
Output: Hello <nil>
type PayloadKind ¶
type PayloadKind uint8
PayloadKind identifies a source payload slot in getter order.
const ( Title PayloadKind = iota Description Rows Columns URL Help Value Details Placeholder Identifier SecondaryActions )
Payload slots follow the native getter order.