Spaces:
Running
Running
File size: 1,212 Bytes
645859a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | export type Listener = (event?: DispatcherEvent) => void;
export interface DispatcherEvent {
type: string;
[key: string]: any;
}
export declare class EventDispatcher {
private _listeners;
/**
* Adds the specified event listener.
* @param type event name
* @param listener handler function
* @category Methods
*/
addEventListener(type: string, listener: Listener): void;
/**
* Presence of the specified event listener.
* @param type event name
* @param listener handler function
* @category Methods
*/
hasEventListener(type: string, listener: Listener): boolean;
/**
* Removes the specified event listener
* @param type event name
* @param listener handler function
* @category Methods
*/
removeEventListener(type: string, listener: Listener): void;
/**
* Removes all event listeners
* @param type event name
* @category Methods
*/
removeAllEventListeners(type?: string): void;
/**
* Fire an event type.
* @param event DispatcherEvent
* @category Methods
*/
dispatchEvent(event: DispatcherEvent): void;
}
|