/** * Type-safe event listener and dispatch signatures for the custom events * defined in `TDetails`. */ export interface CustomEventTarget { addEventListener(type: TType, listener: (ev: CustomEvent) => any, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: TType, listener: (ev: CustomEvent) => any, options?: boolean | EventListenerOptions): void; dispatchEvent(ev: _TypedCustomEvent): void; } /** * Internal declaration for the `typeof` trick below. * Never actually implemented. */ declare class _TypedCustomEvent extends CustomEvent { constructor(type: TType, eventInitDict: { detail: TDetails[TType]; } & EventInit); } /** * Typed custom event (technically a typed alias of `CustomEvent`). * Use with `CustomEventTarget.dispatchEvent` to infer `detail` types * automatically. */ export declare const TypedCustomEvent: typeof _TypedCustomEvent; export declare function createEventTarget(): CustomEventTarget; export {};