// tasks/resize-image.ts — runs on a worker thread
import { defineWorkerTask } from '@setu-ts/runtime/worker';
defineWorkerTask<Uint8Array, Uint8Array>(async (imageBytes) => {
return await resize(imageBytes);
});
Inputs and outputs travel by structured clone: plain data only, no functions or class instances.
Registers this module's task handler. Call once, at module top level, in a module that the WorkerPoolPlugin executes: