import { isNode as e } from "../constants/vite.constants.mjs";
//#region libs/shared/common/src/webworker/WorkerWrapper.ts
var t = class {
	worker;
	constructor(e) {
		this.worker = e;
	}
	postMessage(e) {
		this.worker.postMessage(e);
	}
	terminate() {
		this.worker.terminate();
	}
	onMessage(t) {
		e ? this.worker.on("message", t) : this.worker.onmessage = (e) => t(e.data);
	}
	onError(t) {
		e ? this.worker.on("error", t) : this.worker.onerror = t;
	}
};
//#endregion
export { t as WorkerWrapper };
