1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-13 19:42:25 +03:00
Files
matrix-js-sdk/lib/matrix.js
Kegan Dougal d1e51de7ec Split out matrix.js into different files. Glue things back.
Added a models directory. Added store, http-api and client files. Slowly
transitioning to the architecture outlined in SYJS-5.
2015-06-03 17:55:12 +01:00

34 lines
1.1 KiB
JavaScript

"use strict";
/** The Matrix Event class */
module.exports.MatrixEvent = require("./models/event").MatrixEvent;
/** An in-memory store for the SDK */
module.exports.MatrixInMemoryStore = require("./store/memory");
/** The raw HTTP API */
module.exports.MatrixHttpApi = require("./http-api");
/** The managed client class */
module.exports.MatrixClient = require("./client");
// expose the underlying request object so different environments can use
// different request libs (e.g. request or browser-request)
var request;
/**
* The function used to perform HTTP requests.
* @param {Function} r The request function which accepts (opts, callback)
*/
module.exports.request = function(r) {
request = r;
};
/**
* Create a new Matrix Client.
* @param {Object} credentials The Matrix credentials to use.
* @param {Object} config The config options for the client
* @param {Store} store The type of store to use.
* @return {MatrixClient} A new Matrix Client
*/
module.exports.createClient = function(credentials, config, store) {
return new module.exports.MatrixClient(credentials, config, store, request);
};