Class

SynchronousMatrixClient

SynchronousMatrixClient(baseClient)

A MatrixClient class that handles events in sync for the /sync loop, instead of trying to push its way through the /sync loop as fast as possible. It is intended that the consumer extend this class and override the onWhatever() functions it needs. All of the onWhatever() functions have a default behaviour of doing nothing.
Constructor

# new SynchronousMatrixClient(baseClient)

Creates a new SynchronousMatrixClient. Note that this accepts a MatrixClient, though much of the class's properties are not brought over. Always convert your MatrixClient instance to a SynchronousMatrixClient as soon as possible to avoid diversion in which properties are proxied over.
Parameters:
Name Type Description
baseClient MatrixClient The client to wrap.

View Source SynchronousMatrixClient.ts, line 10

Classes

SynchronousMatrixClient
SynchronousMatrixClient

Methods

# protected onAccountData(event) → {Promise.<any>}

Handles the `account_data` event raised by the client.
Parameters:
Name Type Description
event any The account data event.

View Source SynchronousMatrixClient.ts, line 148

Resolves when complete.
Promise.<any>

# protected onRoomAccountData(roomId, event) → {Promise.<any>}

Handles the `room.account_data` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the account data applies to.
event any The room account data event.

View Source SynchronousMatrixClient.ts, line 157

Resolves when complete.
Promise.<any>

# protected onRoomArchived(roomId, event) → {Promise.<any>}

Handles the `room.archived` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the event happened in.
event any The event.

View Source SynchronousMatrixClient.ts, line 202

Resolves when complete.
Promise.<any>

# protected onRoomEvent(roomId, event) → {Promise.<any>}

Handles the `room.event` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the event happened in.
event any The event.

View Source SynchronousMatrixClient.ts, line 220

Resolves when complete.
Promise.<any>

# protected onRoomInvite(roomId, event) → {Promise.<any>}

Handles the `room.invite` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the event happened in.
event any The event.

View Source SynchronousMatrixClient.ts, line 175

Resolves when complete.
Promise.<any>

# protected onRoomJoin(roomId, event) → {Promise.<any>}

Handles the `room.join` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the event happened in.
event any The event.

View Source SynchronousMatrixClient.ts, line 184

Resolves when complete.
Promise.<any>

# protected onRoomLeave(roomId, event) → {Promise.<any>}

Handles the `room.leave` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the event happened in.
event any The event.

View Source SynchronousMatrixClient.ts, line 166

Resolves when complete.
Promise.<any>

# protected onRoomMessage(roomId, event) → {Promise.<any>}

Handles the `room.message` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the event happened in.
event any The event.

View Source SynchronousMatrixClient.ts, line 193

Resolves when complete.
Promise.<any>

# protected onRoomUpgraded(roomId, event) → {Promise.<any>}

Handles the `room.upgraded` event raised by the client.
Parameters:
Name Type Description
roomId string The Room ID the event happened in.
event any The event.

View Source SynchronousMatrixClient.ts, line 211

Resolves when complete.
Promise.<any>