///
///
///
declare global {
namespace React {
// Augment React synthetic events to provide typed target for ALL HTML elements
interface SyntheticEvent {
target: EventTarget & T;
}
}
// Augment DOM event listeners to provide typed target for ALL elements
// This works by augmenting the base Element interface which covers all HTML, SVG, etc.
interface Element {
addEventListener(
type: K,
listener: (this: Element, ev: HTMLElementEventMap[K] & { target: Element }) => any,
options?: boolean | AddEventListenerOptions
): void;
removeEventListener(
type: K,
listener: (this: Element, ev: HTMLElementEventMap[K] & { target: Element }) => any,
options?: boolean | EventListenerOptions
): void;
}
}
export {};