@next2d/events 1.14.20

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,101 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * IOErrorEvent オブジェクトは、エラーが発生して入力操作または出力操作が失敗したときに送出されます。
4
+ *
5
+ * An IOErrorEvent object is dispatched when an error causes input or output operations to fail.
6
+ *
7
+ * @class
8
+ * @memberOf next2d.events
9
+ * @extends Event
10
+ */
11
+ export class IOErrorEvent extends Event {
12
+ /**
13
+ * @param {string} type
14
+ * @param {boolean} [bubbles=true]
15
+ * @param {boolean} [cancelable=false]
16
+ * @param {string} [text=""]
17
+ *
18
+ * @constructor
19
+ * @public
20
+ */
21
+ constructor(type, bubbles = false, cancelable = false, text = "") {
22
+ super(type, bubbles, cancelable);
23
+ /**
24
+ * @type {string}
25
+ * @default ""
26
+ * @private
27
+ */
28
+ this._$text = `${text}`;
29
+ }
30
+ /**
31
+ * 指定されたクラスのストリングを返します。
32
+ * Returns the string representation of the specified class.
33
+ *
34
+ * @return {string}
35
+ * @default [class IOErrorEvent]
36
+ * @method
37
+ * @static
38
+ */
39
+ static toString() {
40
+ return "[class IOErrorEvent]";
41
+ }
42
+ /**
43
+ * @description 指定されたクラスの空間名を返します。
44
+ * Returns the space name of the specified class.
45
+ *
46
+ * @member {string}
47
+ * @default next2d.events.IOErrorEvent
48
+ * @const
49
+ * @static
50
+ */
51
+ static get namespace() {
52
+ return "next2d.events.IOErrorEvent";
53
+ }
54
+ /**
55
+ * @description 指定されたオブジェクトのストリングを返します。
56
+ * Returns the string representation of the specified object.
57
+ *
58
+ * @return {string}
59
+ * @method
60
+ * @public
61
+ */
62
+ toString() {
63
+ return this.formatToString("IOErrorEvent", "type", "bubbles", "cancelable", "eventPhase", "text");
64
+ }
65
+ /**
66
+ * @description 指定されたオブジェクトの空間名を返します。
67
+ * Returns the space name of the specified object.
68
+ *
69
+ * @member {string}
70
+ * @default next2d.events.IOErrorEvent
71
+ * @const
72
+ * @public
73
+ */
74
+ get namespace() {
75
+ return "next2d.events.IOErrorEvent";
76
+ }
77
+ /**
78
+ * @description ioError イベントオブジェクトの type プロパティ値を定義します。
79
+ * Defines the value of the type property of an ioError event object.
80
+ *
81
+ * @return {string}
82
+ * @default ioError
83
+ * @const
84
+ * @static
85
+ */
86
+ static get IO_ERROR() {
87
+ return "ioError";
88
+ }
89
+ /**
90
+ * @description エラーテキストです。
91
+ * error text.
92
+ *
93
+ * @return {string}
94
+ * @default ""
95
+ * @readonly
96
+ * @public
97
+ */
98
+ get text() {
99
+ return this._$text;
100
+ }
101
+ }
@@ -0,0 +1,163 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * MouseEvent オブジェクトは、マウスイベントが発生するたびにイベントフローに送出されます。
4
+ * 通常、マウスイベントは、マウスやトラックボールなど、ポインターを使用したユーザー入力デバイスによって生成されます。
5
+ *
6
+ * A MouseEvent object is dispatched into the event flow whenever mouse events occur.
7
+ * A mouse event is usually generated by a user input device,
8
+ * such as a mouse or a trackball, that uses a pointer.
9
+ *
10
+ * @class
11
+ * @memberOf next2d.events
12
+ * @extends Event
13
+ */
14
+ export declare class MouseEvent extends Event {
15
+ /**
16
+ * @param {string} type
17
+ * @param {boolean} [bubbles=true]
18
+ * @param {boolean} [cancelable=false]
19
+ *
20
+ * @constructor
21
+ * @public
22
+ */
23
+ constructor(type: string, bubbles?: boolean, cancelable?: boolean);
24
+ /**
25
+ * 指定されたクラスのストリングを返します。
26
+ * Returns the string representation of the specified class.
27
+ *
28
+ * @return {string}
29
+ * @default [class MouseEvent]
30
+ * @method
31
+ * @static
32
+ */
33
+ static toString(): string;
34
+ /**
35
+ * @description 指定されたクラスの空間名を返します。
36
+ * Returns the space name of the specified class.
37
+ *
38
+ * @member {string}
39
+ * @default next2d.events.MouseEvent
40
+ * @const
41
+ * @static
42
+ */
43
+ static get namespace(): string;
44
+ /**
45
+ * @description 指定されたオブジェクトのストリングを返します。
46
+ * Returns the string representation of the specified object.
47
+ *
48
+ * @return {string}
49
+ * @method
50
+ * @public
51
+ */
52
+ toString(): string;
53
+ /**
54
+ * @description 指定されたオブジェクトの空間名を返します。
55
+ * Returns the space name of the specified object.
56
+ *
57
+ * @member {string}
58
+ * @default next2d.events.MouseEvent
59
+ * @const
60
+ * @public
61
+ */
62
+ get namespace(): string;
63
+ /**
64
+ * @description click イベントオブジェクトの type プロパティ値を定義します。
65
+ * Defines the value of the type property of a click event object.
66
+ *
67
+ * @return {string}
68
+ * @default click
69
+ * @const
70
+ * @static
71
+ */
72
+ static get CLICK(): string;
73
+ /**
74
+ * @description dblclick イベントオブジェクトの type プロパティ値を定義します。
75
+ * Defines the value of the type property of a dblclick event object.
76
+ *
77
+ * @return {string}
78
+ * @default dblclick
79
+ * @const
80
+ * @static
81
+ */
82
+ static get DOUBLE_CLICK(): string;
83
+ /**
84
+ * @description mouseDown イベントオブジェクトの type プロパティ値を定義します。
85
+ * Defines the value of the type property of a mouseDown event object.
86
+ *
87
+ * @return {string}
88
+ * @default mouseDown
89
+ * @const
90
+ * @static
91
+ */
92
+ static get MOUSE_DOWN(): string;
93
+ /**
94
+ * @description mouseMove イベントオブジェクトの type プロパティ値を定義します。
95
+ * Defines the value of the type property of a mouseMove event object.
96
+ *
97
+ * @return {string}
98
+ * @default mouseMove
99
+ * @const
100
+ * @static
101
+ */
102
+ static get MOUSE_MOVE(): string;
103
+ /**
104
+ * @description mouseOut イベントオブジェクトの type プロパティ値を定義します。
105
+ * Defines the value of the type property of a mouseOut event object.
106
+ *
107
+ * @return {string}
108
+ * @default mouseOut
109
+ * @const
110
+ * @static
111
+ */
112
+ static get MOUSE_OUT(): string;
113
+ /**
114
+ * @description mouseOver イベントオブジェクトの type プロパティ値を定義します。
115
+ * Defines the value of the type property of a mouseOver event object.
116
+ *
117
+ * @return {string}
118
+ * @default mouseOver
119
+ * @const
120
+ * @static
121
+ */
122
+ static get MOUSE_OVER(): string;
123
+ /**
124
+ * @description mouseUp イベントオブジェクトの type プロパティ値を定義します。
125
+ * Defines the value of the type property of a mouseUp event object.
126
+ *
127
+ * @return {string}
128
+ * @default mouseUp
129
+ * @const
130
+ * @static
131
+ */
132
+ static get MOUSE_UP(): string;
133
+ /**
134
+ * @description mouseWheel イベントオブジェクトの type プロパティ値を定義します。
135
+ * Defines the value of the type property of a mouseWheel event object.
136
+ *
137
+ * @return {string}
138
+ * @default mouseWheel
139
+ * @const
140
+ * @static
141
+ */
142
+ static get MOUSE_WHEEL(): string;
143
+ /**
144
+ * @description rollOut イベントオブジェクトの type プロパティ値を定義します。
145
+ * Defines the value of the type property of a rollOut event object.
146
+ *
147
+ * @return {string}
148
+ * @default rollOut
149
+ * @const
150
+ * @static
151
+ */
152
+ static get ROLL_OUT(): string;
153
+ /**
154
+ * @description rollOver イベントオブジェクトの type プロパティ値を定義します。
155
+ * Defines the value of the type property of a rollOver event object.
156
+ *
157
+ * @return {string}
158
+ * @default rollOver
159
+ * @const
160
+ * @static
161
+ */
162
+ static get ROLL_OVER(): string;
163
+ }
@@ -0,0 +1,207 @@
1
+ import { Event } from "./Event";
2
+ import { $getEvent } from "@next2d/util";
3
+ /**
4
+ * MouseEvent オブジェクトは、マウスイベントが発生するたびにイベントフローに送出されます。
5
+ * 通常、マウスイベントは、マウスやトラックボールなど、ポインターを使用したユーザー入力デバイスによって生成されます。
6
+ *
7
+ * A MouseEvent object is dispatched into the event flow whenever mouse events occur.
8
+ * A mouse event is usually generated by a user input device,
9
+ * such as a mouse or a trackball, that uses a pointer.
10
+ *
11
+ * @class
12
+ * @memberOf next2d.events
13
+ * @extends Event
14
+ */
15
+ export class MouseEvent extends Event {
16
+ /**
17
+ * @param {string} type
18
+ * @param {boolean} [bubbles=true]
19
+ * @param {boolean} [cancelable=false]
20
+ *
21
+ * @constructor
22
+ * @public
23
+ */
24
+ constructor(type, bubbles = true, cancelable = false) {
25
+ super(type, bubbles, cancelable);
26
+ return new Proxy(this, {
27
+ "get": (object, name) => {
28
+ if (name in object) {
29
+ return object[name];
30
+ }
31
+ const $event = $getEvent();
32
+ if ($event && name in $event) {
33
+ // @ts-ignore
34
+ return $event[name];
35
+ }
36
+ return undefined;
37
+ }
38
+ });
39
+ }
40
+ /**
41
+ * 指定されたクラスのストリングを返します。
42
+ * Returns the string representation of the specified class.
43
+ *
44
+ * @return {string}
45
+ * @default [class MouseEvent]
46
+ * @method
47
+ * @static
48
+ */
49
+ static toString() {
50
+ return "[class MouseEvent]";
51
+ }
52
+ /**
53
+ * @description 指定されたクラスの空間名を返します。
54
+ * Returns the space name of the specified class.
55
+ *
56
+ * @member {string}
57
+ * @default next2d.events.MouseEvent
58
+ * @const
59
+ * @static
60
+ */
61
+ static get namespace() {
62
+ return "next2d.events.MouseEvent";
63
+ }
64
+ /**
65
+ * @description 指定されたオブジェクトのストリングを返します。
66
+ * Returns the string representation of the specified object.
67
+ *
68
+ * @return {string}
69
+ * @method
70
+ * @public
71
+ */
72
+ toString() {
73
+ return this.formatToString("MouseEvent", "type", "bubbles", "cancelable", "eventPhase", "localX", "localY", "stageX", "stageY", "ctrlKey", "altKey", "shiftKey", "buttonDown", "delta", "commandKey", "controlKey", "clickCount");
74
+ }
75
+ /**
76
+ * @description 指定されたオブジェクトの空間名を返します。
77
+ * Returns the space name of the specified object.
78
+ *
79
+ * @member {string}
80
+ * @default next2d.events.MouseEvent
81
+ * @const
82
+ * @public
83
+ */
84
+ get namespace() {
85
+ return "next2d.events.MouseEvent";
86
+ }
87
+ /**
88
+ * @description click イベントオブジェクトの type プロパティ値を定義します。
89
+ * Defines the value of the type property of a click event object.
90
+ *
91
+ * @return {string}
92
+ * @default click
93
+ * @const
94
+ * @static
95
+ */
96
+ static get CLICK() {
97
+ return "click";
98
+ }
99
+ /**
100
+ * @description dblclick イベントオブジェクトの type プロパティ値を定義します。
101
+ * Defines the value of the type property of a dblclick event object.
102
+ *
103
+ * @return {string}
104
+ * @default dblclick
105
+ * @const
106
+ * @static
107
+ */
108
+ static get DOUBLE_CLICK() {
109
+ return "dblclick";
110
+ }
111
+ /**
112
+ * @description mouseDown イベントオブジェクトの type プロパティ値を定義します。
113
+ * Defines the value of the type property of a mouseDown event object.
114
+ *
115
+ * @return {string}
116
+ * @default mouseDown
117
+ * @const
118
+ * @static
119
+ */
120
+ static get MOUSE_DOWN() {
121
+ return "mouseDown";
122
+ }
123
+ /**
124
+ * @description mouseMove イベントオブジェクトの type プロパティ値を定義します。
125
+ * Defines the value of the type property of a mouseMove event object.
126
+ *
127
+ * @return {string}
128
+ * @default mouseMove
129
+ * @const
130
+ * @static
131
+ */
132
+ static get MOUSE_MOVE() {
133
+ return "mouseMove";
134
+ }
135
+ /**
136
+ * @description mouseOut イベントオブジェクトの type プロパティ値を定義します。
137
+ * Defines the value of the type property of a mouseOut event object.
138
+ *
139
+ * @return {string}
140
+ * @default mouseOut
141
+ * @const
142
+ * @static
143
+ */
144
+ static get MOUSE_OUT() {
145
+ return "mouseOut";
146
+ }
147
+ /**
148
+ * @description mouseOver イベントオブジェクトの type プロパティ値を定義します。
149
+ * Defines the value of the type property of a mouseOver event object.
150
+ *
151
+ * @return {string}
152
+ * @default mouseOver
153
+ * @const
154
+ * @static
155
+ */
156
+ static get MOUSE_OVER() {
157
+ return "mouseOver";
158
+ }
159
+ /**
160
+ * @description mouseUp イベントオブジェクトの type プロパティ値を定義します。
161
+ * Defines the value of the type property of a mouseUp event object.
162
+ *
163
+ * @return {string}
164
+ * @default mouseUp
165
+ * @const
166
+ * @static
167
+ */
168
+ static get MOUSE_UP() {
169
+ return "mouseUp";
170
+ }
171
+ /**
172
+ * @description mouseWheel イベントオブジェクトの type プロパティ値を定義します。
173
+ * Defines the value of the type property of a mouseWheel event object.
174
+ *
175
+ * @return {string}
176
+ * @default mouseWheel
177
+ * @const
178
+ * @static
179
+ */
180
+ static get MOUSE_WHEEL() {
181
+ return "mouseWheel";
182
+ }
183
+ /**
184
+ * @description rollOut イベントオブジェクトの type プロパティ値を定義します。
185
+ * Defines the value of the type property of a rollOut event object.
186
+ *
187
+ * @return {string}
188
+ * @default rollOut
189
+ * @const
190
+ * @static
191
+ */
192
+ static get ROLL_OUT() {
193
+ return "rollOut";
194
+ }
195
+ /**
196
+ * @description rollOver イベントオブジェクトの type プロパティ値を定義します。
197
+ * Defines the value of the type property of a rollOver event object.
198
+ *
199
+ * @return {string}
200
+ * @default rollOver
201
+ * @const
202
+ * @static
203
+ */
204
+ static get ROLL_OVER() {
205
+ return "rollOver";
206
+ }
207
+ }
@@ -0,0 +1,97 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * ProgressEvent オブジェクトは、ロード処理が開始されたとき、またはソケットがデータを受信したときに送出されます。
4
+ * これらのイベントは通常、JSON ファイル、イメージまたはデータがアプリケーションにロードされるときに生成されます。
5
+ *
6
+ * A ProgressEvent object is dispatched when a load operation has begun or a socket has received data.
7
+ * These events are usually generated when JSON files, images or data are loaded into an application.
8
+ *
9
+ * @class
10
+ * @memberOf next2d.events
11
+ * @extends Event
12
+ */
13
+ export declare class ProgressEvent extends Event {
14
+ private readonly _$bytesLoaded;
15
+ private readonly _$bytesTotal;
16
+ /**
17
+ * @param {string} type
18
+ * @param {boolean} [bubbles=true]
19
+ * @param {boolean} [cancelable=false]
20
+ * @param {number} [bytes_loaded=0]
21
+ * @param {number} [bytes_total=0]
22
+ *
23
+ * @constructor
24
+ * @public
25
+ */
26
+ constructor(type: string, bubbles?: boolean, cancelable?: boolean, bytes_loaded?: number, bytes_total?: number);
27
+ /**
28
+ * 指定されたクラスのストリングを返します。
29
+ * Returns the string representation of the specified class.
30
+ *
31
+ * @return {string}
32
+ * @default [class ProgressEvent]
33
+ * @method
34
+ * @static
35
+ */
36
+ static toString(): string;
37
+ /**
38
+ * @description 指定されたクラスの空間名を返します。
39
+ * Returns the space name of the specified class.
40
+ *
41
+ * @member {string}
42
+ * @default next2d.events.ProgressEvent
43
+ * @const
44
+ * @static
45
+ */
46
+ static get namespace(): string;
47
+ /**
48
+ * @description 指定されたオブジェクトのストリングを返します。
49
+ * Returns the string representation of the specified object.
50
+ *
51
+ * @return {string}
52
+ * @method
53
+ * @public
54
+ */
55
+ toString(): string;
56
+ /**
57
+ * @description 指定されたオブジェクトの空間名を返します。
58
+ * Returns the space name of the specified object.
59
+ *
60
+ * @member {string}
61
+ * @default next2d.events.ProgressEvent
62
+ * @const
63
+ * @public
64
+ */
65
+ get namespace(): string;
66
+ /**
67
+ * @description progress イベントオブジェクトの type プロパティ値を定義します。
68
+ * Defines the value of the type property of a progress event object.
69
+ *
70
+ * @return {string}
71
+ * @default progress
72
+ * @const
73
+ * @static
74
+ */
75
+ static get PROGRESS(): string;
76
+ /**
77
+ * @description リスナーがイベントを処理しているときに読み込まれたアイテム数またはバイト数です。
78
+ * The number of items or bytes loaded when the listener processes the event.
79
+ *
80
+ * @return {number}
81
+ * @default 0
82
+ * @readonly
83
+ * @public
84
+ */
85
+ get bytesLoaded(): number;
86
+ /**
87
+ * @description 読み込みプロセスが成功した場合に読み込まれるアイテムまたはバイトの総数です。
88
+ * The total number of items or bytes that will be loaded
89
+ * if the loading process succeeds.
90
+ *
91
+ * @return {number}
92
+ * @default 0
93
+ * @readonly
94
+ * @public
95
+ */
96
+ get bytesTotal(): number;
97
+ }
@@ -0,0 +1,123 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * ProgressEvent オブジェクトは、ロード処理が開始されたとき、またはソケットがデータを受信したときに送出されます。
4
+ * これらのイベントは通常、JSON ファイル、イメージまたはデータがアプリケーションにロードされるときに生成されます。
5
+ *
6
+ * A ProgressEvent object is dispatched when a load operation has begun or a socket has received data.
7
+ * These events are usually generated when JSON files, images or data are loaded into an application.
8
+ *
9
+ * @class
10
+ * @memberOf next2d.events
11
+ * @extends Event
12
+ */
13
+ export class ProgressEvent extends Event {
14
+ /**
15
+ * @param {string} type
16
+ * @param {boolean} [bubbles=true]
17
+ * @param {boolean} [cancelable=false]
18
+ * @param {number} [bytes_loaded=0]
19
+ * @param {number} [bytes_total=0]
20
+ *
21
+ * @constructor
22
+ * @public
23
+ */
24
+ constructor(type, bubbles = false, cancelable = false, bytes_loaded = 0, bytes_total = 0) {
25
+ super(type, bubbles, cancelable);
26
+ /**
27
+ * @type {number}
28
+ * @default 0
29
+ * @private
30
+ */
31
+ this._$bytesLoaded = bytes_loaded | 0;
32
+ /**
33
+ * @type {number}
34
+ * @default 0
35
+ * @private
36
+ */
37
+ this._$bytesTotal = bytes_total | 0;
38
+ }
39
+ /**
40
+ * 指定されたクラスのストリングを返します。
41
+ * Returns the string representation of the specified class.
42
+ *
43
+ * @return {string}
44
+ * @default [class ProgressEvent]
45
+ * @method
46
+ * @static
47
+ */
48
+ static toString() {
49
+ return "[class ProgressEvent]";
50
+ }
51
+ /**
52
+ * @description 指定されたクラスの空間名を返します。
53
+ * Returns the space name of the specified class.
54
+ *
55
+ * @member {string}
56
+ * @default next2d.events.ProgressEvent
57
+ * @const
58
+ * @static
59
+ */
60
+ static get namespace() {
61
+ return "next2d.events.ProgressEvent";
62
+ }
63
+ /**
64
+ * @description 指定されたオブジェクトのストリングを返します。
65
+ * Returns the string representation of the specified object.
66
+ *
67
+ * @return {string}
68
+ * @method
69
+ * @public
70
+ */
71
+ toString() {
72
+ return this.formatToString("ProgressEvent", "type", "bubbles", "cancelable", "eventPhase", "bytesLoaded", "bytesTotal");
73
+ }
74
+ /**
75
+ * @description 指定されたオブジェクトの空間名を返します。
76
+ * Returns the space name of the specified object.
77
+ *
78
+ * @member {string}
79
+ * @default next2d.events.ProgressEvent
80
+ * @const
81
+ * @public
82
+ */
83
+ get namespace() {
84
+ return "next2d.events.ProgressEvent";
85
+ }
86
+ /**
87
+ * @description progress イベントオブジェクトの type プロパティ値を定義します。
88
+ * Defines the value of the type property of a progress event object.
89
+ *
90
+ * @return {string}
91
+ * @default progress
92
+ * @const
93
+ * @static
94
+ */
95
+ static get PROGRESS() {
96
+ return "progress";
97
+ }
98
+ /**
99
+ * @description リスナーがイベントを処理しているときに読み込まれたアイテム数またはバイト数です。
100
+ * The number of items or bytes loaded when the listener processes the event.
101
+ *
102
+ * @return {number}
103
+ * @default 0
104
+ * @readonly
105
+ * @public
106
+ */
107
+ get bytesLoaded() {
108
+ return this._$bytesLoaded;
109
+ }
110
+ /**
111
+ * @description 読み込みプロセスが成功した場合に読み込まれるアイテムまたはバイトの総数です。
112
+ * The total number of items or bytes that will be loaded
113
+ * if the loading process succeeds.
114
+ *
115
+ * @return {number}
116
+ * @default 0
117
+ * @readonly
118
+ * @public
119
+ */
120
+ get bytesTotal() {
121
+ return this._$bytesTotal;
122
+ }
123
+ }