1 |
|
2 |
|
3 |
|
4 | export interface IEventRecord {
|
5 | target: any;
|
6 | eventName: string;
|
7 | parent: any;
|
8 | callback: (args?: any) => void;
|
9 | elementCallback?: (...args: any[]) => void;
|
10 | objectCallback?: (args?: any) => void;
|
11 | options?: boolean | AddEventListenerOptions;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 | export interface IEventRecordsByName {
|
17 | [eventName: string]: IEventRecordList;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 | export interface IEventRecordList {
|
23 | [id: string]: IEventRecord[] | number;
|
24 | count: number;
|
25 | }
|
26 |
|
27 |
|
28 |
|
29 | export interface IDeclaredEventsByName {
|
30 | [eventName: string]: boolean;
|
31 | }
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare class EventGroup {
|
44 | private static _uniqueId;
|
45 | private _parent;
|
46 | private _eventRecords;
|
47 | private _id;
|
48 | private _isDisposed;
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | static raise(target: any, eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined;
|
56 | static isObserved(target: any, eventName: string): boolean;
|
57 |
|
58 | static isDeclared(target: any, eventName: string): boolean;
|
59 | static stopPropagation(event: any): void;
|
60 | private static _isElement;
|
61 |
|
62 | constructor(parent: any);
|
63 | dispose(): void;
|
64 | /** On the target, attach a set of events, where the events object is a name to function mapping. */
|
65 | onAll(target: any, events: {
|
66 | [key: string]: (args?: any) => void;
|
67 | }, useCapture?: boolean): void;
|
68 | /**
|
69 | * On the target, attach an event whose handler will be called in the context of the parent
|
70 | * of this instance of EventGroup.
|
71 | */
|
72 | on(target: any, eventName: string, callback: (args?: any) => void, options?: boolean | AddEventListenerOptions): void;
|
73 | off(target?: any, eventName?: string, callback?: (args?: any) => void, options?: boolean | AddEventListenerOptions): void;
|
74 | /** Trigger the given event in the context of this instance of EventGroup. */
|
75 | raise(eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined;
|
76 | /** Declare an event as being supported by this instance of EventGroup. */
|
77 | declare(event: string | string[]): void;
|
78 | }
|