Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AttributeCollection

An collection of attributes for a client, user account, or room.

Hierarchy

  • EventDispatcher
    • AttributeCollection

Index

Constructors

constructor

Properties

Readonly target

target: EventDispatcher

Methods

addEventListener

  • addEventListener(type: string, listener: Function, thisArg: any, priority?: number): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any
    • Default value priority: number = 0

    Returns boolean

contains

  • contains(name: string, scope: string): boolean
  • Returns true if this AttributeCollection contains the specified attribute;false otherwise

    Parameters

    • name: string
    • scope: string

    Returns boolean

dispatchEvent

  • dispatchEvent(event: Event): void
  • Parameters

    • event: Event

    Returns void

getAll

  • getAll(): {}
  • Returns an object containing all attributes in this collection. Each attribute is represented by a dynamic variable name/value pair.

    Returns {}

    • [name: string]: string | undefined

getAttribute

  • getAttribute(attrName: string, attrScope?: undefined | string): string | null
  • Returns the value of the specified attribute.

    Parameters

    • attrName: string
    • Optional attrScope: undefined | string

    Returns string | null

getAttributesNamesForScope

  • getAttributesNamesForScope(scope: string): string[]
  • Returns the names of the attributes with the specified scope.

    Parameters

    • scope: string

    Returns string[]

getByScope

  • getByScope(scope?: undefined | string): {} | {}
  • Returns an object containing all attributes for the specified scope. When scope is specified, the object returned has the following format:

        {name1:value1, name2:value2,...namen:valuen}

    When scope is not specified, the object returned has the following format:

        {scope1: {name1:value1, name2:value2,...namen:valuen},
         scope2: {name1:value1, name2:value2,...namen:valuen},
         scopen: {name1:value1, name2:value2,...namen:valuen}}

    Parameters

    • Optional scope: undefined | string

    Returns {} | {}

getListeners

  • getListeners(type: string): EventListener[]
  • Parameters

    • type: string

    Returns EventListener[]

getScopes

  • getScopes(): string[]
  • Returns a list of the scopes defined by attributes in this AttributeCollection.

    Returns string[]

hasListener

  • hasListener(type: string, listener: Function, thisArg: any): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any

    Returns boolean

removeEventListener

  • removeEventListener(type: string, listener: Function, thisArg: any): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any

    Returns boolean

synchronizeScope

  • Updates the specified scope in this collection to match the specified collection, eleting, adding, and updating attributes as necessary.

    Parameters

    Returns void