mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-11-22 13:23:39 +00:00
15 lines
337 B
TypeScript
15 lines
337 B
TypeScript
import { wrap } from 'comlink'
|
|
|
|
import CryptWorker from './worker?worker'
|
|
import type { packContent, unpackContent } from '@cryptgeon/shared'
|
|
|
|
export function createWorker() {
|
|
const worker = new CryptWorker()
|
|
return wrap<WorkerConract>(worker)
|
|
}
|
|
|
|
export type WorkerConract = {
|
|
pack: typeof packContent
|
|
unpack: typeof unpackContent
|
|
}
|