@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
@@ -0,0 +1,99 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description ネットワーク要求が HTTP ステータスコードを返すと、アプリケーションによって HTTPStatusEvent オブジェクトが送出されます。
4
+ * The application dispatches HTTPStatusEvent objects when a network request returns an HTTP status code.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export class HTTPStatusEvent extends Event {
11
+ /**
12
+ * @param {string} type
13
+ * @param {boolean} [bubbles=false]
14
+ * @param {number} [status=0]
15
+ * @param {string} [response_url=""]
16
+ * @param {array} [response_headers=[]]
17
+ *
18
+ * @constructor
19
+ * @public
20
+ */
21
+ constructor(type, bubbles = false, status = 0, response_url = "", response_headers = []) {
22
+ super(type, bubbles);
23
+ /**
24
+ * @description サーバーから返された HTTP ステータスコードです。
25
+ * The HTTP status code returned by the server.
26
+ *
27
+ * @return {number}
28
+ * @readonly
29
+ * @public
30
+ */
31
+ Object.defineProperty(this, "status", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ /**
38
+ * @description 返された応答ヘッダー(URLRequestHeader オブジェクトの配列)です。
39
+ * The response headers that the response returned,
40
+ * as an array of URLRequestHeader objects.
41
+ *
42
+ * @return {array}
43
+ * @readonly
44
+ * @public
45
+ */
46
+ Object.defineProperty(this, "responseHeaders", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: void 0
51
+ });
52
+ /**
53
+ * @description 応答の返送元の URL です。
54
+ * The URL that the response was returned from.
55
+ *
56
+ * @return {string}
57
+ * @readonly
58
+ * @public
59
+ */
60
+ Object.defineProperty(this, "responseURL", {
61
+ enumerable: true,
62
+ configurable: true,
63
+ writable: true,
64
+ value: void 0
65
+ });
66
+ /**
67
+ * @type {number}
68
+ * @default 0
69
+ * @private
70
+ */
71
+ this.status = status | 0;
72
+ /**
73
+ * @type {array}
74
+ * @default {array}
75
+ * @private
76
+ */
77
+ this.responseHeaders = response_headers;
78
+ /**
79
+ * @type {string}
80
+ * @default ""
81
+ * @private
82
+ */
83
+ this.responseURL = response_url;
84
+ }
85
+ /**
86
+ * @description HTTPStatusEvent.HTTP_STATUS 定数は、
87
+ * httpStatus イベントオブジェクトの type プロパティの値を定義します。
88
+ * The HTTPStatusEvent.HTTP_STATUS constant defines the value
89
+ * of the type property of a httpStatus event object.
90
+ *
91
+ * @return {string}
92
+ * @default "httpStatus"
93
+ * @const
94
+ * @static
95
+ */
96
+ static get HTTP_STATUS() {
97
+ return "httpStatus";
98
+ }
99
+ }
@@ -0,0 +1,39 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description IOErrorEvent オブジェクトは、エラーが発生して入力操作または出力操作が失敗したときに送出されます。
4
+ * An IOErrorEvent object is dispatched when an error causes input or output operations to fail.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export declare class IOErrorEvent extends Event {
11
+ /**
12
+ * @description エラーテキストです。
13
+ * error text.
14
+ *
15
+ * @return {string}
16
+ * @default ""
17
+ * @readonly
18
+ * @public
19
+ */
20
+ readonly text: string;
21
+ /**
22
+ * @param {string} type
23
+ * @param {boolean} [bubbles=true]
24
+ * @param {string} [text=""]
25
+ *
26
+ * @constructor
27
+ * @public
28
+ */
29
+ constructor(type: string, bubbles?: boolean, text?: string);
30
+ /**
31
+ * @description ioError イベントオブジェクトの type プロパティ値を定義します。
32
+ * Defines the value of the type property of an ioError event object.
33
+ *
34
+ * @return {string}
35
+ * @const
36
+ * @static
37
+ */
38
+ static get IO_ERROR(): string;
39
+ }
@@ -0,0 +1,49 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description IOErrorEvent オブジェクトは、エラーが発生して入力操作または出力操作が失敗したときに送出されます。
4
+ * An IOErrorEvent object is dispatched when an error causes input or output operations to fail.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export class IOErrorEvent extends Event {
11
+ /**
12
+ * @param {string} type
13
+ * @param {boolean} [bubbles=true]
14
+ * @param {string} [text=""]
15
+ *
16
+ * @constructor
17
+ * @public
18
+ */
19
+ constructor(type, bubbles = false, text = "") {
20
+ super(type, bubbles);
21
+ /**
22
+ * @description エラーテキストです。
23
+ * error text.
24
+ *
25
+ * @return {string}
26
+ * @default ""
27
+ * @readonly
28
+ * @public
29
+ */
30
+ Object.defineProperty(this, "text", {
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true,
34
+ value: void 0
35
+ });
36
+ this.text = `${text}`;
37
+ }
38
+ /**
39
+ * @description ioError イベントオブジェクトの type プロパティ値を定義します。
40
+ * Defines the value of the type property of an ioError event object.
41
+ *
42
+ * @return {string}
43
+ * @const
44
+ * @static
45
+ */
46
+ static get IO_ERROR() {
47
+ return "ioError";
48
+ }
49
+ }
@@ -0,0 +1,29 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description Tween処理に関するイベントを示します。
4
+ * Indicates events related to Tween processing.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export declare class JobEvent extends Event {
11
+ /**
12
+ * @description Jobのプロパティが更新されたときに発生します。
13
+ * Occurs when the Job property is updated.
14
+ *
15
+ * @return {string}
16
+ * @const
17
+ * @static
18
+ */
19
+ static get UPDATE(): string;
20
+ /**
21
+ * @description TweenのJobが停止したときに発生します。
22
+ * Occurs when the Tween Job is stopped.
23
+ *
24
+ * @return {string}
25
+ * @const
26
+ * @static
27
+ */
28
+ static get STOP(): string;
29
+ }
@@ -0,0 +1,33 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description Tween処理に関するイベントを示します。
4
+ * Indicates events related to Tween processing.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export class JobEvent extends Event {
11
+ /**
12
+ * @description Jobのプロパティが更新されたときに発生します。
13
+ * Occurs when the Job property is updated.
14
+ *
15
+ * @return {string}
16
+ * @const
17
+ * @static
18
+ */
19
+ static get UPDATE() {
20
+ return "jobupdate";
21
+ }
22
+ /**
23
+ * @description TweenのJobが停止したときに発生します。
24
+ * Occurs when the Tween Job is stopped.
25
+ *
26
+ * @return {string}
27
+ * @const
28
+ * @static
29
+ */
30
+ static get STOP() {
31
+ return "jobstop";
32
+ }
33
+ }
@@ -0,0 +1,37 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description キーボードによるユーザーの操作を示します。
4
+ * Indicates user operation via keyboard.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export declare class KeyboardEvent extends Event {
11
+ /**
12
+ * @param {string} type
13
+ * @param {boolean} [bubbles=true]
14
+ *
15
+ * @constructor
16
+ * @public
17
+ */
18
+ constructor(type: string, bubbles?: boolean);
19
+ /**
20
+ * @description キーボードのキーが押される度に発生します。
21
+ * Occurs each time a key is pressed on the keyboard.
22
+ *
23
+ * @return {string}
24
+ * @const
25
+ * @static
26
+ */
27
+ static get KEY_DOWN(): string;
28
+ /**
29
+ * @description キーボードのキーが離されたときに発生します。
30
+ * Occurs when a key on the keyboard is released.
31
+ *
32
+ * @return {string}
33
+ * @const
34
+ * @static
35
+ */
36
+ static get KEY_UP(): string;
37
+ }
@@ -0,0 +1,66 @@
1
+ import { $getEvent } from "./EventUtil";
2
+ import { Event } from "./Event";
3
+ /**
4
+ * @description キーボードによるユーザーの操作を示します。
5
+ * Indicates user operation via keyboard.
6
+ *
7
+ * @class
8
+ * @memberOf next2d.events
9
+ * @extends Event
10
+ */
11
+ export class KeyboardEvent extends Event {
12
+ /**
13
+ * @param {string} type
14
+ * @param {boolean} [bubbles=true]
15
+ *
16
+ * @constructor
17
+ * @public
18
+ */
19
+ constructor(type, bubbles = true) {
20
+ super(type, bubbles);
21
+ return new Proxy(this, {
22
+ "get": (object, name) => {
23
+ if (name in object) {
24
+ return object[name];
25
+ }
26
+ const event = $getEvent();
27
+ if (!event) {
28
+ return undefined;
29
+ }
30
+ switch (event.type) {
31
+ case KeyboardEvent.KEY_DOWN:
32
+ case KeyboardEvent.KEY_UP:
33
+ if (name in event) {
34
+ // @ts-ignore
35
+ return $event[name];
36
+ }
37
+ return undefined;
38
+ default:
39
+ return undefined;
40
+ }
41
+ }
42
+ });
43
+ }
44
+ /**
45
+ * @description キーボードのキーが押される度に発生します。
46
+ * Occurs each time a key is pressed on the keyboard.
47
+ *
48
+ * @return {string}
49
+ * @const
50
+ * @static
51
+ */
52
+ static get KEY_DOWN() {
53
+ return "keydown";
54
+ }
55
+ /**
56
+ * @description キーボードのキーが離されたときに発生します。
57
+ * Occurs when a key on the keyboard is released.
58
+ *
59
+ * @return {string}
60
+ * @const
61
+ * @static
62
+ */
63
+ static get KEY_UP() {
64
+ return "keyup";
65
+ }
66
+ }
@@ -0,0 +1,84 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description ポインターは、入力機器(マウス、ペン、またはタッチ可能な面の上の接触点など)のハードウェアにとらわれない表現です。
4
+ * ポインターは、画面などの接触面上の特定の座標(または座標の集合)をターゲットにすることができます。
5
+ * A pointer is a hardware-agnostic representation of an input device (such as a mouse, pen, or point of contact on a touchable surface).
6
+ * A pointer can target a specific coordinate (or set of coordinates) on a screen or other contact surface.
7
+ *
8
+ * @class
9
+ * @memberOf next2d.events
10
+ * @extends Event
11
+ */
12
+ export declare class PointerEvent extends Event {
13
+ /**
14
+ * @param {string} type
15
+ * @param {boolean} [bubbles=true]
16
+ *
17
+ * @constructor
18
+ * @public
19
+ */
20
+ constructor(type: string, bubbles?: boolean);
21
+ /**
22
+ * @description ボタンが連続で押された時に発生します。
23
+ * Occurs when a button is pressed continuously.
24
+ *
25
+ * @return {string}
26
+ * @const
27
+ * @static
28
+ */
29
+ static get DOUBLE_CLICK(): string;
30
+ /**
31
+ * @description ボタンが押されていない状態から 1 つ以上のボタンが押されている状態に遷移したときに発生します
32
+ * Occurs when one or more buttons are pressed from the state where no buttons are pressed.
33
+ *
34
+ * @return {string}
35
+ * @const
36
+ * @static
37
+ */
38
+ static get POINTER_DOWN(): string;
39
+ /**
40
+ * @description ポインティングデバイスが要素のヒットテスト領域を出た時に発生します
41
+ * Occurs when the pointing device leaves the hit test area of an element
42
+ *
43
+ * @return {string}
44
+ * @const
45
+ * @static
46
+ */
47
+ static get POINTER_LEAVE(): string;
48
+ /**
49
+ * @description ポインターの座標が変化し、かつタッチ操作によってポインターがキャンセルされていないときに発生します。
50
+ * Occurs when the pointer coordinates change and the pointer is not canceled by a touch operation.
51
+ *
52
+ * @return {string}
53
+ * @const
54
+ * @static
55
+ */
56
+ static get POINTER_MOVE(): string;
57
+ /**
58
+ * @description ヒットテスト境界を出たに発生します。ホバーに対応していない端末では発生しません。
59
+ * Occurs when the hit test boundary is exited. Does not occur on devices that do not support hover.
60
+ *
61
+ * @return {string}
62
+ * @const
63
+ * @static
64
+ */
65
+ static get POINTER_OUT(): string;
66
+ /**
67
+ * @description インティングデバイスが要素のヒットテスト境界内に移動したときに発生します。
68
+ * Occurs when the pointing device moves into the hit test boundary of an element.
69
+ *
70
+ * @return {string}
71
+ * @const
72
+ * @static
73
+ */
74
+ static get POINTER_OVER(): string;
75
+ /**
76
+ * @description ポインターがアクティブではなくなったときに発生します。
77
+ * Occurs when the pointer is no longer active.
78
+ *
79
+ * @return {string}
80
+ * @const
81
+ * @static
82
+ */
83
+ static get POINTER_UP(): string;
84
+ }
@@ -0,0 +1,127 @@
1
+ import { Event } from "./Event";
2
+ import { $getEvent } from "./EventUtil";
3
+ /**
4
+ * @description ポインターは、入力機器(マウス、ペン、またはタッチ可能な面の上の接触点など)のハードウェアにとらわれない表現です。
5
+ * ポインターは、画面などの接触面上の特定の座標(または座標の集合)をターゲットにすることができます。
6
+ * A pointer is a hardware-agnostic representation of an input device (such as a mouse, pen, or point of contact on a touchable surface).
7
+ * A pointer can target a specific coordinate (or set of coordinates) on a screen or other contact surface.
8
+ *
9
+ * @class
10
+ * @memberOf next2d.events
11
+ * @extends Event
12
+ */
13
+ export class PointerEvent extends Event {
14
+ /**
15
+ * @param {string} type
16
+ * @param {boolean} [bubbles=true]
17
+ *
18
+ * @constructor
19
+ * @public
20
+ */
21
+ constructor(type, bubbles = true) {
22
+ super(type, bubbles);
23
+ return new Proxy(this, {
24
+ "get": (object, name) => {
25
+ if (name in object) {
26
+ return object[name];
27
+ }
28
+ const event = $getEvent();
29
+ if (!event) {
30
+ return undefined;
31
+ }
32
+ switch (event.type) {
33
+ case PointerEvent.POINTER_DOWN:
34
+ case PointerEvent.POINTER_MOVE:
35
+ case PointerEvent.POINTER_UP:
36
+ case PointerEvent.POINTER_LEAVE:
37
+ case PointerEvent.POINTER_OVER:
38
+ case PointerEvent.POINTER_OUT:
39
+ if (name in event) {
40
+ // @ts-ignore
41
+ return $event[name];
42
+ }
43
+ return undefined;
44
+ default:
45
+ return undefined;
46
+ }
47
+ }
48
+ });
49
+ }
50
+ /**
51
+ * @description ボタンが連続で押された時に発生します。
52
+ * Occurs when a button is pressed continuously.
53
+ *
54
+ * @return {string}
55
+ * @const
56
+ * @static
57
+ */
58
+ static get DOUBLE_CLICK() {
59
+ return "dblclick";
60
+ }
61
+ /**
62
+ * @description ボタンが押されていない状態から 1 つ以上のボタンが押されている状態に遷移したときに発生します
63
+ * Occurs when one or more buttons are pressed from the state where no buttons are pressed.
64
+ *
65
+ * @return {string}
66
+ * @const
67
+ * @static
68
+ */
69
+ static get POINTER_DOWN() {
70
+ return "pointerdown";
71
+ }
72
+ /**
73
+ * @description ポインティングデバイスが要素のヒットテスト領域を出た時に発生します
74
+ * Occurs when the pointing device leaves the hit test area of an element
75
+ *
76
+ * @return {string}
77
+ * @const
78
+ * @static
79
+ */
80
+ static get POINTER_LEAVE() {
81
+ return "pointerleave";
82
+ }
83
+ /**
84
+ * @description ポインターの座標が変化し、かつタッチ操作によってポインターがキャンセルされていないときに発生します。
85
+ * Occurs when the pointer coordinates change and the pointer is not canceled by a touch operation.
86
+ *
87
+ * @return {string}
88
+ * @const
89
+ * @static
90
+ */
91
+ static get POINTER_MOVE() {
92
+ return "pointermove";
93
+ }
94
+ /**
95
+ * @description ヒットテスト境界を出たに発生します。ホバーに対応していない端末では発生しません。
96
+ * Occurs when the hit test boundary is exited. Does not occur on devices that do not support hover.
97
+ *
98
+ * @return {string}
99
+ * @const
100
+ * @static
101
+ */
102
+ static get POINTER_OUT() {
103
+ return "pointerout";
104
+ }
105
+ /**
106
+ * @description インティングデバイスが要素のヒットテスト境界内に移動したときに発生します。
107
+ * Occurs when the pointing device moves into the hit test boundary of an element.
108
+ *
109
+ * @return {string}
110
+ * @const
111
+ * @static
112
+ */
113
+ static get POINTER_OVER() {
114
+ return "pointerover";
115
+ }
116
+ /**
117
+ * @description ポインターがアクティブではなくなったときに発生します。
118
+ * Occurs when the pointer is no longer active.
119
+ *
120
+ * @return {string}
121
+ * @const
122
+ * @static
123
+ */
124
+ static get POINTER_UP() {
125
+ return "pointerup";
126
+ }
127
+ }
@@ -0,0 +1,53 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description ProgressEvent オブジェクトは、ロード処理が開始されたとき、またはソケットがデータを受信したときに送出されます。
4
+ * これらのイベントは通常、JSON ファイル、イメージまたはデータがアプリケーションにロードされるときに生成されます。
5
+ * A ProgressEvent object is dispatched when a load operation has begun or a socket has received data.
6
+ * These events are usually generated when JSON files, images or data are loaded into an application.
7
+ *
8
+ * @class
9
+ * @memberOf next2d.events
10
+ * @extends Event
11
+ */
12
+ export declare class ProgressEvent extends Event {
13
+ /**
14
+ * @description リスナーがイベントを処理しているときに読み込まれたアイテム数またはバイト数です。
15
+ * The number of items or bytes loaded when the listener processes the event.
16
+ *
17
+ * @return {number}
18
+ * @default 0
19
+ * @readonly
20
+ * @public
21
+ */
22
+ readonly bytesLoaded: number;
23
+ /**
24
+ * @description 読み込みプロセスが成功した場合に読み込まれるアイテムまたはバイトの総数です。
25
+ * The total number of items or bytes that will be loaded
26
+ * if the loading process succeeds.
27
+ *
28
+ * @return {number}
29
+ * @default 0
30
+ * @readonly
31
+ * @public
32
+ */
33
+ readonly bytesTotal: number;
34
+ /**
35
+ * @param {string} type
36
+ * @param {boolean} [bubbles=true]
37
+ * @param {number} [bytes_loaded=0]
38
+ * @param {number} [bytes_total=0]
39
+ *
40
+ * @constructor
41
+ * @public
42
+ */
43
+ constructor(type: string, bubbles?: boolean, bytes_loaded?: number, bytes_total?: number);
44
+ /**
45
+ * @description progress イベントオブジェクトの type プロパティ値を定義します。
46
+ * Defines the value of the type property of a progress event object.
47
+ *
48
+ * @return {string}
49
+ * @const
50
+ * @static
51
+ */
52
+ static get PROGRESS(): string;
53
+ }
@@ -0,0 +1,69 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description ProgressEvent オブジェクトは、ロード処理が開始されたとき、またはソケットがデータを受信したときに送出されます。
4
+ * これらのイベントは通常、JSON ファイル、イメージまたはデータがアプリケーションにロードされるときに生成されます。
5
+ * A ProgressEvent object is dispatched when a load operation has begun or a socket has received data.
6
+ * These events are usually generated when JSON files, images or data are loaded into an application.
7
+ *
8
+ * @class
9
+ * @memberOf next2d.events
10
+ * @extends Event
11
+ */
12
+ export class ProgressEvent extends Event {
13
+ /**
14
+ * @param {string} type
15
+ * @param {boolean} [bubbles=true]
16
+ * @param {number} [bytes_loaded=0]
17
+ * @param {number} [bytes_total=0]
18
+ *
19
+ * @constructor
20
+ * @public
21
+ */
22
+ constructor(type, bubbles = false, bytes_loaded = 0, bytes_total = 0) {
23
+ super(type, bubbles);
24
+ /**
25
+ * @description リスナーがイベントを処理しているときに読み込まれたアイテム数またはバイト数です。
26
+ * The number of items or bytes loaded when the listener processes the event.
27
+ *
28
+ * @return {number}
29
+ * @default 0
30
+ * @readonly
31
+ * @public
32
+ */
33
+ Object.defineProperty(this, "bytesLoaded", {
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true,
37
+ value: void 0
38
+ });
39
+ /**
40
+ * @description 読み込みプロセスが成功した場合に読み込まれるアイテムまたはバイトの総数です。
41
+ * The total number of items or bytes that will be loaded
42
+ * if the loading process succeeds.
43
+ *
44
+ * @return {number}
45
+ * @default 0
46
+ * @readonly
47
+ * @public
48
+ */
49
+ Object.defineProperty(this, "bytesTotal", {
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true,
53
+ value: void 0
54
+ });
55
+ this.bytesLoaded = bytes_loaded | 0;
56
+ this.bytesTotal = bytes_total | 0;
57
+ }
58
+ /**
59
+ * @description progress イベントオブジェクトの type プロパティ値を定義します。
60
+ * Defines the value of the type property of a progress event object.
61
+ *
62
+ * @return {string}
63
+ * @const
64
+ * @static
65
+ */
66
+ static get PROGRESS() {
67
+ return "progress";
68
+ }
69
+ }