Documentation
    Preparing search index...

    Interface WorkerLike

    The injected Worker seam for decodeInWorker (§76).

    The DOM's Worker satisfies it (postMessage / onmessage / optional terminate). Tests inject a fake that echoes or transforms an ArrayBuffer on the same turn or the next microtask — no real worker thread is required, and this package never names Worker.

    interface WorkerLike {
        onerror?: ((event: { message?: string }) => void) | null;
        onmessage: ((event: { data: unknown }) => void) | null;
        postMessage(message: unknown): void;
        terminate?(): void;
    }
    Index
    onerror?: ((event: { message?: string }) => void) | null

    Optional; a failed worker may surface here instead of onmessage.

    onmessage: ((event: { data: unknown }) => void) | null

    The one handler this package installs; null until then.

    • Delivers one message to the worker.

      Parameters

      • message: unknown

      Returns void

    • Optional; called once after the decode settles.

      Returns void