obby-client for TypeScript
    Preparing search index...

    Type Alias VoiceSignal

    VoiceSignal:
        | { channel: string; type: "join" }
        | { channel: string; type: "leave" }
        | {
            members: string[];
            mode: VoiceRoomKind | null;
            role: VoiceRole | null;
            streamers: string[] | null;
            tracks: VoiceTrackHint[] | null;
            turn: TurnCredentials | null;
            type: "joined";
        }
        | {
            chunk: ChunkMeta
            | null;
            sdp: string;
            tracks: VoiceTrackHint[] | null;
            type: "offer";
        }
        | { chunk: ChunkMeta
        | null; sdp: string; type: "answer" }
        | {
            cand: string;
            mid: string | null;
            mlineidx: number | null;
            type: "ice";
        }
        | {
            kind: VoiceToggle
            | null;
            member: string;
            role: VoiceRole | null;
            state: VoicePresence;
            type: "presence";
        }
        | { state: OnOff; type: "mic" }
        | { state: OnOff; type: "video" }
        | { state: OnOff; type: "screen" }
        | { state: OnOff; type: "hand" }
        | { state: OnOff; type: "deaf" }
        | { type: "speaking" }
        | { type: "silent" }
        | { emoji: string; member: string | null; type: "react" }
        | { target: string; type: "promote" }
        | { target: string; type: "demote" }
        | { member: string; role: VoiceRole; type: "role" }
        | { error: string | null; type: "error" }

    One +obsidianirc/rtc signalling frame.

    Every variant is one JSON object's type. The published https://github.com/obbyworld/extensions/blob/main/voice.md documents only 9 of these, the wire carries 19, and this enum follows the wire. Outbound intent and inbound notification are modelled as distinct shapes where the wire actually distinguishes them (mic/video/screen/hand/speaking/silent/deaf versus the presence they get rebroadcast as; promote/demote versus role), rather than collapsed into one type as the published table's prose implies.

    Type Declaration

    • { channel: string; type: "join" }
      • channel: string

        The channel to join.

      • type: "join"
    • { channel: string; type: "leave" }
      • channel: string

        The channel to leave.

      • type: "leave"
    • {
          members: string[];
          mode: VoiceRoomKind | null;
          role: VoiceRole | null;
          streamers: string[] | null;
          tracks: VoiceTrackHint[] | null;
          turn: TurnCredentials | null;
          type: "joined";
      }
      • members: string[]

        Every current member's nick.

      • mode: VoiceRoomKind | null

        The room's kind, present only for a $ channel.

      • role: VoiceRole | null

        The role granted to us specifically, present only for a $ channel.

      • streamers: string[] | null

        Who currently publishes, for a $ channel.

      • tracks: VoiceTrackHint[] | null

        Hints mapping media lines to the members they belong to.

      • turn: TurnCredentials | null

        The TURN credentials for this call.

      • type: "joined"
    • {
          chunk: ChunkMeta | null;
          sdp: string;
          tracks: VoiceTrackHint[] | null;
          type: "offer";
      }
      • chunk: ChunkMeta | null

        Set when this frame is one of several chunks sharing an id.

      • sdp: string

        The offer SDP, or one slice of it when chunk is set.

      • tracks: VoiceTrackHint[] | null

        Track-attribution hints, carried only on chunk 0 or an unchunked offer.

      • type: "offer"
    • { chunk: ChunkMeta | null; sdp: string; type: "answer" }
      • chunk: ChunkMeta | null

        Set when this frame is one of several chunks sharing an id.

      • sdp: string

        The answer SDP, or one slice of it when chunk is set.

      • type: "answer"
    • { cand: string; mid: string | null; mlineidx: number | null; type: "ice" }
      • cand: string

        The candidate string.

      • mid: string | null

        The media line it applies to.

      • mlineidx: number | null

        The media line's index, when mid is absent.

      • type: "ice"
    • {
          kind: VoiceToggle | null;
          member: string;
          role: VoiceRole | null;
          state: VoicePresence;
          type: "presence";
      }
      • kind: VoiceToggle | null

        Which toggle, when state is [PresenceState::On] or [PresenceState::Off].

      • member: string

        Who this is about.

      • role: VoiceRole | null

        The role granted, when state is [PresenceState::Joined] in a $ room.

      • state: VoicePresence

        What changed.

      • type: "presence"
    • { state: OnOff; type: "mic" }
      • state: OnOff

        The new state.

      • type: "mic"
    • { state: OnOff; type: "video" }
      • state: OnOff

        The new state.

      • type: "video"
    • { state: OnOff; type: "screen" }
      • state: OnOff

        The new state.

      • type: "screen"
    • { state: OnOff; type: "hand" }
      • state: OnOff

        The new state.

      • type: "hand"
    • { state: OnOff; type: "deaf" }
      • state: OnOff

        The new state.

      • type: "deaf"
    • { type: "speaking" }
    • { type: "silent" }
    • { emoji: string; member: string | null; type: "react" }
      • emoji: string

        The emoji.

      • member: string | null

        Who reacted, present only on the inbound broadcast.

      • type: "react"
    • { target: string; type: "promote" }
      • target: string

        The member to promote.

      • type: "promote"
    • { target: string; type: "demote" }
      • target: string

        The member to demote.

      • type: "demote"
    • { member: string; role: VoiceRole; type: "role" }
      • member: string

        Whose role changed.

      • role: VoiceRole

        Their new role.

      • type: "role"
    • { error: string | null; type: "error" }
      • error: string | null

        A human-readable reason, when the server gave one.

      • type: "error"