Skip to content

Commit 48b3106

Browse files
author
paulgo
committed
Improves event typings
1 parent 906b9d8 commit 48b3106

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Raw.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,9 @@ class Raw extends (() => Object as any as RawElements)()
578578
}
579579

580580
/** */
581-
on<K extends keyof Raw.ExtendedEventMap>(
581+
on<K extends keyof Raw.EventMap>(
582582
type: K,
583-
listener: (this: HTMLElement, ev: Raw.ExtendedEventMap[K]) => any,
583+
listener: (this: HTMLElement, ev: Raw.EventMap[K]) => any,
584584
options?: boolean | EventListenerOptions): Raw.Event;
585585
/** */
586586
on<K extends keyof Raw.EventMap>(
@@ -589,6 +589,12 @@ class Raw extends (() => Object as any as RawElements)()
589589
listener: (this: HTMLElement, ev: Raw.EventMap[K]) => any,
590590
options?: boolean | EventListenerOptions): Raw.Event;
591591
/** */
592+
on<K extends keyof WindowEventMap>(
593+
remoteTarget: Window,
594+
type: K,
595+
listener: (this: Window, ev: WindowEventMap[K]) => any,
596+
options?: boolean | EventListenerOptions): Raw.Event;
597+
/** */
592598
on(...args: any[])
593599
{
594600
const target: Node | null = typeof args[0] === "string" ? null : args[0];
@@ -1399,11 +1405,6 @@ declare namespace Raw
13991405
export interface EventMap extends HTMLElementEventMap
14001406
{
14011407
"input": InputEvent;
1402-
}
1403-
1404-
/** */
1405-
export interface ExtendedEventMap extends EventMap
1406-
{
14071408
"connected": Event;
14081409
"disconnected": Event;
14091410
"rendered": Event;

0 commit comments

Comments
 (0)