dom

package
v0.0.0-...-9989d13 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEventListener

func AddEventListener(node Node, typ string, listener func(event js.Value))

func RemoveNode

func RemoveNode(node Node)

Types

type Canvas

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

Canvas wraps a JS canvas element. Canvas implements Node.

func (*Canvas) Context2D

func (canvas *Canvas) Context2D() (*Context2D, error)

func (*Canvas) SetHeight

func (canvas *Canvas) SetHeight(height int)

func (*Canvas) SetSize

func (canvas *Canvas) SetSize(width, height int)

func (*Canvas) SetWidth

func (canvas *Canvas) SetWidth(width int)

type Context2D

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

func (*Context2D) ClearRect

func (ctx2D *Context2D) ClearRect(x, y, width, height int)

func (*Context2D) DisableImageSmoothing

func (ctx2D *Context2D) DisableImageSmoothing()

func (*Context2D) DrawImage

func (ctx2D *Context2D) DrawImage(image *Image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight int)

func (*Context2D) Size

func (ctx2D *Context2D) Size() (w int, h int)

type Document

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

func (*Document) CreateCanvasElement

func (doc *Document) CreateCanvasElement() (*Canvas, error)

func (*Document) CreateImageElement

func (doc *Document) CreateImageElement(src string) (*Image, error)

func (*Document) GetElementByID

func (doc *Document) GetElementByID(id string) (*Element, error)

type Element

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

func (*Element) AppendChild

func (element *Element) AppendChild(node Node) error

type Image

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

func (*Image) On

func (image *Image) On(load func(), fail func(err interface{}))

type Node

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

type Window

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

func GlobalWindow

func GlobalWindow() (*Window, error)

func (*Window) Document

func (w *Window) Document() (*Document, error)

func (*Window) RequestAnimationFrame

func (w *Window) RequestAnimationFrame(f func())

Jump to

Keyboard shortcuts

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