Members
ContentRepo
ContentRepo utility functions.
CRYPTO_ENABLED
True if crypto libraries are being used on this client.
EventStatus
The EventStatus enum.
EventTimeline
The module:models/event-timeline~EventTimeline class.
EventTimelineSet
Filter
The Filter class.
InteractiveAuth
The module:interactive-auth class.
MatrixClient
The MatrixClient class.
MatrixError
The MatrixError class.
MatrixEvent
The MatrixEvent class.
MatrixHttpApi
The MatrixHttpApi class.
MatrixInMemoryStore
The MatrixInMemoryStore class.
MatrixScheduler
The MatrixScheduler class.
Room
The Room class.
RoomMember
The RoomMember class.
RoomState
The RoomState class.
TimelineWindow
The module:timeline-window~TimelineWindow class.
User
The User class.
WebStorageSessionStore
The WebStorageSessionStore class. Work in progress; unstable.
WebStorageStore
The WebStorageStore class.
Work in progress; unstable.
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
|
- Source:
- See:
-
- module:client~MatrixClient for the full list of options for
opts
.
- module:client~MatrixClient for the full list of options for
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. |
Returns:
The Matrix call or null if the browser
does not support WebRTC.
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. |
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. |
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
|
|||||||||||||||||||||
callback |
requestCallback | The request callback. |