2023-05-09 00:22:00 +00:00
|
|
|
import { WorkerServerBus } from '~/util/WorkerEventBus';
|
2023-05-08 16:36:10 +00:00
|
|
|
import { DECRYPTION_WORKER_ACTION_NAME } from './constants';
|
|
|
|
|
2023-05-14 23:09:26 +00:00
|
|
|
import { getSDKVersion } from '@jixun/libparakeet';
|
2023-05-14 22:15:59 +00:00
|
|
|
|
2023-05-21 16:58:54 +00:00
|
|
|
import { workerDecryptHandler } from './worker/handler/decrypt';
|
2023-05-09 00:23:35 +00:00
|
|
|
|
2023-05-08 16:36:10 +00:00
|
|
|
const bus = new WorkerServerBus();
|
|
|
|
onmessage = bus.onmessage;
|
|
|
|
|
2023-05-14 23:09:26 +00:00
|
|
|
bus.addEventHandler(DECRYPTION_WORKER_ACTION_NAME.DECRYPT, workerDecryptHandler);
|
2023-05-17 23:18:22 +00:00
|
|
|
bus.addEventHandler(DECRYPTION_WORKER_ACTION_NAME.VERSION, getSDKVersion);
|