utils

package
v0.0.0-...-782a2d6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(v interface{}, object js.Value) error

func BindFunction

func BindFunction(tag string, fptr reflect.Type, object js.Value, value interface{}, index int) error

func BindValue

func BindValue(v interface{}, object js.Value) error

func Functions

func Functions(v interface{}) []reflect.Method

func IsFunction

func IsFunction(tag string) (string, bool)

func IsProperty

func IsProperty(tag string) (string, bool)

func IsStructurePtr

func IsStructurePtr(v interface{}) error

func Keys

func Keys(obj js.Value) []string

func MatchInputs

func MatchInputs(method reflect.Method, inputs []reflect.Type) error

func Members

func Members(v interface{}) []reflect.StructField

Types

type Document

type Document struct {
	Node
	Body          func() *HtmlElement       `wasm:"body"`
	CreateElement func(string) *HtmlElement `wasm:"createElement()"`
}

func (Document) JSValue

func (obj Document) JSValue() js.Value

type Global

type Global struct {
	Node
	Window func() *Window `wasm:"window"`
}

func (Global) JSValue

func (obj Global) JSValue() js.Value

type HtmlCollection

type HtmlCollection struct {
	Node
	Length    func() int             `wasm:"length"`
	Item      func(int) *HtmlElement `wasm:"item"`
	NamedItem func(int) *HtmlElement `wasm:"namedItem"`
}

func (HtmlCollection) JSValue

func (obj HtmlCollection) JSValue() js.Value

type HtmlElement

type HtmlElement struct {
	Node
	InnerHtml    func() string      `wasm:"innerHTML"`
	SetInnerHtml func(string)       `wasm:"innerHTML"`
	AppendChild  func(*HtmlElement) `wasm:"appendChild()"`
}

func (HtmlElement) JSValue

func (obj HtmlElement) JSValue() js.Value

type Location

type Location struct {
	Node
	HRef     func() string `wasm:"href"`
	Origin   func() string `wasm:"origin"`
	Protocol func() string `wasm:"protocol"`
	Host     func() string `wasm:"host"`
	Hostname func() string `wasm:"hostname"`
	Port     func() string `wasm:"port"`
	Pathname func() string `wasm:"pathname"`
	Search   func() string `wasm:"search"`
	Hash     func() string `wasm:"hash"`
	Assign   func(string)  `wasm:"assign()"`
	Replace  func(string)  `wasm:"replace()"`
	Reload   func(bool)    `wasm:"reload()"`
}

func (Location) JSValue

func (obj Location) JSValue() js.Value

type Node

type Node struct {
	js.Value
}

func (Node) JSValue

func (obj Node) JSValue() js.Value

type Window

type Window struct {
	Node
	Document func() *Document  `wasm:"document"`
	Location func() *Location  `wasm:"location"`
	Alert    func(interface{}) `wasm:"alert()"`
}

func (Window) JSValue

func (obj Window) JSValue() js.Value

Jump to

Keyboard shortcuts

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