@open-rpc/client-js
Preparing search index...
WebSocketTransport
Class WebSocketTransport
Hierarchy
Transport
WebSocketTransport
Index
Constructors
constructor
Properties
connection
transport
Request
Manager
uri
Methods
close
connect
parse
Data
send
Data
subscribe
unsubscribe
Constructors
constructor
new
WebSocketTransport
(
uri
:
string
)
:
WebSocketTransport
Parameters
uri
:
string
Returns
WebSocketTransport
Properties
connection
connection
:
WebSocket
Protected
transport
Request
Manager
transportRequestManager
:
TransportRequestManager
uri
uri
:
string
Methods
close
close
()
:
void
Returns
void
connect
connect
()
:
Promise
<
any
>
Returns
Promise
<
any
>
Protected
parse
Data
parseData
(
data
:
JSONRPCRequestData
,
)
:
|
IJSONRPCRequest
|
IJSONRPCNotification
|
(
IJSONRPCRequest
|
IJSONRPCNotification
)
[]
Parameters
data
:
JSONRPCRequestData
Returns
|
IJSONRPCRequest
|
IJSONRPCNotification
|
(
IJSONRPCRequest
|
IJSONRPCNotification
)
[]
send
Data
sendData
(
data
:
JSONRPCRequestData
,
timeout
?:
null
|
number
)
:
Promise
<
any
>
Parameters
data
:
JSONRPCRequestData
timeout
:
null
|
number
= 5000
Returns
Promise
<
any
>
subscribe
subscribe
(
event
:
keyof
ITransportEvents
,
handler
:
|
(
(
data
:
JSONRPCError
)
=>
void
)
|
(
(
data
:
JSONRPCRequestData
)
=>
void
)
|
(
(
data
:
IJSONRPCNotificationResponse
)
=>
void
)
|
(
(
data
:
IJSONRPCResponse
)
=>
void
)
,
)
:
void
Parameters
event
:
keyof
ITransportEvents
handler
:
|
(
(
data
:
JSONRPCError
)
=>
void
)
|
(
(
data
:
JSONRPCRequestData
)
=>
void
)
|
(
(
data
:
IJSONRPCNotificationResponse
)
=>
void
)
|
(
(
data
:
IJSONRPCResponse
)
=>
void
)
Returns
void
unsubscribe
unsubscribe
(
event
?:
keyof ITransportEvents
,
handler
?:
|
(
(
data
:
JSONRPCError
)
=>
void
)
|
(
(
data
:
JSONRPCRequestData
)
=>
void
)
|
(
(
data
:
IJSONRPCNotificationResponse
)
=>
void
)
|
(
(
data
:
IJSONRPCResponse
)
=>
void
)
,
)
:
undefined
|
EventEmitter
<
DefaultEventMap
>
Parameters
Optional
event
: keyof ITransportEvents
Optional
handler
:
|
(
(
data
:
JSONRPCError
)
=>
void
)
|
(
(
data
:
JSONRPCRequestData
)
=>
void
)
|
(
(
data
:
IJSONRPCNotificationResponse
)
=>
void
)
|
(
(
data
:
IJSONRPCResponse
)
=>
void
)
Returns
undefined
|
EventEmitter
<
DefaultEventMap
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
connection
transport
Request
Manager
uri
Methods
close
connect
parse
Data
send
Data
subscribe
unsubscribe
@open-rpc/client-js
Loading...