Options
All
  • Public
  • Public/Protected
  • All
Menu

Module chatRoom

Index

Functions

add

  • add(room: string): Promise<any>
  • Add a new chat room. Throws an error if the room already exists.

    Parameters

    • room: string

    Returns Promise<any>

addMember

  • addMember(connectionId: string, room: string): Promise<any>
  • Add a connection (via id) to a rooom. Throws errors if the room does not exist, or the connection is already in the room. Middleware errors also throw.

    Parameters

    • connectionId: string
    • room: string

    Returns Promise<any>

addMiddleware

destroy

  • destroy(room: string): Promise<void>
  • Remove an exsitng chat room. All connections in the room will be removed. Throws an error if the room does not exist.

    Parameters

    • room: string

    Returns Promise<void>

exists

  • exists(room: string): Promise<boolean>

generateMemberDetails

  • generateMemberDetails(connection: Connection): Promise<object>
  • An overwritable method which configures what properties of connections in a room are initially stored about a connection when added via api.chatRoom.addMember

    Parameters

    Returns Promise<object>

list

  • list(): Promise<Array<string>>

removeMember

  • removeMember(connectionId: string, room: string, toWaitRemote?: boolean): Promise<any>
  • Remote a connection (via id) from a rooom. Throws errors if the room does not exist, or the connection is not in the room. Middleware errors also throw. toWaitRemote: Should this method wait until the remote ActionHero server (the one the connection is connected too) responds?

    Parameters

    • connectionId: string
    • room: string
    • Default value toWaitRemote: boolean = true

    Returns Promise<any>

roomStatus

  • roomStatus(room: string): Promise<object>
  • Learn about the connections in the room. Returns a hash of the form { room: room, members: cleanedMembers, membersCount: count }. Members is an array of connections in the room sanitized via api.chatRoom.sanitizeMemberDetails

    Parameters

    • room: string

    Returns Promise<object>

sanitizeMemberDetails

  • sanitizeMemberDetails(memberData: any): Promise<object>
  • Configures what properties of connections in a room to return via api.chatRoom.roomStatus

    Parameters

    • memberData: any

    Returns Promise<object>

Generated using TypeDoc