AIRI Server API - v0.10.2
Preparing search index...
server-sdk/src
Client
Class Client<C>
Type Parameters
C
=
undefined
Index
Constructors
constructor
Accessors
connection
Status
is
Ready
is
Socket
Open
last
Error
Methods
connect
ready
ensure
Connected
on
Connection
State
Change
on
Event
off
Event
send
send
Or
Throw
send
Raw
close
Constructors
constructor
new
Client
<
C
=
undefined
>
(
options
:
ClientOptions
<
C
>
)
:
Client
<
C
>
Type Parameters
C
=
undefined
Parameters
options
:
ClientOptions
<
C
>
Returns
Client
<
C
>
Accessors
connection
Status
get
connectionStatus
()
:
ClientStatus
Returns
ClientStatus
is
Ready
get
isReady
()
:
boolean
Returns
boolean
is
Socket
Open
get
isSocketOpen
()
:
boolean
Returns
boolean
last
Error
get
lastError
()
:
Error
|
undefined
Returns
Error
|
undefined
Methods
connect
connect
(
options
?:
ConnectOptions
)
:
Promise
<
void
>
Parameters
Optional
options
:
ConnectOptions
Returns
Promise
<
void
>
ready
ready
(
options
?:
ConnectOptions
)
:
Promise
<
void
>
Parameters
Optional
options
:
ConnectOptions
Returns
Promise
<
void
>
ensure
Connected
ensureConnected
(
options
?:
ConnectOptions
)
:
Promise
<
void
>
Parameters
Optional
options
:
ConnectOptions
Returns
Promise
<
void
>
on
Connection
State
Change
onConnectionStateChange
(
callback
:
(
context
:
ClientStateChangeContext
)
=>
void
,
)
:
()
=>
void
Parameters
callback
:
(
context
:
ClientStateChangeContext
)
=>
void
Returns
()
=>
void
on
Event
onEvent
<
E
extends
keyof
WebSocketEvents
<
C
>
>
(
event
:
E
,
callback
:
(
data
:
WebSocketBaseEvent
<
E
,
WebSocketEvents
<
C
>
[
E
]
>
,
)
=>
void
|
Promise
<
void
>
,
)
:
()
=>
void
Type Parameters
E
extends
keyof
WebSocketEvents
<
C
>
Parameters
event
:
E
callback
:
(
data
:
WebSocketBaseEvent
<
E
,
WebSocketEvents
<
C
>
[
E
]
>
)
=>
void
|
Promise
<
void
>
Returns
()
=>
void
off
Event
offEvent
<
E
extends
keyof
WebSocketEvents
<
C
>
>
(
event
:
E
,
callback
?:
(
data
:
WebSocketBaseEvent
<
E
,
WebSocketEvents
<
C
>
[
E
]
>
,
)
=>
void
|
Promise
<
void
>
,
)
:
void
Type Parameters
E
extends
keyof
WebSocketEvents
<
C
>
Parameters
event
:
E
Optional
callback
:
(
data
:
WebSocketBaseEvent
<
E
,
WebSocketEvents
<
C
>
[
E
]
>
)
=>
void
|
Promise
<
void
>
Returns
void
send
send
(
data
:
WebSocketEventOptionalSource
<
C
>
)
:
boolean
Parameters
data
:
WebSocketEventOptionalSource
<
C
>
Returns
boolean
send
Or
Throw
sendOrThrow
(
data
:
WebSocketEventOptionalSource
<
C
>
)
:
void
Parameters
data
:
WebSocketEventOptionalSource
<
C
>
Returns
void
send
Raw
sendRaw
(
data
:
string
|
ArrayBufferLike
|
ArrayBufferView
<
ArrayBufferLike
>
,
)
:
boolean
Parameters
data
:
string
|
ArrayBufferLike
|
ArrayBufferView
<
ArrayBufferLike
>
Returns
boolean
close
close
()
:
void
Returns
void
Settings
Member Visibility
Inherited
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Accessors
connection
Status
is
Ready
is
Socket
Open
last
Error
Methods
connect
ready
ensure
Connected
on
Connection
State
Change
on
Event
off
Event
send
send
Or
Throw
send
Raw
close
AIRI Server API - v0.10.2
Loading...