// https://html.spec.whatwg.org/multipage/workers.html#worker
[Exposed=(Window,DedicatedWorker,SharedWorker)]
interface Worker : EventTarget {
    constructor((TrustedScriptURL or Utf16USVString) scriptURL, optional WorkerOptions options = {});

    undefined terminate();
    undefined postMessage(any message, sequence<object> transfer);
    undefined postMessage(any message, optional StructuredSerializeOptions options = {});

    attribute EventHandler onmessage;
    attribute EventHandler onmessageerror;
};

dictionary WorkerOptions {
    DOMString name = "";
    WorkerType type = "classic";
    RequestCredentials credentials = "same-origin";
};

enum WorkerType { "classic", "module" };

Worker includes AbstractWorker;
