the set of timelines this is part of
Private
basePrivate
Optional
endPrivate
endPrivate
Readonly
eventthe set of timelines this is part of
Private
eventsPrivate
Readonly
namePrivate
nextPrivate
prevPrivate
Readonly
roomPrivate
Optional
startPrivate
startStatic
Readonly
BACKWARDSSymbolic constant for methods which take a 'direction' argument: refers to the start of the timeline, or backwards in time.
Static
Readonly
FORWARDSSymbolic constant for methods which take a 'direction' argument: refers to the end of the timeline, or forwards in time.
Add a new event to the timeline, and update the state
new event
addEvent options
In favor of the overload with IAddEventOptions
Optional
roomState: RoomStateCreates an independent timeline, inheriting the directional state from this timeline.
the new timeline
EventTimeline.BACKWARDS to get the state at the start of the timeline; EventTimeline.FORWARDS to get the state at the end of the timeline.
Forks the (live) timeline, taking ownership of the existing directional state of this timeline. All attached listeners will keep receiving state updates from the new live timeline state. The end state of this timeline gets replaced with an independent copy of the current RoomState, and will need a new pagination token if it ever needs to paginate forwards.
the new timeline
EventTimeline.BACKWARDS to get the state at the start of the timeline; EventTimeline.FORWARDS to get the state at the end of the timeline.
Get the base index.
This is an index which is incremented when events are prepended to the timeline. An individual event therefore stays at the same index in the array relative to the base index (although note that a given event's index may well be less than the base index, thus giving that event a negative relative index).
Get the list of events in this context
An array of MatrixEvents
Get the next timeline in the series
previous or following timeline, if they have been joined up.
EventTimeline.BACKWARDS to get the previous timeline; EventTimeline.FORWARDS to get the next timeline.
Get a pagination token
pagination token
EventTimeline.BACKWARDS to get the pagination token for going backwards in time; EventTimeline.FORWARDS to get the pagination token for going forwards in time.
Get the room state at the start/end of the timeline
state at the start/end of the timeline
EventTimeline.BACKWARDS to get the state at the start of the timeline; EventTimeline.FORWARDS to get the state at the end of the timeline.
Get the timelineSet for this timeline
timelineSet
Initialise the start and end state with the given events
This can only be called before any events are added.
Error if an attempt is made to call this after addEvent is called.
list of state events to initialise the state with.
Remove an event from the timeline
removed event, or null if not found
ID of event to be removed
Set the next timeline in the series
Error if an attempt is made to set the neighbouring timeline when it is already set.
previous/following timeline
EventTimeline.BACKWARDS to set the previous timeline; EventTimeline.FORWARDS to set the next timeline.
Set a pagination token
pagination token
EventTimeline.BACKWARDS to set the pagination token for going backwards in time; EventTimeline.FORWARDS to set the pagination token for going forwards in time.
Static
setStatic helper method to set sender and target properties
the event whose metadata is to be set
the room state to be queried
if true the event's forwardLooking flag is set false
Generated using TypeDoc
Construct a new EventTimeline
An EventTimeline represents a contiguous sequence of events in a room.
As well as keeping track of the events themselves, it stores the state of the room at the beginning and end of the timeline, and pagination tokens for going backwards and forwards in the timeline.
In order that clients can meaningfully maintain an index into a timeline, the EventTimeline object tracks a 'baseIndex'. This starts at zero, but is incremented when events are prepended to the timeline. The index of an event relative to baseIndex therefore remains constant.
Once a timeline joins up with its neighbour, they are linked together into a doubly-linked list.