import type { EventOfType, TypedCustomEvent } from "./TypedCustomEvent"; export type TypedEventListener = (evt: Event) => void; export interface TypedEventListenerOptions { once?: boolean; } /** * Extract the generic Events type (which must extend {@link TypedCustomEvent}) from a {@link TypedEventTarget} */ export type EventsFromTarget = Target extends TypedEventTarget ? Events : never; /** * This wrapper around EventTarget provides more descriptive type information. By using this class, calls to EventTarget * methods are correctly type checked to ensure only allowed event types are used, and that events and their type * strings are correctly associated. * * For example, when calling TypedEventTarget::addEventListener, the event passed to the callback will have the correct * type corresponding to the type of event for which the listener has been added. */ export declare class TypedEventTarget { private readonly listeners; private readonly options; constructor(); addEventListener(type: K, callback: TypedEventListener>, options?: TypedEventListenerOptions): void; dispatchEvent(event: Events): true; removeEventListener(type: K, callback: TypedEventListener>): void; } //# sourceMappingURL=TypedEventTarget.d.ts.map