Definition object for the functionality of the Socket.
Optional
mainServerLogging: LoggingTypesReadonly
defaultReadonly
defaultAccess the CustomData object of this Socket.
Optional
key: KThe key of the CustomData property to fetch. If left out the entire CustomData Object is returned.
Either the content of the CustomData property or the CustomData Object
Generics message interceptor
The Socket to target.
Either the name of the Communication preset that processed the message or true.
Used to decide if the message should be forwarded to the socket's default handling function if available.
Fetch all or a subset of current connections of the Socket, optionally narrowed by a filter.
Optional
arg: ConnectionFilter<NonNullable<Connector<S>>>a Filter for the connections to be fetched. If left empty, all connections are returned.
Registers a communication preset.
identifier of this preset.
Optional
handlerName: stringname of the handler function on the target Socket this should process the messages
Optional
defaultTarget: ConnectionFilter<NonNullable<Connector<S>>>identifier of the Socket the communication should target. uses the 'main' socket by default
the generated Communication preset.
Registers socket
the name of the targeted endpoint.
WebSocket ws or wss URL
How long to wait for the endpoint to respond
Optional
initialized: booleanShould the connection be initialized at a later time?
Optional
logging: LoggingTypeswhich messages should be logged?
The created SocketWrapper
Client id generated by the server, empty in the Base and Server versions of the class
Protected
customPrivate
proxytrue if we have hijacked window.webSocket object to intercept connections
Protected
_launchLaunch a previously registered communication preset.
the name of the communication preset to start
Optional
content: DefBack<S, N, "content">the data used to initialize the connection.
Optional
targetFilter: ConnectionFilter<NonNullable<Connector<S>>>the identifier of the endpoint this should receive this message
Providing the communication method with smart and typed parameter functions.
Name of preset
handler name
targetName
Optional
pID: stringPID instance
The finished method handler
Modifies custom data on a Socket or Client. All connected Sockets and Clients receive the change immediately.
name of the property to set
new value of the property
Private
socketMethod to modify the window.WebSocket object. Only executed if there is at least one entry in the trapMap.
Protected
connectionsProtected
presetsMap holding all communication presets registered to the Socket
Protected
promisePrivate
Readonly
trapOptional
timeout: numberOptional
logging: LoggingTypesGenerated using TypeDoc
Tocket client for browsers. Designed to be bundled.