appshotlex

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

type Range

type Range struct {
	Lower, Upper int64
	Present      bool
}

Range is an optional signed closed range.

type Text

type Text struct {
	Value   string
	Present bool
}

Text distinguishes absent from present-empty constructor text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL