viewmodel

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	Name       string
	Value      string
	Boolean    bool
	Expression bool
	Spread     bool
	Start      int
	End        int
}

Attr is a literal HTML or component attribute.

type Component

type Component struct {
	Name          string
	Package       string
	Uses          map[string]string
	JS            []string
	InlineJS      []InlineScript
	ScopeIDs      []string
	DefaultIsland string
	Props         []string
	PropTypes     map[string]clientlang.ValueType
	PropDefaults  map[string]string
	State         map[string]string
	StateJSON     string
	Handlers      map[string]clientlang.Handler
	HandlersJSON  string
	StateTypes    map[string]clientlang.ValueType
	Refs          map[string]clientlang.Ref
	Emits         map[string]clientlang.Emit
	Exports       map[string]clientlang.ValueType
	Computed      []clientlang.Computed
	Body          string
	Nodes         []Node
}

Component is a literal component template known to the view renderer and generated-output passes.

func (Component) HasProp

func (component Component) HasProp(name string) bool

HasProp reports whether a component declares a prop.

func (Component) HasStateField

func (component Component) HasStateField(name string) bool

HasStateField reports whether a component declares local browser state with the given name.

func (Component) Identity

func (component Component) Identity() string

Identity is the package-qualified component identity used for compiler-time resolution and recursion checks. The public call name can be an import alias.

func (Component) PropType

func (component Component) PropType(name string) clientlang.ValueType

PropType returns the declared scalar type for a prop. Components constructed by older tests only populate Props; those props remain string-typed.

type ComponentCall

type ComponentCall struct {
	Name     string
	Attrs    []Attr
	Children []Node
	Start    int
	End      int
}

ComponentCall invokes a parsed component with literal or expression props.

type Element

type Element struct {
	Name     string
	Attrs    []Attr
	Children []Node
	Start    int
	End      int
}

Element is a lowercase HTML element in a parsed view tree.

type InlineScript

type InlineScript struct {
	Name string
	Body string
}

InlineScript records browser module code declared directly inside a component source file.

type Node

type Node interface {
	// contains filtered or unexported methods
}

Node is a parsed view markup node.

type Text

type Text struct {
	Value string
	Start int
	End   int
}

Text is escaped text content.

Jump to

Keyboard shortcuts

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