import type { Worker as NodeWorker } from "worker_threads" ; import { createExpose , createWrap , Adapter } from "./shared" ; const adapter = [ ( ctx , arg ) => { ctx . postMessage ( { data : arg } ) ; } , ( ctx , handler ) => { ctx . on ( "message" , handler ) ; } , ( ctx ) => ctx . terminate ( ) , ] ; export type { WorkerApi , RemoteCall } from "./shared" ; export const expose = createExpose ( adapter ) ; export const wrap = createWrap ( adapter ) ;