Package org.angular.ts.ng
Interface WebSocketConfig
@JsType(isNative=true,
name="ng.WebSocketConfig",
namespace="<global>")
public interface WebSocketConfig
WebSocket-specific configuration
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property. -
Method Summary
Modifier and TypeMethodDescriptionstatic WebSocketConfigcreate()elemental2.core.JsArray<String> Additional EventSource event names to subscribe todoubleTimeout in milliseconds to detect heartbeat inactivitydoubleMaximum number of reconnect attemptsCalled when a WebSocket connection closesCalled when an error occursCalled with every registered connection message, including custom SSE event typesCalled when a message is receivedCalled when the connection opensCalled when a decoded message uses the realtime protocol shape.Called when a reconnect attempt happenselemental2.core.JsArray<String> Optional WebSocket subprotocolsdoubleDelay between reconnect attempts in millisecondsFunction to transform incoming messagesvoidsetEventTypes(elemental2.core.JsArray<String> eventTypes) Additional EventSource event names to subscribe tovoidsetHeartbeatTimeout(double heartbeatTimeout) Timeout in milliseconds to detect heartbeat inactivityvoidsetMaxRetries(double maxRetries) Maximum number of reconnect attemptsvoidCalled when a WebSocket connection closesvoidCalled when an error occursvoidCalled with every registered connection message, including custom SSE event typesvoidsetOnMessage(WebSocketConfig.OnMessageCallback onMessage) Called when a message is receivedvoidCalled when the connection opensvoidsetOnProtocolMessage(WebSocketConfig.OnProtocolMessageCallback onProtocolMessage) Called when a decoded message uses the realtime protocol shape.voidsetOnReconnect(WebSocketConfig.OnReconnectCallback onReconnect) Called when a reconnect attempt happensvoidsetProtocols(elemental2.core.JsArray<String> protocols) Optional WebSocket subprotocolsvoidsetRetryDelay(double retryDelay) Delay between reconnect attempts in millisecondsvoidsetTransformMessage(WebSocketConfig.TransformMessageCallback transformMessage) Function to transform incoming messages
-
Method Details
-
create
-
getEventTypes
Additional EventSource event names to subscribe to -
getHeartbeatTimeout
@JsProperty double getHeartbeatTimeout()Timeout in milliseconds to detect heartbeat inactivity -
getMaxRetries
@JsProperty double getMaxRetries()Maximum number of reconnect attempts -
getOnClose
Called when a WebSocket connection closes -
getOnError
Called when an error occurs -
getOnEvent
Called with every registered connection message, including custom SSE event types -
getOnMessage
Called when a message is received -
getOnOpen
Called when the connection opens -
getOnProtocolMessage
Called when a decoded message uses the realtime protocol shape. -
getOnReconnect
Called when a reconnect attempt happens -
getProtocols
Optional WebSocket subprotocols -
getRetryDelay
@JsProperty double getRetryDelay()Delay between reconnect attempts in milliseconds -
getTransformMessage
Function to transform incoming messages -
setEventTypes
Additional EventSource event names to subscribe to -
setHeartbeatTimeout
@JsProperty void setHeartbeatTimeout(double heartbeatTimeout) Timeout in milliseconds to detect heartbeat inactivity -
setMaxRetries
@JsProperty void setMaxRetries(double maxRetries) Maximum number of reconnect attempts -
setOnClose
Called when a WebSocket connection closes -
setOnError
Called when an error occurs -
setOnEvent
Called with every registered connection message, including custom SSE event types -
setOnMessage
Called when a message is received -
setOnOpen
Called when the connection opens -
setOnProtocolMessage
Called when a decoded message uses the realtime protocol shape. -
setOnReconnect
Called when a reconnect attempt happens -
setProtocols
Optional WebSocket subprotocols -
setRetryDelay
@JsProperty void setRetryDelay(double retryDelay) Delay between reconnect attempts in milliseconds -
setTransformMessage
Function to transform incoming messages
-