#import <DOM/EventTarget.idl>
#import <DOM/EventHandler.idl>

// https://dom.spec.whatwg.org/#interface-AbortSignal
[Exposed=(Window,Worker), CustomVisit]
interface AbortSignal : EventTarget {
    // FIXME: [NewObject] static AbortSignal abort(optional any reason);
    // FIXME: [Exposed=(Window,Worker), NewObject] static AbortSignal timeout([EnforceRange] unsigned long long milliseconds);
    // FIXME: [NewObject] static AbortSignal _any(sequence<AbortSignal> signals);

    readonly attribute boolean aborted;
    readonly attribute any reason;
    undefined throwIfAborted();

    attribute EventHandler onabort;
};
