playground / Exports / PlaygroundWebSocketClient
Class: PlaygroundWebSocketClient
WebSocket client for Playground real-time communication
Table of contents
Constructors
Methods
Constructors
constructor
• new PlaygroundWebSocketClient(serverUrl, userId?, sessionId?, authToken?): PlaygroundWebSocketClient
Parameters
| Name | Type |
|---|---|
serverUrl | string |
userId? | string |
sessionId? | string |
authToken? | string |
Returns
Defined in
playground/src/lib/playground/websocket-client.ts:78
Methods
connect
▸ connect(): Promise<boolean>
Connect to the WebSocket server
Returns
Promise<boolean>
Defined in
playground/src/lib/playground/websocket-client.ts:88
disconnect
▸ disconnect(): void
Disconnect from the WebSocket server
Returns
void
Defined in
playground/src/lib/playground/websocket-client.ts:179
updateAuth
▸ updateAuth(userId, sessionId, authToken): void
Update authentication credentials
Parameters
| Name | Type |
|---|---|
userId | string |
sessionId | string |
authToken | string |
Returns
void
Defined in
playground/src/lib/playground/websocket-client.ts:219
sendMessage
▸ sendMessage(message): boolean
Send a message through the WebSocket
Parameters
| Name | Type |
|---|---|
message | Omit<IPlaygroundWebSocketMessage, "timestamp"> |
Returns
boolean
Defined in
playground/src/lib/playground/websocket-client.ts:233
broadcastUpdate
▸ broadcastUpdate(data): boolean
Broadcast playground update
Parameters
| Name | Type |
|---|---|
data | TUniversalValue |
Returns
boolean
Defined in
playground/src/lib/playground/websocket-client.ts:256
on
▸ on(event, handler): void
Add event listener
Parameters
| Name | Type |
|---|---|
event | string |
handler | TPlaygroundWebSocketEventHandler |
Returns
void
Defined in
playground/src/lib/playground/websocket-client.ts:268
off
▸ off(event, handler): void
Remove event listener
Parameters
| Name | Type |
|---|---|
event | string |
handler | TPlaygroundWebSocketEventHandler |
Returns
void
Defined in
playground/src/lib/playground/websocket-client.ts:278
getStatus
▸ getStatus(): IPlaygroundConnectionStatus
Get current connection status