Revert loki modules to commonjs export

pull/1161/head
Mikunj 5 years ago
parent 4139144b73
commit 2f5fd5d835

@ -478,7 +478,7 @@ const serverRequest = async (endpoint, options = {}) => {
};
// the core ADN class that handles all communication with a specific server
export default class LokiAppDotNetServerAPI {
class LokiAppDotNetServerAPI {
constructor(ourKey, url) {
this.ourKey = ourKey;
this.channels = [];
@ -2314,3 +2314,7 @@ class LokiPublicChannelAPI {
return false;
}
}
// These files are expected to be in commonjs so we can't use es6 syntax :(
// If we move these to TS then we should be able to use es6
module.exports = LokiAppDotNetServerAPI;

@ -67,7 +67,7 @@ async function _retrieveNextMessages(nodeData, pubkey) {
return result.messages || [];
}
export default class LokiMessageAPI {
class LokiMessageAPI {
constructor(ourKey) {
this.jobQueue = new window.JobQueue();
this.sendingData = {};
@ -610,3 +610,7 @@ export default class LokiMessageAPI {
// no, our caller already handles this...
}
}
// These files are expected to be in commonjs so we can't use es6 syntax :(
// If we move these to TS then we should be able to use es6
module.exports = LokiMessageAPI;

@ -3,7 +3,7 @@ const EventEmitter = require('events');
const nodeFetch = require('node-fetch');
const LokiAppDotNetAPI = require('./loki_app_dot_net_api');
export default class LokiPublicChatFactoryAPI extends EventEmitter {
class LokiPublicChatFactoryAPI extends EventEmitter {
constructor(ourKey) {
super();
this.ourKey = ourKey;
@ -199,3 +199,7 @@ export default class LokiPublicChatFactoryAPI extends EventEmitter {
);
}
}
// These files are expected to be in commonjs so we can't use es6 syntax :(
// If we move these to TS then we should be able to use es6
module.exports = LokiPublicChatFactoryAPI;

Loading…
Cancel
Save