import { Event } from "./Event"; import { ASObject } from "../../avm2/nat/ASObject"; import { IEventDispatcher, EventHandler } from "./IEventDispatcher"; import { AXClass } from '../../avm2/run/AXClass'; /** * Broadcast Events * * The logic here is pretty much copied from: * http://www.senocular.com/flash/tutorials/orderofoperations/ */ export declare class BroadcastEventDispatchQueue { /** * The queues start off compact but can have null values if event targets are removed. * Periodically we compact them if too many null values exist. */ private _queues; constructor(); reset(): void; add(type: string, target: EventDispatcher): void; remove(type: string, target: EventDispatcher): void; dispatchEvent(event: Event): void; getQueueLength(type: string): number; } /** * The EventDispatcher class is the base class for all classes that dispatch events. * The EventDispatcher class implements the IEventDispatcher interface and is the base class for * the DisplayObject class. The EventDispatcher class allows any object on the display list to be * an event target and as such, to use the methods of the IEventDispatcher interface. */ export declare class EventDispatcher extends ASObject implements IEventDispatcher { static axClass: typeof EventDispatcher & AXClass; static broadcastEventDispatchQueue: BroadcastEventDispatchQueue; static classInitializer(): void; private _target; private _captureListeners; private _targetOrBubblingListeners; protected _fieldsInitialized: boolean; constructor(target?: IEventDispatcher); protected _initializeFields(target: IEventDispatcher): void; toString(): string; /** * Don't lazily construct listener lists if all we're doing is looking for listener types that * don't exist yet. */ private _getListenersForType; /** * Lazily construct listeners lists to avoid object allocation. */ private _getListeners; addEventListener(type: string, listener: EventHandler, useCapture?: boolean, priority?: number, useWeakReference?: boolean): void; removeEventListener(type: string, listener: EventHandler, useCapture?: boolean): void; private _hasTargetOrBubblingEventListener; private _hasCaptureEventListener; /** * Faster internal version of |hasEventListener| that doesn't do any argument checking. */ private _hasEventListener; hasEventListener(type: string): boolean; willTrigger(type: string): boolean; /** * Check to see if we can skip event dispatching in case there are no event listeners * for this |event|. */ private _skipDispatchEvent; dispatchEvent(event: Event): boolean; private static callListeners; }