1 //:build !wasm
2
3 package ws
4
5 // Dial opens a WebSocket connection. Callbacks are JS callback IDs
6 // from dom.RegisterCallback. Returns connection handle.
7 func Dial(url string, onMessage func(int32, string), onOpen func(int32), onClose func(int32, int32, string), onError func(int32)) (c Conn) {
8 panic("jsbridge")
9 }
10
11 // Send sends a string message. Returns true if sent.
12 func Send(conn Conn, msg string) (ok bool) { panic("jsbridge") }
13
14 // Close closes the connection.
15 func Close(conn Conn) { panic("jsbridge") }
16
17 // ReadyState returns the WebSocket readyState.
18 // 0=CONNECTING, 1=OPEN, 2=CLOSING, 3=CLOSED, -1=invalid
19 func ReadyState(conn Conn) (n int32) { panic("jsbridge") }
20