interface EventOptions { once?: boolean; capture?: boolean; } type EventCallback = (event: Event) => void; export declare const EventPhase: { readonly NONE: 0; readonly CAPTURING_PHASE: 1; readonly AT_TARGET: 2; readonly BUBBLING_PHASE: 3; }; export type EventPhase = typeof EventPhase[keyof typeof EventPhase]; export declare const NONE: 0; export declare const CAPTURING_PHASE: 1; export declare const AT_TARGET: 2; export declare const BUBBLING_PHASE: 3; export declare class Event, string> = ''> { static create, string> = ''>(type: E, bubbles?: boolean, cancelable?: boolean): Event; type: E; parentNode: any; target: EventTarget | null; currentTarget: EventTarget | null; data: T | null; eventPhase: number; bubbles: boolean; cancelable: boolean; defaultPrevented: boolean; cancelBubble: boolean; immediateCancelBubble: boolean; constructor(type: E, bubbles?: boolean, cancelable?: boolean); setData(data: T | null): this; initEvent(type: E, bubbles?: boolean, cancelable?: boolean): void; /** * * @returns {EventTarget[]} */ composedPath(): EventTarget<{}>[]; preventDefault(): void; stopPropagation(): void; stopImmediatePropagation(): void; } export interface EventTarget = {}> { on(type: K, fn: EventCallback, options?: EventOptions | boolean): void; off(type: K, fn: EventCallback, options?: EventOptions | boolean): void; emit>(e: Event): void; } export declare class EventTarget = {}> { parent: EventTarget | null; private _bubble_emitter; private _capture_emitter; addEventListener(type: K, fn: EventCallback, options?: EventOptions | boolean): void; removeEventListener(type: K, fn: EventCallback, options?: EventOptions | boolean): void; /** * * @param {Event} e */ dispatchEvent>(e: Event): boolean; removeAllListeners(): void; } export { EventTarget as EventPropagation };