Class: Transport
Hierarchy
-
client
↳
Transport
Constructors
constructor
• new Transport(reconnectTimeout?
): Transport
Parameters
Name | Type |
---|---|
reconnectTimeout? | number |
Returns
Overrides
WebSocket.constructor
Properties
MessageTypes
▪ Static
MessageTypes: typeof Type
= Message.Type
connection
• connection: connection
onAction
• Optional
onAction: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onChat
• Optional
onChat: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onEntity
• Optional
onEntity: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onError
• Optional
onError: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onEvent
• Optional
onEvent: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onInit
• Optional
onInit: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onJoin
• Optional
onJoin: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onLeave
• Optional
onLeave: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onLoad
• Optional
onLoad: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onMethod
• Optional
onMethod: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onPeer
• Optional
onPeer: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onTransport
• Optional
onTransport: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onUnload
• Optional
onUnload: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
onUpdate
• Optional
onUpdate: (event
: MessageProtocol
) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
reconnectTimeout
• Optional
reconnectTimeout: number
Methods
connect
▸ connect(address
, secret
): Promise
<void
>
Parameters
Name | Type |
---|---|
address | string |
secret | string |
Returns
Promise
<void
>
Overrides
WebSocket.connect
decodeSync
▸ decodeSync(buffer
): MessageProtocol
Parameters
Name | Type |
---|---|
buffer | any |
Returns
encodeSync
▸ encodeSync(message
): Uint8Array
Parameters
Name | Type |
---|---|
message | any |
Returns
Uint8Array
send
▸ send(event
): void
Parameters
Name | Type |
---|---|
event | MessageProtocol |
Returns
void
tryReconnect
▸ tryReconnect(): void
Returns
void