Setu-TS
    Preparing search index...
    • Registers this module's task handler. Call once, at module top level, in a module that the WorkerPoolPlugin executes:

      Type Parameters

      • TInput
      • TOutput

      Parameters

      Returns void

      // 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.

      When called outside a worker

      0.1.0