1 | export interface EventCallback extends Function {
|
2 | _callback?: Function;
|
3 | }
|
4 | export interface EventMap {
|
5 | [name: string]: EventCallback;
|
6 | }
|
7 | export declare class Event {
|
8 | private _name;
|
9 | private _isPropagationStopped;
|
10 | private _isDefaultPrevented;
|
11 | constructor(name: string);
|
12 | stopPropagation(): void;
|
13 | preventDefault(): void;
|
14 | readonly name: string;
|
15 | readonly isPropagationStopped: boolean;
|
16 | readonly isDefaultPrevented: boolean;
|
17 | }
|
18 | export declare class EventDispatcher {
|
19 | private _events?;
|
20 | private _listeningTo?;
|
21 | private _listeners?;
|
22 | private readonly _listenId;
|
23 | private _savedListenId?;
|
24 | on(eventMap: EventMap, context?: any): any;
|
25 | on(eventMap: EventMap, callback?: EventCallback, context?: any, priority?: number): any;
|
26 | on(name: string, callback: EventCallback, context?: any, priority?: number): any;
|
27 | private internalOn;
|
28 | once(eventMap: EventMap, context?: any): any;
|
29 | once(name: string, callback: EventCallback, context?: any, priority?: any): any;
|
30 | off(): any;
|
31 | off(eventMap: EventMap | undefined, context?: any): any;
|
32 | off(name: string | undefined, callback?: EventCallback, context?: any): any;
|
33 | listenTo(obj: EventDispatcher, name: EventMap | string, callback?: EventCallback, priority?: number): this;
|
34 | listenToOnce(obj: EventDispatcher, eventMap: EventMap): any;
|
35 | listenToOnce(obj: EventDispatcher, name: string, callback: EventCallback, priority?: number): any;
|
36 | stopListening(obj?: EventDispatcher, name?: EventMap | string, callback?: EventCallback): this;
|
37 | trigger(name: Event | EventMap | string, ...args: any[]): this;
|
38 | }
|