WebPubSubGroup interface
Properties
api |
The Web PubSub API version being used by this client |
endpoint | The Web PubSub endpoint this client is connected to |
group |
The name of this group |
hub |
The name of the hub this group belongs to |
Methods
add |
Add a specific connection to this group |
add |
Add a user to this group |
close |
Close all connections to the group |
remove |
Remove a specific connection from this group |
remove |
Remove a user from this group |
send |
Send a json message to every connection in this group |
send |
Send a binary message to every connection in this group |
send |
Send a text message to every connection in this group |
Property Details
apiVersion
The Web PubSub API version being used by this client
apiVersion: string
Property Value
string
endpoint
The Web PubSub endpoint this client is connected to
endpoint: string
Property Value
string
groupName
The name of this group
groupName: string
Property Value
string
hubName
The name of the hub this group belongs to
hubName: string
Property Value
string
Method Details
addConnection(string, GroupAddConnectionOptions)
Add a specific connection to this group
function addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>
Parameters
- connectionId
-
string
The connection id to add to this group
- options
- GroupAddConnectionOptions
Additional options
Returns
Promise<void>
addUser(string, GroupAddUserOptions)
Add a user to this group
function addUser(username: string, options?: GroupAddUserOptions): Promise<void>
Parameters
- username
-
string
The user name to add
- options
- GroupAddUserOptions
Additional options
Returns
Promise<void>
closeAllConnections(GroupCloseAllConnectionsOptions)
Close all connections to the group
function closeAllConnections(options?: GroupCloseAllConnectionsOptions): Promise<void>
Parameters
- options
- GroupCloseAllConnectionsOptions
Additional options
Returns
Promise<void>
removeConnection(string, GroupRemoveConnectionOptions)
Remove a specific connection from this group
function removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>
Parameters
- connectionId
-
string
The connection id to remove from this group
- options
- GroupRemoveConnectionOptions
Additional options
Returns
Promise<void>
removeUser(string, GroupRemoveUserOptions)
Remove a user from this group
function removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>
Parameters
- username
-
string
The user name to remove
- options
- GroupRemoveUserOptions
Additional options
Returns
Promise<void>
sendToAll(JSONTypes, GroupSendToAllOptions)
Send a json message to every connection in this group
function sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>
Parameters
- message
- JSONTypes
The message to send
- options
- GroupSendToAllOptions
Additional options
Returns
Promise<void>
sendToAll(RequestBodyType, GroupSendToAllOptions)
Send a binary message to every connection in this group
function sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>
Parameters
- message
- RequestBodyType
The binary message to send
- options
- GroupSendToAllOptions
Additional options
Returns
Promise<void>
sendToAll(string, GroupSendTextToAllOptions)
Send a text message to every connection in this group
function sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>
Parameters
- message
-
string
The message to send
- options
- GroupSendTextToAllOptions
Additional options
Returns
Promise<void>