@next2d/events 1.18.12 → 2.0.1

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.
Files changed (66) hide show
  1. package/package.json +8 -24
  2. package/src/Event.d.ts +222 -0
  3. package/src/Event.js +337 -0
  4. package/src/EventDispatcher/service/EventDispatcherAddEventListenerService.d.ts +14 -0
  5. package/src/EventDispatcher/service/EventDispatcherAddEventListenerService.js +87 -0
  6. package/src/EventDispatcher/service/EventDispatcherDispatchEventService.d.ts +13 -0
  7. package/src/EventDispatcher/service/EventDispatcherDispatchEventService.js +189 -0
  8. package/src/EventDispatcher/service/EventDispatcherHasEventListenerService.d.ts +12 -0
  9. package/src/EventDispatcher/service/EventDispatcherHasEventListenerService.js +25 -0
  10. package/src/EventDispatcher/service/EventDispatcherRemoveAllEventListenerService.d.ts +13 -0
  11. package/src/EventDispatcher/service/EventDispatcherRemoveAllEventListenerService.js +83 -0
  12. package/src/EventDispatcher/service/EventDispatcherRemoveEventListenerService.d.ts +14 -0
  13. package/src/EventDispatcher/service/EventDispatcherRemoveEventListenerService.js +80 -0
  14. package/src/EventDispatcher/service/EventDispatcherWillTriggerService.d.ts +12 -0
  15. package/src/EventDispatcher/service/EventDispatcherWillTriggerService.js +28 -0
  16. package/{dist → src}/EventDispatcher.d.ts +13 -62
  17. package/src/EventDispatcher.js +120 -0
  18. package/src/EventPhase.d.ts +39 -0
  19. package/src/EventPhase.js +45 -0
  20. package/src/EventUtil.d.ts +42 -0
  21. package/src/EventUtil.js +59 -0
  22. package/src/FocusEvent.d.ts +42 -0
  23. package/src/FocusEvent.js +71 -0
  24. package/src/HTTPStatusEvent.d.ts +63 -0
  25. package/src/HTTPStatusEvent.js +99 -0
  26. package/src/IOErrorEvent.d.ts +39 -0
  27. package/src/IOErrorEvent.js +49 -0
  28. package/src/JobEvent.d.ts +29 -0
  29. package/src/JobEvent.js +33 -0
  30. package/src/KeyboardEvent.d.ts +37 -0
  31. package/src/KeyboardEvent.js +66 -0
  32. package/src/PointerEvent.d.ts +84 -0
  33. package/src/PointerEvent.js +127 -0
  34. package/src/ProgressEvent.d.ts +53 -0
  35. package/src/ProgressEvent.js +69 -0
  36. package/src/VideoEvent.d.ts +47 -0
  37. package/src/VideoEvent.js +55 -0
  38. package/src/WheelEvent.d.ts +28 -0
  39. package/src/WheelEvent.js +49 -0
  40. package/{dist → src}/index.d.ts +5 -1
  41. package/{dist → src}/index.js +5 -1
  42. package/src/interface/IEvent.d.ts +2 -0
  43. package/src/interface/IEvent.js +1 -0
  44. package/src/interface/IEventDispatcher.d.ts +2 -0
  45. package/src/interface/IEventDispatcher.js +1 -0
  46. package/src/interface/IEventListener.d.ts +7 -0
  47. package/src/interface/IEventListener.js +1 -0
  48. package/src/interface/IURLRequestHeader.d.ts +4 -0
  49. package/src/interface/IURLRequestHeader.js +1 -0
  50. package/dist/Event.d.ts +0 -424
  51. package/dist/Event.js +0 -560
  52. package/dist/EventDispatcher.js +0 -622
  53. package/dist/EventPhase.d.ts +0 -80
  54. package/dist/EventPhase.js +0 -94
  55. package/dist/FocusEvent.d.ts +0 -89
  56. package/dist/FocusEvent.js +0 -103
  57. package/dist/HTTPStatusEvent.d.ts +0 -107
  58. package/dist/HTTPStatusEvent.js +0 -139
  59. package/dist/IOErrorEvent.d.ts +0 -82
  60. package/dist/IOErrorEvent.js +0 -101
  61. package/dist/MouseEvent.d.ts +0 -163
  62. package/dist/MouseEvent.js +0 -207
  63. package/dist/ProgressEvent.d.ts +0 -97
  64. package/dist/ProgressEvent.js +0 -123
  65. package/dist/VideoEvent.d.ts +0 -145
  66. package/dist/VideoEvent.js +0 -181
package/package.json CHANGED
@@ -1,26 +1,18 @@
1
1
  {
2
2
  "name": "@next2d/events",
3
- "version": "1.18.12",
4
- "description": "Next2D Events Packages",
5
- "author": "Toshiyuki Ienaga<ienaga@tvon.jp> (https://github.com/ienaga/)",
3
+ "version": "2.0.1",
4
+ "description": "Next2D Events Package",
5
+ "author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
7
7
  "homepage": "https://next2d.app",
8
8
  "bugs": "https://github.com/Next2D/Player/issues",
9
- "main": "dist/index.js",
10
- "types": "dist/index.d.ts",
11
- "files": [
12
- "dist"
13
- ],
9
+ "main": "src/index.js",
10
+ "types": "src/index.d.ts",
11
+ "type": "module",
14
12
  "exports": {
15
13
  ".": {
16
- "import": {
17
- "types": "./dist/index.d.ts",
18
- "default": "./dist/index.js"
19
- },
20
- "require": {
21
- "types": "./dist/index.d.ts",
22
- "default": "./dist/index.js"
23
- }
14
+ "import": "./src/index.js",
15
+ "require": "./src/index.js"
24
16
  }
25
17
  },
26
18
  "keywords": [
@@ -30,13 +22,5 @@
30
22
  "repository": {
31
23
  "type": "git",
32
24
  "url": "git+https://github.com/Next2D/Player.git"
33
- },
34
- "peerDependencies": {
35
- "@next2d/interface": "1.18.12",
36
- "@next2d/display": "1.18.12",
37
- "@next2d/core": "1.18.12",
38
- "@next2d/util": "1.18.12",
39
- "@next2d/net": "1.18.12",
40
- "@next2d/share": "1.18.12"
41
25
  }
42
26
  }
package/src/Event.d.ts ADDED
@@ -0,0 +1,222 @@
1
+ import type { EventDispatcher } from "./EventDispatcher";
2
+ import type { IEventDispatcher } from "./interface/IEventDispatcher";
3
+ /**
4
+ * @description Event クラスのメソッドは、イベントリスナー関数で使用してイベントオブジェクトの動作に影響を与えることができます。
5
+ * 一部のイベントにはデフォルトの動作が関連付けられています。
6
+ * 例えば、doubleClick イベントには、イベント時にマウスポインター位置の単語がハイライト表示されるというデフォルトの動作が関連付けられています。
7
+ * イベントリスナーで preventDefault() メソッドを呼び出してこの動作をキャンセルできます。
8
+ * また、stopPropagation() メソッドまたは stopImmediatePropagation() メソッドを呼び出すと、
9
+ * 現在のイベントリスナーを、イベントを処理する最後のイベントリスナーにすることができます。
10
+ *
11
+ * The methods of the Event class can be used in event listener functions to affect the behavior of the event object.
12
+ * Some events have an associated default behavior. For example,
13
+ * the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event.
14
+ * Your event listener can cancel this behavior by calling the preventDefault() method.
15
+ * You can also make the current event listener the last one to process
16
+ * an event by calling the stopPropagation() or stopImmediatePropagation() method.
17
+ *
18
+ * @class
19
+ * @memberOf next2d.events
20
+ */
21
+ export declare class Event {
22
+ /**
23
+ * @description イベントのタイプです。
24
+ * The type of event.
25
+ *
26
+ * @member {string}
27
+ * @readonly
28
+ * @public
29
+ */
30
+ readonly type: string;
31
+ /**
32
+ * @description イベントがバブリングイベントかどうかを示します。
33
+ * Indicates whether an event is a bubbling event.
34
+ *
35
+ * @member {boolean}
36
+ * @default false
37
+ * @readonly
38
+ * @public
39
+ */
40
+ readonly bubbles: boolean;
41
+ /**
42
+ * @description 実行される関数
43
+ * The function to execute.
44
+ *
45
+ * @type {Function | null}
46
+ * @default null
47
+ * @public
48
+ */
49
+ listener: Function | null;
50
+ /**
51
+ * @description イベント登録を行なったオブジェクト
52
+ * The object that registered the event.
53
+ *
54
+ * @type {EventDispatcher | null}
55
+ * @default null
56
+ * @public
57
+ */
58
+ target: IEventDispatcher<EventDispatcher> | null;
59
+ /**
60
+ * @description イベントを発火したオブジェクト
61
+ * The object that fired the event.
62
+ *
63
+ * @type {EventDispatcher | null}
64
+ * @default null
65
+ * @public
66
+ */
67
+ currentTarget: IEventDispatcher<EventDispatcher> | null;
68
+ /**
69
+ * @description イベントフェーズ
70
+ * Event phase.
71
+ *
72
+ * @see {EventPhase}
73
+ * @type {number}
74
+ * @default EventPhase.AT_TARGET
75
+ * @public
76
+ */
77
+ eventPhase: number;
78
+ /**
79
+ * @type {boolean}
80
+ * @private
81
+ */
82
+ _$stopImmediatePropagation: boolean;
83
+ /**
84
+ * @type {boolean}
85
+ * @private
86
+ */
87
+ _$stopPropagation: boolean;
88
+ /**
89
+ * @param {string} type
90
+ * @param {boolean} [bubbles=false]
91
+ *
92
+ * @constructor
93
+ * @public
94
+ */
95
+ constructor(type: string, bubbles?: boolean);
96
+ /**
97
+ * @description Sprite または MovieClip を親に持つオブジェクトに追加されたときに発生します。
98
+ * Occurs when the object is added to a parent object.
99
+ *
100
+ * @return {string}
101
+ * @const
102
+ * @static
103
+ */
104
+ static get ADDED(): string;
105
+ /**
106
+ * @description Stage に追加されたときに発生します。
107
+ * Occurs when the object is added to the Stage.
108
+ *
109
+ * @return {string}
110
+ * @const
111
+ * @static
112
+ */
113
+ static get ADDED_TO_STAGE(): string;
114
+ /**
115
+ * @description 読み込みや、処理完了時に発生します。
116
+ * Occurs when loading or processing is complete.
117
+ *
118
+ * @return {string}
119
+ * @const
120
+ * @static
121
+ */
122
+ static get COMPLETE(): string;
123
+ /**
124
+ * @description サウンドやビデオなどの再生処理の終了時に発生します。
125
+ * Occurs when playback of a sound or video ends.
126
+ *
127
+ * @return {string}
128
+ * @const
129
+ * @static
130
+ */
131
+ static get ENDED(): string;
132
+ /**
133
+ * @description MovieClip のフレームが変更される度に発生します。
134
+ * Occurs when the frame of a MovieClip changes.
135
+ *
136
+ * @return {string}
137
+ * @const
138
+ * @static
139
+ */
140
+ static get ENTER_FRAME(): string;
141
+ /**
142
+ * @description MovieClip のフレームラベルのキーフレームに到達したときに発生します。
143
+ * Occurs when a MovieClip reaches a keyframe that designates a frame label.
144
+ *
145
+ * @return {string}
146
+ * @const
147
+ * @static
148
+ */
149
+ static get FRAME_LABEL(): string;
150
+ /**
151
+ * @description データの読み込み開始時に発生します。
152
+ * Occurs when sound data loading starts.
153
+ *
154
+ * @return {string}
155
+ * @const
156
+ * @static
157
+ */
158
+ static get INPUT(): string;
159
+ /**
160
+ * @description データの読み込み開始時に発生します。
161
+ * Occurs when sound data loading starts.
162
+ *
163
+ * @return {string}
164
+ * @const
165
+ * @static
166
+ */
167
+ static get OPEN(): string;
168
+ /**
169
+ * @description Sprite または MovieClip を親に持つオブジェクトから削除されたときに発生します。
170
+ * Occurs when the object is removed from a parent object.
171
+ *
172
+ * @return {string}
173
+ * @const
174
+ * @static
175
+ */
176
+ static get REMOVED(): string;
177
+ /**
178
+ * @description Stage から削除されたときに発生します。
179
+ * Occurs when the object is removed from the Stage.
180
+ *
181
+ * @return {string}
182
+ * @const
183
+ * @static
184
+ */
185
+ static get REMOVED_FROM_STAGE(): string;
186
+ /**
187
+ * @description 画面のサイズが変更されたときに発生します。
188
+ * Occurs when the screen size changes.
189
+ *
190
+ * @return {string}
191
+ * @const
192
+ * @static
193
+ */
194
+ static get RESIZE(): string;
195
+ /**
196
+ * @description スクロール位置が変更されたときに発生します。
197
+ * Occurs when the scroll position changes.
198
+ *
199
+ * @return {string}
200
+ * @const
201
+ * @static
202
+ */
203
+ static get SCROLL(): string;
204
+ /**
205
+ * @description イベントフローの現在のノードおよび後続するノードで、イベントリスナーが処理されないようにします。
206
+ * Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
207
+ *
208
+ * @return {void}
209
+ * @method
210
+ * @public
211
+ */
212
+ stopImmediatePropagation(): void;
213
+ /**
214
+ * @description イベントフローの現在のノードに後続するノードで、イベントリスナーが処理されないようにします。
215
+ * Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
216
+ *
217
+ * @return {void}
218
+ * @method
219
+ * @public
220
+ */
221
+ stopPropagation(): void;
222
+ }
package/src/Event.js ADDED
@@ -0,0 +1,337 @@
1
+ import { EventPhase } from "./EventPhase";
2
+ /**
3
+ * @description Event クラスのメソッドは、イベントリスナー関数で使用してイベントオブジェクトの動作に影響を与えることができます。
4
+ * 一部のイベントにはデフォルトの動作が関連付けられています。
5
+ * 例えば、doubleClick イベントには、イベント時にマウスポインター位置の単語がハイライト表示されるというデフォルトの動作が関連付けられています。
6
+ * イベントリスナーで preventDefault() メソッドを呼び出してこの動作をキャンセルできます。
7
+ * また、stopPropagation() メソッドまたは stopImmediatePropagation() メソッドを呼び出すと、
8
+ * 現在のイベントリスナーを、イベントを処理する最後のイベントリスナーにすることができます。
9
+ *
10
+ * The methods of the Event class can be used in event listener functions to affect the behavior of the event object.
11
+ * Some events have an associated default behavior. For example,
12
+ * the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event.
13
+ * Your event listener can cancel this behavior by calling the preventDefault() method.
14
+ * You can also make the current event listener the last one to process
15
+ * an event by calling the stopPropagation() or stopImmediatePropagation() method.
16
+ *
17
+ * @class
18
+ * @memberOf next2d.events
19
+ */
20
+ export class Event {
21
+ /**
22
+ * @param {string} type
23
+ * @param {boolean} [bubbles=false]
24
+ *
25
+ * @constructor
26
+ * @public
27
+ */
28
+ constructor(type, bubbles = false) {
29
+ /**
30
+ * @description イベントのタイプです。
31
+ * The type of event.
32
+ *
33
+ * @member {string}
34
+ * @readonly
35
+ * @public
36
+ */
37
+ Object.defineProperty(this, "type", {
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true,
41
+ value: void 0
42
+ });
43
+ /**
44
+ * @description イベントがバブリングイベントかどうかを示します。
45
+ * Indicates whether an event is a bubbling event.
46
+ *
47
+ * @member {boolean}
48
+ * @default false
49
+ * @readonly
50
+ * @public
51
+ */
52
+ Object.defineProperty(this, "bubbles", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: void 0
57
+ });
58
+ /**
59
+ * @description 実行される関数
60
+ * The function to execute.
61
+ *
62
+ * @type {Function | null}
63
+ * @default null
64
+ * @public
65
+ */
66
+ Object.defineProperty(this, "listener", {
67
+ enumerable: true,
68
+ configurable: true,
69
+ writable: true,
70
+ value: void 0
71
+ });
72
+ /**
73
+ * @description イベント登録を行なったオブジェクト
74
+ * The object that registered the event.
75
+ *
76
+ * @type {EventDispatcher | null}
77
+ * @default null
78
+ * @public
79
+ */
80
+ Object.defineProperty(this, "target", {
81
+ enumerable: true,
82
+ configurable: true,
83
+ writable: true,
84
+ value: void 0
85
+ });
86
+ /**
87
+ * @description イベントを発火したオブジェクト
88
+ * The object that fired the event.
89
+ *
90
+ * @type {EventDispatcher | null}
91
+ * @default null
92
+ * @public
93
+ */
94
+ Object.defineProperty(this, "currentTarget", {
95
+ enumerable: true,
96
+ configurable: true,
97
+ writable: true,
98
+ value: void 0
99
+ });
100
+ /**
101
+ * @description イベントフェーズ
102
+ * Event phase.
103
+ *
104
+ * @see {EventPhase}
105
+ * @type {number}
106
+ * @default EventPhase.AT_TARGET
107
+ * @public
108
+ */
109
+ Object.defineProperty(this, "eventPhase", {
110
+ enumerable: true,
111
+ configurable: true,
112
+ writable: true,
113
+ value: void 0
114
+ });
115
+ /**
116
+ * @type {boolean}
117
+ * @private
118
+ */
119
+ Object.defineProperty(this, "_$stopImmediatePropagation", {
120
+ enumerable: true,
121
+ configurable: true,
122
+ writable: true,
123
+ value: void 0
124
+ });
125
+ /**
126
+ * @type {boolean}
127
+ * @private
128
+ */
129
+ Object.defineProperty(this, "_$stopPropagation", {
130
+ enumerable: true,
131
+ configurable: true,
132
+ writable: true,
133
+ value: void 0
134
+ });
135
+ /**
136
+ * @type {string}
137
+ * @private
138
+ */
139
+ this.type = `${type}`;
140
+ /**
141
+ * @type {boolean}
142
+ * @default false
143
+ * @private
144
+ */
145
+ this.bubbles = bubbles;
146
+ /**
147
+ * @type {EventDispatcher | null}
148
+ * @default null
149
+ * @private
150
+ */
151
+ this.target = null;
152
+ /**
153
+ * @type {EventDispatcher | null}
154
+ * @default null
155
+ * @private
156
+ */
157
+ this.currentTarget = null;
158
+ /**
159
+ * @type {number}
160
+ * @default EventPhase.AT_TARGET
161
+ * @private
162
+ */
163
+ this.eventPhase = EventPhase.AT_TARGET;
164
+ /**
165
+ * @type {function}
166
+ * @default null
167
+ * @private
168
+ */
169
+ this.listener = null;
170
+ /**
171
+ * @type {boolean}
172
+ * @default false
173
+ * @private
174
+ */
175
+ this._$stopImmediatePropagation = false;
176
+ /**
177
+ * @type {boolean}
178
+ * @default false
179
+ * @private
180
+ */
181
+ this._$stopPropagation = false;
182
+ }
183
+ /**
184
+ * @description Sprite または MovieClip を親に持つオブジェクトに追加されたときに発生します。
185
+ * Occurs when the object is added to a parent object.
186
+ *
187
+ * @return {string}
188
+ * @const
189
+ * @static
190
+ */
191
+ static get ADDED() {
192
+ return "added";
193
+ }
194
+ /**
195
+ * @description Stage に追加されたときに発生します。
196
+ * Occurs when the object is added to the Stage.
197
+ *
198
+ * @return {string}
199
+ * @const
200
+ * @static
201
+ */
202
+ static get ADDED_TO_STAGE() {
203
+ return "addedToStage";
204
+ }
205
+ /**
206
+ * @description 読み込みや、処理完了時に発生します。
207
+ * Occurs when loading or processing is complete.
208
+ *
209
+ * @return {string}
210
+ * @const
211
+ * @static
212
+ */
213
+ static get COMPLETE() {
214
+ return "complete";
215
+ }
216
+ /**
217
+ * @description サウンドやビデオなどの再生処理の終了時に発生します。
218
+ * Occurs when playback of a sound or video ends.
219
+ *
220
+ * @return {string}
221
+ * @const
222
+ * @static
223
+ */
224
+ static get ENDED() {
225
+ return "ended";
226
+ }
227
+ /**
228
+ * @description MovieClip のフレームが変更される度に発生します。
229
+ * Occurs when the frame of a MovieClip changes.
230
+ *
231
+ * @return {string}
232
+ * @const
233
+ * @static
234
+ */
235
+ static get ENTER_FRAME() {
236
+ return "enterFrame";
237
+ }
238
+ /**
239
+ * @description MovieClip のフレームラベルのキーフレームに到達したときに発生します。
240
+ * Occurs when a MovieClip reaches a keyframe that designates a frame label.
241
+ *
242
+ * @return {string}
243
+ * @const
244
+ * @static
245
+ */
246
+ static get FRAME_LABEL() {
247
+ return "frameLabel";
248
+ }
249
+ /**
250
+ * @description データの読み込み開始時に発生します。
251
+ * Occurs when sound data loading starts.
252
+ *
253
+ * @return {string}
254
+ * @const
255
+ * @static
256
+ */
257
+ static get INPUT() {
258
+ return "input";
259
+ }
260
+ /**
261
+ * @description データの読み込み開始時に発生します。
262
+ * Occurs when sound data loading starts.
263
+ *
264
+ * @return {string}
265
+ * @const
266
+ * @static
267
+ */
268
+ static get OPEN() {
269
+ return "open";
270
+ }
271
+ /**
272
+ * @description Sprite または MovieClip を親に持つオブジェクトから削除されたときに発生します。
273
+ * Occurs when the object is removed from a parent object.
274
+ *
275
+ * @return {string}
276
+ * @const
277
+ * @static
278
+ */
279
+ static get REMOVED() {
280
+ return "removed";
281
+ }
282
+ /**
283
+ * @description Stage から削除されたときに発生します。
284
+ * Occurs when the object is removed from the Stage.
285
+ *
286
+ * @return {string}
287
+ * @const
288
+ * @static
289
+ */
290
+ static get REMOVED_FROM_STAGE() {
291
+ return "removedFromStage";
292
+ }
293
+ /**
294
+ * @description 画面のサイズが変更されたときに発生します。
295
+ * Occurs when the screen size changes.
296
+ *
297
+ * @return {string}
298
+ * @const
299
+ * @static
300
+ */
301
+ static get RESIZE() {
302
+ return "resize";
303
+ }
304
+ /**
305
+ * @description スクロール位置が変更されたときに発生します。
306
+ * Occurs when the scroll position changes.
307
+ *
308
+ * @return {string}
309
+ * @const
310
+ * @static
311
+ */
312
+ static get SCROLL() {
313
+ return "scroll";
314
+ }
315
+ /**
316
+ * @description イベントフローの現在のノードおよび後続するノードで、イベントリスナーが処理されないようにします。
317
+ * Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
318
+ *
319
+ * @return {void}
320
+ * @method
321
+ * @public
322
+ */
323
+ stopImmediatePropagation() {
324
+ this._$stopImmediatePropagation = true;
325
+ }
326
+ /**
327
+ * @description イベントフローの現在のノードに後続するノードで、イベントリスナーが処理されないようにします。
328
+ * Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
329
+ *
330
+ * @return {void}
331
+ * @method
332
+ * @public
333
+ */
334
+ stopPropagation() {
335
+ this._$stopPropagation = true;
336
+ }
337
+ }
@@ -0,0 +1,14 @@
1
+ import type { EventDispatcher } from "../../EventDispatcher";
2
+ /**
3
+ * @description 指定イベントに関数を登録、既に登録されている場合は上書。
4
+ * Register a function in the specified event, or overwrite if already registered.
5
+ *
6
+ * @param {EventDispatcher} scope
7
+ * @param {string} type
8
+ * @param {Function} listener
9
+ * @param {boolean} [use_capture = false]
10
+ * @param {number} [priority = 0]
11
+ * @method
12
+ * @protected
13
+ */
14
+ export declare const execute: <D extends EventDispatcher>(scope: D, type: string, listener: Function, use_capture?: boolean, priority?: number) => void;