A read-only history-aware version of a RealTimeObject. See HistoricalElement and HistoricalModel for some common usages.

### Hierarchy

- HistoricalElement<object>
  - HistoricalObject

### Implements

- ObservableElement<object>
- HistoricalContainerElement<object>
- ObservableObject

## Index

### Properties

- Events

### Methods

- addListener
- elementAt
- events
- forEach
- get
- hasKey
- id
- isAttached
- isDetached
- keys
- model
- off
- on
- once
- parent
- path
- relativePath
- removeAllListeners
- removeListener
- removeListeners
- toJSON
- type
- value

## Properties

### StaticEvents

Events: HistoricalObjectEvents = ObservableObjectEventConstants

Overrides HistoricalElement.Events

## Methods

### addListener

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

- Implementation of ObservableObject.addListener

  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.

### elementAt

- elementAt(path: Path): HistoricalElement<any>
- elementAt(...elements: PathElement[]): HistoricalElement<any>

- Implementation of ObservableObject.elementAt

  Given a search path, returns the HistoricalElement at that path, or null if no such element exists. Scoped to this object, so the first element in the given path should be a string (representing an existing key)

  #### Parameters

  - ##### path: Path

    the search path for accessing a node within this object

  #### Returns HistoricalElement<any>

  The HistoricalElement at the given path, or null if no such element exists

- Implementation of ObservableObject.elementAt

  #### Parameters

  - ##### Rest ...elements: PathElement[]

  #### Returns HistoricalElement<any>

### events

- events(): Observable<IConvergenceEvent>

- Implementation of ObservableObject.events

  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.

### forEach

- forEach(callback: function): void

- Synchronously calls the provided callback function for each key-value pair in this object at the current version.

  #### Parameters

  - ##### callback: function

    a function to be called for each key-value pair

    - - (model: HistoricalElement<any>, key?: string): void

      - #### Parameters

        - ##### model: HistoricalElement<any>

        - ##### Optional key: string

        #### Returns void

### get

- get(key: string): HistoricalElement<any>

- Implementation of ObservableObject.get

  Returns the HistoricalElement at the given key at the current version.

  Also see RealTimeObject.get.

  #### Parameters

  - ##### key: string

    the key whose value is desired

  #### Returns HistoricalElement<any>

### hasKey

- hasKey(key: string): boolean

- Implementation of ObservableObject.hasKey

  Returns true if the provided key existed on this object at the current version.

  #### Parameters

  - ##### key: string

  #### Returns boolean

### id

- id(): string

- Implementation of ObservableObject.id

  Inherited from HistoricalObject.id

  Each node within a RealTimeModel has a system-generated ID that is unique within this model's contents.

  #### Returns string

### isAttached

- isAttached(): boolean

- Implementation of ObservableObject.isAttached

  Inherited from HistoricalObject.isAttached

  This doesn't have much utility in the context of a HistoricalModel and is really only provided for API compatibility with a RealTimeModel.

  #### Returns boolean

  true

### isDetached

- isDetached(): boolean

- Implementation of ObservableObject.isDetached

  Inherited from HistoricalObject.isDetached

  This doesn't have much utility in the context of a HistoricalModel and is really only provided for API compatibility with a RealTimeModel.

  #### Returns boolean

  false

### keys

- keys(): string[]

- Implementation of ObservableObject.keys

  Returns an array of all the current version's keys

  #### Returns string[]

  an array with all the current version's keys

### model

- model(): HistoricalModel

- Implementation of ObservableObject.model

  Inherited from HistoricalObject.model

  Returns the model to which this element belongs.

  #### Returns HistoricalModel

### off

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

- Implementation of ObservableObject.off

  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>

- Implementation of ObservableObject.on

  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>

- Implementation of ObservableObject.once

  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.

### parent

- parent(): HistoricalContainerElement<any>

- Implementation of ObservableObject.parent

  Inherited from HistoricalObject.parent

  Returns the parent of this element within the model.

  #### Returns HistoricalContainerElement<any>

  the parent of this element, or `this` if this is the root element

### path

- path(): Path

- Implementation of ObservableObject.path

  Inherited from HistoricalObject.path

  The Path representing this element's location in the containing model's data.

  #### Returns Path

### relativePath

- relativePath(): PathElement

- Implementation of ObservableObject.relativePath

  Inherited from HistoricalObject.relativePath

  This returns the PathElement representing this element's location relevant to its parent. For example, given a model with contents

      {
        obj: {
          with: 1,
          stuff: ['a', 'string']
        }
      }

      let rtNumber = rtModel.elementAt(['obj', 'with']);
      rtNumber.value() // 1
      rtNumber.relativePath() // 'with'

      let rtString = rtModel.elementAt(['obj', 'stuff', 0]);
      rtString.value() // 'a'
      rtString.relativePath() // 0

  #### Returns PathElement

  a PathElement representing this node's location relative to its parent, or null if it has no parent.

### removeAllListeners

- removeAllListeners(): ConvergenceEventEmitter<IConvergenceEvent>

- Implementation of ObservableObject.removeAllListeners

  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>

- Implementation of ObservableObject.removeListener

  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>

- Implementation of ObservableObject.removeListeners

  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.

### toJSON

- toJSON(): any

- Implementation of ObservableObject.toJSON

  Inherited from HistoricalObject.toJSON

  Returns a JSON-compatible representation of this element.

  #### Returns any

### type

- type(): string

- Implementation of ObservableObject.type

  Inherited from HistoricalObject.type

  This element's type. See [[ModelElementType]] for an enumeration of types.

  #### Returns string

### value

- value(): object

- Implementation of ObservableObject.value

  Inherited from HistoricalObject.value

  The value of this element at the parent model's current version.

  #### Returns object

  - ##### [key: string]: any