[]
Represents a collaboration connection on the server.
• new Connection()
• get
auth(): Object
Retrieves the authentication data of the connection.
Object
The authentication data associated with the connection.
• get
id(): string
Retrieves the unique identifier of the connection.
string
The connection's ID.
• get
query(): Record
<string
, unknown
>
Retrieves the query parameters of the connection.
Record
<string
, unknown
>
The query parameters of the connection.
• get
roomId(): string
Retrieves the room identifier of the connection.
string
The room ID associated with the connection.
• get
tags(): Map
<string
, unknown
>
Retrieves the custom data saved for the connection.
Map
<string
, unknown
>
A map of custom tags for the connection.
▸ broadcast(data
, type?
, includeSelf?
): void
Broadcasts a message to all connections in the room.
Name | Type | Description |
---|---|---|
data |
unknown |
The message data to broadcast. |
type? |
MessageType |
- |
includeSelf? |
boolean |
- |
void
▸ close(): void
Closes the connection.
void
▸ send(data
, type?
): void
Sends a message to the client.
Name | Type | Description |
---|---|---|
data |
unknown |
The message data to send. |
type? |
MessageType |
- |
void