FreakingGenius - v0.1.0
    Preparing search index...

    Class ProtocolDecoder

    Decodes incoming WebSocket frames and dispatches them to type-specific handlers.

    const decoder = new ProtocolDecoder();
    decoder.on(BridgeMessageType.RENDER_COMMAND, (msg) => primitiveRenderer.apply(msg.command));
    decoder.on(BridgeMessageType.SESSION_START, (msg) => deviceState.setActiveSession(/* … */));
    websocket.onmessage = (e) => decoder.decode(e.data);
    Index

    Constructors

    Methods

    Constructors

    Methods

    • 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).

      Parameters

      • rawFrame: string

        The raw string payload from a WebSocket message event.

      Returns void