Global

Members

ContentHelpers

Source:

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:

Group

The Group class.
Source:

IndexedDBStore

The IndexedDBStore class.
Source:

IndexedDBStoreBackend

The IndexedDBStoreBackend class.
Source:

IndexedDBStoreWorker

The module:indexeddb-store-worker~IndexedDBStoreWorker class.
Source:

InteractiveAuth

Source:

InvalidStoreError

The InvalidStoreError class.
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:

SyncAccumulator

The SyncAccumulator class.
Source:

TimelineWindow

Source:

User

The User class.
Source:

WebStorageSessionStore

The WebStorageSessionStore 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 Attributes 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.
cryptoStore module:crypto.store.base~CryptoStore <optional>
crypto store implementation. Calls the factory supplied to setCryptoStoreFactory if unspecified; or if no factory has been specified, uses a default implementation (indexeddb in the browser, in-memory otherwise).
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

getRequest() → {requestFunction}

Return the currently-set request function.
Source:
Returns:
The current request function.
Type
requestFunction

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:

selectQuery(store, keyRangeopt, resultMapper) → {Promise.<Array.<T>>}

Helper method to collect results from a Cursor and promiseify it.
Parameters:
Name Type Attributes Description
store ObjectStore | Index The store to perform openCursor on.
keyRange IDBKeyRange <optional>
Optional key range to apply on the cursor.
resultMapper function A function which is repeatedly called with a Cursor. Return the data you want to keep.
Source:
Returns:
Resolves to an array of whatever you returned from resultMapper.
Type
Promise.<Array.<T>>

setCryptoStoreFactory(fac)

Configure a different factory to be used for creating crypto stores
Parameters:
Name Type Description
fac function a function which will return a new module:crypto.store.base~CryptoStore.
Source:

setMatrixCallAudioInput(deviceIdopt)

Set an audio input device to use for MatrixCalls
Parameters:
Name Type Attributes Description
deviceId string <optional>
the identifier for the device undefined treated as unset
Source:

setMatrixCallAudioOutput(deviceIdopt)

Set an audio output device to use for MatrixCalls
Parameters:
Name Type Attributes Description
deviceId string <optional>
the identifier for the device undefined treated as unset
Source:

setMatrixCallVideoInput(deviceIdopt)

Set a video input device to use for MatrixCalls
Parameters:
Name Type Attributes Description
deviceId string <optional>
the identifier for the device undefined treated as unset
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

wrapRequest(wrapper)

Apply wrapping code around the request function. The wrapper function is installed as the new request handler, and when invoked it is passed the previous value, along with the options and callback arguments.
Parameters:
Name Type Description
wrapper requestWrapperFunction The wrapping function.
Source:

Type Definitions

Promise

A promise implementation (Q). Functions which return this will specify 2 return arguments. These arguments map to the "onFulfilled" and "onRejected" values of the Promise.
Type:
  • Object
Properties:
Name Type Description
then function promise.then(onFulfilled, onRejected, onProgress)
catch function promise.catch(onRejected)
finally function promise.finally(callback)
done function promise.done(onFulfilled, onRejected, onProgress)
Source:

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:

requestWrapperFunction(origRequest, opts, callback)

A wrapper for the request function interface.
Parameters:
Name Type Description
origRequest requestFunction The underlying request function being wrapped
opts Object The options for this HTTP request, given in the same form as requestFunction.
callback requestCallback The request callback.
Source: