Create a new sliding sync instance
The base URL of the sliding sync proxy
The lists to use for sliding sync.
The params to use for room subscriptions.
The client to use for /sync calls.
The number of milliseconds to wait for a response.
Private
Optional
abortPrivate
Readonly
clientThe client to use for /sync calls.
Private
confirmedPrivate
customPrivate
desiredPrivate
extensionsPrivate
listPrivate
listsPrivate
needsPrivate
Optional
pendingPrivate
Readonly
proxyThe base URL of the sliding sync proxy
Private
roomPrivate
roomThe params to use for room subscriptions.
Private
terminatedPrivate
Readonly
timeoutMSThe number of milliseconds to wait for a response.
Private
txnPrivate
txnAdd a custom room subscription, referred to by an arbitrary name. If a subscription with this name already exists, it is replaced. No requests are sent by calling this method.
The name of the subscription. Only used to reference this subscription in useCustomSubscription.
The subscription information.
Private
addRest
...args: Parameters<SlidingSyncEventHandlerMap[T]>Rest
...args: Parameters<SlidingSyncEventHandlerMap[T]>Private
getGet the room index data for a list.
The list data which contains the rooms in this list
The list key
Get the full request list parameters for a list index. This function is provided for callers to use in conjunction with setList to update fields on an existing list.
A copy of the list params or undefined.
The list key to get the params for.
Private
invokeInvoke all attached lifecycle listeners.
The Lifecycle state
The raw sync response JSON
Optional
err: ErrorAny error that occurred when making the request e.g. network errors.
Private
invokeInvoke all attached room data listeners.
The room which received some data.
The raw sliding sync response JSON.
Modify which events to retrieve for room subscriptions. Invalidates all room subscriptions such that they will be sent up afresh.
A promise which resolves to the transaction ID when it has been received down sync (or rejects with the transaction ID if the action was not applied e.g the request was cancelled immediately after sending, in which case the action will be applied in the subsequent request)
The new room subscription fields to fetch.
Modify the room subscriptions for the sync API. Calling this function will interrupt the /sync request to resend new subscriptions. If the /sync stream has not started, this will prepare the room subscriptions for when start() is called.
A promise which resolves to the transaction ID when it has been received down sync (or rejects with the transaction ID if the action was not applied e.g the request was cancelled immediately after sending, in which case the action will be applied in the subsequent request)
The new desired room subscriptions.
Private
onPrivate
onPrivate
processOptional
event: EventEmitterEvents | SlidingSyncEventPrivate
removePrivate
resetupPrivate
resolveAdd or replace a list. Calling this function will interrupt the /sync request to resend new lists.
A promise which resolves to the transaction ID when it has been received down sync (or rejects with the transaction ID if the action was not applied e.g the request was cancelled immediately after sending, in which case the action will be applied in the subsequent request)
The key to modify
The new list parameters.
Set new ranges for an existing list. Calling this function when only the ranges have changed is more efficient than calling setList(index,list) as this function won't resend sticky params, whereas setList always will.
A promise which resolves to the transaction ID when it has been received down sync (or rejects with the transaction ID if the action was not applied e.g the request was cancelled immediately after sending, in which case the action will be applied in the subsequent request)
The list key to modify
The new ranges to apply.
Private
shiftPrivate
shiftUse a custom subscription previously added via addCustomSubscription. No requests are sent by calling this method. Use modifyRoomSubscriptions to resend subscription information.
The room to use the subscription in.
The name of the subscription. If this name is unknown, the default subscription will be used.
Generated using TypeDoc
SlidingSync is a high-level data structure which controls the majority of sliding sync. It has no hooks into JS SDK except for needing a MatrixClient to perform the HTTP request. This means this class (and everything it uses) can be used in isolation from JS SDK if needed. To hook this up with the JS SDK, you need to use SlidingSyncSdk.