@next2d/events 1.18.12 → 2.0.0

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/dist/Event.js DELETED
@@ -1,560 +0,0 @@
1
- import { EventPhase } from "./EventPhase";
2
- /**
3
- * 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
- * @param {boolean} [cancelable=false]
25
- *
26
- * @constructor
27
- * @public
28
- */
29
- constructor(type, bubbles = false, cancelable = false) {
30
- /**
31
- * @type {string}
32
- * @private
33
- */
34
- this._$type = `${type}`;
35
- /**
36
- * @type {boolean}
37
- * @private
38
- */
39
- this._$bubbles = bubbles;
40
- /**
41
- * @type {boolean}
42
- * @private
43
- */
44
- this._$cancelable = cancelable;
45
- /**
46
- * @type {EventDispatcher}
47
- * @private
48
- */
49
- this._$target = null;
50
- /**
51
- * @type {EventDispatcher}
52
- * @default null
53
- * @private
54
- */
55
- this._$currentTarget = null;
56
- /**
57
- * @type {number}
58
- * @default EventPhase.AT_TARGET
59
- * @private
60
- */
61
- this._$eventPhase = EventPhase.AT_TARGET;
62
- /**
63
- * @type {function}
64
- * @default null
65
- * @private
66
- */
67
- this._$listener = null;
68
- /**
69
- * @type {boolean}
70
- * @default false
71
- * @private
72
- */
73
- this._$stopImmediatePropagation = false;
74
- /**
75
- * @type {boolean}
76
- * @default false
77
- * @private
78
- */
79
- this._$stopPropagation = false;
80
- }
81
- /**
82
- * 指定されたクラスのストリングを返します。
83
- * Returns the string representation of the specified class.
84
- *
85
- * @return {string}
86
- * @default [class Event]
87
- * @method
88
- * @static
89
- */
90
- static toString() {
91
- return "[class Event]";
92
- }
93
- /**
94
- * @description 指定されたクラスの空間名を返します。
95
- * Returns the space name of the specified class.
96
- *
97
- * @member {string}
98
- * @default next2d.events.Event
99
- * @const
100
- * @static
101
- */
102
- static get namespace() {
103
- return "next2d.events.Event";
104
- }
105
- /**
106
- * @description 指定されたオブジェクトのストリングを返します。
107
- * Returns the string representation of the specified object.
108
- *
109
- * @return {string}
110
- * @method
111
- * @public
112
- */
113
- toString() {
114
- return this.formatToString("Event", "type", "bubbles", "cancelable", "eventPhase");
115
- }
116
- /**
117
- * @description 指定されたオブジェクトの空間名を返します。
118
- * Returns the space name of the specified object.
119
- *
120
- * @member {string}
121
- * @default next2d.events.Event
122
- * @const
123
- * @public
124
- */
125
- get namespace() {
126
- return "next2d.events.Event";
127
- }
128
- /**
129
- * @description ACTIVATE 定数は、type プロパティ(activate イベントオブジェクト)の値を定義します。
130
- * The ACTIVATE constant defines the value
131
- * of the type property of an activate event object.
132
- *
133
- * @return {string}
134
- * @default activate
135
- * @const
136
- * @static
137
- */
138
- static get ACTIVATE() {
139
- return "activate";
140
- }
141
- /**
142
- * @description Event.ADDED 定数は、added イベントオブジェクトの type プロパティの値を定義します。
143
- * The Event.ADDED constant defines the value
144
- * of the type property of an added event object.
145
- *
146
- * @return {string}
147
- * @default added
148
- * @const
149
- * @static
150
- */
151
- static get ADDED() {
152
- return "added";
153
- }
154
- /**
155
- * @description Event.ADDED_TO_STAGE 定数は、type プロパティ(addedToStage イベントオブジェクト)の値を定義します。
156
- * The Event.ADDED_TO_STAGE constant defines the value
157
- * of the type property of an addedToStage event object.
158
- *
159
- * @return {string}
160
- * @default addedToStage
161
- * @const
162
- * @static
163
- */
164
- static get ADDED_TO_STAGE() {
165
- return "addedToStage";
166
- }
167
- /**
168
- * @description Event.CHANGE 定数は、type プロパティ(change イベントオブジェクト)の値を定義します。
169
- * The Event.CHANGE constant defines the value
170
- * of the type property of a change event object.
171
- *
172
- * @return {string}
173
- * @default change
174
- * @const
175
- * @static
176
- */
177
- static get CHANGE() {
178
- return "change";
179
- }
180
- /**
181
- * @description Event.COMPLETE 定数は、complete イベントオブジェクトの type プロパティの値を定義します。
182
- * The Event.COMPLETE constant defines the value
183
- * of the type property of a complete event object.
184
- *
185
- * @return {string}
186
- * @default complete
187
- * @const
188
- * @static
189
- */
190
- static get COMPLETE() {
191
- return "complete";
192
- }
193
- /**
194
- * @description Event.DEACTIVATE 定数は、deactivate イベントオブジェクトの type プロパティの値を定義します。
195
- * The Event.DEACTIVATE constant defines the value
196
- * of the type property of a deactivate event object.
197
- *
198
- * @return {string}
199
- * @default deactivate
200
- * @const
201
- * @static
202
- */
203
- static get DEACTIVATE() {
204
- return "deactivate";
205
- }
206
- /**
207
- * @description Event.ENTER_FRAME 定数は、enterFrame イベントオブジェクトの type プロパティの値を定義します。
208
- * The Event.ENTER_FRAME constant defines the value
209
- * of the type property of an enterFrame event object.
210
- *
211
- * @return {string}
212
- * @default enterFrame
213
- * @const
214
- * @static
215
- */
216
- static get ENTER_FRAME() {
217
- return "enterFrame";
218
- }
219
- /**
220
- * @description Event.EXIT_FRAME 定数は、exitFrame イベントオブジェクトの type プロパティの値を定義します。
221
- * The Event.EXIT_FRAME constant defines the value
222
- * of the type property of an exitFrame event object.
223
- *
224
- * @return {string}
225
- * @default exitFrame
226
- * @const
227
- * @static
228
- */
229
- static get EXIT_FRAME() {
230
- return "exitFrame";
231
- }
232
- /**
233
- * @description Event.FRAME_CONSTRUCTED 定数は、frameConstructed イベントオブジェクトの type プロパティの値を定義します。
234
- * The Event.FRAME_CONSTRUCTED constant defines the value
235
- * of the type property of an frameConstructed event object.
236
- *
237
- * @return {string}
238
- * @default frameConstructed
239
- * @const
240
- * @static
241
- */
242
- static get FRAME_CONSTRUCTED() {
243
- return "frameConstructed";
244
- }
245
- /**
246
- * @description Event.FRAME_LABEL 定数は、frameLabel イベントオブジェクトの type プロパティの値を定義します。
247
- * The Event.FRAME_LABEL constant defines the value
248
- * of the type property of an frameLabel event object.
249
- *
250
- * @return {string}
251
- * @default frameLabel
252
- * @const
253
- * @static
254
- */
255
- static get FRAME_LABEL() {
256
- return "frameLabel";
257
- }
258
- /**
259
- * @description Event.INIT 定数は、init イベントオブジェクトの type プロパティの値を定義します。
260
- * The Event.INIT constant defines the value
261
- * of the type property of an init event object.
262
- *
263
- * @return {string}
264
- * @default frameConstructed
265
- * @const
266
- * @static
267
- */
268
- static get INIT() {
269
- return "init";
270
- }
271
- /**
272
- * @description Event.LOAD 定数は、load イベントオブジェクトの type プロパティの値を定義します。
273
- * The Event.LOAD constant defines the value
274
- * of the type property of an load event object.
275
- *
276
- * @return {string}
277
- * @default frameConstructed
278
- * @const
279
- * @static
280
- */
281
- static get LOAD() {
282
- return "load";
283
- }
284
- /**
285
- * @description Event.MOUSE_LEAVE 定数は、mouseLeave イベントオブジェクトの type プロパティの値を定義します。
286
- * The Event.MOUSE_LEAVE constant defines the value
287
- * of the type property of a mouseLeave event object.
288
- *
289
- * @return {string}
290
- * @default mouseLeave
291
- * @const
292
- * @static
293
- */
294
- static get MOUSE_LEAVE() {
295
- return "mouseLeave";
296
- }
297
- /**
298
- * @description Event.REMOVED 定数は、removed プロパティ(paste イベントオブジェクト)の値を定義します。
299
- * The Event.REMOVED constant defines the value
300
- * of the type property of a removed event object.
301
- *
302
- * @return {string}
303
- * @default removed
304
- * @const
305
- * @static
306
- */
307
- static get REMOVED() {
308
- return "removed";
309
- }
310
- /**
311
- * @description Event.REMOVED_FROM_STAGE 定数は、removedFromStage イベントオブジェクトの type プロパティの値を定義します。
312
- * The Event.REMOVED_FROM_STAGE constant defines the value
313
- * of the type property of a removedFromStage event object.
314
- *
315
- * @return {string}
316
- * @default removedFromStage
317
- * @const
318
- * @static
319
- */
320
- static get REMOVED_FROM_STAGE() {
321
- return "removedFromStage";
322
- }
323
- /**
324
- * @description Event.RENDER 定数は、render イベントオブジェクトの
325
- * type プロパティの値を定義します。
326
- * The Event.RENDER constant defines the value
327
- * of the type property of a render event object.
328
- *
329
- * @return {string}
330
- * @default render
331
- * @const
332
- * @static
333
- */
334
- static get RENDER() {
335
- return "render";
336
- }
337
- /**
338
- * @description Event.RESIZE 定数は、resize イベントオブジェクトの
339
- * type プロパティの値を定義します。
340
- * The Event.RESIZE constant defines the value
341
- * of the type property of a resize event object.
342
- *
343
- * @return {string}
344
- * @default resize
345
- * @const
346
- * @static
347
- */
348
- static get RESIZE() {
349
- return "resize";
350
- }
351
- /**
352
- * @description Event.SCROLL 定数は、render イベントオブジェクトの
353
- * type プロパティの値を定義します。
354
- * The Event.SCROLL constant defines the value
355
- * of the type property of a render event object.
356
- *
357
- * @return {string}
358
- * @default scroll
359
- * @const
360
- * @static
361
- */
362
- static get SCROLL() {
363
- return "scroll";
364
- }
365
- /**
366
- * @description Event.OPEN 定数は、render イベントオブジェクトの
367
- * type プロパティの値を定義します。
368
- * The Event.OPEN constant defines the value
369
- * of the type property of a render event object.
370
- *
371
- * @return {string}
372
- * @default open
373
- * @const
374
- * @static
375
- */
376
- static get OPEN() {
377
- return "open";
378
- }
379
- /**
380
- * @description Event.STOP 定数は、render イベントオブジェクトの
381
- * type プロパティの値を定義します。
382
- * The Event.STOP constant defines the value
383
- * of the type property of a render event object.
384
- *
385
- * @return {string}
386
- * @default stop
387
- * @const
388
- * @static
389
- */
390
- static get STOP() {
391
- return "stop";
392
- }
393
- /**
394
- * @description Event.SOUND_COMPLETE 定数は、soundComplete イベントオブジェクトの type プロパティの値を定義します。
395
- * The Event.SOUND_COMPLETE constant defines the value
396
- * of the type property of a soundComplete event object.
397
- *
398
- * @return {string}
399
- * @default render
400
- * @const
401
- * @static
402
- */
403
- static get SOUND_COMPLETE() {
404
- return "soundComplete";
405
- }
406
- /**
407
- * @description Event.UPDATE 定数は、render イベントオブジェクトの
408
- * type プロパティの値を定義します。
409
- * The Event.STOP constant defines the value
410
- * of the type property of a render event object.
411
- *
412
- * @return {string}
413
- * @default update
414
- * @const
415
- * @static
416
- */
417
- static get UPDATE() {
418
- return "update";
419
- }
420
- /**
421
- * @description イベントがバブリングイベントかどうかを示します。
422
- * Indicates whether an event is a bubbling event.
423
- *
424
- * @member {boolean}
425
- * @readonly
426
- * @public
427
- */
428
- get bubbles() {
429
- return this._$bubbles;
430
- }
431
- /**
432
- * @description イベントに関連付けられた動作を回避できるかどうかを示します。
433
- * Indicates whether the behavior associated
434
- * with the event can be prevented.
435
- *
436
- * @member {boolean}
437
- * @readonly
438
- * @public
439
- */
440
- get cancelable() {
441
- return this._$cancelable;
442
- }
443
- /**
444
- * @description イベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。
445
- * The object that is actively processing the Event object
446
- * with an event listener.
447
- *
448
- * @member {EventDispatcher|null}
449
- * @public
450
- */
451
- get currentTarget() {
452
- return this._$currentTarget;
453
- }
454
- set currentTarget(current_target) {
455
- this._$currentTarget = current_target;
456
- }
457
- /**
458
- * @description イベントフローの現在の段階です。
459
- * The current phase in the event flow.
460
- *
461
- * @member {number}
462
- * @public
463
- */
464
- get eventPhase() {
465
- return this._$eventPhase;
466
- }
467
- set eventPhase(event_phase) {
468
- this._$eventPhase = event_phase;
469
- }
470
- /**
471
- * @description 現在コールされている関数
472
- * Function currently being called.
473
- *
474
- * @member {function}
475
- * @public
476
- */
477
- get listener() {
478
- return this._$listener;
479
- }
480
- set listener(listener) {
481
- this._$listener = listener;
482
- }
483
- /**
484
- * @description イベントターゲットです。
485
- * The event target.
486
- *
487
- * @member {EventDispatcher|null}
488
- * @public
489
- */
490
- get target() {
491
- return this._$target ? this._$target : this._$currentTarget;
492
- }
493
- set target(target) {
494
- this._$target = target;
495
- }
496
- /**
497
- * @description イベントのタイプです。
498
- * The type of event.
499
- *
500
- * @member {string}
501
- * @readonly
502
- * @public
503
- */
504
- get type() {
505
- return this._$type;
506
- }
507
- /**
508
- * @description カスタム ActionScript 3.0 Event クラスに
509
- * toString() メソッドを実装するためのユーティリティ関数です。
510
- * A utility function for implementing the toString() method
511
- * in custom ActionScript 3.0 Event classes.
512
- *
513
- * @return {string}
514
- * @method
515
- * @public
516
- */
517
- formatToString(...args) {
518
- let str = `[${args[0]}`;
519
- for (let idx = 1; idx < args.length; ++idx) {
520
- // eslint-disable-next-line prefer-rest-params
521
- const name = args[idx];
522
- str += ` ${name}=`;
523
- // @ts-ignore
524
- const value = this[name];
525
- if (typeof value === "string") {
526
- str += `"${value}"`;
527
- }
528
- else {
529
- str += `${value}`;
530
- }
531
- }
532
- return `${str}]`;
533
- }
534
- /**
535
- * @description イベントフローの現在のノードおよび後続するノードで、
536
- * イベントリスナーが処理されないようにします。
537
- * Prevents processing of any event listeners in the current node
538
- * and any subsequent nodes in the event flow.
539
- *
540
- * @return {void}
541
- * @method
542
- * @public
543
- */
544
- stopImmediatePropagation() {
545
- this._$stopImmediatePropagation = true;
546
- }
547
- /**
548
- * @description イベントフローの現在のノードに後続するノードで
549
- * イベントリスナーが処理されないようにします。
550
- * Prevents processing of any event listeners in nodes subsequent
551
- * to the current node in the event flow.
552
- *
553
- * @return {void}
554
- * @method
555
- * @public
556
- */
557
- stopPropagation() {
558
- this._$stopPropagation = true;
559
- }
560
- }