mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-10 17:39:31 +02:00
Re-added typed event target
This commit is contained in:
parent
1c73b7c269
commit
54ec5904f0
17
src/@types/typed-event-target.ts
Normal file
17
src/@types/typed-event-target.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Interface restricting the events emitted by an {@linkcode EventTarget} to a certain kind of {@linkcode Event}.
|
||||
* @typeParam T - The type to restrict the interface's access; must extend from {@linkcode Event}
|
||||
*/
|
||||
export interface TypedEventTarget<T extends Event = never> extends EventTarget {
|
||||
dispatchEvent(event: T): boolean;
|
||||
addEventListener(
|
||||
event: T["type"],
|
||||
callback: EventListenerOrEventListenerObject | null,
|
||||
options?: AddEventListenerOptions | boolean,
|
||||
): void;
|
||||
removeEventListener(
|
||||
type: T["type"],
|
||||
callback: EventListenerOrEventListenerObject | null,
|
||||
options?: EventListenerOptions | boolean,
|
||||
): void;
|
||||
}
|
Loading…
Reference in New Issue
Block a user