internal

package
v0.0.0-...-6902453 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderToString

func RenderToString(w io.Writer, n VNodeAccessor, optFns ...RenderOptionFunc)

func SameComponent

func SameComponent(type1 Component, type2 Component) bool

func UseHook

func UseHook[T Hook](v VNodeAccessor, h T) T

Types

type BuildContext

type BuildContext interface {
	context.Context

	ChildVNodes() []VNode
	Modifiers() modifier.Modifiers
}

type BuildContextAccessor

type BuildContextAccessor interface {
	VNode() VNodeAccessor
	RawContext() context.Context
}

type Component

type Component interface {
	Build(BuildContext) VNode
}

type ComponentWrapper

type ComponentWrapper interface {
	Component
	Wrap(v VNode) Component
}

type ContextProvider

type ContextProvider interface {
	GetChildContext(ctx context.Context) context.Context
}

type EffectHook

type EffectHook struct {
	Setup func() func()
	Deps  []any
	// contains filtered or unexported fields
}

func (*EffectHook) Commit

func (h *EffectHook) Commit()

func (*EffectHook) Destroy

func (h *EffectHook) Destroy()

func (*EffectHook) String

func (h *EffectHook) String() string

func (*EffectHook) UpdateHook

func (h *EffectHook) UpdateHook(next Hook)

type Element

type ElementComponent

type ElementComponent struct{}

func (ElementComponent) Build

func (ElementComponent) Build(ctx BuildContext) VNode

type ElementCreator

type ElementCreator interface {
	New(ctx context.Context) Element
}

type ElementPainter

type ElementPainter interface {
	Layout(gtx layout.Context) layout.Dimensions
}

type ElementPatcher

type ElementPatcher interface {
	Update(ctx context.Context, modifiers ...modifier.Modifier[any]) bool
}

type Fragment

type Fragment struct{}

func (Fragment) Build

func (f Fragment) Build(BuildContext) VNode

type Hook

type Hook interface {
	UpdateHook(next Hook)
}

type HookAsyncCommitter

type HookAsyncCommitter interface {
	CommitAsync()
}

type HookCommitter

type HookCommitter interface {
	Commit()
}

type HookDestroyer

type HookDestroyer interface {
	Destroy()
}

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

func (*Hooks) CommitAsync

func (hs *Hooks) CommitAsync()

func (*Hooks) Reset

func (hs *Hooks) Reset()

type MemoHook

type MemoHook[T any] struct {
	Setup func() T
	Deps  []any
	// contains filtered or unexported fields
}

func (*MemoHook[T]) Memorised

func (h *MemoHook[T]) Memorised() T

func (*MemoHook[T]) String

func (h *MemoHook[T]) String() string

func (*MemoHook[T]) UpdateHook

func (h *MemoHook[T]) UpdateHook(next Hook)

type Portal

type Portal struct{}

func (Portal) Build

func (Portal) Build(c BuildContext) VNode

func (Portal) IsRoot

func (Portal) IsRoot() bool

type Provider

type Provider func(ctx context.Context) context.Context

func (Provider) Build

func (Provider) Build(c BuildContext) VNode

func (Provider) GetChildContext

func (p Provider) GetChildContext(ctx context.Context) context.Context

type RefHook

type RefHook[T any] struct {
	Current T
}

func (*RefHook[T]) String

func (s *RefHook[T]) String() string

func (RefHook[T]) UpdateHook

func (RefHook[T]) UpdateHook(next Hook)

type RenderOptionFunc

type RenderOptionFunc = func(w *printer)

func WithPretty

func WithPretty(pretty bool) RenderOptionFunc

func WithPtr

func WithPtr(ptr bool) RenderOptionFunc

type StateHook

type StateHook[T comparable] struct {
	State         T
	OnStateChange func()
	// contains filtered or unexported fields
}

func (*StateHook[T]) CleanTimer

func (s *StateHook[T]) CleanTimer()

func (*StateHook[T]) Commit

func (s *StateHook[T]) Commit()

func (*StateHook[T]) CommitAsync

func (s *StateHook[T]) CommitAsync()

func (*StateHook[T]) Destroy

func (s *StateHook[T]) Destroy()

func (*StateHook[T]) Mount

func (s *StateHook[T]) Mount()

func (*StateHook[T]) String

func (s *StateHook[T]) String() string

func (*StateHook[T]) Update

func (s *StateHook[T]) Update(v T)

func (*StateHook[T]) UpdateFunc

func (s *StateHook[T]) UpdateFunc(fn func(prev T) T)

func (*StateHook[T]) UpdateHook

func (s *StateHook[T]) UpdateHook(next Hook)

func (*StateHook[T]) Value

func (s *StateHook[T]) Value() T

type VNode

type VNode interface {
	Children(vnodes ...VNode) VNode
}

func H

func H(component Component, modifiers ...modifier.Modifier[any]) VNode

type VNodeAccessor

type VNodeAccessor interface {
	String() string
	Key() any
	SetKey(key any)

	Type() Component
	Modifiers() modifier.Modifiers
	ChildVNodes() []VNode

	PutChildVNodes(childVNodes ...VNode)
	ReplaceChildVNodeAccessor(old VNodeAccessor, new VNodeAccessor)
	ChildVNodeAccessors() []VNodeAccessor

	Parent() VNodeAccessor
	IsRoot() bool
	Node() node.Node

	BindNode(n node.Node)
	BindParent(va VNodeAccessor)

	OnMount(fn func(ctx context.Context, va VNodeAccessor))
	OnUpdate(fn func(ctx context.Context, va VNodeAccessor, old VNodeAccessor))

	WillRender(oldVNode VNodeAccessor)
	Update(ctx context.Context)
	DidMount(ctx context.Context)

	Use(hook Hook) Hook
	Hooks() Hooks
	Destroy() error
	CommitAsync()
}

type VNodeModifier

type VNodeModifier interface {
	VNodeOnly()
}

Jump to

Keyboard shortcuts

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