Represents one or more elements in a RealTimeModel that must be adjusted while the data is changing. See an example in the developer guide.

### Hierarchy

- ModelReference<RealTimeElement<any>>
  - ElementReference

## Index

### Methods

- addListener
- events
- isDisposed
- isLocal
- isSet
- key
- off
- on
- once
- removeAllListeners
- removeListener
- removeListeners
- sessionId
- source
- type
- user
- value
- values

### Object literals

- Events
- Types

## Methods

### addListener

- addListener(event: string, listener: ConvergenceEventListener<IConvergenceEvent>): ConvergenceEventEmitter<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.addListener

  Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.

  #### Parameters

  - ##### event: string

    The name of the event to add the listener for.

  - ##### listener: ConvergenceEventListener<IConvergenceEvent>

    The listener callback to register.

  #### Returns ConvergenceEventEmitter<IConvergenceEvent>

  This object, in support of a fluent API.

### events

- events(): Observable<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.events

  Provides the events emitted by this object as an Observable stream.

  example

        eventEmitter.events()
          .filter(e => e.name === "myevent")
          .subscribe(e => console.log(e));

  #### Returns Observable<IConvergenceEvent>

  An Observable stream of all events emitted by this object.

### isDisposed

- isDisposed(): boolean

- Inherited from IndexReference.isDisposed

  Returns true if this reference has already been disposed (cleaned up).

  #### Returns boolean

### isLocal

- isLocal(): boolean

- Inherited from IndexReference.isLocal

  Returns true if this reference was created locally.

  #### Returns boolean

### isSet

- isSet(): boolean

- Inherited from IndexReference.isSet

  Returns true if a value is currenly set on the reference.

  #### Returns boolean

### key

- key(): string

- Inherited from IndexReference.key

  Returns the unique key corresponding to this reference.

  #### Returns string

### off

- off(event: string, listener: ConvergenceEventListener<IConvergenceEvent>): ConvergenceEventEmitter<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.off

  Removes a single event listener for a specific event.

  #### Parameters

  - ##### event: string

    The name of the event to remove the listener for.

  - ##### listener: ConvergenceEventListener<IConvergenceEvent>

    The listener callback to unregister.

  #### Returns ConvergenceEventEmitter<IConvergenceEvent>

  This object, in support of a fluent API.

### on

- on(event: string, listener: ConvergenceEventListener<IConvergenceEvent>): ConvergenceEventEmitter<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.on

  Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.

  #### Parameters

  - ##### event: string

    The name of the event to add the listener for.

  - ##### listener: ConvergenceEventListener<IConvergenceEvent>

    The listener callback to register.

  #### Returns ConvergenceEventEmitter<IConvergenceEvent>

  This object, in support of a fluent API.

### once

- once(event: string, listener: ConvergenceEventListener<IConvergenceEvent>): ConvergenceEventEmitter<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.once

  Adds a single shot event listener for the specified event. The listener will be called the first time the specified event is fired after the event registration occurs, after which the registration will be removed and no further events will be passed to the listener.

  #### Parameters

  - ##### event: string

    The name of the event to add the listener for.

  - ##### listener: ConvergenceEventListener<IConvergenceEvent>

    The listener callback to register.

  #### Returns ConvergenceEventEmitter<IConvergenceEvent>

  This object, in support of a fluent API.

### removeAllListeners

- removeAllListeners(): ConvergenceEventEmitter<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.removeAllListeners

  Removes all listeners for all events. This is useful for cleanup before disposing of this particular event emitter.

  #### Returns ConvergenceEventEmitter<IConvergenceEvent>

  This object, in support of a fluent API.

### removeListener

- removeListener(event: string, listener: ConvergenceEventListener<IConvergenceEvent>): ConvergenceEventEmitter<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.removeListener

  Removes a single event listener for a specific event.

  #### Parameters

  - ##### event: string

    The name of the event to remove the listener for.

  - ##### listener: ConvergenceEventListener<IConvergenceEvent>

    The listener callback to unregister.

  #### Returns ConvergenceEventEmitter<IConvergenceEvent>

  This object, in support of a fluent API.

### removeListeners

- removeListeners(event: string): ConvergenceEventEmitter<IConvergenceEvent>

- Inherited from ConvergenceEventEmitter.removeListeners

  Removes all listeners bound on the given event.

  #### Parameters

  - ##### event: string

    the name of the event to remove listeners for

  #### Returns ConvergenceEventEmitter<IConvergenceEvent>

  This object, in support of a fluent API.

### sessionId

- sessionId(): string

- Inherited from IndexReference.sessionId

  Returns the session ID of the user session that created this reference.

  #### Returns string

### source

- source(): RealTimeElement<any> | RealTimeModel

- Inherited from IndexReference.source

  Returns the element or model on which this reference was created.

  #### Returns RealTimeElement<any> | RealTimeModel

### type

- type(): ReferenceType

- Inherited from IndexReference.type

  Returns a string indicating the type of reference this is.

  #### Returns ReferenceType

### user

- user(): DomainUser

- Inherited from IndexReference.user

  Returns the user that created this reference.

  #### Returns DomainUser

### value

- value(): RealTimeElement<any>

- Inherited from IndexReference.value

  Returns the first value of the underlying reference.

  #### Returns RealTimeElement<any>

### values

- values(): RealTimeElement<any>[]

- Inherited from IndexReference.values

  Returns all values of the underlying reference.

  #### Returns RealTimeElement<any>[]

## Object literals

### StaticEvents

Events: object

Inherited from IndexReference.Events

A mapping of the events this instance could emit to each event's unique name. Use this to refer an event name:

    reference.on(ModelReference.Events.SET, function listener(e) {
      // ...
    })

### CLEARED

CLEARED: string = ReferenceClearedEvent.NAME

### DISPOSED

DISPOSED: string = ReferenceDisposedEvent.NAME

### SET

SET: string = ReferenceChangedEvent.NAME

### StaticTypes

Types: object

Inherited from IndexReference.Types

All the types of references available on the various RealTimeElements.

### ELEMENT

ELEMENT: "element" = "element"

### INDEX

INDEX: "index" = "index"

### PROPERTY

PROPERTY: "property" = "property"

### RANGE

RANGE: "range" = "range"