Skip to content

Commit c66e580

Browse files
author
paulgo
committed
Rename Raw.Event to Raw.Portable event in order to improve DX around custom event typing.
1 parent 8b56d33 commit c66e580

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Raw.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,11 @@ class Raw extends (() => Object as any as RawElements)()
451451
}
452452
else switch (param.constructor)
453453
{
454-
case Raw.Event:
454+
case Raw.PortableEvent:
455455
{
456456
if (e)
457457
{
458-
const he = param as Raw.Event;
458+
const he = param as Raw.PortableEvent;
459459
if (he.target)
460460
he.host = e;
461461
else
@@ -561,7 +561,7 @@ class Raw extends (() => Object as any as RawElements)()
561561
//# Event Related
562562

563563
/** */
564-
static readonly Event = class Event
564+
static readonly PortableEvent = class PortableEvent
565565
{
566566
/** */
567567
constructor(
@@ -583,19 +583,19 @@ class Raw extends (() => Object as any as RawElements)()
583583
on<K extends keyof Raw.EventMap>(
584584
type: K,
585585
listener: (this: HTMLElement, ev: Raw.EventMap[K]) => any,
586-
options?: boolean | EventListenerOptions): Raw.Event;
586+
options?: boolean | EventListenerOptions): Raw.PortableEvent;
587587
/** */
588588
on<K extends keyof Raw.EventMap>(
589589
remoteTarget: Node | Window,
590590
type: K,
591591
listener: (this: HTMLElement, ev: Raw.EventMap[K]) => any,
592-
options?: boolean | EventListenerOptions): Raw.Event;
592+
options?: boolean | EventListenerOptions): Raw.PortableEvent;
593593
/** */
594594
on<K extends keyof WindowEventMap>(
595595
remoteTarget: Window,
596596
type: K,
597597
listener: (this: Window, ev: WindowEventMap[K]) => any,
598-
options?: boolean | EventListenerOptions): Raw.Event;
598+
options?: boolean | EventListenerOptions): Raw.PortableEvent;
599599
/** */
600600
on(...args: any[])
601601
{
@@ -611,7 +611,7 @@ class Raw extends (() => Object as any as RawElements)()
611611
options.once = true;
612612
}
613613

614-
const hev = new Raw.Event(target, type, handler, options);
614+
const hev = new Raw.PortableEvent(target, type, handler, options);
615615

616616
// If the event has a defined target, then add the event listener right away,
617617
// and the apply() function will assign any host element, if present.
@@ -1057,7 +1057,7 @@ declare namespace Raw
10571057
// Class name list
10581058
string |
10591059
// Event connections
1060-
Raw.Event |
1060+
Raw.PortableEvent |
10611061
// Immediately invoked closure
10621062
ElementClosure |
10631063
// Arrays of Params
@@ -1073,7 +1073,7 @@ declare namespace Raw
10731073

10741074
/** */
10751075
export type ShadowParam =
1076-
Raw.Event |
1076+
Raw.PortableEvent |
10771077
Raw.ShadowClosure |
10781078
// Conditionals
10791079
false | void | null | undefined |
@@ -1403,7 +1403,7 @@ declare namespace Raw
14031403
declare namespace Raw
14041404
{
14051405
/** */
1406-
export type Event = InstanceType<typeof Raw.Event>;
1406+
export type PortableEvent = InstanceType<typeof Raw.PortableEvent>;
14071407

14081408
/** */
14091409
export interface EventMap extends HTMLElementEventMap

0 commit comments

Comments
 (0)