Interfaces
@system-inc/base-foundation · 515c140 · 8 symbols
BaseWebSocket
BaseWebSocket is an interface the combines the libdom WebSocket interface with the Cloudflare WebSocket interface. It is used to provide a common interface for WebSocket connections.
extends WebSocket
Members
deserializeAttachment():anyserializeAttachment(attachment:any):void
WebSocketContextMapping
A mapping from a RequestContextKey to a WebSocketInfoKey.
Modules register these so the framework automatically copies per-request values from the RequestContext into the WebSocketInfo context bag at WebSocket connect time.
Readers on the WebSocket side then pull the value back out with
getWsContext(info, wsKey).
Members
rcKey:RequestContextKey<T>wsKey:WebSocketInfoKey<T>
WebSocketDelegateSettings
Members
delegate:Constructor<WebSocketDelegate>name:stringpath:stringrpcEndpoint?:string
WebSocketErrorEvent
extends WebSocketEvent
Members
arguments?:any[]The arguments that were passed as part of the event. These will be passed to the event handler.
errorType:stringThe error that occurred.
message?:stringThe error message.
origin:stringThe origin of the event.
This is the worker that the event originated from.
originatingType?:stringThe web socket event that was being handled when the error occurred.
type:"error"Designates this event as an error event.
WebSocketEvent
Members
arguments?:any[]The arguments that were passed as part of the event. These will be passed to the event handler.
origin:stringThe origin of the event.
This is the worker that the event originated from.
type:stringThe type of the event. This determines how the event should be handled.
static isWebSocketErrorEvent(event:WebSocketEvent):event is WebSocketErrorEventstatic isWebSocketEvent(event:any):event is WebSocketEventstatic isWebSocketForwardingEvent(event:WebSocketEvent):event is WebSocketForwardingEvent
WebSocketForwardingEvent
extends WebSocketEvent
Members
arguments?:any[]The arguments that were passed as part of the event. These will be passed to the event handler.
origin:stringThe origin of the event.
This is the worker that the event originated from.
originatingType:stringThe event that is being forwarded.
rpcEndpoint?:stringThe rpc endpoint on the target.
target:stringThe target of the event.
This is the worker that the event is being forwarded to.
type:"forwarding"Designates this event as a forwarding event.
WebSocketInfo
Information about a WebSocket connection that is carried alongside every message and across workers / durable objects.
Values written to context must be JSON-serializable since
WebSocketInfo is serialized on the wire. Write and read through
getWsContext and setWsContext using typed
WebSocketInfoKeys.
extends JsonObject
Members
context:JsonObjectpath:stringsocketId:string
WebSocketSettings
Members
delegates:WebSocketDelegateSettings[]mappings?:(WebSocketContextMapping<Json>)[]RC → WS key mappings aggregated across all modules. Applied to
WebSocketInfo.contextat connect time.Populated from module settings via BaseAppManifest; app code generally does not need to set this directly.