js

package
v0.0.0-...-f902c1e Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

View Source
var (
	NULL      = js.Null()
	Undefined = js.Undefined()
)

Functions

func Alert

func Alert(msg string)

func Dial

func Dial(addr string) (net.Conn, error)

func DialWithContext

func DialWithContext(ctx context.Context, addr string) (_ net.Conn, gerr error)

func NewError

func NewError(e JsValue) error

Types

type Error

type Error = js.Error

type EventType

type EventType = int

type JsFunc

type JsFunc = js.Func

func AsyncCallbackOf

func AsyncCallbackOf(fn func(v []JsValue)) JsFunc

func JsCallbackOf

func JsCallbackOf(fn func(v []JsValue)) JsFunc

func JsFuncOf

func JsFuncOf(fn TJsFunc) JsFunc

type JsObj

type JsObj = map[string]interface{}

type JsPromise

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

func JsPromiseInstance

func JsPromiseInstance(v JsValue) *JsPromise

func (*JsPromise) JsAwait

func (p *JsPromise) JsAwait() ([]JsValue, error)

func (*JsPromise) JsAwaitContext

func (p *JsPromise) JsAwaitContext(ctx context.Context) ([]JsValue, error)

func (*JsPromise) JsValue

func (p *JsPromise) JsValue() JsValue

type JsValue

type JsValue = js.Value

func Global

func Global() JsValue

func JsClass

func JsClass(class string, path ...string) JsValue

func JsGet

func JsGet(name string, path ...string) JsValue

func JsNativeFuncOf

func JsNativeFuncOf(args ...string) JsValue

func JsNew

func JsNew(class string, args ...interface{}) JsValue

func JsNewPromise

func JsNewPromise(fn func() ([]interface{}, error)) JsValue

func JsValueAwait

func JsValueAwait(v JsValue) ([]JsValue, error)

func JsValueOf

func JsValueOf(o interface{}) JsValue

type JsValueWrapper

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

func (JsValueWrapper) Promised

func (v JsValueWrapper) Promised() *JsPromise

type TJsFunc

type TJsFunc = func(this JsValue, args []JsValue) any

type Wrapper

type Wrapper interface {
	JSVaule() JsValue
}

type WsConn

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

func (*WsConn) Close

func (ws *WsConn) Close() error

func (*WsConn) LocalAddr

func (ws *WsConn) LocalAddr() net.Addr

func (*WsConn) Read

func (ws *WsConn) Read(b []byte) (int, error)

func (*WsConn) RemoteAddr

func (ws *WsConn) RemoteAddr() net.Addr

func (*WsConn) SetDeadline

func (ws *WsConn) SetDeadline(t time.Time) error

func (*WsConn) SetReadDeadline

func (ws *WsConn) SetReadDeadline(t time.Time) error

func (*WsConn) SetWriteDeadline

func (ws *WsConn) SetWriteDeadline(t time.Time) error

func (*WsConn) Write

func (ws *WsConn) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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