js

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncFunc

func AsyncFunc(f func(this js.Value, p []js.Value) (any, error)) js.Func

(AI GENERATED DESCRIPTION): Creates a JavaScript function that runs the supplied Go function asynchronously and returns a Promise that resolves with its result or rejects with its error.

func Await

func Await(promise js.Value) (val js.Value, err error)

(AI GENERATED DESCRIPTION): Blocks until the given JavaScript Promise settles, returning the resolved value or an error.

func JsArrayToSlice

func JsArrayToSlice(jsArray js.Value) []byte

(AI GENERATED DESCRIPTION): Converts a JavaScript ArrayBuffer or Uint8Array into a Go `[]byte` slice by copying its bytes.

func Promise

func Promise() (promise js.Value, resolve func(args ...any), reject func(args ...any))

(AI GENERATED DESCRIPTION): Creates a new JavaScript Promise, returning the Promise object and Go-wrapped `resolve` and `reject` functions to fulfill or reject it.

func ReleaseMap

func ReleaseMap(m map[string]any)

(AI GENERATED DESCRIPTION): Iterates over the map values and releases any js.Func instances it contains.

func SliceToJsArray

func SliceToJsArray(slice []byte) js.Value

(AI GENERATED DESCRIPTION): Converts a Go byte slice into a JavaScript Uint8Array, enabling the byte data to be passed to JavaScript from WebAssembly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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