Preparing search index...
The search index is not available
live-js
live-js
<internal>
WebSocketClient
Class WebSocketClient<WSCommand>
Type Parameters
WSCommand
Hierarchy
EventTarget
<
WebsocketEventMap
<
WSCommand
>
>
WebSocketClient
Index
Constructors
constructor
Properties
_listeners
off
on
Accessors
is
Connected
Methods
_dispatch
Event
add
Event
Listener
clear
Session
Key
connect
once
process
Command
remove
All
Event
Listeners
remove
Event
Listener
set
Session
Key
Constructors
constructor
new
Web
Socket
Client
<
WSCommand
>
(
_ctx
:
WebsocketClientContext
<
WSCommand
>
)
:
WebSocketClient
<
WSCommand
>
Type Parameters
WSCommand
Parameters
_ctx:
WebsocketClientContext
<
WSCommand
>
Returns
WebSocketClient
<
WSCommand
>
Properties
Protected
_listeners
_listeners
:
{
command
?:
EventListener
<
{
args
:
[
WSCommand
]
}
>
[]
;
error
?:
EventListener
<
{
args
:
[
Error
]
}
>
[]
}
= {}
Type declaration
Optional
command
?:
EventListener
<
{
args
:
[
WSCommand
]
}
>
[]
Optional
error
?:
EventListener
<
{
args
:
[
Error
]
}
>
[]
off
off
:
(
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
=>
void
)
= ...
Type declaration
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
:
void
Type Parameters
K
extends
keyof
WebsocketEventMap
<
WSCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
Returns
void
on
on
:
(
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
=>
(
(
)
=>
void
)
)
= ...
Type declaration
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
:
(
(
)
=>
void
)
Type Parameters
K
extends
keyof
WebsocketEventMap
<
WSCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
Returns
(
(
)
=>
void
)
(
)
:
void
Returns
void
Accessors
is
Connected
get
isConnected
(
)
:
boolean
Returns
boolean
Methods
Protected
_dispatch
Event
_dispatch
Event
<
K
>
(
type
:
K
,
...
args
:
ArgsType
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
:
void
Type Parameters
K
extends
keyof
WebsocketEventMap
<
WSCommand
>
Parameters
type:
K
Rest
...
args:
ArgsType
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
Returns
void
add
Event
Listener
add
Event
Listener
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
:
(
(
)
=>
void
)
Type Parameters
K
extends
keyof
WebsocketEventMap
<
WSCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
Returns
(
(
)
=>
void
)
(
)
:
void
Returns
void
clear
Session
Key
clear
Session
Key
(
)
:
void
Returns
void
connect
connect
(
)
:
Promise
<
unknown
>
Returns
Promise
<
unknown
>
once
once
<
K
>
(
type
:
K
, givenCb
:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
:
(
(
)
=>
void
)
Type Parameters
K
extends
keyof
WebsocketEventMap
<
WSCommand
>
Parameters
type:
K
givenCb:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
Returns
(
(
)
=>
void
)
(
)
:
void
Returns
void
process
Command
process
Command
(
command
:
WSCommand
)
:
void
Parameters
command:
WSCommand
Returns
void
remove
All
Event
Listeners
remove
All
Event
Listeners
(
)
:
void
Returns
void
remove
Event
Listener
remove
Event
Listener
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
)
:
void
Type Parameters
K
extends
keyof
WebsocketEventMap
<
WSCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
WSCommand
>
[
K
]
>
Returns
void
set
Session
Key
set
Session
Key
(
sessionKey
:
string
)
:
void
Parameters
sessionKey:
string
Returns
void
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
Modules
live-
js
<internal>
Web
Socket
Client
constructor
_listeners
off
on
is
Connected
_dispatch
Event
add
Event
Listener
clear
Session
Key
connect
once
process
Command
remove
All
Event
Listeners
remove
Event
Listener
set
Session
Key
Generated using
TypeDoc