"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.workerPort = void 0;
const workerPort = (worker) => {
    const port = {
        send(message) {
            worker.postMessage(message);
        },
        onmessage(event) { },
        onerror(event) { },
    };
    worker.onerror = (event) => {
        const { message } = event;
        port.onerror({ message });
    };
    worker.onmessage = (event) => {
        const { data } = event;
        port.onmessage(data);
    };
    return port;
};
exports.workerPort = workerPort;
//# sourceMappingURL=worker.js.map