peerix - v0.8.0
    Preparing search index...

    Interface ChannelRawMessageEvent<M>

    Emitted when a message is received on a channel with a protocol. The payload arrives as sent, with no stream wrapper.

    room.on("channel:message", (e) => {
    if (e.raw) console.log(new Float32Array(e.data as ArrayBuffer));
    });
    interface ChannelRawMessageEvent<M extends object = Metadata> {
        channel: RTCDataChannel;
        data: string | ArrayBuffer;
        info?: undefined;
        label: string;
        name: "channel:message";
        peer: Peer<M>;
        raw: true;
        type: "text" | "bytes";
    }

    Type Parameters

    Hierarchy (View Summary)

    Index
    channel: RTCDataChannel

    Data channel associated with the event.

    data: string | ArrayBuffer

    Received payload.

    info?: undefined

    Never set; raw messages carry no info.

    label: string

    Label of the data channel.

    name: "channel:message"

    Name of the event.

    peer: Peer<M>

    Peer object containing connection details.

    raw: true

    Tells a raw message from a regular one.

    type: "text" | "bytes"

    Detected type of the payload: text for a string, bytes otherwise.