ladybird/Userland/Libraries/LibWeb/DOM/EventTarget.idl
Luke Wilde 3479f1c4e8 LibWeb: Add support for the options variant of {add,remove}EventListener
This also adds a variant of {add,remove}_event_listener called
{add,remove}_event_listener_with_options.

This is used internally to perform {add,remove}_event_listener with a
default constructed options struct. It was done like this because
default constructing the Variant with the options struct requires the
struct defintions to be present, which requires us to include
AbortSignal.h, which would cause a circular include as AbortSignal.h
includes EventTarget.h.
2022-02-20 02:03:24 +01:00

21 lines
616 B
Plaintext

#import <DOM/AbortSignal.idl>
interface EventTarget {
undefined addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options = {});
undefined removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options = {});
[ImplementedAs=dispatch_event_binding] boolean dispatchEvent(Event event);
};
dictionary EventListenerOptions {
boolean capture = false;
};
dictionary AddEventListenerOptions : EventListenerOptions {
boolean passive = false;
boolean once = false;
AbortSignal signal;
};