A copy of SyncApi such that it can be used as a drop-in replacement for sync v2. For the actual sliding sync API, see sliding-sync.ts or the class SlidingSync.

Constructors

Methods

  • Returns the additional data object associated with the current sync state, or null if there is no such data. Sync errors, if available, are put in the 'error' key of this object.

    Returns null | SyncStateData

  • Injects events into a room's model.

    Parameters

    • room: Room
    • stateEventList: MatrixEvent[]

      A list of state events. This is the state at the END of the timeline list if it is supplied.

    • timelineEventList: MatrixEvent[] = []

      A list of timeline events. Lower index is earlier in time. Higher index is later.

    • numLive: number = 0

      the number of events in timelineEventList which just happened, supplied from the server.

    Returns Promise<void>

  • Peek into a room. This will result in the room in question being synced so it is accessible via getRooms(). Live updates for the room will be provided.

    Parameters

    • roomId: string

      The room ID to peek into.

    Returns Promise<Room>

    A promise which resolves once the room has been added to the store.

  • Specify the set_presence value to be used for subsequent calls to the Sync API.

    Parameters

    • Optionalpresence: SetPresence

      the presence to specify to set_presence of sync calls

    Returns void

  • Stop polling for updates in the peeked room. NOPs if there is no room being peeked.

    Returns void