Global

Members

ContentRepo

ContentRepo utility functions.
Source:

CRYPTO_ENABLED

True if crypto libraries are being used on this client.
Source:

EventStatus

The EventStatus enum.
Source:

EventTimeline

Source:

EventTimelineSet

Source:

Filter

The Filter class.
Source:

InteractiveAuth

Source:

MatrixClient

The MatrixClient class.
Source:

MatrixError

The MatrixError class.
Source:

MatrixEvent

The MatrixEvent class.
Source:

MatrixHttpApi

The MatrixHttpApi class.
Source:

MatrixInMemoryStore

The MatrixInMemoryStore class.
Source:

MatrixScheduler

The MatrixScheduler class.
Source:

Room

The Room class.
Source:

RoomMember

The RoomMember class.
Source:

RoomState

The RoomState class.
Source:

TimelineWindow

Source:

User

The User class.
Source:

WebStorageSessionStore

The WebStorageSessionStore class. Work in progress; unstable.
Source:

WebStorageStore

The WebStorageStore class. Work in progress; unstable.
Source:

Methods

clearTimeout(key)

reimplementation of window.clearTimeout, which mirrors setTimeout
Parameters:
Name Type Description
key Number result from an earlier setTimeout call
Source:

createClient(opts) → {MatrixClient}

Construct a Matrix Client. Similar to module:client~MatrixClient except that the 'request', 'store' and 'scheduler' dependencies are satisfied.
Parameters:
Name Type Description
opts Object | string The configuration options for this client. If this is a string, it is assumed to be the base URL. These configuration options will be passed directly to module:client~MatrixClient.
Properties
Name Type Description
store Object If not set, defaults to module:store/memory.MatrixInMemoryStore.
scheduler Object If not set, defaults to module:scheduler~MatrixScheduler.
request requestFunction If not set, defaults to the function supplied to request which defaults to the request module from NPM.
Source:
See:
Returns:
A new matrix client.
Type
MatrixClient

createNewMatrixCall(client, roomId) → {module:webrtc/call~MatrixCall}

Create a new Matrix Call.
Parameters:
Name Type Description
client module:client.MatrixClient The MatrixClient instance to use.
roomId string The room the call is in.
Source:
Returns:
The Matrix call or null if the browser does not support WebRTC.
Type
module:webrtc/call~MatrixCall

request(r)

The function used to perform HTTP requests. Only use this if you want to use a different HTTP library, e.g. Angular's $http. This should be set prior to calling createClient.
Parameters:
Name Type Description
r requestFunction The request function to use.
Source:

setNow(f)

Replace the function used by this module to get the current time. Intended for use by the unit tests.
Parameters:
Name Type Description
f function function which should return a millisecond counter
Source:

setTimeout(func, delayMs) → {Number}

reimplementation of window.setTimeout, which will call the callback if the wallclock time goes past the deadline.
Parameters:
Name Type Description
func function callback to be called after a delay
delayMs Number number of milliseconds to delay by
Source:
Returns:
an identifier for this callback, which may be passed into clearTimeout later.
Type
Number

Type Definitions

requestCallback(err, response, body)

The request callback interface for performing HTTP requests. This matches the API for the request NPM module. The SDK will implement a callback which meets this interface in order to handle the HTTP response.
Parameters:
Name Type Description
err Error The error if one occurred, else falsey.
response Object The HTTP response which consists of {statusCode: {Number}, headers: {Object}}
body Object The parsed HTTP response body.
Source:

requestFunction(opts, callback)

The request function interface for performing HTTP requests. This matches the API for the request NPM module. The SDK will attempt to call this function in order to perform an HTTP request.
Parameters:
Name Type Description
opts Object The options for this HTTP request.
Properties
Name Type Description
uri string The complete URI.
method string The HTTP method.
qs Object The query parameters to append to the URI.
body Object The JSON-serializable object.
json boolean True if this is a JSON request.
_matrix_opts Object The underlying options set for MatrixHttpApi.
callback requestCallback The request callback.
Source: