You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
615 B
16 lines
615 B
import { EncryptionService } from "./EncryptionService";
|
|
import { SJCLEncryptionService } from "./SJCLEncryptionService";
|
|
// import PromiseWorker = require('promise-worker');
|
|
import PromiseWorker from "promise-worker";
|
|
|
|
export class EncryptionServiceFactory {
|
|
private static readonly _worker = new Worker(
|
|
localStorage.getItem("CHAT_WORKER_BUNDLE") || "chat-worker-error.js"
|
|
);
|
|
private static readonly _promiseWorker = new PromiseWorker(
|
|
EncryptionServiceFactory._worker
|
|
);
|
|
public static getEncryptionService(): EncryptionService {
|
|
return new SJCLEncryptionService(this._promiseWorker);
|
|
}
|
|
}
|