Remove __event, __eventTarget, __customEvent namespaces
@@ -35,12 +35,24 @@ unitTest(function constructedEventTargetCanBeUsedAsExpected(): void {
assertEquals(callCount, 2);
});
+// TODO(ry) Should AddEventListenerOptions and EventListenerOptions be exposed
+// from the public API?
+
+interface AddEventListenerOptions extends EventListenerOptions {
+ once?: boolean;
+ passive?: boolean;
+}
+
+interface EventListenerOptions {
+ capture?: boolean;
+}
+
unitTest(function anEventTargetCanBeSubclassed(): void {
class NicerEventTarget extends EventTarget {
on(
type: string,
callback: ((e: Event) => void) | null,
- options?: __domTypes.AddEventListenerOptions
+ options?: AddEventListenerOptions
): void {
this.addEventListener(type, callback, options);
}
@@ -48,7 +60,7 @@ unitTest(function anEventTargetCanBeSubclassed(): void {
off(
type: string,
callback: ((e: Event) => void) | null,
- options?: __domTypes.EventListenerOptions
+ options?: EventListenerOptions
): void {
this.removeEventListener(type, callback, options);
}
