jsrt

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Code generated by codegen.go; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValueOf

func ValueOf(val any) (ret js.Value)

Types

type CanvasRenderingContext2D added in v0.0.5

type CanvasRenderingContext2D interface {
	ClearRect(x, y, w, h float64)
	FillRect(x, y, w, h float64)
	StrokeRect(x, y, w, h float64)

	FillText(text string, x, y float64)
	FillText1(text string, x, y float64, maxWidth float64)
	StrokeText(text string, x, y float64)
	StrokeText1(text string, x, y float64, maxWidth float64)

	GetLineWidth() float64
	SetLineWidth(float64)
	GetLineCap() string
	SetLineCap(string)
	GetLineJoin() string
	SetLineJoin(string)
	GetMiterLimit() float64
	SetMiterLimit(float64)
	GetLineDash() []float64
	SetLineDash([]float64)
	GetLineDashOffset() float64
	SetLineDashOffset(float64)

	GetFont() string
	SetFont(string)
	GetTextAlign() string
	SetTextAlign(string)
	GetTextBaseline() string
	SetTextBaseline(string)
	GetDirection() string
	SetDirection(string)
	GetLetterSpacing() string
	SetLetterSpacing(string)
	GetFontKerning() string
	SetFontKerning(string)
	GetFontStretch() string
	SetFontStretch(string)
	GetFontVariantCaps() string
	SetFontVariantCaps(string)
	GetTextRendering() string
	SetTextRendering(string)
	GetWordSpacing() string
	SetWordSpacing(string)
	GetLang() string
	SetLang(string)

	GetFillStyle() string
	SetFillStyle(string)
	GetStrokeStyle() string
	SetStrokeStyle(string)

	GetShadowBlur() float64
	SetShadowBlur(float64)
	GetShadowColor() string
	SetShadowColor(string)
	GetShadowOffsetX() float64
	SetShadowOffsetX(float64)
	GetShadowOffsetY() float64
	SetShadowOffsetY(float64)

	BeginPath()
	ClosePath()
	MoveTo(x, y float64)
	LineTo(x, y float64)
	BezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y float64)
	QuadraticCurveTo(cpx, cpy, x, y float64)
	Arc(x, y, r, startAngle, endAngle float64, anticlockwise ...bool)
	ArcTo(x1, y1, x2, y2, r float64)
	Ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle float64, anticlockwise ...bool)
	Rect(x, y, w, h float64)
	RoundRect(x, y, w, h, r float64)

	Fill()
	Stroke()
	// DrawFocusIfNeeded(el any)
	// Clip()
	IsPointInPath(x, y float64) bool
	IsPointInStroke(x, y float64) bool

	// GetTransform() any
	Rotate(angle float64)
	Scale(x, y float64)
	Translate(x, y float64)
	Transform(a, b, c, d, e, f float64)
	SetTransform(a, b, c, d, e, f float64)
	ResetTransform()

	GetGlobalAlpha() float64
	SetGlobalAlpha(float64)
	GetGlobalCompositeOperation() string
	SetGlobalCompositeOperation(string)

	GetImageSmoothingEnabled() bool
	SetImageSmoothingEnabled(bool)
	GetImageSmoothingQuality() string
	SetImageSmoothingQuality(string)

	Save()
	Restore()
	Canvas() HTMLCanvasElement
	GetContextAttributes() CanvasRenderingContext2DAttributes
	Reset()
	IsContextLost() bool

	GetFilter() string
	SetFilter(string)
}

interface covering most of the 2D drawing API. Parameters are deliberately weakly typed to make the wrapper easy to call; more-precise signatures can be added as needed.

type CanvasRenderingContext2DAttributes added in v0.0.5

type CanvasRenderingContext2DAttributes struct {
	Alpha bool

	Desynchronized     bool
	WillReadFrequently bool
	// contains filtered or unexported fields
}

type Console

type Console interface {
	Wrapper

	Clear()
	Debug(data ...any)
	Error(data ...any)
	Info(data ...any)
	Warn(data ...any)
}

https://developer.mozilla.org/en-US/docs/Web/API/console

func GetConsole

func GetConsole() Console

type Document

type Document interface {
	Node

	CreateElement(tagName string) Element // TODO: options param
	CreateTextNode(text string) Text
	GetElementByID(id string) Element
	GetElementsByClassName(names string) HTMLCollection
}

https://developer.mozilla.org/en-US/docs/Web/API/Document

func GetDocument

func GetDocument() Document

type Element

type Element interface {
	Node

	Remove()
	GetClassList() TokenList
	SetID(string)
	GetID() string
	SetInnerHTML(string)
	QuerySelector(string) Element
}

https://developer.mozilla.org/en-US/docs/Web/API/Element

type Event

type Event interface {
	GetBubbles() bool
	GetCancelable() bool
	GetComposed() bool
	GetCurrentTarget() EventTarget
	GetDefaultPrevented() bool
	// GetEventPhase()
	GetIsTrusted() bool
	GetTarget() EventTarget
	// GetTimeStamp()
	GetType() string
}

https://developer.mozilla.org/en-US/docs/Web/API/Event

type EventHandlerFn

type EventHandlerFn func(event Event)

type EventTarget

type EventTarget interface {
	Wrapper

	AddEventListener(eventType string, listener EventHandlerFn) // TODO: opts
}

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget

type HTMLCanvasElement added in v0.0.5

type HTMLCanvasElement interface {
	HTMLElement

	// attributes
	GetWidth() int
	SetWidth(int)
	GetHeight() int
	SetHeight(int)

	// CaptureStream(frameRate ...float64) MediaStream
	GetContext2D(attributes ...CanvasRenderingContext2DAttributes) CanvasRenderingContext2D
	ToDataURL() string
	ToDataURL1(type_ string) string
	ToDataURL2(type_ string, quality float64) string
}

https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement

type HTMLCollection

type HTMLCollection interface {
	GetLength() uint
	Item(index uint) Element
	NamedItem(key string) Element
}

https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection

type HTMLElement

type HTMLElement interface {
	Element
}

type HTMLInputElement

type HTMLInputElement interface {
	HTMLElement

	GetValue() string
	SetValue(string)
}

type KeyboardEvent

type KeyboardEvent interface {
	UIEvent

	GetAltKey() bool
	GetCode() string
	GetCtrlKey() bool
	GetIsComposing() bool
	GetKey() string
	GetLocation() KeyboardEventLocation
	GetMetaKey() bool
	GetRepeat() bool
	GetShiftKey() bool
}

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent

type KeyboardEventLocation

type KeyboardEventLocation uint
const (
	KeyboardEventLocationStandard KeyboardEventLocation = 0x00
	KeyboardEventLocationLeft     KeyboardEventLocation = 0x01
	KeyboardEventLocationRight    KeyboardEventLocation = 0x02
	KeyboardEventLocationNumpad   KeyboardEventLocation = 0x03
)

type Node

type Node interface {
	EventTarget

	AppendChild(child Node) Node

	GetParentElement() Element
	FirstChild() Node
}

https://developer.mozilla.org/en-US/docs/Web/API/Node

type TokenList

type TokenList interface {
	Wrapper

	GetLength() uint
	GetValues() string
	Add(tokens ...string)
	Contains(token string) bool
	// Entries()
	// ForEach()
	Item(index uint) *string
	// Keys()
	Remove(tokens ...string)
	Replace(oldToken string, newToken string) bool
	Supports(token string) bool
}

https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList

type Window added in v0.0.6

type Window interface {
	RequestAnimationFrame(func(timestampMS float64))
}

https://developer.mozilla.org/en-US/docs/Web/API/Window

func GetWindow added in v0.0.6

func GetWindow() Window

type Wrapper

type Wrapper interface {
	Unwrap() js.Value
}

Jump to

Keyboard shortcuts

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