This represents a particular node in a HistoricalModel's contents. If you think of the contents of a model as a JSON tree, this could be the root object, an array, or any other element.

Much of the API of this class is designed to be the same as a RealTimeModel, since the logic that deals with each representation is likely to be shared.

As HistoricalElements represent a snapshot of a RealTimeElement in a given moment in time, they are read-only.

### Type parameters

- #### T

### Hierarchy

- ConvergenceEventEmitter<IConvergenceEvent>
  - HistoricalElement
    - HistoricalObject
    - HistoricalBoolean
    - HistoricalNull
    - HistoricalNumber
    - HistoricalString
    - HistoricalUndefined
    - HistoricalDate
    - HistoricalArray

### Implements

- ObservableElement<T>

## Index

### Properties

- Events

### Methods

- addListener
- events
- id
- isAttached
- isDetached
- model
- off
- on
- once
- parent
- path
- relativePath
- removeAllListeners
- removeListener
- removeListeners
- toJSON
- type
- value

## Properties

### StaticEvents

Events: HistoricalElementEvents = ObservableElementEventConstants

An interface enumerating the different events that could be fired on this HistoricalElement.

## Methods

### addListener

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

- Implementation of ObservableElement.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.

### events

- events(): Observable<IConvergenceEvent>

- Implementation of ObservableElement.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.

### id

- id(): string

- Implementation of ObservableElement.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 ObservableElement.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 ObservableElement.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

### model

- model(): HistoricalModel

- Implementation of ObservableElement.model

  Returns the model to which this element belongs.

  #### Returns HistoricalModel

### off

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

- Implementation of ObservableElement.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 ObservableElement.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 ObservableElement.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 ObservableElement.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 ObservableElement.path

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

  #### Returns Path

### relativePath

- relativePath(): PathElement

- Implementation of ObservableElement.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 ObservableElement.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 ObservableElement.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 ObservableElement.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 ObservableElement.toJSON

  Returns a JSON-compatible representation of this element.

  #### Returns any

### type

- type(): string

- Implementation of ObservableElement.type

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

  #### Returns string

### value

- value(): T

- Implementation of ObservableElement.value

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

  #### Returns T