gl-draw 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ export type Listener = (event?: DispatcherEvent) => void;
2
+ export interface DispatcherEvent {
3
+ type: string;
4
+ [key: string]: any;
5
+ }
6
+ export declare class EventDispatcher {
7
+ private _listeners;
8
+ /**
9
+ * Adds the specified event listener.
10
+ * @param type event name
11
+ * @param listener handler function
12
+ * @category Methods
13
+ */
14
+ addEventListener(type: string, listener: Listener): void;
15
+ /**
16
+ * Presence of the specified event listener.
17
+ * @param type event name
18
+ * @param listener handler function
19
+ * @category Methods
20
+ */
21
+ hasEventListener(type: string, listener: Listener): boolean;
22
+ /**
23
+ * Removes the specified event listener
24
+ * @param type event name
25
+ * @param listener handler function
26
+ * @category Methods
27
+ */
28
+ removeEventListener(type: string, listener: Listener): void;
29
+ /**
30
+ * Removes all event listeners
31
+ * @param type event name
32
+ * @category Methods
33
+ */
34
+ removeAllEventListeners(type?: string): void;
35
+ /**
36
+ * Fire an event type.
37
+ * @param event DispatcherEvent
38
+ * @category Methods
39
+ */
40
+ dispatchEvent(event: DispatcherEvent): void;
41
+ }