Preparing search index...
The search index is not available
live-js
live-js
<internal>
CommandRouter
Class CommandRouter
Hierarchy
EventTarget
<
WebsocketEventMap
<
EventCommand
>
>
CommandRouter
Index
Constructors
constructor
Properties
_listeners
api
Client
off
on
ws
Client
Methods
_dispatch
Event
add
Event
Listener
authenticate
connect
Ws
deauthenticate
once
remove
All
Event
Listeners
remove
Event
Listener
send
send
With
Retry
Constructors
constructor
new
Command
Router
(
_ctx
:
Partial
<
ApplicationContext
>
)
:
CommandRouter
Parameters
_ctx:
Partial
<
ApplicationContext
>
Returns
CommandRouter
Properties
Protected
_listeners
_listeners
:
{
command
?:
EventListener
<
{
args
:
[
EventCommand
]
}
>
[]
;
error
?:
EventListener
<
{
args
:
[
Error
]
}
>
[]
}
= {}
Type declaration
Optional
command
?:
EventListener
<
{
args
:
[
EventCommand
]
}
>
[]
Optional
error
?:
EventListener
<
{
args
:
[
Error
]
}
>
[]
api
Client
api
Client
:
APIClient
off
off
:
(
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
)
=>
void
)
= ...
Type declaration
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
)
:
void
Type Parameters
K
extends
keyof
WebsocketEventMap
<
EventCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
Returns
void
on
on
:
(
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
)
=>
(
(
)
=>
void
)
)
= ...
Type declaration
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
)
:
(
(
)
=>
void
)
Type Parameters
K
extends
keyof
WebsocketEventMap
<
EventCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
Returns
(
(
)
=>
void
)
(
)
:
void
Returns
void
ws
Client
ws
Client
:
WebSocketClient
<
EventCommand
>
Methods
Protected
_dispatch
Event
_dispatch
Event
<
K
>
(
type
:
K
,
...
args
:
ArgsType
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
)
:
void
Type Parameters
K
extends
keyof
WebsocketEventMap
<
EventCommand
>
Parameters
type:
K
Rest
...
args:
ArgsType
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
Returns
void
add
Event
Listener
add
Event
Listener
<
K
>
(
type
:
K
, callback
:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
)
:
(
(
)
=>
void
)
Type Parameters
K
extends
keyof
WebsocketEventMap
<
EventCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
Returns
(
(
)
=>
void
)
(
)
:
void
Returns
void
authenticate
authenticate
(
__namedParameters
:
AuthOption
)
:
Promise
<
void
>
Parameters
__namedParameters:
AuthOption
Returns
Promise
<
void
>
connect
Ws
connect
Ws
(
)
:
Promise
<
unknown
>
Returns
Promise
<
unknown
>
deauthenticate
deauthenticate
(
)
:
void
Returns
void
once
once
<
K
>
(
type
:
K
, givenCb
:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
)
:
(
(
)
=>
void
)
Type Parameters
K
extends
keyof
WebsocketEventMap
<
EventCommand
>
Parameters
type:
K
givenCb:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
Returns
(
(
)
=>
void
)
(
)
:
void
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
<
EventCommand
>
[
K
]
>
)
:
void
Type Parameters
K
extends
keyof
WebsocketEventMap
<
EventCommand
>
Parameters
type:
K
callback:
EventListener
<
WebsocketEventMap
<
EventCommand
>
[
K
]
>
Returns
void
send
send
(
req
:
APICommand
)
:
Promise
<
any
>
Parameters
req:
APICommand
Returns
Promise
<
any
>
send
With
Retry
send
With
Retry
(
req
:
APICommand
, strategy
?:
RetryStrategy
, meta
?:
{
count
:
number
;
deferred
:
Deferred
<
any
>
}
)
:
Promise
<
any
>
Parameters
req:
APICommand
strategy:
RetryStrategy
= ...
meta:
{
count
:
number
;
deferred
:
Deferred
<
any
>
}
= ...
count
:
number
deferred
:
Deferred
<
any
>
Returns
Promise
<
any
>
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
Modules
live-
js
<internal>
Command
Router
constructor
_listeners
api
Client
off
on
ws
Client
_dispatch
Event
add
Event
Listener
authenticate
connect
Ws
deauthenticate
once
remove
All
Event
Listeners
remove
Event
Listener
send
send
With
Retry
Generated using
TypeDoc