MatrixClient to be used for context/pagination requests.
The timelineSet to track
Configuration options for this window
Private
Readonly
clientMatrixClient to be used for context/pagination requests.
Private
Optional
endPrivate
eventPrivate
Optional
startPrivate
Readonly
timelineThe timelineSet to track
Private
Readonly
windowCheck if this window can be extended
This returns true if we either have more events, or if we have a pagination token which means we can paginate in that direction. It does not necessarily mean that there are more events available in that direction at this time.
true if we can paginate in the given direction
EventTimeline.BACKWARDS to check if we can paginate backwards; EventTimeline.FORWARDS to check if we can go forwards
Try to extend the window using events that are already in the underlying TimelineIndex.
true if the window was extended, false otherwise.
EventTimeline.BACKWARDS to try extending it backwards; EventTimeline.FORWARDS to try extending it forwards.
number of events to try to extend by.
Get a list of the events currently in the window
the events in the window
Get the TimelineIndex of the window in the given direction.
The requested timeline index if one exists, null otherwise.
EventTimeline.BACKWARDS to get the TimelineIndex at the start of the window; EventTimeline.FORWARDS to get the TimelineIndex at the end.
Initialise the window to point at a given event, or the live timeline
Optional
initialEventId: stringIf given, the window will contain the given event
Size of the initial window
Attempt to extend the window
Promise which resolves to a boolean which is true if more events were successfully retrieved.
EventTimeline.BACKWARDS to extend the window backwards (towards older events); EventTimeline.FORWARDS to go forwards.
number of events to try to extend by. If fewer than this number are immediately available, then we return immediately rather than making an API call.
whether we should make API calls to fetch further events if we don't have any at all. (This has no effect if the room already knows about additional events in the relevant direction, even if there are fewer than 'size' of them, as we will just return those we already know about.)
limit for the number of API requests we should make.
Generated using TypeDoc
Construct a TimelineWindow.
This abstracts the separate timelines in a Matrix [Room](Room.html) into a single iterable thing. It keeps track of the start and endpoints of the window, which can be advanced with the help of pagination requests.
Before the window is useful, it must be initialised by calling [load](TimelineWindow.html#load).
Note that the window will not automatically extend itself when new events are received from /sync; you should arrange to call [paginate](TimelineWindow.html#paginate) on [Timeline](../enums/RoomEvent.html#Timeline) events.