Interface Room

Represents a chat room.

interface Room {
    get error(): undefined | ErrorInfo;
    get messages(): Messages;
    get occupancy(): Occupancy;
    get presence(): Presence;
    get reactions(): RoomReactions;
    get roomId(): string;
    get status(): RoomStatus;
    get typing(): Typing;
    attach(): Promise<void>;
    detach(): Promise<void>;
    offAllStatusChange(): void;
    onStatusChange(listener: RoomStatusListener): OnRoomStatusChangeResponse;
    options(): RoomOptions;
}

Accessors

  • get presence(): Presence
  • Allows you to subscribe to presence events in the room.

    Returns Presence

    The presence instance for the room.

    ErrorInfo} if presence is not enabled for the room.

  • get roomId(): string
  • The unique identifier of the room.

    Returns string

    The room identifier.

  • get typing(): Typing
  • Allows you to interact with typing events in the room.

    Returns Typing

    The typing instance for the room.

    ErrorInfo if typing is not enabled for the room.

Methods

  • Attaches to the room to receive events in realtime.

    If a room fails to attach, it will enter either the RoomStatus.Suspended or RoomStatus.Failed state.

    If the room enters the failed state, then it will not automatically retry attaching and intervention is required.

    If the room enters the suspended state, then the call to attach will reject with the ErrorInfo that caused the suspension. However, the room will automatically retry attaching after a delay.

    Returns Promise<void>

    A promise that resolves when the room is attached.

  • Detaches from the room to stop receiving events in realtime.

    Returns Promise<void>

    A promise that resolves when the room is detached.

  • Removes all listeners that were added by the onStatusChange method.

    Returns void