um-react/src/decrypt-worker/worker.ts

16 lines
487 B
TypeScript
Raw Normal View History

2023-05-09 00:22:00 +00:00
import { WorkerServerBus } from '~/util/WorkerEventBus';
import { DECRYPTION_WORKER_ACTION_NAME } from './constants';
import { getSDKVersion } from '@jixun/libparakeet';
2023-05-14 22:15:59 +00:00
import { workerDecryptHandler } from './worker-handler/decrypt';
const bus = new WorkerServerBus();
onmessage = bus.onmessage;
bus.addEventHandler(DECRYPTION_WORKER_ACTION_NAME.DECRYPT, workerDecryptHandler);
2023-05-13 19:04:55 +00:00
bus.addEventHandler(DECRYPTION_WORKER_ACTION_NAME.VERSION, async () => {
return getSDKVersion();
});