Documentation
¶
Index ¶
- func AsyncFunc(f func(this js.Value, p []js.Value) (any, error)) js.Func
- func Await(promise js.Value) (val js.Value, err error)
- func JsArrayToSlice(jsArray js.Value) []byte
- func Promise() (promise js.Value, resolve func(args ...any), reject func(args ...any))
- func ReleaseMap(m map[string]any)
- func SliceToJsArray(slice []byte) js.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsyncFunc ¶
(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 ¶
(AI GENERATED DESCRIPTION): Blocks until the given JavaScript Promise settles, returning the resolved value or an error.
func JsArrayToSlice ¶
(AI GENERATED DESCRIPTION): Converts a JavaScript ArrayBuffer or Uint8Array into a Go `[]byte` slice by copying its bytes.
func Promise ¶
(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 ¶
(AI GENERATED DESCRIPTION): Iterates over the map values and releases any js.Func instances it contains.
func SliceToJsArray ¶
(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.