Creates a new ProtocolDecoder with an empty handler registry.
Parses a raw WebSocket frame, validates it, and dispatches to the
registered handler for the message's type discriminant.
Unknown or malformed frames are silently dropped (with a console warning).
The raw string payload from a WebSocket message event.
Removes the handler for a specific message type.
The BridgeMessageType to deregister.
Registers a handler for a specific message type. Replaces any previously registered handler for that type.
The BridgeMessageType this handler responds to.
The function to call with the decoded message.
Decodes incoming WebSocket frames and dispatches them to type-specific handlers.