Interface ChatRoomListenerMap

Utility type defining events emitted by chat room. These include both lifecycle events as well as received messages and room events.

Hierarchy

  • ChatRoomListenerMap

Properties

connect: (() => unknown)

Type declaration

    • (): unknown
    • Called when room connection is established and user can start sending and receiving messages, occurs when the room transitions into the connected state.

      Returns unknown

connecting: (() => unknown)

Type declaration

    • (): unknown
    • Called when the room attempts to establish or reestablish socket connection, occurs when the room transitions into connecting state.

      During this state user cannot send nor receive messages.

      Returns unknown

disconnect: ((reason: DisconnectReason) => unknown)

Type declaration

    • (reason: DisconnectReason): unknown
    • Called when room connection is closed and room will not automatically try to re-establish it, occurs when the room transitions into disconnected state.

      During this state user cannot send nor receive messages.

      Parameters

      Returns unknown

event: ((event: ChatEvent) => unknown)

Type declaration

message: ((message: ChatMessage) => unknown)

Type declaration

    • (message: ChatMessage): unknown
    • Called after receiving a chat room message. The message can be sent by any of the users in the room, including the current user.

      Parameters

      Returns unknown

messageDelete: ((event: DeleteMessageEvent) => unknown)

Type declaration

userDisconnect: ((event: DisconnectUserEvent) => unknown)

Type declaration

Generated using TypeDoc