Documentation
¶
Index ¶
- Constants
- func Expose(name string, fn func())
- func ExposeEvent(name string, fn func(Value))
- func ExposeFunc(name string, fn func(this Value, args []Value) any)
- func RAF(cb Func)
- func RequestAnimationFrame(cb Func)
- func Set(name string, v any)
- func Stack() string
- func TypedArrayOf(slice any) jst.Value
- type Array
- type Dict
- type Func
- type Type
- type Value
- func Call(name string, args ...any) Value
- func Console() Value
- func CustomEvent() Value
- func Doc() Value
- func Document() Value
- func Error() Value
- func Fetch(args ...any) Value
- func Float32Array() Value
- func Get(name string) Value
- func Global() Value
- func History() Value
- func Image() Value
- func IntersectionObserver() Value
- func JSON() Value
- func LS() Value
- func Loc() Value
- func LocalStorage() Value
- func Location() Value
- func Math() Value
- func MutationObserver() Value
- func Null() Value
- func Object() Value
- func Perf() Value
- func Performance() Value
- func RegExp() Value
- func Uint8Array() Value
- func Uint16Array() Value
- func Undefined() Value
- func ValueOf(v any) Value
- func WebAssembly() Value
- func Win() Value
- func Window() Value
Constants ¶
const ( TypeUndefined = jst.TypeUndefined TypeNull = jst.TypeNull TypeBoolean = jst.TypeBoolean TypeNumber = jst.TypeNumber TypeString = jst.TypeString TypeSymbol = jst.TypeSymbol TypeObject = jst.TypeObject TypeFunction = jst.TypeFunction )
Re-exported Value type constants.
Variables ¶
This section is empty.
Functions ¶
func Expose ¶
func Expose(name string, fn func())
Expose registers a no-argument Go function under the given name on the JavaScript global object.
func ExposeEvent ¶
ExposeEvent registers a Go function that receives the first argument from the JavaScript call as the event object.
func ExposeFunc ¶
ExposeFunc registers a Go function with custom arguments on the JavaScript global object.
func RequestAnimationFrame ¶
func RequestAnimationFrame(cb Func)
RequestAnimationFrame wraps the requestAnimationFrame global function.
func Stack ¶
func Stack() string
Stack returns the current JavaScript stack trace using Error().stack.
func TypedArrayOf ¶
TypedArrayOf converts a Go slice to a JavaScript typed array.
Types ¶
type Array ¶
type Array struct{ Value }
Array represents a JavaScript Array instance.
type Dict ¶
type Dict struct{ Value }
Dict represents a plain JavaScript object with string keys.
type Value ¶
Type aliases to re-export syscall/js types.
func IntersectionObserver ¶
func IntersectionObserver() Value
IntersectionObserver returns the IntersectionObserver constructor.
func MutationObserver ¶
func MutationObserver() Value
MutationObserver returns the MutationObserver constructor.