From 198a045dbee7b0350055b7f88f1e0670da87fb3b Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 9 Apr 2020 06:03:44 -0400 Subject: Remove __event, __eventTarget, __customEvent namespaces (#4683) --- cli/js/tests/event_target_test.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cli/js/tests') diff --git a/cli/js/tests/event_target_test.ts b/cli/js/tests/event_target_test.ts index 45f626502..ece4b5dba 100644 --- a/cli/js/tests/event_target_test.ts +++ b/cli/js/tests/event_target_test.ts @@ -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); } -- cgit v1.2.3