@pixui-dev/pxw 0.1.26 → 0.1.28

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.
@@ -1,1788 +1,1792 @@
1
1
  /// <reference no-default-lib="true"/>
2
2
  /// <reference lib="es2020" />
3
3
 
4
- /*pix
5
- gen: readArg
6
- */
7
- interface EventListener {
8
- (evt: Event): void;
9
- }
10
-
11
- /*pix
12
- gen: binding
13
- */
14
- /** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */
15
- interface EventTarget {
16
- /**
17
- * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
18
- *
19
- * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
20
- */
21
- addEventListener(type: string, listener: EventListener): void;
22
-
23
- /**
24
- * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
25
- */
26
- dispatchEvent(event: Event): void;
27
-
28
- /**
29
- * Removes the event listener in target's event listener list with the same type, callback, and options.
30
- */
31
- removeEventListener(type: string, callback: EventListener): void;
32
- }
33
-
34
- /*pix
35
- gen: binding
36
- cpp-class: ElementEvent
37
- */
38
- /** An event which takes place in the DOM. */
39
- interface Event {
40
- /**
41
- * Returns the object to which event is dispatched (its target).
42
- */
43
- readonly target: EventTarget | null;
44
- /**
45
- * Returns the object whose event listener's callback is currently being invoked.
46
- */
47
- readonly currentTarget: EventTarget | null;
48
- /**
49
- * Returns the type of event, e.g. "click", "hashchange", or "submit".
50
- */
51
- readonly type: string;
52
- /** 和stopPropagation()效果一样,只是兼容老代码 */
53
- cancelBubble: boolean;
54
-
55
- /**
56
- * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
57
- */
58
- stopPropagation(): void;
59
-
60
- /**
61
- * Returns true if stopPropagation() was invoked successfully, and false otherwise.
62
- */
63
- isPropagationStopped(): boolean;
64
-
65
- /**
66
- * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
67
- */
68
- preventDefault(): void;
69
-
70
- initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
71
- /**
72
- * MouseEvent: Take the target element as the origin
73
- */
74
- readonly offsetX: number;
75
- readonly offsetY: number;
76
- /**
77
- * MouseEvent: Take the upper left corner of the view as the origin
78
- */
79
- readonly clientX: number;
80
- readonly clientY: number;
81
- }
82
-
83
- /*pix
84
- gen: struct
85
- */
86
- interface EventInit {
87
- bubbles?: boolean;
88
- cancelable?: boolean;
89
- }
90
-
91
- // declare let Event: {
92
- // prototype: Event;
93
- // new(target: EventTarget, type: string): Event;
94
- // };
95
-
96
- /*pix
97
- gen: struct
98
- */
99
- interface CustomEventInit<T = any> {
100
- detail?: T;
101
- }
102
-
103
- /*pix
104
- gen: binding
105
- */
106
- /** Simple user interface events. */
107
- interface CustomEvent<T = any> extends Event {
108
- readonly detail: T;
109
-
110
- // initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void;
111
- }
112
-
113
- declare let CustomEvent: {
114
- prototype: CustomEvent;
115
- new <T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
116
- };
117
-
118
- /*pix
119
- gen: binding
120
- */
121
- /** Events providing information related to animations. */
122
- interface AnimationEvent extends Event {
123
- readonly name: string;
124
- }
125
-
126
- /*pix
127
- gen: binding
128
- */
129
- /** Events providing information related to transitions. */
130
- interface TransitionEvent extends Event {
131
- readonly name: string;
132
- }
133
-
134
- /*pix
135
- gen: binding
136
- */
137
- /** KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard. */
138
- interface KeyboardEvent extends Event {
139
- readonly keyCode: number;
140
- readonly key: number;
141
- readonly code: number;
142
- readonly altKey: boolean;
143
- readonly metaKey: boolean;
144
- readonly ctrlKey: boolean;
145
- readonly shiftKey: boolean;
146
- hasHandled: boolean;
147
- }
148
-
149
- declare let KeyboardEvent: {
150
- prototype: KeyboardEvent;
151
- };
152
-
153
- /*pix
154
- gen: binding
155
- */
156
- /** GamepadEvent objects describe a user interaction with the gamepad; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the gamepad. */
157
- interface GamepadEvent extends Event {
158
- readonly key: number;
159
- readonly index: number;
160
- readonly axis: number;
161
- readonly isDown: boolean;
162
- hasHandled: boolean;
163
- }
164
-
165
- declare let GamepadEvent: {
166
- prototype: GamepadEvent;
167
- };
168
-
169
- /*pix
170
- gen: binding
171
- */
172
- /** Events providing information related to errors in scripts or in files. */
173
- interface MouseMoveEvent extends Event {}
174
-
175
- /*pix
4
+ import 'preact'
5
+
6
+ declare global {
7
+ /*pix
8
+ gen: readArg
9
+ */
10
+ interface EventListener {
11
+ (evt: Event): void;
12
+ }
13
+
14
+ /*pix
15
+ gen: binding
16
+ */
17
+ /** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */
18
+ interface EventTarget {
19
+ /**
20
+ * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
21
+ *
22
+ * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
23
+ */
24
+ addEventListener(type: string, listener: EventListener): void;
25
+
26
+ /**
27
+ * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
28
+ */
29
+ dispatchEvent(event: Event): void;
30
+
31
+ /**
32
+ * Removes the event listener in target's event listener list with the same type, callback, and options.
33
+ */
34
+ removeEventListener(type: string, callback: EventListener): void;
35
+ }
36
+
37
+ /*pix
38
+ gen: binding
39
+ cpp-class: ElementEvent
40
+ */
41
+ /** An event which takes place in the DOM. */
42
+ interface Event {
43
+ /**
44
+ * Returns the object to which event is dispatched (its target).
45
+ */
46
+ readonly target: EventTarget | null;
47
+ /**
48
+ * Returns the object whose event listener's callback is currently being invoked.
49
+ */
50
+ readonly currentTarget: EventTarget | null;
51
+ /**
52
+ * Returns the type of event, e.g. "click", "hashchange", or "submit".
53
+ */
54
+ readonly type: string;
55
+ /** 和stopPropagation()效果一样,只是兼容老代码 */
56
+ cancelBubble: boolean;
57
+
58
+ /**
59
+ * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
60
+ */
61
+ stopPropagation(): void;
62
+
63
+ /**
64
+ * Returns true if stopPropagation() was invoked successfully, and false otherwise.
65
+ */
66
+ isPropagationStopped(): boolean;
67
+
68
+ /**
69
+ * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
70
+ */
71
+ preventDefault(): void;
72
+
73
+ initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
74
+ /**
75
+ * MouseEvent: Take the target element as the origin
76
+ */
77
+ readonly offsetX: number;
78
+ readonly offsetY: number;
79
+ /**
80
+ * MouseEvent: Take the upper left corner of the view as the origin
81
+ */
82
+ readonly clientX: number;
83
+ readonly clientY: number;
84
+ }
85
+
86
+ /*pix
87
+ gen: struct
88
+ */
89
+ interface EventInit {
90
+ bubbles?: boolean;
91
+ cancelable?: boolean;
92
+ }
93
+
94
+ // declare let Event: {
95
+ // prototype: Event;
96
+ // new(target: EventTarget, type: string): Event;
97
+ // };
98
+
99
+ /*pix
100
+ gen: struct
101
+ */
102
+ interface CustomEventInit<T = any> {
103
+ detail?: T;
104
+ }
105
+
106
+ /*pix
176
107
  gen: binding
177
- */
178
- interface MouseUpEvent extends Event {
179
- readonly button: number;
180
- }
108
+ */
109
+ /** Simple user interface events. */
110
+ interface CustomEvent<T = any> extends Event {
111
+ readonly detail: T;
181
112
 
182
- /*pix
113
+ // initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void;
114
+ }
115
+
116
+ declare let CustomEvent: {
117
+ prototype: CustomEvent;
118
+ new <T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
119
+ };
120
+
121
+ /*pix
183
122
  gen: binding
184
- */
185
- interface MouseDownEvent extends Event {
186
- readonly button: number;
187
- }
123
+ */
124
+ /** Events providing information related to animations. */
125
+ interface AnimationEvent extends Event {
126
+ readonly name: string;
127
+ }
188
128
 
189
- /*pix
129
+ /*pix
190
130
  gen: binding
191
- */
192
- interface MouseClickEvent extends Event {
193
- readonly button: number;
194
- }
131
+ */
132
+ /** Events providing information related to transitions. */
133
+ interface TransitionEvent extends Event {
134
+ readonly name: string;
135
+ }
195
136
 
196
- /*pix
137
+ /*pix
138
+ gen: binding
139
+ */
140
+ /** KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard. */
141
+ interface KeyboardEvent extends Event {
142
+ readonly keyCode: number;
143
+ readonly key: number;
144
+ readonly code: number;
145
+ readonly altKey: boolean;
146
+ readonly metaKey: boolean;
147
+ readonly ctrlKey: boolean;
148
+ readonly shiftKey: boolean;
149
+ hasHandled: boolean;
150
+ }
151
+
152
+ declare let KeyboardEvent: {
153
+ prototype: KeyboardEvent;
154
+ };
155
+
156
+ /*pix
157
+ gen: binding
158
+ */
159
+ /** GamepadEvent objects describe a user interaction with the gamepad; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the gamepad. */
160
+ interface GamepadEvent extends Event {
161
+ readonly key: number;
162
+ readonly index: number;
163
+ readonly axis: number;
164
+ readonly isDown: boolean;
165
+ hasHandled: boolean;
166
+ }
167
+
168
+ declare let GamepadEvent: {
169
+ prototype: GamepadEvent;
170
+ };
171
+
172
+ /*pix
197
173
  gen: binding
198
- */
199
- interface MouseDragEvent extends MouseMoveEvent {
200
- readonly dragged: Node;
201
- }
202
-
203
- /*pix
204
- gen: binding
205
- */
206
- interface WheelEvent extends Event {
207
- readonly deltaX: number;
208
- readonly deltaY: number;
209
- readonly deltaZ: number;
210
- }
211
-
212
- /*pix
174
+ */
175
+ /** Events providing information related to errors in scripts or in files. */
176
+ interface MouseMoveEvent extends Event {}
177
+
178
+ /*pix
179
+ gen: binding
180
+ */
181
+ interface MouseUpEvent extends Event {
182
+ readonly button: number;
183
+ }
184
+
185
+ /*pix
186
+ gen: binding
187
+ */
188
+ interface MouseDownEvent extends Event {
189
+ readonly button: number;
190
+ }
191
+
192
+ /*pix
193
+ gen: binding
194
+ */
195
+ interface MouseClickEvent extends Event {
196
+ readonly button: number;
197
+ }
198
+
199
+ /*pix
200
+ gen: binding
201
+ */
202
+ interface MouseDragEvent extends MouseMoveEvent {
203
+ readonly dragged: Node;
204
+ }
205
+
206
+ /*pix
213
207
  gen: binding
214
- */
215
- interface InputStateEvent extends Event {
216
- readonly state: string;
217
- readonly start: number;
218
- readonly end: number;
219
- }
220
-
221
- /*pix
208
+ */
209
+ interface WheelEvent extends Event {
210
+ readonly deltaX: number;
211
+ readonly deltaY: number;
212
+ readonly deltaZ: number;
213
+ }
214
+
215
+ /*pix
216
+ gen: binding
217
+ */
218
+ interface InputStateEvent extends Event {
219
+ readonly state: string;
220
+ readonly start: number;
221
+ readonly end: number;
222
+ }
223
+
224
+ /*pix
225
+ gen: binding
226
+ */
227
+ interface TextAreaStateEvent extends Event {
228
+ readonly state: string;
229
+ readonly startX: number;
230
+ readonly startY: number;
231
+ readonly endX: number;
232
+ readonly endY: number;
233
+ }
234
+
235
+ /*pix
236
+ gen: binding
237
+ */
238
+ interface DataEvent extends Event {
239
+ data: any;
240
+
241
+ count: number;
242
+
243
+ readonly index: number;
244
+ }
245
+
246
+ /*pix
247
+ gen: binding
248
+ */
249
+ interface ScrollEvent extends Event {}
250
+
251
+ /*pix
252
+ gen: binding
253
+ */
254
+ interface TemplateLoadEvent extends Event {
255
+ readonly data: any;
256
+ }
257
+
258
+ /*pix
259
+ gen: binding
260
+ */
261
+ interface WindowMessageEvent extends Event {
262
+ readonly data: string;
263
+ readonly source: EventTarget;
264
+
265
+ result: string;
266
+ }
267
+
268
+ /*pix
222
269
  gen: binding
223
- */
224
- interface TextAreaStateEvent extends Event {
225
- readonly state: string;
226
- readonly startX: number;
227
- readonly startY: number;
228
- readonly endX: number;
229
- readonly endY: number;
230
- }
231
-
232
- /*pix
270
+ */
271
+ /** Simple user interface events. */
272
+ interface UIEvent extends Event {}
273
+
274
+ /*pix
275
+ gen: binding
276
+ */
277
+ interface MessageEvent extends Event {
278
+ readonly data: string;
279
+ readonly source: EventTarget;
280
+ }
281
+
282
+ /*pix
233
283
  gen: binding
234
- */
235
- interface DataEvent extends Event {
236
- data: any;
284
+ */
285
+ /** Events providing information related to errors in scripts or in files. */
286
+ interface ErrorEvent extends Event {
287
+ readonly message: string;
288
+ }
237
289
 
238
- count: number;
290
+ /*pix
291
+ gen: binding
292
+ */
293
+ interface InputEvent extends UIEvent {
294
+ readonly data: string | null;
295
+ }
296
+
297
+ /*pix
298
+ gen: binding
299
+ */
300
+ /** A single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad. */
301
+ interface Touch {
302
+ readonly clientX: number;
303
+ readonly clientY: number;
304
+ readonly identifier: number;
305
+ readonly target: EventTarget;
306
+ }
307
+
308
+ /*pix
309
+ gen: binding
310
+ */
311
+ /** An event sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. */
312
+ interface TouchEvent extends UIEvent {
313
+ readonly targetTouches: Touch[];
314
+ readonly touches: Touch[];
315
+ }
316
+
317
+ /*pix
318
+ gen: binding
319
+ cpp-precompile: BUILD_WITH_RLOTTIE
320
+ */
321
+ interface LottieEvent<T extends EventTarget = EventTarget> extends Event {
322
+ readonly currentFrame: number;
323
+ }
239
324
 
240
- readonly index: number;
241
- }
325
+ /*pix
326
+ gen: binding
327
+ */
328
+ interface SlotAttachmentScriptBinding {
329
+ readonly src: string;
330
+ readonly handle: number;
331
+ }
242
332
 
243
- /*pix
333
+ /*pix
334
+ gen: binding
335
+ */
336
+ interface File {
337
+ readonly fullPath: string;
338
+ readonly name: string;
339
+ readonly type: string;
340
+ readonly size: number;
341
+ readonly lastModified: number;
342
+ }
343
+
344
+ /*pix
345
+ gen: binding
346
+ cpp-class: WebsocketCloseEvent
347
+ */
348
+ /** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
349
+ interface CloseEvent extends Event {
350
+ /**
351
+ * Returns the WebSocket connection close code provided by the server.
352
+ */
353
+ readonly code: any;
354
+ /**
355
+ * Returns the WebSocket connection close reason provided by the server.
356
+ */
357
+ readonly reason: any;
358
+ /**
359
+ * Returns true if the connection closed cleanly; false otherwise.
360
+ */
361
+ readonly wasClean: any;
362
+ }
363
+
364
+ /*pix
244
365
  gen: binding
245
- */
246
- interface ScrollEvent extends Event {}
366
+ cpp-class: WebsocketMsgEvent
367
+ */
368
+ interface MsgEvent extends Event {
369
+ readonly data: any;
370
+ }
371
+
372
+ type instantEchoType = boolean;
373
+
374
+ interface WebSocketEventMap {
375
+ close: CloseEvent;
376
+ error: Event;
377
+ message: MsgEvent;
378
+ open: Event;
379
+ }
380
+
381
+ /*pix
382
+ gen: binding
383
+ */
384
+ /** Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */
385
+ interface WebSocket extends EventTarget {
386
+ instantEcho: instantEchoType;
387
+ /**
388
+ * Returns the state of the WebSocket object's connection. It can have the values described below.
389
+ */
390
+ readonly readyState: number;
391
+ readonly CLOSED: number;
392
+ readonly CLOSING: number;
393
+ readonly CONNECTING: number;
394
+ readonly OPEN: number;
395
+
396
+ onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
397
+ onerror: ((this: WebSocket, ev: Event) => any) | null;
398
+ onmessage: ((this: WebSocket, ev: MsgEvent) => any) | null;
399
+ onopen: ((this: WebSocket, ev: Event) => any) | null;
400
+
401
+ /**
402
+ * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
403
+ */
404
+ close(code?: number, reason?: string): void;
405
+ /**
406
+ * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
407
+ */
408
+ send(data: string | ArrayBufferLike | ArrayBufferView): void;
409
+ /**
410
+ * Receive network messages synchronously, for debugger use only.
411
+ */
412
+ syncReceiveMsg(timeout?: number): string;
413
+ zip(data: any): void;
414
+
415
+ unzip(data: any): void;
416
+
417
+ addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any): void;
418
+
419
+ removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any): void;
420
+ }
421
+
422
+ declare let WebSocket: {
423
+ prototype: WebSocket;
424
+ new (url: string, protocols?: string | string[]): WebSocket;
425
+ readonly CLOSED: number;
426
+ readonly CLOSING: number;
427
+ readonly CONNECTING: number;
428
+ readonly OPEN: number;
429
+ };
430
+
431
+ ///////////////////////////////////////////////////////////
432
+
433
+ interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {
434
+ readystatechange: Event;
435
+ }
436
+
437
+ type BufferSource = ArrayBufferView | ArrayBuffer;
438
+ type BodyInit = BufferSource | string;
439
+ type XMLHttpRequestResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
440
+
441
+ /*pix
442
+ gen: struct
443
+ convertor: toJS
444
+ */
445
+ interface NetDebugMsg {
446
+ total_time?: number /* defaultValue:0.0 */;
447
+ namelookup_time?: number /* defaultValue:0.0 */;
448
+ connect_time?: number /* defaultValue:0.0 */;
449
+ appconnect_time?: number /* defaultValue:0.0 */;
450
+ pretransfer_time?: number /* defaultValue:0.0 */;
451
+ redirect_time?: number /* defaultValue:0.0 */;
452
+ start_transfer_time?: number /* defaultValue:0.0 */;
453
+ download_size?: number /* defaultValue:0.0 */;
454
+ upload_size?: number /* defaultValue:0.0 */;
455
+ req_size?: number /* defaultValue:0.0 */;
456
+ header_size?: number /* defaultValue:0.0 */;
457
+ speed_download?: number /* defaultValue:0.0 */;
458
+ speed_upload?: number /* defaultValue:0.0 */;
459
+ }
460
+
461
+ /*pix
462
+ gen: binding
463
+ */
464
+ /** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */
465
+ interface XMLHttpRequest extends EventTarget {
466
+ readonly DONE: number /* value:4 */;
467
+ readonly LOADING: number /* value:3 */;
468
+ readonly HEADERS_RECEIVED: number /* value:2 */;
469
+ readonly OPENED: number /* value:1 */;
470
+ readonly UNSENT: number /* value:0 */;
471
+ /**
472
+ * Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server.
473
+ */
474
+ readonly upload: XMLHttpRequestUpload;
475
+
476
+ readonly status: number;
477
+ /**
478
+ * Returns the response's body.
479
+ */
480
+ readonly response: any;
481
+
482
+ readonly statusText: string;
483
+ /**
484
+ * Returns client's state.
485
+ */
486
+ readonly readyState: number;
487
+ /**
488
+ * Returns the text response.
489
+ *
490
+ * Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text".
491
+ */
492
+ readonly responseText: string;
493
+
494
+ readonly responseURL: string;
495
+ /**
496
+ * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a "TimeoutError" DOMException will be thrown otherwise (for the send() method).
497
+ *
498
+ * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
499
+ */
500
+ timeout: number;
501
+ /**
502
+ * Returns the response type.
503
+ *
504
+ * Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
505
+ *
506
+ * When set: setting to "document" is ignored if current global object is not a Window object.
507
+ *
508
+ * When set: throws an "InvalidStateError" DOMException if state is loading or done.
509
+ *
510
+ * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
511
+ */
512
+ responseType: XMLHttpRequestResponseType;
513
+ /**
514
+ * Get Set xhr incrementalDataSize.
515
+ * default is 0, means do not call onincrementaldata
516
+ * if set 1024, then call onincrementaldata when recv data size over 1024B,
517
+ */
518
+ incrementalDataSize: number;
519
+
520
+ onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
521
+ onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
522
+ onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
523
+ onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
524
+ onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
525
+ onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
526
+ ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
527
+ onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
528
+ onincrementaldata: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
529
+
530
+ /**
531
+ * Cancels any network activity.
532
+ */
533
+ abort(): void;
534
+
535
+ getResponseHeader(name: string): string | null;
536
+
537
+ getAllResponseHeaders(): string;
538
+
539
+ /**
540
+ * Sets the request method, request URL, and synchronous flag.
541
+ *
542
+ * Throws a "SyntaxError" DOMException if either method is not a valid HTTP method or url cannot be parsed.
543
+ *
544
+ * Throws a "SecurityError" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.
545
+ *
546
+ * Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.
547
+ */
548
+ open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;
549
+
550
+ /**
551
+ * Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD.
552
+ *
553
+ * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
554
+ */
555
+ send(body?: BodyInit | null): void;
556
+
557
+ /**
558
+ * Combines a header in author request headers.
559
+ *
560
+ * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
561
+ *
562
+ * Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value.
563
+ */
564
+ setRequestHeader(name: string, value: string): void;
565
+
566
+ /**
567
+ * Set xhr request to net debug mode
568
+ * Net stat will be saved after req finished
569
+ */
570
+ setDebugMode(isDebug: boolean): void;
571
+
572
+ /**
573
+ * Return net stat to js
574
+ */
575
+ getDebugMsg(): NetDebugMsg;
576
+
577
+ setCurlEasyOpt(opt: number, val: number): void;
578
+ setCurlHostAddress(hostAddress: string): void;
579
+
580
+ addEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any): void;
581
+
582
+ removeEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any): void;
583
+ }
584
+
585
+ declare let XMLHttpRequest: {
586
+ prototype: XMLHttpRequest;
587
+ new (): XMLHttpRequest;
588
+ readonly DONE: number;
589
+ readonly HEADERS_RECEIVED: number;
590
+ readonly LOADING: number;
591
+ readonly OPENED: number;
592
+ readonly UNSENT: number;
593
+ };
594
+
595
+ /*pix
596
+ gen: binding
597
+ cpp-class: XmlHttpRequestProgressEvent
598
+ */
599
+ interface ProgressEvent<T extends EventTarget = EventTarget> extends Event {
600
+ readonly lengthComputable: boolean;
601
+ readonly loaded: number;
602
+ readonly total: number;
603
+ }
604
+
605
+ interface PopStateEvent<T extends EventTarget = EventTarget> extends Event {
606
+ readonly target: T | null;
607
+ readonly state: any;
608
+ }
609
+
610
+ interface XMLHttpRequestEventTargetEventMap {
611
+ abort: ProgressEvent<XMLHttpRequestEventTarget>;
612
+ error: ProgressEvent<XMLHttpRequestEventTarget>;
613
+ load: ProgressEvent<XMLHttpRequestEventTarget>;
614
+ loadend: ProgressEvent<XMLHttpRequestEventTarget>;
615
+ loadstart: ProgressEvent<XMLHttpRequestEventTarget>;
616
+ progress: ProgressEvent<XMLHttpRequestEventTarget>;
617
+ timeout: ProgressEvent<XMLHttpRequestEventTarget>;
618
+ }
619
+
620
+ interface XMLHttpRequestEventTarget extends EventTarget {
621
+ onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
622
+ onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
623
+ onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
624
+ onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
625
+ onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
626
+ onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
627
+ ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
628
+
629
+ addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
630
+
631
+ removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
632
+ }
633
+
634
+ /*pix
635
+ gen: binding
636
+ */
637
+ interface XMLHttpRequestUpload extends EventTarget {
638
+ onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
639
+ onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
640
+ onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
641
+ onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
642
+ onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
643
+ onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
644
+ ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
645
+ addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
646
+
647
+ removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
648
+ }
649
+
650
+ /*pix
651
+ gen: binding
652
+ */
653
+ interface XmlHttpRequestEvent {}
654
+
655
+ /*pix
656
+ gen: binding
657
+ */
658
+ interface XmlHttpRequestErrorEvent {
659
+ message: string;
660
+ }
661
+
662
+ /*pix
663
+ gen: binding
664
+ cpp-class: DomRect
665
+ */
666
+ interface DOMRect {
667
+ readonly height: number;
668
+ readonly width: number;
669
+ readonly x: number;
670
+ readonly y: number;
671
+ readonly left: number;
672
+ readonly top: number;
673
+ readonly right: number;
674
+ readonly bottom: number;
675
+ }
676
+
677
+ declare let DOMRect: {
678
+ prototype: DOMRect;
679
+ new (element: HTMLElement): DOMRect;
680
+ };
681
+
682
+ interface EventHandlersEventMap {
683
+ click: MouseClickEvent;
684
+ load: Event;
685
+ mousedown: MouseDownEvent;
686
+ mousemove: MouseMoveEvent;
687
+ mouseout: MouseMoveEvent;
688
+ mouseover: MouseMoveEvent;
689
+ mouseup: MouseUpEvent;
690
+ mouseleave: Event;
691
+ mouseenter: Event;
692
+ wheel: WheelEvent;
693
+ animationstart: AnimationEvent;
694
+ animationend: AnimationEvent;
695
+ animationiteration: AnimationEvent;
696
+ transitionstart: TransitionEvent;
697
+ transitionend: TransitionEvent;
698
+ drag: MouseDragEvent;
699
+ dragstart: MouseDragEvent;
700
+ dragend: MouseDragEvent;
701
+ dragenter: MouseDragEvent;
702
+ dragleave: MouseDragEvent;
703
+ dragover: MouseDragEvent;
704
+ drop: MouseDragEvent;
705
+ scroll: Event;
706
+ touchcancel: TouchEvent;
707
+ touchend: TouchEvent;
708
+ touchmove: TouchEvent;
709
+ touchstart: TouchEvent;
710
+ // 'change': Event;
711
+ // 'input': Event;
712
+ keydown: KeyboardEvent;
713
+ keypress: KeyboardEvent;
714
+ keyup: KeyboardEvent;
715
+
716
+ resize: Event;
717
+ }
718
+
719
+ interface EventHandlers {
720
+ onclick: ((this: EventHandlers, ev: MouseClickEvent) => any) | null;
721
+ onload: ((this: EventHandlers, ev: Event) => any) | null;
722
+ onerror: ((this: EventHandlers, ev: ErrorEvent) => any) | null;
723
+ onmousedown: ((this: EventHandlers, ev: MouseDownEvent) => any) | null;
724
+ onmousemove: ((this: EventHandlers, ev: MouseMoveEvent) => any) | null;
725
+ onmouseout: ((this: EventHandlers, ev: MouseMoveEvent) => any) | null;
726
+ onmouseover: ((this: EventHandlers, ev: MouseMoveEvent) => any) | null;
727
+ onmouseup: ((this: EventHandlers, ev: MouseUpEvent) => any) | null;
728
+ onmouseleave: ((this: EventHandlers, ev: Event) => any) | null;
729
+ onmouseenter: ((this: EventHandlers, ev: Event) => any) | null;
730
+ onwheel: ((this: EventHandlers, ev: WheelEvent) => any) | null;
731
+
732
+ onanimationstart: ((this: EventHandlers, ev: AnimationEvent) => any) | null;
733
+ onanimationend: ((this: EventHandlers, ev: AnimationEvent) => any) | null;
734
+ onanimationiteration: ((this: EventHandlers, ev: AnimationEvent) => any) | null;
735
+ ontransitionstart: ((this: EventHandlers, ev: TransitionEvent) => any) | null;
736
+ ontransitionend: ((this: EventHandlers, ev: TransitionEvent) => any) | null;
737
+
738
+ ondrag: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
739
+ ondragstart: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
740
+ ondragend: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
741
+ ondragenter: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
742
+ ondragleave: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
743
+ ondragover: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
744
+ ondrop: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
745
+
746
+ onscroll: ((this: EventHandlers, ev: Event) => any) | null;
747
+
748
+ ontouchcancel?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
749
+ ontouchend?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
750
+ ontouchmove?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
751
+ ontouchstart?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
752
+
753
+ // onchange: ((this: EventHandlers, ev: Event) => any) | null;
754
+ // oninput: ((this: EventHandlers, ev: Event) => any) | null;
755
+ onkeydown: ((this: EventHandlers, ev: KeyboardEvent) => any) | null;
756
+ onkeypress: ((this: EventHandlers, ev: KeyboardEvent) => any) | null;
757
+ onkeyup: ((this: EventHandlers, ev: KeyboardEvent) => any) | null;
758
+ }
759
+
760
+ /*pix
761
+ gen: struct
762
+ convertor: toJS
763
+ */
764
+ interface Attr {
765
+ name: string;
766
+ value: string;
767
+ }
768
+
769
+ /*pix
770
+ gen: binding
771
+ cpp-class: H5Element
772
+ */
773
+ interface Node extends EventTarget {
774
+ id: string;
775
+ readonly localName: string;
776
+ readonly tagName: string;
777
+ readonly nodeType: number;
778
+ readonly nodeName: string;
779
+ readonly ownerDocument: Document;
780
+ readonly parentNode?: HTMLElement;
781
+ readonly nextSibling?: NodeOrHTMLElement;
782
+ /**
783
+ * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
784
+ */
785
+ getAttribute(qualifiedName: string): string | null;
786
+
787
+ /**
788
+ * Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
789
+ */
790
+ hasAttribute(qualifiedName: string): boolean;
791
+
792
+ /**
793
+ * Removes element's first attribute whose qualified name is qualifiedName.
794
+ */
795
+ removeAttribute(qualifiedName: string): void;
796
+
797
+ /**
798
+ * Sets the value of element's first attribute whose qualified name is qualifiedName to value.
799
+ */
800
+ setAttribute(qualifiedName: string, value: string): void;
801
+
802
+ className: string;
803
+ readonly attributes: Attr[];
804
+ textContent: string | null;
805
+ focus(): void;
806
+ blur(): void;
807
+ }
808
+
809
+ /*pix
810
+ gen: binding
811
+ cpp-class: H5ElementText
812
+ */
813
+ /** The textual content of Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children. */
814
+ interface Text extends Node {
815
+ data: string;
816
+ nodeValue: string;
817
+ }
818
+
819
+ /*pix
820
+ gen: binding
821
+ cpp-class: MediaError
822
+ */
823
+ interface MediaError {
824
+ readonly message: string;
825
+ readonly code: number;
826
+ }
827
+
828
+ /*pix
829
+ gen: binding
830
+ cpp-class: H5ElementAudio
831
+ with-handlers: AudioEventHandlers
832
+ */
833
+ interface HTMLAudioElement extends HTMLElement {
834
+ src: string;
835
+ loop: boolean;
836
+ currentTime: number;
837
+ muted: boolean;
838
+ readonly duration: number;
839
+ playbackRate: number;
840
+ autoPlay: boolean;
841
+ volume: number;
842
+ autoPauseOnBacked: boolean;
843
+ readonly error: MediaError;
844
+ preload: boolean;
845
+
846
+ play(): void;
847
+
848
+ pause(): void;
849
+
850
+ resume(): void;
851
+
852
+ seek(second: number): void;
853
+
854
+ stop(): void;
855
+
856
+ load(): void;
857
+
858
+ canPlayType(format: string): string;
859
+
860
+ addEventListener<K extends keyof AudioEventHandlersEventMap>(type: K, listener: (this: HTMLAudioElement, ev: AudioEventHandlersEventMap[K]) => any): void;
861
+
862
+ removeEventListener<K extends keyof AudioEventHandlersEventMap>(type: K, listener: (this: HTMLAudioElement, ev: AudioEventHandlersEventMap[K]) => any): void;
863
+ }
864
+
865
+ /*pix
866
+ gen: binding
867
+ cpp-class: H5ElementVideo
868
+ with-handlers: VideoEventHandlers
869
+ */
870
+ interface HTMLVideoElement extends HTMLAudioElement {
871
+ poster: string;
872
+
873
+ addEventListener<K extends keyof VideoEventHandlersEventMap>(type: K, listener: (this: HTMLVideoElement, ev: VideoEventHandlersEventMap[K]) => any): void;
874
+
875
+ removeEventListener<K extends keyof VideoEventHandlersEventMap>(type: K, listener: (this: HTMLVideoElement, ev: VideoEventHandlersEventMap[K]) => any): void;
876
+ }
877
+
878
+ /*pix
879
+ gen: binding
880
+ cpp-class: PxLibCustomValue
881
+ */
882
+ interface PxLibCustomValue extends EventTarget {
883
+ isNull(): boolean;
884
+
885
+ libName(): string;
886
+ }
887
+
888
+ /*pix
889
+ gen: binding
890
+ cpp-class: RenderingContext
891
+ */
892
+ interface CanvasRenderingContext2D extends HTMLElement {
893
+ lineWidth: number;
894
+ fillStyle: string;
895
+ strokeStyle: string;
896
+ font: string;
897
+ lineCap: string;
898
+ lineJoin: string;
899
+ textAlign: string;
900
+ textBaseline: string;
901
+ canvas: HTMLCanvasElement;
902
+
903
+ beginPath(): void;
904
+
905
+ closePath(): void;
906
+
907
+ moveTo(x: number, y: number): void;
908
+
909
+ lineTo(x: number, y: number): void;
910
+
911
+ stroke(): void;
912
+
913
+ fill(): void;
914
+
915
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: number): void;
916
+
917
+ arcTo(fromX: number, fromY: number, toX: number, toY: number, radius: number): void;
918
+
919
+ strokeRect(x: number, y: number, w: number, h: number): void;
920
+
921
+ fillRect(x: number, y: number, w: number, h: number): void;
922
+
923
+ clearRect(x: number, y: number, w: number, h: number): void;
924
+
925
+ drawImage(ele: HTMLElement, a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): void;
926
+
927
+ fillText(text: string, x: number, y: number): void;
928
+
929
+ save(): void;
247
930
 
248
- /*pix
931
+ restore(): void;
932
+
933
+ rect(x: number, y: number, w: number, h: number): void;
934
+
935
+ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
936
+
937
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
938
+
939
+ scale(x: number, y: number): void;
940
+
941
+ translate(x: number, y: number): void;
942
+
943
+ rotate(angle: number): void;
944
+
945
+ measureText(text: string): TexMetrics;
946
+
947
+ setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
948
+ }
949
+
950
+ /*pix
951
+ gen: binding
952
+ cpp-class: TexMetr
953
+ */
954
+ interface TexMetrics extends EventTarget {
955
+ readonly width: number;
956
+ }
957
+
958
+ /*pix
249
959
  gen: binding
250
- */
251
- interface TemplateLoadEvent extends Event {
252
- readonly data: any;
253
- }
960
+ cpp-class: H5ElementSpine
961
+ cpp-precompile: BUILD_WITH_SPINE
962
+ */
963
+ interface HTMLSpineElement extends HTMLElement {
964
+ scaleX: number;
965
+ scaleY: number;
966
+ timeScale: number;
967
+ animations: string[];
968
+ setAtlas(path: string): void;
969
+ setSkel(path: string): void;
970
+ setAnimation(name: string, loop: boolean);
971
+ }
972
+
973
+ /*pix
974
+ gen: binding
975
+ cpp-class: H5ElementCanvas
976
+ */
977
+ interface HTMLCanvasElement extends HTMLElement {
978
+ width: number;
979
+ height: number;
980
+
981
+ getContext(type: string): CanvasRenderingContext2D;
254
982
 
255
- /*pix
983
+ toDataURL(type: string): string;
984
+ }
985
+
986
+ type NodeOrHTMLElement = Node | HTMLElement;
987
+
988
+ /*pix
256
989
  gen: binding
257
- */
258
- interface WindowMessageEvent extends Event {
259
- readonly data: string;
260
- readonly source: EventTarget;
990
+ cpp-class: H5ElementTag
991
+ with-handlers: EventHandlers
992
+ */
993
+ /** HTMLElement is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from HTMLElement. */
994
+ interface HTMLElement extends Node, EventHandlers {
995
+ click(): void;
996
+
997
+ appendChild(newChild: NodeOrHTMLElement): NodeOrHTMLElement;
998
+
999
+ insertBefore(newChild: NodeOrHTMLElement, refChild?: NodeOrHTMLElement): NodeOrHTMLElement;
261
1000
 
262
- result: string;
263
- }
1001
+ removeChild(oldChild: NodeOrHTMLElement): NodeOrHTMLElement;
264
1002
 
265
- /*pix
266
- gen: binding
267
- */
268
- /** Simple user interface events. */
269
- interface UIEvent extends Event {}
1003
+ cloneNode(deep: boolean): NodeOrHTMLElement;
270
1004
 
271
- /*pix
1005
+ clearRecurise(): void;
1006
+
1007
+ dispatchEvent(event: Event): void;
1008
+
1009
+ getBoundingClientRect(): DOMRect;
1010
+
1011
+ /**
1012
+ * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
1013
+ */
1014
+ getElementsByClassName(classNames: string): HTMLElement[];
1015
+
1016
+ /**
1017
+ * Retrieves a collection of objects based on the specified element name.
1018
+ * @param name Specifies the name of an element.
1019
+ */
1020
+ getElementsByTagName(qualifiedName: string): HTMLElement[];
1021
+
1022
+ querySelectorAll(selectors: string): HTMLElement[];
1023
+
1024
+ querySelector(selectors: string): HTMLElement;
1025
+
1026
+ addEventListener<K extends keyof EventHandlersEventMap>(type: K, listener: (this: EventHandlers, ev: EventHandlersEventMap[K]) => any): void;
1027
+
1028
+ removeEventListener<K extends keyof EventHandlersEventMap>(type: K, listener: (this: EventHandlers, ev: EventHandlersEventMap[K]) => any): void;
1029
+
1030
+ readonly childNodes: NodeOrHTMLElement[];
1031
+ readonly children: HTMLElement[];
1032
+ id: string;
1033
+ draggable: boolean;
1034
+ style: CSSStyleDeclaration;
1035
+ classList: DOMTokenList;
1036
+ innerText: string;
1037
+ innerHTML: string;
1038
+ outerHTML: string;
1039
+ scrollLeft: number;
1040
+ scrollTop: number;
1041
+ firstChild: NodeOrHTMLElement;
1042
+ firstElementChild: NodeOrHTMLElement;
1043
+ lastChild: NodeOrHTMLElement;
1044
+ nextElementSibling: HTMLElement;
1045
+ readonly clientHeight: number;
1046
+ readonly clientWidth: number;
1047
+ readonly scrollHeight: number;
1048
+ readonly scrollWidth: number;
1049
+ }
1050
+
1051
+ /*pix
272
1052
  gen: binding
273
- */
274
- interface MessageEvent extends Event {
275
- readonly data: string;
276
- readonly source: EventTarget;
277
- }
278
-
279
- /*pix
280
- gen: binding
281
- */
282
- /** Events providing information related to errors in scripts or in files. */
283
- interface ErrorEvent extends Event {
284
- readonly message: string;
285
- }
286
-
287
- /*pix
288
- gen: binding
289
- */
290
- interface InputEvent extends UIEvent {
291
- readonly data: string | null;
292
- }
293
-
294
- /*pix
295
- gen: binding
296
- */
297
- /** A single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad. */
298
- interface Touch {
299
- readonly clientX: number;
300
- readonly clientY: number;
301
- readonly identifier: number;
302
- readonly target: EventTarget;
303
- }
304
-
305
- /*pix
306
- gen: binding
307
- */
308
- /** An event sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. */
309
- interface TouchEvent extends UIEvent {
310
- readonly targetTouches: Touch[];
311
- readonly touches: Touch[];
312
- }
313
-
314
- /*pix
315
- gen: binding
316
- cpp-precompile: BUILD_WITH_RLOTTIE
317
- */
318
- interface LottieEvent<T extends EventTarget = EventTarget> extends Event {
319
- readonly currentFrame: number;
320
- }
321
-
322
- /*pix
323
- gen: binding
324
- */
325
- interface SlotAttachmentScriptBinding {
326
- readonly src: string;
327
- readonly handle: number;
328
- }
329
-
330
- /*pix
331
- gen: binding
332
- */
333
- interface File {
334
- readonly fullPath: string;
335
- readonly name: string;
336
- readonly type: string;
337
- readonly size: number;
338
- readonly lastModified: number;
339
- }
340
-
341
- /*pix
342
- gen: binding
343
- cpp-class: WebsocketCloseEvent
344
- */
345
- /** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
346
- interface CloseEvent extends Event {
347
- /**
348
- * Returns the WebSocket connection close code provided by the server.
349
- */
350
- readonly code: any;
351
- /**
352
- * Returns the WebSocket connection close reason provided by the server.
353
- */
354
- readonly reason: any;
355
- /**
356
- * Returns true if the connection closed cleanly; false otherwise.
357
- */
358
- readonly wasClean: any;
359
- }
360
-
361
- /*pix
362
- gen: binding
363
- cpp-class: WebsocketMsgEvent
364
- */
365
- interface MsgEvent extends Event {
366
- readonly data: any;
367
- }
368
-
369
- type instantEchoType = boolean;
370
-
371
- interface WebSocketEventMap {
372
- close: CloseEvent;
373
- error: Event;
374
- message: MsgEvent;
375
- open: Event;
376
- }
377
-
378
- /*pix
379
- gen: binding
380
- */
381
- /** Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */
382
- interface WebSocket extends EventTarget {
383
- instantEcho: instantEchoType;
384
- /**
385
- * Returns the state of the WebSocket object's connection. It can have the values described below.
386
- */
387
- readonly readyState: number;
388
- readonly CLOSED: number;
389
- readonly CLOSING: number;
390
- readonly CONNECTING: number;
391
- readonly OPEN: number;
392
-
393
- onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
394
- onerror: ((this: WebSocket, ev: Event) => any) | null;
395
- onmessage: ((this: WebSocket, ev: MsgEvent) => any) | null;
396
- onopen: ((this: WebSocket, ev: Event) => any) | null;
397
-
398
- /**
399
- * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
400
- */
401
- close(code?: number, reason?: string): void;
402
- /**
403
- * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
404
- */
405
- send(data: string | ArrayBufferLike | ArrayBufferView): void;
406
- /**
407
- * Receive network messages synchronously, for debugger use only.
408
- */
409
- syncReceiveMsg(timeout?: number): string;
410
- zip(data: any): void;
411
-
412
- unzip(data: any): void;
413
-
414
- addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any): void;
415
-
416
- removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any): void;
417
- }
418
-
419
- declare let WebSocket: {
420
- prototype: WebSocket;
421
- new (url: string, protocols?: string | string[]): WebSocket;
422
- readonly CLOSED: number;
423
- readonly CLOSING: number;
424
- readonly CONNECTING: number;
425
- readonly OPEN: number;
426
- };
427
-
428
- ///////////////////////////////////////////////////////////
429
-
430
- interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {
431
- readystatechange: Event;
432
- }
433
-
434
- type BufferSource = ArrayBufferView | ArrayBuffer;
435
- type BodyInit = BufferSource | string;
436
- type XMLHttpRequestResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
437
-
438
- /*pix
439
- gen: struct
440
- convertor: toJS
441
- */
442
- interface NetDebugMsg {
443
- total_time?: number /* defaultValue:0.0 */;
444
- namelookup_time?: number /* defaultValue:0.0 */;
445
- connect_time?: number /* defaultValue:0.0 */;
446
- appconnect_time?: number /* defaultValue:0.0 */;
447
- pretransfer_time?: number /* defaultValue:0.0 */;
448
- redirect_time?: number /* defaultValue:0.0 */;
449
- start_transfer_time?: number /* defaultValue:0.0 */;
450
- download_size?: number /* defaultValue:0.0 */;
451
- upload_size?: number /* defaultValue:0.0 */;
452
- req_size?: number /* defaultValue:0.0 */;
453
- header_size?: number /* defaultValue:0.0 */;
454
- speed_download?: number /* defaultValue:0.0 */;
455
- speed_upload?: number /* defaultValue:0.0 */;
456
- }
457
-
458
- /*pix
459
- gen: binding
460
- */
461
- /** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */
462
- interface XMLHttpRequest extends EventTarget {
463
- readonly DONE: number /* value:4 */;
464
- readonly LOADING: number /* value:3 */;
465
- readonly HEADERS_RECEIVED: number /* value:2 */;
466
- readonly OPENED: number /* value:1 */;
467
- readonly UNSENT: number /* value:0 */;
468
- /**
469
- * Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server.
470
- */
471
- readonly upload: XMLHttpRequestUpload;
472
-
473
- readonly status: number;
474
- /**
475
- * Returns the response's body.
476
- */
477
- readonly response: any;
478
-
479
- readonly statusText: string;
480
- /**
481
- * Returns client's state.
482
- */
483
- readonly readyState: number;
484
- /**
485
- * Returns the text response.
486
- *
487
- * Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text".
488
- */
489
- readonly responseText: string;
490
-
491
- readonly responseURL: string;
492
- /**
493
- * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a "TimeoutError" DOMException will be thrown otherwise (for the send() method).
494
- *
495
- * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
496
- */
497
- timeout: number;
498
- /**
499
- * Returns the response type.
500
- *
501
- * Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
502
- *
503
- * When set: setting to "document" is ignored if current global object is not a Window object.
504
- *
505
- * When set: throws an "InvalidStateError" DOMException if state is loading or done.
506
- *
507
- * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
508
- */
509
- responseType: XMLHttpRequestResponseType;
510
- /**
511
- * Get Set xhr incrementalDataSize.
512
- * default is 0, means do not call onincrementaldata
513
- * if set 1024, then call onincrementaldata when recv data size over 1024B,
514
- */
515
- incrementalDataSize: number;
516
-
517
- onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
518
- onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
519
- onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
520
- onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
521
- onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
522
- onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
523
- ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
524
- onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
525
- onincrementaldata: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
526
-
527
- /**
528
- * Cancels any network activity.
529
- */
530
- abort(): void;
531
-
532
- getResponseHeader(name: string): string | null;
533
-
534
- getAllResponseHeaders(): string;
535
-
536
- /**
537
- * Sets the request method, request URL, and synchronous flag.
538
- *
539
- * Throws a "SyntaxError" DOMException if either method is not a valid HTTP method or url cannot be parsed.
540
- *
541
- * Throws a "SecurityError" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.
542
- *
543
- * Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.
544
- */
545
- open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;
546
-
547
- /**
548
- * Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD.
549
- *
550
- * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
551
- */
552
- send(body?: BodyInit | null): void;
553
-
554
- /**
555
- * Combines a header in author request headers.
556
- *
557
- * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
558
- *
559
- * Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value.
560
- */
561
- setRequestHeader(name: string, value: string): void;
562
-
563
- /**
564
- * Set xhr request to net debug mode
565
- * Net stat will be saved after req finished
566
- */
567
- setDebugMode(isDebug: boolean): void;
568
-
569
- /**
570
- * Return net stat to js
571
- */
572
- getDebugMsg(): NetDebugMsg;
573
-
574
- setCurlEasyOpt(opt: number, val: number): void;
575
- setCurlHostAddress(hostAddress: string): void;
576
-
577
- addEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any): void;
578
-
579
- removeEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any): void;
580
- }
581
-
582
- declare let XMLHttpRequest: {
583
- prototype: XMLHttpRequest;
584
- new (): XMLHttpRequest;
585
- readonly DONE: number;
586
- readonly HEADERS_RECEIVED: number;
587
- readonly LOADING: number;
588
- readonly OPENED: number;
589
- readonly UNSENT: number;
590
- };
591
-
592
- /*pix
593
- gen: binding
594
- cpp-class: XmlHttpRequestProgressEvent
595
- */
596
- interface ProgressEvent<T extends EventTarget = EventTarget> extends Event {
597
- readonly lengthComputable: boolean;
598
- readonly loaded: number;
599
- readonly total: number;
600
- }
601
-
602
- interface PopStateEvent<T extends EventTarget = EventTarget> extends Event {
603
- readonly target: T | null;
604
- readonly state: any;
605
- }
606
-
607
- interface XMLHttpRequestEventTargetEventMap {
608
- abort: ProgressEvent<XMLHttpRequestEventTarget>;
609
- error: ProgressEvent<XMLHttpRequestEventTarget>;
610
- load: ProgressEvent<XMLHttpRequestEventTarget>;
611
- loadend: ProgressEvent<XMLHttpRequestEventTarget>;
612
- loadstart: ProgressEvent<XMLHttpRequestEventTarget>;
613
- progress: ProgressEvent<XMLHttpRequestEventTarget>;
614
- timeout: ProgressEvent<XMLHttpRequestEventTarget>;
615
- }
616
-
617
- interface XMLHttpRequestEventTarget extends EventTarget {
618
- onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
619
- onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
620
- onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
621
- onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
622
- onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
623
- onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
624
- ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
625
-
626
- addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
627
-
628
- removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
629
- }
630
-
631
- /*pix
632
- gen: binding
633
- */
634
- interface XMLHttpRequestUpload extends EventTarget {
635
- onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
636
- onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
637
- onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
638
- onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
639
- onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
640
- onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
641
- ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
642
- addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
643
-
644
- removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any): void;
645
- }
646
-
647
- /*pix
648
- gen: binding
649
- */
650
- interface XmlHttpRequestEvent {}
651
-
652
- /*pix
653
- gen: binding
654
- */
655
- interface XmlHttpRequestErrorEvent {
656
- message: string;
657
- }
658
-
659
- /*pix
660
- gen: binding
661
- cpp-class: DomRect
662
- */
663
- interface DOMRect {
664
- readonly height: number;
665
- readonly width: number;
666
- readonly x: number;
667
- readonly y: number;
668
- readonly left: number;
669
- readonly top: number;
670
- readonly right: number;
671
- readonly bottom: number;
672
- }
673
-
674
- declare let DOMRect: {
675
- prototype: DOMRect;
676
- new (element: HTMLElement): DOMRect;
677
- };
678
-
679
- interface EventHandlersEventMap {
680
- click: MouseClickEvent;
681
- load: Event;
682
- mousedown: MouseDownEvent;
683
- mousemove: MouseMoveEvent;
684
- mouseout: MouseMoveEvent;
685
- mouseover: MouseMoveEvent;
686
- mouseup: MouseUpEvent;
687
- mouseleave: Event;
688
- mouseenter: Event;
689
- wheel: WheelEvent;
690
- animationstart: AnimationEvent;
691
- animationend: AnimationEvent;
692
- animationiteration: AnimationEvent;
693
- transitionstart: TransitionEvent;
694
- transitionend: TransitionEvent;
695
- drag: MouseDragEvent;
696
- dragstart: MouseDragEvent;
697
- dragend: MouseDragEvent;
698
- dragenter: MouseDragEvent;
699
- dragleave: MouseDragEvent;
700
- dragover: MouseDragEvent;
701
- drop: MouseDragEvent;
702
- scroll: Event;
703
- touchcancel: TouchEvent;
704
- touchend: TouchEvent;
705
- touchmove: TouchEvent;
706
- touchstart: TouchEvent;
707
- // 'change': Event;
708
- // 'input': Event;
709
- keydown: KeyboardEvent;
710
- keypress: KeyboardEvent;
711
- keyup: KeyboardEvent;
712
-
713
- resize: Event;
714
- }
715
-
716
- interface EventHandlers {
717
- onclick: ((this: EventHandlers, ev: MouseClickEvent) => any) | null;
718
- onload: ((this: EventHandlers, ev: Event) => any) | null;
719
- onerror: ((this: EventHandlers, ev: ErrorEvent) => any) | null;
720
- onmousedown: ((this: EventHandlers, ev: MouseDownEvent) => any) | null;
721
- onmousemove: ((this: EventHandlers, ev: MouseMoveEvent) => any) | null;
722
- onmouseout: ((this: EventHandlers, ev: MouseMoveEvent) => any) | null;
723
- onmouseover: ((this: EventHandlers, ev: MouseMoveEvent) => any) | null;
724
- onmouseup: ((this: EventHandlers, ev: MouseUpEvent) => any) | null;
725
- onmouseleave: ((this: EventHandlers, ev: Event) => any) | null;
726
- onmouseenter: ((this: EventHandlers, ev: Event) => any) | null;
727
- onwheel: ((this: EventHandlers, ev: WheelEvent) => any) | null;
728
-
729
- onanimationstart: ((this: EventHandlers, ev: AnimationEvent) => any) | null;
730
- onanimationend: ((this: EventHandlers, ev: AnimationEvent) => any) | null;
731
- onanimationiteration: ((this: EventHandlers, ev: AnimationEvent) => any) | null;
732
- ontransitionstart: ((this: EventHandlers, ev: TransitionEvent) => any) | null;
733
- ontransitionend: ((this: EventHandlers, ev: TransitionEvent) => any) | null;
734
-
735
- ondrag: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
736
- ondragstart: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
737
- ondragend: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
738
- ondragenter: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
739
- ondragleave: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
740
- ondragover: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
741
- ondrop: ((this: EventHandlers, ev: MouseDragEvent) => any) | null;
742
-
743
- onscroll: ((this: EventHandlers, ev: Event) => any) | null;
744
-
745
- ontouchcancel?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
746
- ontouchend?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
747
- ontouchmove?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
748
- ontouchstart?: ((this: EventHandlers, ev: TouchEvent) => any) | null;
749
-
750
- // onchange: ((this: EventHandlers, ev: Event) => any) | null;
751
- // oninput: ((this: EventHandlers, ev: Event) => any) | null;
752
- onkeydown: ((this: EventHandlers, ev: KeyboardEvent) => any) | null;
753
- onkeypress: ((this: EventHandlers, ev: KeyboardEvent) => any) | null;
754
- onkeyup: ((this: EventHandlers, ev: KeyboardEvent) => any) | null;
755
- }
756
-
757
- /*pix
758
- gen: struct
759
- convertor: toJS
760
- */
761
- interface Attr {
762
- name: string;
763
- value: string;
764
- }
765
-
766
- /*pix
767
- gen: binding
768
- cpp-class: H5Element
769
- */
770
- interface Node extends EventTarget {
771
- id: string;
772
- readonly localName: string;
773
- readonly tagName: string;
774
- readonly nodeType: number;
775
- readonly nodeName: string;
776
- readonly ownerDocument: Document;
777
- readonly parentNode?: HTMLElement;
778
- readonly nextSibling?: NodeOrHTMLElement;
779
- /**
780
- * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
781
- */
782
- getAttribute(qualifiedName: string): string | null;
783
-
784
- /**
785
- * Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
786
- */
787
- hasAttribute(qualifiedName: string): boolean;
788
-
789
- /**
790
- * Removes element's first attribute whose qualified name is qualifiedName.
791
- */
792
- removeAttribute(qualifiedName: string): void;
793
-
794
- /**
795
- * Sets the value of element's first attribute whose qualified name is qualifiedName to value.
796
- */
797
- setAttribute(qualifiedName: string, value: string): void;
798
-
799
- className: string;
800
- readonly attributes: Attr[];
801
- textContent: string | null;
802
- focus(): void;
803
- blur(): void;
804
- }
805
-
806
- /*pix
807
- gen: binding
808
- cpp-class: H5ElementText
809
- */
810
- /** The textual content of Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children. */
811
- interface Text extends Node {
812
- data: string;
813
- nodeValue: string;
814
- }
815
-
816
- /*pix
817
- gen: binding
818
- cpp-class: MediaError
819
- */
820
- interface MediaError {
821
- readonly message: string;
822
- readonly code: number;
823
- }
824
-
825
- /*pix
826
- gen: binding
827
- cpp-class: H5ElementAudio
828
- with-handlers: AudioEventHandlers
829
- */
830
- interface HTMLAudioElement extends HTMLElement {
831
- src: string;
832
- loop: boolean;
833
- currentTime: number;
834
- muted: boolean;
835
- readonly duration: number;
836
- playbackRate: number;
837
- autoPlay: boolean;
838
- volume: number;
839
- autoPauseOnBacked: boolean;
840
- readonly error: MediaError;
841
- preload: boolean;
842
-
843
- play(): void;
844
-
845
- pause(): void;
846
-
847
- resume(): void;
848
-
849
- seek(second: number): void;
850
-
851
- stop(): void;
852
-
853
- load(): void;
854
-
855
- canPlayType(format: string): string;
856
-
857
- addEventListener<K extends keyof AudioEventHandlersEventMap>(type: K, listener: (this: HTMLAudioElement, ev: AudioEventHandlersEventMap[K]) => any): void;
858
-
859
- removeEventListener<K extends keyof AudioEventHandlersEventMap>(type: K, listener: (this: HTMLAudioElement, ev: AudioEventHandlersEventMap[K]) => any): void;
860
- }
861
-
862
- /*pix
863
- gen: binding
864
- cpp-class: H5ElementVideo
865
- with-handlers: VideoEventHandlers
866
- */
867
- interface HTMLVideoElement extends HTMLAudioElement {
868
- poster: string;
869
-
870
- addEventListener<K extends keyof VideoEventHandlersEventMap>(type: K, listener: (this: HTMLVideoElement, ev: VideoEventHandlersEventMap[K]) => any): void;
871
-
872
- removeEventListener<K extends keyof VideoEventHandlersEventMap>(type: K, listener: (this: HTMLVideoElement, ev: VideoEventHandlersEventMap[K]) => any): void;
873
- }
874
-
875
- /*pix
876
- gen: binding
877
- cpp-class: PxLibCustomValue
878
- */
879
- interface PxLibCustomValue extends EventTarget {
880
- isNull(): boolean;
1053
+ cpp-class: H5ElementDiv
1054
+ */
1055
+ interface HTMLDivElement extends HTMLElement {}
881
1056
 
882
- libName(): string;
883
- }
1057
+ /*pix
1058
+ gen: binding
1059
+ cpp-class: H5ElementScript
1060
+ */
1061
+ interface HTMLScriptElement extends HTMLElement {
1062
+ async: boolean;
1063
+ /**
1064
+ * Retrieves the URL to an external file that contains the source code or data.
1065
+ */
1066
+ src: string;
1067
+ /**
1068
+ * Retrieves or sets the text of the object as a string.
1069
+ */
1070
+ text: string;
1071
+ content: string;
1072
+ }
1073
+
1074
+ /*pix
1075
+ gen: binding
1076
+ cpp-class: H5ElementComment
1077
+ */
1078
+ /** Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. */
1079
+ interface Comment extends Node {}
884
1080
 
885
- /*pix
886
- gen: binding
887
- cpp-class: RenderingContext
888
- */
889
- interface CanvasRenderingContext2D extends HTMLElement {
890
- lineWidth: number;
891
- fillStyle: string;
892
- strokeStyle: string;
893
- font: string;
894
- lineCap: string;
895
- lineJoin: string;
896
- textAlign: string;
897
- textBaseline: string;
898
- canvas: HTMLCanvasElement;
1081
+ /*pix
1082
+ gen: binding
1083
+ cpp-class: H5ElementImage
1084
+ */
1085
+ /** Provides special properties and methods for manipulating <img> elements. */
1086
+ interface HTMLImageElement extends HTMLElement {
1087
+ src: string;
1088
+ height: number;
1089
+ width: number;
1090
+ }
1091
+
1092
+ /*pix
1093
+ gen: binding
1094
+ cpp-class: H5ElementLottie
1095
+ with-handlers: LottieEventHandlers
1096
+ cpp-precompile: BUILD_WITH_RLOTTIE
1097
+ */
1098
+ interface HTMLLottieElement extends HTMLImageElement, LottieEventHandlers {
1099
+ play(): void;
899
1100
 
900
- beginPath(): void;
1101
+ stop(): void;
901
1102
 
902
- closePath(): void;
1103
+ pause(): void;
903
1104
 
904
- moveTo(x: number, y: number): void;
1105
+ autoPlay: boolean;
1106
+ loop: boolean;
905
1107
 
906
- lineTo(x: number, y: number): void;
1108
+ setDirection(dr: number): void;
907
1109
 
908
- stroke(): void;
1110
+ getDuration(inFrames: boolean): number;
909
1111
 
910
- fill(): void;
1112
+ setSpeed(sp: number): void;
911
1113
 
912
- arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: number): void;
1114
+ setProperty(...args: any[]): number;
913
1115
 
914
- arcTo(fromX: number, fromY: number, toX: number, toY: number, radius: number): void;
1116
+ gotoAndPlay(v: number, isFrame: boolean): void;
915
1117
 
916
- strokeRect(x: number, y: number, w: number, h: number): void;
1118
+ gotoAndStop(v: number, isFrame: boolean): void;
917
1119
 
918
- fillRect(x: number, y: number, w: number, h: number): void;
1120
+ enableSimd(enable: boolean): void;
919
1121
 
920
- clearRect(x: number, y: number, w: number, h: number): void;
1122
+ addEventListener<K extends keyof LottieEventHandlersEventMap>(type: K, listener: (this: HTMLLottieElement, ev: LottieEventHandlersEventMap[K]) => any): void;
921
1123
 
922
- drawImage(ele: HTMLElement, a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): void;
1124
+ removeEventListener<K extends keyof LottieEventHandlersEventMap>(type: K, listener: (this: HTMLLottieElement, ev: LottieEventHandlersEventMap[K]) => any): void;
1125
+ }
923
1126
 
924
- fillText(text: string, x: number, y: number): void;
1127
+ /*pix
1128
+ gen: binding
1129
+ cpp-class: H5ElementInput
1130
+ with-handlers: InputEventHandlers
1131
+ */
1132
+ interface HTMLInputElement extends HTMLElement, InputEventHandlers {
1133
+ placeholder: string;
1134
+ value: string;
1135
+ accept: string;
1136
+ multiple: boolean;
1137
+ readonly files: File[];
1138
+
1139
+ updateCursorPosition(v: number): void;
1140
+ updateSelectionHead(v: number): void;
1141
+ updateSelectionTail(v: number): void;
1142
+
1143
+ copy(): void;
1144
+ paste(): void;
1145
+ cut(): void;
1146
+
1147
+ addEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLInputElement, ev: InputEventHandlersEventMap[K]) => any): void;
1148
+
1149
+ removeEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLInputElement, ev: InputEventHandlersEventMap[K]) => any): void;
1150
+ }
1151
+
1152
+ /*pix
1153
+ gen: binding
1154
+ cpp-class: H5ElementTextArea
1155
+ with-handlers: InputEventHandlers
1156
+ */
1157
+ interface HTMLTextAreaElement extends HTMLElement, InputEventHandlers {
1158
+ placeholder: string;
1159
+ value: string;
1160
+
1161
+ updateCursorPosition(x: number, y: number): void;
1162
+ updateSelectionHead(x: number, y: number): void;
1163
+ updateSelectionTail(x: number, y: number): void;
1164
+
1165
+ copy(): void;
1166
+
1167
+ paste(): void;
1168
+
1169
+ cut(): void;
1170
+
1171
+ addEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: InputEventHandlersEventMap[K]) => any): void;
1172
+
1173
+ removeEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: InputEventHandlersEventMap[K]) => any): void;
1174
+ }
1175
+
1176
+ /*pix
1177
+ gen: binding
1178
+ cpp-class: H5ElementFragment
1179
+ */
1180
+ interface HTMLElementFragment extends HTMLElement {}
1181
+
1182
+ /*pix
1183
+ gen: binding
1184
+ cpp-class: H5ElementLink
1185
+ */
1186
+ interface HTMLLinkElement extends HTMLElement {}
1187
+
1188
+ /*pix
1189
+ gen: binding
1190
+ cpp-class: H5ElementSlot
1191
+ */
1192
+ interface HTMLSlotElement extends HTMLElement {
1193
+ src: string;
1194
+ attachment: number;
1195
+ }
1196
+
1197
+ /*pix
1198
+ gen: binding
1199
+ cpp-class: H5ElementTextField
1200
+ */
1201
+ interface HTMLTextFieldElement extends HTMLDivElement {
1202
+ calcHeight: number;
1203
+ }
1204
+
1205
+ /*pix
1206
+ gen: binding
1207
+ cpp-class: H5Document
1208
+ */
1209
+ interface Document extends Node {
1210
+ readonly nodeType: number /* value:9 */;
1211
+ body: HTMLElement;
1212
+ head: HTMLElement;
1213
+ title: string;
1214
+ readonly defaultView: Window;
1215
+ readonly documentElement: HTMLElement;
1216
+ readonly activeElement: HTMLElement;
1217
+ hidden: boolean;
1218
+ visibilityState: string;
1219
+ styleSheets: CSSStyleSheet[];
1220
+
1221
+ createEvent(type: string): Event;
1222
+
1223
+ createElement(tagName: string): HTMLElement;
1224
+
1225
+ createComment(text: string): HTMLElement;
1226
+
1227
+ createElementNS(namespace: string, tagName: string): HTMLElement;
1228
+
1229
+ createDocumentFragment(): HTMLElementFragment;
1230
+
1231
+ /**
1232
+ * Creates a text string from the specified value.
1233
+ * @param data String that specifies the nodeValue property of the text node.
1234
+ */
1235
+ createTextNode(data: string): Text;
1236
+
1237
+ /**
1238
+ * Returns a reference to the first object with the specified value of the ID attribute.
1239
+ * @param elementId String that specifies the ID value.
1240
+ */
1241
+ getElementById(elementId: string): HTMLElement | null;
1242
+
1243
+ /**
1244
+ * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
1245
+ */
1246
+ getElementsByClassName(classNames: string): HTMLElement[];
1247
+
1248
+ /**
1249
+ * Retrieves a collection of objects based on the specified element name.
1250
+ * @param name Specifies the name of an element.
1251
+ */
1252
+ getElementsByTagName(qualifiedName: string): HTMLElement[];
1253
+
1254
+ /**
1255
+ * Returns the first element that is a descendant of node that matches selectors.
1256
+ */
1257
+ querySelector<E extends HTMLElement = HTMLElement>(selectors: string): E | null;
1258
+
1259
+ /**
1260
+ * Returns all element descendants of node that match selectors.
1261
+ */
1262
+ querySelectorAll<E extends HTMLElement = HTMLElement>(selectors: string): Array<E>;
1263
+ }
1264
+
1265
+ /*pix
1266
+ gen: binding
1267
+ cpp-class: H5TokenList
1268
+ */
1269
+ interface DOMTokenList {
1270
+ readonly length: number;
1271
+ value: string;
925
1272
 
926
- save(): void;
1273
+ item(index: number): string | null;
927
1274
 
928
- restore(): void;
1275
+ contains(token: string): boolean;
929
1276
 
930
- rect(x: number, y: number, w: number, h: number): void;
1277
+ replace(oldValue: string, newValue: string): boolean;
931
1278
 
932
- bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
1279
+ toggle(token: string, force?: boolean): boolean;
933
1280
 
934
- quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
1281
+ entries(): any;
935
1282
 
936
- scale(x: number, y: number): void;
1283
+ keys(): string[];
937
1284
 
938
- translate(x: number, y: number): void;
1285
+ values(): string[];
939
1286
 
940
- rotate(angle: number): void;
1287
+ add(...args: string[]): void;
941
1288
 
942
- measureText(text: string): TexMetrics;
1289
+ remove(...args: string[]): void;
1290
+ }
1291
+
1292
+ /*pix
1293
+ gen: binding
1294
+ */
1295
+ /** An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. */
1296
+ interface CSSStyleDeclaration extends EventTarget {
1297
+ /// begin-style-key
1298
+ font: string /*pix {'no-gen':1} */;
1299
+ fontSize: string /*pix {'no-gen':1} */;
1300
+ fontWeight: string /*pix {'no-gen':1} */;
1301
+ fontStyle: string /*pix {'no-gen':1} */;
1302
+ textDecoration: string /*pix {'no-gen':1} */;
1303
+ fontFamily: string /*pix {'no-gen':1} */;
1304
+ display: string /*pix {'no-gen':1} */;
1305
+ visibility: string /*pix {'no-gen':1} */;
1306
+ opacity: string /*pix {'no-gen':1} */;
1307
+ color: string /*pix {'no-gen':1} */;
1308
+ textShadow: string /*pix {'no-gen':1} */;
1309
+ whiteSpace: string /*pix {'no-gen':1} */;
1310
+ zIndex: string /*pix {'no-gen':1} */;
1311
+ transformOrigin: string /*pix {'no-gen':1} */;
1312
+ transform: string /*pix {'no-gen':1} */;
1313
+ pointerEvents: string /*pix {'no-gen':1} */;
1314
+ PixuiRenderLayer: string /*pix {'no-gen':1} */;
1315
+ background: string /*pix {'no-gen':1} */;
1316
+ backgroundColor: string /*pix {'no-gen':1} */;
1317
+ backgroundImage: string /*pix {'no-gen':1} */;
1318
+ backgroundPosition: string /*pix {'no-gen':1} */;
1319
+ backgroundSize: string /*pix {'no-gen':1} */;
1320
+ backgroundOrigin: string /*pix {'no-gen':1} */;
1321
+ backgroundClip: string /*pix {'no-gen':1} */;
1322
+ backgroundAttachment: string /*pix {'no-gen':1} */;
1323
+ backgroundRepeat: string /*pix {'no-gen':1} */;
1324
+ maskImage: string /*pix {'no-gen':1} */;
1325
+ cursor: string /*pix {'no-gen':1} */;
1326
+ overflow: string /*pix {'no-gen':1} */;
1327
+ overflowStyle: string /*pix {'no-gen':1} */;
1328
+ width: string /*pix {'no-gen':1} */;
1329
+ height: string /*pix {'no-gen':1} */;
1330
+ left: string /*pix {'no-gen':1} */;
1331
+ right: string /*pix {'no-gen':1} */;
1332
+ top: string /*pix {'no-gen':1} */;
1333
+ bottom: string /*pix {'no-gen':1} */;
1334
+ minWidth: string /*pix {'no-gen':1} */;
1335
+ minHeight: string /*pix {'no-gen':1} */;
1336
+ maxWidth: string /*pix {'no-gen':1} */;
1337
+ maxHeight: string /*pix {'no-gen':1} */;
1338
+ margin: string /*pix {'no-gen':1} */;
1339
+ marginLeft: string /*pix {'no-gen':1} */;
1340
+ marginRight: string /*pix {'no-gen':1} */;
1341
+ marginTop: string /*pix {'no-gen':1} */;
1342
+ marginBottom: string /*pix {'no-gen':1} */;
1343
+ padding: string /*pix {'no-gen':1} */;
1344
+ paddingLeft: string /*pix {'no-gen':1} */;
1345
+ paddingRight: string /*pix {'no-gen':1} */;
1346
+ paddingTop: string /*pix {'no-gen':1} */;
1347
+ paddingBottom: string /*pix {'no-gen':1} */;
1348
+ alignContent: string /*pix {'no-gen':1} */;
1349
+ alignItems: string /*pix {'no-gen':1} */;
1350
+ alignSelf: string /*pix {'no-gen':1} */;
1351
+ flexWrap: string /*pix {'no-gen':1} */;
1352
+ justifyContent: string /*pix {'no-gen':1} */;
1353
+ flexGrow: string /*pix {'no-gen':1} */;
1354
+ flexShrink: string /*pix {'no-gen':1} */;
1355
+ aspectRatio: string /*pix {'no-gen':1} */;
1356
+ flexDirection: string /*pix {'no-gen':1} */;
1357
+ position: string /*pix {'no-gen':1} */;
1358
+ flexBasis: string /*pix {'no-gen':1} */;
1359
+ border: string /*pix {'no-gen':1} */;
1360
+ borderImage: string /*pix {'no-gen':1} */;
1361
+ borderImageSource: string /*pix {'no-gen':1} */;
1362
+ borderImageSlice: string /*pix {'no-gen':1} */;
1363
+ borderImageModel: string /*pix {'no-gen':1} */;
1364
+ borderImageRepeat: string /*pix {'no-gen':1} */;
1365
+ borderImagePosition: string /*pix {'no-gen':1} */;
1366
+ borderBottom: string /*pix {'no-gen':1} */;
1367
+ borderTop: string /*pix {'no-gen':1} */;
1368
+ borderLeft: string /*pix {'no-gen':1} */;
1369
+ borderRight: string /*pix {'no-gen':1} */;
1370
+ borderWidth: string /*pix {'no-gen':1} */;
1371
+ borderTopWidth: string /*pix {'no-gen':1} */;
1372
+ borderRightWidth: string /*pix {'no-gen':1} */;
1373
+ borderBottomWidth: string /*pix {'no-gen':1} */;
1374
+ borderLeftWidth: string /*pix {'no-gen':1} */;
1375
+ borderColor: string /*pix {'no-gen':1} */;
1376
+ borderTopColor: string /*pix {'no-gen':1} */;
1377
+ borderRightColor: string /*pix {'no-gen':1} */;
1378
+ borderBottomColor: string /*pix {'no-gen':1} */;
1379
+ borderLeftColor: string /*pix {'no-gen':1} */;
1380
+ borderStyle: string /*pix {'no-gen':1} */;
1381
+ borderTopStyle: string /*pix {'no-gen':1} */;
1382
+ borderRightStyle: string /*pix {'no-gen':1} */;
1383
+ borderBottomStyle: string /*pix {'no-gen':1} */;
1384
+ borderLeftStyle: string /*pix {'no-gen':1} */;
1385
+ borderRadius: string /*pix {'no-gen':1} */;
1386
+ borderRadiusX: string /*pix {'no-gen':1} */;
1387
+ borderRadiusY: string /*pix {'no-gen':1} */;
1388
+ borderTopLeftRadius: string /*pix {'no-gen':1} */;
1389
+ borderTopRightRadius: string /*pix {'no-gen':1} */;
1390
+ borderBottomLeftRadius: string /*pix {'no-gen':1} */;
1391
+ borderBottomRightRadius: string /*pix {'no-gen':1} */;
1392
+ borderTopLeftRadiusX: string /*pix {'no-gen':1} */;
1393
+ borderTopRightRadiusX: string /*pix {'no-gen':1} */;
1394
+ borderBottomRightRadiusX: string /*pix {'no-gen':1} */;
1395
+ borderBottomLeftRadiusX: string /*pix {'no-gen':1} */;
1396
+ borderTopLeftRadiusY: string /*pix {'no-gen':1} */;
1397
+ borderTopRightRadiusY: string /*pix {'no-gen':1} */;
1398
+ borderBottomRightRadiusY: string /*pix {'no-gen':1} */;
1399
+ borderBottomLeftRadiusY: string /*pix {'no-gen':1} */;
1400
+ outline: string /*pix {'no-gen':1} */;
1401
+ outlineWidth: string /*pix {'no-gen':1} */;
1402
+ outlineColor: string /*pix {'no-gen':1} */;
1403
+ outlineStyle: string /*pix {'no-gen':1} */;
1404
+ animation: string /*pix {'no-gen':1} */;
1405
+ animationName: string /*pix {'no-gen':1} */;
1406
+ animationDuration: string /*pix {'no-gen':1} */;
1407
+ animationTimingFunction: string /*pix {'no-gen':1} */;
1408
+ animationIterationCount: string /*pix {'no-gen':1} */;
1409
+ animationDelay: string /*pix {'no-gen':1} */;
1410
+ animationDirection: string /*pix {'no-gen':1} */;
1411
+ animationPlayState: string /*pix {'no-gen':1} */;
1412
+ animationFillMode: string /*pix {'no-gen':1} */;
1413
+ transition: string /*pix {'no-gen':1} */;
1414
+ textStroke: string /*pix {'no-gen':1} */;
1415
+ textStrokeColor: string /*pix {'no-gen':1} */;
1416
+ textStrokeWidth: string /*pix {'no-gen':1} */;
1417
+ lineClamp: string /*pix {'no-gen':1} */;
1418
+ /// end-style-key
1419
+ cssText: string;
1420
+ setProperty(property: string, value: string): void;
1421
+
1422
+ getPropertyValue(property: string): string;
1423
+ }
1424
+
1425
+ declare let CSSStyleDeclaration: {
1426
+ prototype: CSSStyleDeclaration;
1427
+ new (element: HTMLElement, pseudoElt: HTMLElement): CSSStyleDeclaration;
1428
+ };
1429
+
1430
+ interface FrameRequestCallback {
1431
+ (time: number): void;
1432
+ }
1433
+
1434
+ /*pix
1435
+ gen: binding
1436
+ cpp-class: H5BrowserLocation
1437
+ */
1438
+ interface Location {
1439
+ /**
1440
+ * Returns the Location object's URL's fragment (includes leading "#" if non-empty).
1441
+ *
1442
+ * Can be set, to navigate to the same URL with a changed fragment (ignores leading "#").
1443
+ */
1444
+ hash: string;
1445
+ /**
1446
+ * Returns the Location object's URL's host and port (if different from the default port for the scheme).
1447
+ *
1448
+ * Can be set, to navigate to the same URL with a changed host and port.
1449
+ */
1450
+ host: string;
1451
+ /**
1452
+ * Returns the Location object's URL's host name.
1453
+ *
1454
+ * Can be set, to navigate to the same URL with a changed host name.
1455
+ */
1456
+ hostname: string;
1457
+ /**
1458
+ * Returns the Location object's URL.
1459
+ *
1460
+ * Can be set, to navigate to the given URL.
1461
+ */
1462
+ href: string;
1463
+ /**
1464
+ * Returns the Location object's URL's path.
1465
+ *
1466
+ * Can be set, to navigate to the same URL with a changed path.
1467
+ */
1468
+ pathname: string;
1469
+ /**
1470
+ * Returns the Location object's URL's port.
1471
+ *
1472
+ * Can be set, to navigate to the same URL with a changed port.
1473
+ */
1474
+ port: string;
1475
+ /**
1476
+ * Returns the Location object's URL's scheme.
1477
+ *
1478
+ * Can be set, to navigate to the same URL with a changed scheme.
1479
+ */
1480
+ protocol: string;
1481
+ /**
1482
+ * Returns the Location object's URL's query (includes leading "?" if non-empty).
1483
+ *
1484
+ * Can be set, to navigate to the same URL with a changed query (ignores leading "?").
1485
+ */
1486
+ search: string;
1487
+
1488
+ /**
1489
+ * Navigates to the given URL.
1490
+ */
1491
+ assign(url: string): void;
1492
+
1493
+ /**
1494
+ * Reloads the current page.
1495
+ */
1496
+ reload(): void;
1497
+
1498
+ /**
1499
+ * Removes the current page from the session history and navigates to the given URL.
1500
+ */
1501
+ replace(url: string): void;
1502
+
1503
+ back(): void;
1504
+
1505
+ forward(): void;
1506
+
1507
+ go(step: number): void;
1508
+
1509
+ pushState(state: any, title: string, url: string): void;
1510
+
1511
+ now(): any;
1512
+ }
1513
+
1514
+ /*pix
1515
+ gen: binding
1516
+ cpp-class: H5DebugConsole
1517
+ end-def: WithName
1518
+ */
1519
+ interface Console {
1520
+ enableTrace(b: boolean): void;
1521
+
1522
+ info(msg: string, ...arguments: any[]): number;
1523
+ debug(msg: string, ...arguments: any[]): number;
1524
+
1525
+ log(msg: string, ...arguments: any[]): number;
1526
+
1527
+ warn(msg: string, ...arguments: any[]): number;
1528
+
1529
+ error(msg: string, ...arguments: any[]): number;
1530
+
1531
+ assert(msg: string, ...arguments: any[]): number;
1532
+ }
1533
+
1534
+ interface WindowEventHandlers {
1535
+ // onDOMContentLoaded只能用addEventListener添加
1536
+ // onDOMContentLoaded: ((this: WindowEventHandlers, ev: Event) => any) | null;
1537
+
1538
+ onload: ((this: WindowEventHandlers, ev: Event) => any) | null;
1539
+ onunload: ((this: WindowEventHandlers, ev: Event) => any) | null;
1540
+ onbeforeunload: ((this: WindowEventHandlers, ev: Event) => any) | null;
1541
+ onclose: ((this: WindowEventHandlers, ev: CloseEvent) => any) | null;
1542
+ onclick: ((this: WindowEventHandlers, ev: MouseClickEvent) => any) | null;
1543
+ onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;
1544
+ // onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any) | null;
1545
+ onerror: ((this: WindowEventHandlers, ev: ErrorEvent) => any) | null;
1546
+ onresize: ((this: WindowEventHandlers, ev: Event) => any) | null;
1547
+ onscreenresize: ((this: WindowEventHandlers, ev: Event) => any) | null;
1548
+ }
1549
+
1550
+ interface WindowEventHandlersEventMap {
1551
+ DOMContentLoaded: Event;
1552
+ load: Event;
1553
+ unload: Event;
1554
+ beforeunload: Event;
1555
+ close: CloseEvent;
1556
+ click: Event;
1557
+ message: MessageEvent;
1558
+ error: ErrorEvent;
1559
+ resize: Event;
1560
+ screenresize: Event;
1561
+ }
1562
+
1563
+ interface AudioEventHandlers extends EventHandlers {
1564
+ onplay: ((this: AudioEventHandlers, ev: Event) => any) | null;
1565
+ onplaying: ((this: AudioEventHandlers, ev: Event) => any) | null;
1566
+ onended: ((this: AudioEventHandlers, ev: Event) => any) | null;
1567
+ onpause: ((this: AudioEventHandlers, ev: Event) => any) | null;
1568
+ onseeking: ((this: AudioEventHandlers, ev: Event) => any) | null;
1569
+ onseeked: ((this: AudioEventHandlers, ev: Event) => any) | null;
1570
+ onerror: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1571
+ onwaiting: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1572
+ oncanplay: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1573
+ onloadstart: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1574
+ onloadeddata: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1575
+ onfirstframe: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1576
+ }
1577
+
1578
+ interface AudioEventHandlersEventMap extends EventHandlersEventMap {
1579
+ seeking: Event;
1580
+ pause: Event;
1581
+ play: Event;
1582
+ playing: Event;
1583
+ ended: Event;
1584
+ seeked: Event;
1585
+ }
1586
+
1587
+ interface VideoEventHandlers extends EventHandlers {
1588
+ onplay: ((this: VideoEventHandlers, ev: Event) => any) | null;
1589
+ onplaying: ((this: VideoEventHandlers, ev: Event) => any) | null;
1590
+ onended: ((this: VideoEventHandlers, ev: Event) => any) | null;
1591
+ onpause: ((this: VideoEventHandlers, ev: Event) => any) | null;
1592
+ onseeking: ((this: VideoEventHandlers, ev: Event) => any) | null;
1593
+ onseeked: ((this: VideoEventHandlers, ev: Event) => any) | null;
1594
+ onerror: ((this: VideoEventHandlers, ev: ErrorEvent) => any) | null;
1595
+ onwaiting: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1596
+ oncanplay: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1597
+ onloadstart: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1598
+ onloadeddata: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1599
+ onfirstframe: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1600
+ }
1601
+
1602
+ interface VideoEventHandlersEventMap extends EventHandlersEventMap {
1603
+ seeking: Event;
1604
+ pause: Event;
1605
+ play: Event;
1606
+ playing: Event;
1607
+ ended: Event;
1608
+ seeked: Event;
1609
+ }
1610
+
1611
+ interface LottieEventHandlers extends EventHandlers {
1612
+ oncomplete: ((this: LottieEventHandlers, ev: Event) => any) | null;
1613
+ onenterframe: ((this: LottieEventHandlers, ev: LottieEvent) => any) | null;
1614
+ }
1615
+
1616
+ interface LottieEventHandlersEventMap extends EventHandlersEventMap {
1617
+ complete: Event;
1618
+ enterframe: LottieEvent;
1619
+ }
1620
+
1621
+ interface InputEventHandlers extends EventHandlers {
1622
+ onchange: ((this: InputEventHandlers, ev: Event) => any) | null;
1623
+ oninput: ((this: InputEventHandlers, ev: Event) => any) | null;
1624
+ }
1625
+
1626
+ interface InputEventHandlersEventMap extends EventHandlersEventMap {
1627
+ change: Event;
1628
+ input: Event;
1629
+ }
1630
+
1631
+ interface ScriptExternalEventHandlers {
1632
+ onmessage: ((this: ScriptExternalEventHandlers, ev: MessageEvent) => any) | null;
1633
+ }
1634
+
1635
+ interface ScriptExternalEventHandlersEventMap {
1636
+ message: MessageEvent;
1637
+ }
1638
+
1639
+ /*pix
1640
+ gen: binding
1641
+ cpp-class: H5Screen
1642
+ */
1643
+ interface Screen {
1644
+ readonly height: number;
1645
+ readonly width: number;
1646
+ }
1647
+
1648
+ /*pix
1649
+ gen: binding
1650
+ cpp-class: H5Window
1651
+ with-handlers: WindowEventHandlers
1652
+ */
1653
+ interface Window extends EventTarget, WindowEventHandlers {
1654
+ readonly innerHeight: number;
1655
+ readonly innerWidth: number;
1656
+ // readonly document: Document;
1657
+ id: number;
1658
+ location: Location;
1659
+ localStorage: Storage;
1660
+ history: Location;
1661
+ opener: number;
1662
+ readonly scrollX: number;
1663
+ readonly scrollY: number;
1664
+ readonly screen: Screen;
1665
+ httpVersion: number;
1666
+ netEncodingMode: string;
1667
+ netThreadMode: string;
1668
+ netTimeout: number;
1669
+ targetApi: number;
943
1670
 
944
- setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
945
- }
1671
+ open(url?: string, target?: string, features?: string, replace?: boolean): number;
946
1672
 
947
- /*pix
948
- gen: binding
949
- cpp-class: TexMetr
950
- */
951
- interface TexMetrics extends EventTarget {
952
- readonly width: number;
953
- }
1673
+ postMessage(message: any, id?: number | null): void;
954
1674
 
955
- /*pix
956
- gen: binding
957
- cpp-class: H5ElementSpine
958
- cpp-precompile: BUILD_WITH_SPINE
959
- */
960
- interface HTMLSpineElement extends HTMLElement {
961
- scaleX: number;
962
- scaleY: number;
963
- timeScale: number;
964
- animations: string[];
965
- setAtlas(path: string): void;
966
- setSkel(path: string): void;
967
- setAnimation(name: string, loop: boolean);
968
- }
1675
+ close(): void;
969
1676
 
970
- /*pix
971
- gen: binding
972
- cpp-class: H5ElementCanvas
973
- */
974
- interface HTMLCanvasElement extends HTMLElement {
975
- width: number;
976
- height: number;
1677
+ blur(): void;
977
1678
 
978
- getContext(type: string): CanvasRenderingContext2D;
1679
+ focus(): void;
979
1680
 
980
- toDataURL(type: string): string;
981
- }
982
-
983
- type NodeOrHTMLElement = Node | HTMLElement;
984
-
985
- /*pix
986
- gen: binding
987
- cpp-class: H5ElementTag
988
- with-handlers: EventHandlers
989
- */
990
- /** HTMLElement is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from HTMLElement. */
991
- interface HTMLElement extends Node, EventHandlers {
992
- click(): void;
993
-
994
- appendChild(newChild: NodeOrHTMLElement): NodeOrHTMLElement;
995
-
996
- insertBefore(newChild: NodeOrHTMLElement, refChild?: NodeOrHTMLElement): NodeOrHTMLElement;
1681
+ getComputedStyle(elt: HTMLElement, pseudoElt?: string | null): CSSStyleDeclaration;
997
1682
 
998
- removeChild(oldChild: NodeOrHTMLElement): NodeOrHTMLElement;
1683
+ cancelAnimationFrame(handle: number): void;
999
1684
 
1000
- cloneNode(deep: boolean): NodeOrHTMLElement;
1685
+ requestAnimationFrame(callback: FrameRequestCallback): number;
1001
1686
 
1002
- clearRecurise(): void;
1687
+ clearInterval(handle?: number): void;
1003
1688
 
1004
- dispatchEvent(event: Event): void;
1689
+ clearTimeout(handle?: number): void;
1005
1690
 
1006
- getBoundingClientRect(): DOMRect;
1691
+ setInterval(handler: Function, timeout?: number, ...arguments: any[]): number;
1007
1692
 
1008
- /**
1009
- * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
1010
- */
1011
- getElementsByClassName(classNames: string): HTMLElement[];
1693
+ setTimeout(handler: Function, timeout?: number, ...arguments: any[]): number;
1012
1694
 
1013
- /**
1014
- * Retrieves a collection of objects based on the specified element name.
1015
- * @param name Specifies the name of an element.
1016
- */
1017
- getElementsByTagName(qualifiedName: string): HTMLElement[];
1695
+ moveBy(x: number, y: number): void;
1018
1696
 
1019
- querySelectorAll(selectors: string): HTMLElement[];
1697
+ moveTo(x: number, y: number): void;
1020
1698
 
1021
- querySelector(selectors: string): HTMLElement;
1022
-
1023
- addEventListener<K extends keyof EventHandlersEventMap>(type: K, listener: (this: EventHandlers, ev: EventHandlersEventMap[K]) => any): void;
1024
-
1025
- removeEventListener<K extends keyof EventHandlersEventMap>(type: K, listener: (this: EventHandlers, ev: EventHandlersEventMap[K]) => any): void;
1026
-
1027
- readonly childNodes: NodeOrHTMLElement[];
1028
- readonly children: HTMLElement[];
1029
- id: string;
1030
- draggable: boolean;
1031
- style: CSSStyleDeclaration;
1032
- classList: DOMTokenList;
1033
- innerText: string;
1034
- innerHTML: string;
1035
- outerHTML: string;
1036
- scrollLeft: number;
1037
- scrollTop: number;
1038
- firstChild: NodeOrHTMLElement;
1039
- firstElementChild: NodeOrHTMLElement;
1040
- lastChild: NodeOrHTMLElement;
1041
- nextElementSibling: HTMLElement;
1042
- readonly clientHeight: number;
1043
- readonly clientWidth: number;
1044
- readonly scrollHeight: number;
1045
- readonly scrollWidth: number;
1046
- }
1047
-
1048
- /*pix
1049
- gen: binding
1050
- cpp-class: H5ElementDiv
1051
- */
1052
- interface HTMLDivElement extends HTMLElement {}
1053
-
1054
- /*pix
1055
- gen: binding
1056
- cpp-class: H5ElementScript
1057
- */
1058
- interface HTMLScriptElement extends HTMLElement {
1059
- async: boolean;
1060
- /**
1061
- * Retrieves the URL to an external file that contains the source code or data.
1062
- */
1063
- src: string;
1064
- /**
1065
- * Retrieves or sets the text of the object as a string.
1066
- */
1067
- text: string;
1068
- content: string;
1069
- }
1070
-
1071
- /*pix
1072
- gen: binding
1073
- cpp-class: H5ElementComment
1074
- */
1075
- /** Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. */
1076
- interface Comment extends Node {}
1077
-
1078
- /*pix
1079
- gen: binding
1080
- cpp-class: H5ElementImage
1081
- */
1082
- /** Provides special properties and methods for manipulating <img> elements. */
1083
- interface HTMLImageElement extends HTMLElement {
1084
- src: string;
1085
- height: number;
1086
- width: number;
1087
- }
1088
-
1089
- /*pix
1090
- gen: binding
1091
- cpp-class: H5ElementLottie
1092
- with-handlers: LottieEventHandlers
1093
- cpp-precompile: BUILD_WITH_RLOTTIE
1094
- */
1095
- interface HTMLLottieElement extends HTMLImageElement, LottieEventHandlers {
1096
- play(): void;
1097
-
1098
- stop(): void;
1099
-
1100
- pause(): void;
1101
-
1102
- autoPlay: boolean;
1103
- loop: boolean;
1104
-
1105
- setDirection(dr: number): void;
1106
-
1107
- getDuration(inFrames: boolean): number;
1108
-
1109
- setSpeed(sp: number): void;
1110
-
1111
- setProperty(...args: any[]): number;
1112
-
1113
- gotoAndPlay(v: number, isFrame: boolean): void;
1114
-
1115
- gotoAndStop(v: number, isFrame: boolean): void;
1116
-
1117
- enableSimd(enable: boolean): void;
1118
-
1119
- addEventListener<K extends keyof LottieEventHandlersEventMap>(type: K, listener: (this: HTMLLottieElement, ev: LottieEventHandlersEventMap[K]) => any): void;
1120
-
1121
- removeEventListener<K extends keyof LottieEventHandlersEventMap>(type: K, listener: (this: HTMLLottieElement, ev: LottieEventHandlersEventMap[K]) => any): void;
1122
- }
1123
-
1124
- /*pix
1125
- gen: binding
1126
- cpp-class: H5ElementInput
1127
- with-handlers: InputEventHandlers
1128
- */
1129
- interface HTMLInputElement extends HTMLElement, InputEventHandlers {
1130
- placeholder: string;
1131
- value: string;
1132
- accept: string;
1133
- multiple: boolean;
1134
- readonly files: File[];
1135
-
1136
- updateCursorPosition(v: number): void;
1137
- updateSelectionHead(v: number): void;
1138
- updateSelectionTail(v: number): void;
1139
-
1140
- copy(): void;
1141
- paste(): void;
1142
- cut(): void;
1143
-
1144
- addEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLInputElement, ev: InputEventHandlersEventMap[K]) => any): void;
1145
-
1146
- removeEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLInputElement, ev: InputEventHandlersEventMap[K]) => any): void;
1147
- }
1148
-
1149
- /*pix
1150
- gen: binding
1151
- cpp-class: H5ElementTextArea
1152
- with-handlers: InputEventHandlers
1153
- */
1154
- interface HTMLTextAreaElement extends HTMLElement, InputEventHandlers {
1155
- placeholder: string;
1156
- value: string;
1157
-
1158
- updateCursorPosition(x: number, y: number): void;
1159
- updateSelectionHead(x: number, y: number): void;
1160
- updateSelectionTail(x: number, y: number): void;
1161
-
1162
- copy(): void;
1163
-
1164
- paste(): void;
1165
-
1166
- cut(): void;
1167
-
1168
- addEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: InputEventHandlersEventMap[K]) => any): void;
1169
-
1170
- removeEventListener<K extends keyof InputEventHandlersEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: InputEventHandlersEventMap[K]) => any): void;
1171
- }
1172
-
1173
- /*pix
1174
- gen: binding
1175
- cpp-class: H5ElementFragment
1176
- */
1177
- interface HTMLElementFragment extends HTMLElement {}
1178
-
1179
- /*pix
1180
- gen: binding
1181
- cpp-class: H5ElementLink
1182
- */
1183
- interface HTMLLinkElement extends HTMLElement {}
1699
+ resizeBy(x: number, y: number): void;
1184
1700
 
1185
- /*pix
1186
- gen: binding
1187
- cpp-class: H5ElementSlot
1188
- */
1189
- interface HTMLSlotElement extends HTMLElement {
1190
- src: string;
1191
- attachment: number;
1192
- }
1701
+ resizeTo(width: number, height: number): void;
1193
1702
 
1194
- /*pix
1195
- gen: binding
1196
- cpp-class: H5ElementTextField
1197
- */
1198
- interface HTMLTextFieldElement extends HTMLDivElement {
1199
- calcHeight: number;
1200
- }
1201
-
1202
- /*pix
1203
- gen: binding
1204
- cpp-class: H5Document
1205
- */
1206
- interface Document extends Node {
1207
- readonly nodeType: number /* value:9 */;
1208
- body: HTMLElement;
1209
- head: HTMLElement;
1210
- title: string;
1211
- readonly defaultView: Window;
1212
- readonly documentElement: HTMLElement;
1213
- readonly activeElement: HTMLElement;
1214
- hidden: boolean;
1215
- visibilityState: string;
1216
- styleSheets: CSSStyleSheet[];
1217
-
1218
- createEvent(type: string): Event;
1219
-
1220
- createElement(tagName: string): HTMLElement;
1221
-
1222
- createComment(text: string): HTMLElement;
1223
-
1224
- createElementNS(namespace: string, tagName: string): HTMLElement;
1225
-
1226
- createDocumentFragment(): HTMLElementFragment;
1227
-
1228
- /**
1229
- * Creates a text string from the specified value.
1230
- * @param data String that specifies the nodeValue property of the text node.
1231
- */
1232
- createTextNode(data: string): Text;
1233
-
1234
- /**
1235
- * Returns a reference to the first object with the specified value of the ID attribute.
1236
- * @param elementId String that specifies the ID value.
1237
- */
1238
- getElementById(elementId: string): HTMLElement | null;
1239
-
1240
- /**
1241
- * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
1242
- */
1243
- getElementsByClassName(classNames: string): HTMLElement[];
1244
-
1245
- /**
1246
- * Retrieves a collection of objects based on the specified element name.
1247
- * @param name Specifies the name of an element.
1248
- */
1249
- getElementsByTagName(qualifiedName: string): HTMLElement[];
1250
-
1251
- /**
1252
- * Returns the first element that is a descendant of node that matches selectors.
1253
- */
1254
- querySelector<E extends HTMLElement = HTMLElement>(selectors: string): E | null;
1255
-
1256
- /**
1257
- * Returns all element descendants of node that match selectors.
1258
- */
1259
- querySelectorAll<E extends HTMLElement = HTMLElement>(selectors: string): Array<E>;
1260
- }
1261
-
1262
- /*pix
1263
- gen: binding
1264
- cpp-class: H5TokenList
1265
- */
1266
- interface DOMTokenList {
1267
- readonly length: number;
1268
- value: string;
1269
-
1270
- item(index: number): string | null;
1271
-
1272
- contains(token: string): boolean;
1273
-
1274
- replace(oldValue: string, newValue: string): boolean;
1275
-
1276
- toggle(token: string, force?: boolean): boolean;
1277
-
1278
- entries(): any;
1279
-
1280
- keys(): string[];
1281
-
1282
- values(): string[];
1283
-
1284
- add(...args: string[]): void;
1285
-
1286
- remove(...args: string[]): void;
1287
- }
1288
-
1289
- /*pix
1290
- gen: binding
1291
- */
1292
- /** An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. */
1293
- interface CSSStyleDeclaration extends EventTarget {
1294
- /// begin-style-key
1295
- font: string /*pix {'no-gen':1} */;
1296
- fontSize: string /*pix {'no-gen':1} */;
1297
- fontWeight: string /*pix {'no-gen':1} */;
1298
- fontStyle: string /*pix {'no-gen':1} */;
1299
- textDecoration: string /*pix {'no-gen':1} */;
1300
- fontFamily: string /*pix {'no-gen':1} */;
1301
- display: string /*pix {'no-gen':1} */;
1302
- visibility: string /*pix {'no-gen':1} */;
1303
- opacity: string /*pix {'no-gen':1} */;
1304
- color: string /*pix {'no-gen':1} */;
1305
- textShadow: string /*pix {'no-gen':1} */;
1306
- whiteSpace: string /*pix {'no-gen':1} */;
1307
- zIndex: string /*pix {'no-gen':1} */;
1308
- transformOrigin: string /*pix {'no-gen':1} */;
1309
- transform: string /*pix {'no-gen':1} */;
1310
- pointerEvents: string /*pix {'no-gen':1} */;
1311
- PixuiRenderLayer: string /*pix {'no-gen':1} */;
1312
- background: string /*pix {'no-gen':1} */;
1313
- backgroundColor: string /*pix {'no-gen':1} */;
1314
- backgroundImage: string /*pix {'no-gen':1} */;
1315
- backgroundPosition: string /*pix {'no-gen':1} */;
1316
- backgroundSize: string /*pix {'no-gen':1} */;
1317
- backgroundOrigin: string /*pix {'no-gen':1} */;
1318
- backgroundClip: string /*pix {'no-gen':1} */;
1319
- backgroundAttachment: string /*pix {'no-gen':1} */;
1320
- backgroundRepeat: string /*pix {'no-gen':1} */;
1321
- maskImage: string /*pix {'no-gen':1} */;
1322
- cursor: string /*pix {'no-gen':1} */;
1323
- overflow: string /*pix {'no-gen':1} */;
1324
- overflowStyle: string /*pix {'no-gen':1} */;
1325
- width: string /*pix {'no-gen':1} */;
1326
- height: string /*pix {'no-gen':1} */;
1327
- left: string /*pix {'no-gen':1} */;
1328
- right: string /*pix {'no-gen':1} */;
1329
- top: string /*pix {'no-gen':1} */;
1330
- bottom: string /*pix {'no-gen':1} */;
1331
- minWidth: string /*pix {'no-gen':1} */;
1332
- minHeight: string /*pix {'no-gen':1} */;
1333
- maxWidth: string /*pix {'no-gen':1} */;
1334
- maxHeight: string /*pix {'no-gen':1} */;
1335
- margin: string /*pix {'no-gen':1} */;
1336
- marginLeft: string /*pix {'no-gen':1} */;
1337
- marginRight: string /*pix {'no-gen':1} */;
1338
- marginTop: string /*pix {'no-gen':1} */;
1339
- marginBottom: string /*pix {'no-gen':1} */;
1340
- padding: string /*pix {'no-gen':1} */;
1341
- paddingLeft: string /*pix {'no-gen':1} */;
1342
- paddingRight: string /*pix {'no-gen':1} */;
1343
- paddingTop: string /*pix {'no-gen':1} */;
1344
- paddingBottom: string /*pix {'no-gen':1} */;
1345
- alignContent: string /*pix {'no-gen':1} */;
1346
- alignItems: string /*pix {'no-gen':1} */;
1347
- alignSelf: string /*pix {'no-gen':1} */;
1348
- flexWrap: string /*pix {'no-gen':1} */;
1349
- justifyContent: string /*pix {'no-gen':1} */;
1350
- flexGrow: string /*pix {'no-gen':1} */;
1351
- flexShrink: string /*pix {'no-gen':1} */;
1352
- aspectRatio: string /*pix {'no-gen':1} */;
1353
- flexDirection: string /*pix {'no-gen':1} */;
1354
- position: string /*pix {'no-gen':1} */;
1355
- flexBasis: string /*pix {'no-gen':1} */;
1356
- border: string /*pix {'no-gen':1} */;
1357
- borderImage: string /*pix {'no-gen':1} */;
1358
- borderImageSource: string /*pix {'no-gen':1} */;
1359
- borderImageSlice: string /*pix {'no-gen':1} */;
1360
- borderImageModel: string /*pix {'no-gen':1} */;
1361
- borderImageRepeat: string /*pix {'no-gen':1} */;
1362
- borderImagePosition: string /*pix {'no-gen':1} */;
1363
- borderBottom: string /*pix {'no-gen':1} */;
1364
- borderTop: string /*pix {'no-gen':1} */;
1365
- borderLeft: string /*pix {'no-gen':1} */;
1366
- borderRight: string /*pix {'no-gen':1} */;
1367
- borderWidth: string /*pix {'no-gen':1} */;
1368
- borderTopWidth: string /*pix {'no-gen':1} */;
1369
- borderRightWidth: string /*pix {'no-gen':1} */;
1370
- borderBottomWidth: string /*pix {'no-gen':1} */;
1371
- borderLeftWidth: string /*pix {'no-gen':1} */;
1372
- borderColor: string /*pix {'no-gen':1} */;
1373
- borderTopColor: string /*pix {'no-gen':1} */;
1374
- borderRightColor: string /*pix {'no-gen':1} */;
1375
- borderBottomColor: string /*pix {'no-gen':1} */;
1376
- borderLeftColor: string /*pix {'no-gen':1} */;
1377
- borderStyle: string /*pix {'no-gen':1} */;
1378
- borderTopStyle: string /*pix {'no-gen':1} */;
1379
- borderRightStyle: string /*pix {'no-gen':1} */;
1380
- borderBottomStyle: string /*pix {'no-gen':1} */;
1381
- borderLeftStyle: string /*pix {'no-gen':1} */;
1382
- borderRadius: string /*pix {'no-gen':1} */;
1383
- borderRadiusX: string /*pix {'no-gen':1} */;
1384
- borderRadiusY: string /*pix {'no-gen':1} */;
1385
- borderTopLeftRadius: string /*pix {'no-gen':1} */;
1386
- borderTopRightRadius: string /*pix {'no-gen':1} */;
1387
- borderBottomLeftRadius: string /*pix {'no-gen':1} */;
1388
- borderBottomRightRadius: string /*pix {'no-gen':1} */;
1389
- borderTopLeftRadiusX: string /*pix {'no-gen':1} */;
1390
- borderTopRightRadiusX: string /*pix {'no-gen':1} */;
1391
- borderBottomRightRadiusX: string /*pix {'no-gen':1} */;
1392
- borderBottomLeftRadiusX: string /*pix {'no-gen':1} */;
1393
- borderTopLeftRadiusY: string /*pix {'no-gen':1} */;
1394
- borderTopRightRadiusY: string /*pix {'no-gen':1} */;
1395
- borderBottomRightRadiusY: string /*pix {'no-gen':1} */;
1396
- borderBottomLeftRadiusY: string /*pix {'no-gen':1} */;
1397
- outline: string /*pix {'no-gen':1} */;
1398
- outlineWidth: string /*pix {'no-gen':1} */;
1399
- outlineColor: string /*pix {'no-gen':1} */;
1400
- outlineStyle: string /*pix {'no-gen':1} */;
1401
- animation: string /*pix {'no-gen':1} */;
1402
- animationName: string /*pix {'no-gen':1} */;
1403
- animationDuration: string /*pix {'no-gen':1} */;
1404
- animationTimingFunction: string /*pix {'no-gen':1} */;
1405
- animationIterationCount: string /*pix {'no-gen':1} */;
1406
- animationDelay: string /*pix {'no-gen':1} */;
1407
- animationDirection: string /*pix {'no-gen':1} */;
1408
- animationPlayState: string /*pix {'no-gen':1} */;
1409
- animationFillMode: string /*pix {'no-gen':1} */;
1410
- transition: string /*pix {'no-gen':1} */;
1411
- textStroke: string /*pix {'no-gen':1} */;
1412
- textStrokeColor: string /*pix {'no-gen':1} */;
1413
- textStrokeWidth: string /*pix {'no-gen':1} */;
1414
- lineClamp: string /*pix {'no-gen':1} */;
1415
- /// end-style-key
1416
- cssText: string;
1417
- setProperty(property: string, value: string): void;
1418
-
1419
- getPropertyValue(property: string): string;
1420
- }
1421
-
1422
- declare let CSSStyleDeclaration: {
1423
- prototype: CSSStyleDeclaration;
1424
- new (element: HTMLElement, pseudoElt: HTMLElement): CSSStyleDeclaration;
1425
- };
1426
-
1427
- interface FrameRequestCallback {
1428
- (time: number): void;
1429
- }
1430
-
1431
- /*pix
1432
- gen: binding
1433
- cpp-class: H5BrowserLocation
1434
- */
1435
- interface Location {
1436
- /**
1437
- * Returns the Location object's URL's fragment (includes leading "#" if non-empty).
1438
- *
1439
- * Can be set, to navigate to the same URL with a changed fragment (ignores leading "#").
1440
- */
1441
- hash: string;
1442
- /**
1443
- * Returns the Location object's URL's host and port (if different from the default port for the scheme).
1444
- *
1445
- * Can be set, to navigate to the same URL with a changed host and port.
1446
- */
1447
- host: string;
1448
- /**
1449
- * Returns the Location object's URL's host name.
1450
- *
1451
- * Can be set, to navigate to the same URL with a changed host name.
1452
- */
1453
- hostname: string;
1454
- /**
1455
- * Returns the Location object's URL.
1456
- *
1457
- * Can be set, to navigate to the given URL.
1458
- */
1459
- href: string;
1460
- /**
1461
- * Returns the Location object's URL's path.
1462
- *
1463
- * Can be set, to navigate to the same URL with a changed path.
1464
- */
1465
- pathname: string;
1466
- /**
1467
- * Returns the Location object's URL's port.
1468
- *
1469
- * Can be set, to navigate to the same URL with a changed port.
1470
- */
1471
- port: string;
1472
- /**
1473
- * Returns the Location object's URL's scheme.
1474
- *
1475
- * Can be set, to navigate to the same URL with a changed scheme.
1476
- */
1477
- protocol: string;
1478
- /**
1479
- * Returns the Location object's URL's query (includes leading "?" if non-empty).
1480
- *
1481
- * Can be set, to navigate to the same URL with a changed query (ignores leading "?").
1482
- */
1483
- search: string;
1484
-
1485
- /**
1486
- * Navigates to the given URL.
1487
- */
1488
- assign(url: string): void;
1489
-
1490
- /**
1491
- * Reloads the current page.
1492
- */
1493
- reload(): void;
1494
-
1495
- /**
1496
- * Removes the current page from the session history and navigates to the given URL.
1497
- */
1498
- replace(url: string): void;
1499
-
1500
- back(): void;
1501
-
1502
- forward(): void;
1503
-
1504
- go(step: number): void;
1505
-
1506
- pushState(state: any, title: string, url: string): void;
1507
-
1508
- now(): any;
1509
- }
1510
-
1511
- /*pix
1512
- gen: binding
1513
- cpp-class: H5DebugConsole
1514
- end-def: WithName
1515
- */
1516
- interface Console {
1517
- enableTrace(b: boolean): void;
1518
-
1519
- info(msg: string, ...arguments: any[]): number;
1520
- debug(msg: string, ...arguments: any[]): number;
1521
-
1522
- log(msg: string, ...arguments: any[]): number;
1523
-
1524
- warn(msg: string, ...arguments: any[]): number;
1525
-
1526
- error(msg: string, ...arguments: any[]): number;
1527
-
1528
- assert(msg: string, ...arguments: any[]): number;
1529
- }
1530
-
1531
- interface WindowEventHandlers {
1532
- // onDOMContentLoaded只能用addEventListener添加
1533
- // onDOMContentLoaded: ((this: WindowEventHandlers, ev: Event) => any) | null;
1534
-
1535
- onload: ((this: WindowEventHandlers, ev: Event) => any) | null;
1536
- onunload: ((this: WindowEventHandlers, ev: Event) => any) | null;
1537
- onbeforeunload: ((this: WindowEventHandlers, ev: Event) => any) | null;
1538
- onclose: ((this: WindowEventHandlers, ev: CloseEvent) => any) | null;
1539
- onclick: ((this: WindowEventHandlers, ev: MouseClickEvent) => any) | null;
1540
- onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;
1541
- // onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any) | null;
1542
- onerror: ((this: WindowEventHandlers, ev: ErrorEvent) => any) | null;
1543
- onresize: ((this: WindowEventHandlers, ev: Event) => any) | null;
1544
- onscreenresize: ((this: WindowEventHandlers, ev: Event) => any) | null;
1545
- }
1546
-
1547
- interface WindowEventHandlersEventMap {
1548
- DOMContentLoaded: Event;
1549
- load: Event;
1550
- unload: Event;
1551
- beforeunload: Event;
1552
- close: CloseEvent;
1553
- click: Event;
1554
- message: MessageEvent;
1555
- error: ErrorEvent;
1556
- resize: Event;
1557
- screenresize: Event;
1558
- }
1559
-
1560
- interface AudioEventHandlers extends EventHandlers {
1561
- onplay: ((this: AudioEventHandlers, ev: Event) => any) | null;
1562
- onplaying: ((this: AudioEventHandlers, ev: Event) => any) | null;
1563
- onended: ((this: AudioEventHandlers, ev: Event) => any) | null;
1564
- onpause: ((this: AudioEventHandlers, ev: Event) => any) | null;
1565
- onseeking: ((this: AudioEventHandlers, ev: Event) => any) | null;
1566
- onseeked: ((this: AudioEventHandlers, ev: Event) => any) | null;
1567
- onerror: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1568
- onwaiting: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1569
- oncanplay: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1570
- onloadstart: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1571
- onloadeddata: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1572
- onfirstframe: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1573
- }
1574
-
1575
- interface AudioEventHandlersEventMap extends EventHandlersEventMap {
1576
- seeking: Event;
1577
- pause: Event;
1578
- play: Event;
1579
- playing: Event;
1580
- ended: Event;
1581
- seeked: Event;
1582
- }
1583
-
1584
- interface VideoEventHandlers extends EventHandlers {
1585
- onplay: ((this: VideoEventHandlers, ev: Event) => any) | null;
1586
- onplaying: ((this: VideoEventHandlers, ev: Event) => any) | null;
1587
- onended: ((this: VideoEventHandlers, ev: Event) => any) | null;
1588
- onpause: ((this: VideoEventHandlers, ev: Event) => any) | null;
1589
- onseeking: ((this: VideoEventHandlers, ev: Event) => any) | null;
1590
- onseeked: ((this: VideoEventHandlers, ev: Event) => any) | null;
1591
- onerror: ((this: VideoEventHandlers, ev: ErrorEvent) => any) | null;
1592
- onwaiting: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1593
- oncanplay: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1594
- onloadstart: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1595
- onloadeddata: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1596
- onfirstframe: ((this: AudioEventHandlers, ev: ErrorEvent) => any) | null;
1597
- }
1598
-
1599
- interface VideoEventHandlersEventMap extends EventHandlersEventMap {
1600
- seeking: Event;
1601
- pause: Event;
1602
- play: Event;
1603
- playing: Event;
1604
- ended: Event;
1605
- seeked: Event;
1606
- }
1607
-
1608
- interface LottieEventHandlers extends EventHandlers {
1609
- oncomplete: ((this: LottieEventHandlers, ev: Event) => any) | null;
1610
- onenterframe: ((this: LottieEventHandlers, ev: LottieEvent) => any) | null;
1611
- }
1612
-
1613
- interface LottieEventHandlersEventMap extends EventHandlersEventMap {
1614
- complete: Event;
1615
- enterframe: LottieEvent;
1616
- }
1617
-
1618
- interface InputEventHandlers extends EventHandlers {
1619
- onchange: ((this: InputEventHandlers, ev: Event) => any) | null;
1620
- oninput: ((this: InputEventHandlers, ev: Event) => any) | null;
1621
- }
1622
-
1623
- interface InputEventHandlersEventMap extends EventHandlersEventMap {
1624
- change: Event;
1625
- input: Event;
1626
- }
1627
-
1628
- interface ScriptExternalEventHandlers {
1629
- onmessage: ((this: ScriptExternalEventHandlers, ev: MessageEvent) => any) | null;
1630
- }
1631
-
1632
- interface ScriptExternalEventHandlersEventMap {
1633
- message: MessageEvent;
1634
- }
1635
-
1636
- /*pix
1637
- gen: binding
1638
- cpp-class: H5Screen
1639
- */
1640
- interface Screen {
1641
- readonly height: number;
1642
- readonly width: number;
1643
- }
1644
-
1645
- /*pix
1646
- gen: binding
1647
- cpp-class: H5Window
1648
- with-handlers: WindowEventHandlers
1649
- */
1650
- interface Window extends EventTarget, WindowEventHandlers {
1651
- readonly innerHeight: number;
1652
- readonly innerWidth: number;
1653
- // readonly document: Document;
1654
- id: number;
1655
- location: Location;
1656
- localStorage: Storage;
1657
- history: Location;
1658
- opener: number;
1659
- readonly scrollX: number;
1660
- readonly scrollY: number;
1661
- readonly screen: Screen;
1662
- httpVersion: number;
1663
- netEncodingMode: string;
1664
- netThreadMode: string;
1665
- netTimeout: number;
1666
- targetApi: number;
1667
-
1668
- open(url?: string, target?: string, features?: string, replace?: boolean): number;
1669
-
1670
- postMessage(message: any, id?: number | null): void;
1671
-
1672
- close(): void;
1673
-
1674
- blur(): void;
1675
-
1676
- focus(): void;
1677
-
1678
- getComputedStyle(elt: HTMLElement, pseudoElt?: string | null): CSSStyleDeclaration;
1679
-
1680
- cancelAnimationFrame(handle: number): void;
1681
-
1682
- requestAnimationFrame(callback: FrameRequestCallback): number;
1683
-
1684
- clearInterval(handle?: number): void;
1685
-
1686
- clearTimeout(handle?: number): void;
1687
-
1688
- setInterval(handler: Function, timeout?: number, ...arguments: any[]): number;
1689
-
1690
- setTimeout(handler: Function, timeout?: number, ...arguments: any[]): number;
1691
-
1692
- moveBy(x: number, y: number): void;
1693
-
1694
- moveTo(x: number, y: number): void;
1695
-
1696
- resizeBy(x: number, y: number): void;
1697
-
1698
- resizeTo(width: number, height: number): void;
1699
-
1700
- scrollBy(x: number, y: number): void;
1701
-
1702
- scrollTo(x: number, y: number): void;
1703
-
1704
- atob(strToDecode: string): string;
1705
-
1706
- btoa(strToEncode: string): string;
1707
-
1708
- addEventListener<K extends keyof WindowEventHandlersEventMap>(type: K, listener: (this: Window, ev: WindowEventHandlersEventMap[K]) => any): void;
1709
-
1710
- removeEventListener<K extends keyof WindowEventHandlersEventMap>(type: K, listener: (this: Window, ev: WindowEventHandlersEventMap[K]) => any): void;
1711
-
1712
- setNetReferer(referer: string): void;
1713
- }
1714
-
1715
- /*pix
1716
- gen: binding
1717
- cpp-class: H5Storage
1718
- */
1719
- interface Storage {
1720
- key(index: number): string;
1721
- getItem(keyName: string): string;
1722
- setItem(keyName: string, value: string): void;
1723
- removeItem(keyName: string): void;
1724
- clear(): void;
1725
- length: number;
1726
- }
1727
-
1728
- /*pix
1729
- gen: binding
1730
- cpp-class: H5CSSStyleRule
1731
- */
1732
- interface CSSRule {
1733
- readonly cssText: string;
1734
- readonly selectorText: string;
1735
- }
1736
-
1737
- /*pix
1738
- gen: binding
1739
- cpp-class: H5CSSStyleSheet
1740
- */
1741
- interface CSSStyleSheet {
1742
- cssRules: CSSRule[];
1743
- }
1744
-
1745
- /*pix
1746
- gen: binding
1747
- cpp-class: H5WindowProxy
1748
- */
1749
- interface WindowProxy {
1750
- isValid(): boolean;
1751
- close(): void;
1752
- postMessage(message: string): void;
1753
- resizeTo(width: number, height: number): void;
1754
- moveTo(x: number, y: number): void;
1755
- }
1703
+ scrollBy(x: number, y: number): void;
1756
1704
 
1757
- interface Navigator {
1758
- readonly userAgent: string;
1759
- }
1705
+ scrollTo(x: number, y: number): void;
1760
1706
 
1761
- declare var document: Document;
1762
- declare var window: Window;
1763
- declare var console: console;
1707
+ atob(strToDecode: string): string;
1764
1708
 
1765
- declare function clearInterval(id: number | undefined): void;
1766
- declare function clearTimeout(id: number | undefined): void;
1767
- declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
1768
- declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
1769
- // declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
1709
+ btoa(strToEncode: string): string;
1770
1710
 
1771
- declare var event: Event | undefined;
1772
- declare var external: External;
1773
- declare var location: Location;
1774
- declare var navigator: Navigator;
1711
+ addEventListener<K extends keyof WindowEventHandlersEventMap>(type: K, listener: (this: Window, ev: WindowEventHandlersEventMap[K]) => any): void;
1775
1712
 
1776
- interface ResizeObserver {
1777
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ResizeObserver/disconnect) */
1778
- disconnect(): void;
1779
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ResizeObserver/observe) */
1780
- observe(target: Element, options?: ResizeObserverOptions): void;
1781
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ResizeObserver/unobserve) */
1782
- unobserve(target: Element): void;
1783
- }
1784
-
1785
- declare var ResizeObserver: {
1786
- prototype: ResizeObserver;
1787
- new (callback: ResizeObserverCallback): ResizeObserver;
1788
- };
1713
+ removeEventListener<K extends keyof WindowEventHandlersEventMap>(type: K, listener: (this: Window, ev: WindowEventHandlersEventMap[K]) => any): void;
1714
+
1715
+ setNetReferer(referer: string): void;
1716
+ }
1717
+
1718
+ /*pix
1719
+ gen: binding
1720
+ cpp-class: H5Storage
1721
+ */
1722
+ interface Storage {
1723
+ key(index: number): string;
1724
+ getItem(keyName: string): string;
1725
+ setItem(keyName: string, value: string): void;
1726
+ removeItem(keyName: string): void;
1727
+ clear(): void;
1728
+ length: number;
1729
+ }
1730
+
1731
+ /*pix
1732
+ gen: binding
1733
+ cpp-class: H5CSSStyleRule
1734
+ */
1735
+ interface CSSRule {
1736
+ readonly cssText: string;
1737
+ readonly selectorText: string;
1738
+ }
1739
+
1740
+ /*pix
1741
+ gen: binding
1742
+ cpp-class: H5CSSStyleSheet
1743
+ */
1744
+ interface CSSStyleSheet {
1745
+ cssRules: CSSRule[];
1746
+ }
1747
+
1748
+ /*pix
1749
+ gen: binding
1750
+ cpp-class: H5WindowProxy
1751
+ */
1752
+ interface WindowProxy {
1753
+ isValid(): boolean;
1754
+ close(): void;
1755
+ postMessage(message: string): void;
1756
+ resizeTo(width: number, height: number): void;
1757
+ moveTo(x: number, y: number): void;
1758
+ }
1759
+
1760
+ interface Navigator {
1761
+ readonly userAgent: string;
1762
+ }
1763
+
1764
+ interface ResizeObserver {
1765
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ResizeObserver/disconnect) */
1766
+ disconnect(): void;
1767
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ResizeObserver/observe) */
1768
+ observe(target: Element, options?: ResizeObserverOptions): void;
1769
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ResizeObserver/unobserve) */
1770
+ unobserve(target: Element): void;
1771
+ }
1772
+
1773
+
1774
+ declare var document: Document;
1775
+ declare var window: Window;
1776
+ declare var console: console;
1777
+
1778
+ declare function clearInterval(id: number | undefined): void;
1779
+ declare function clearTimeout(id: number | undefined): void;
1780
+ declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
1781
+ declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
1782
+ // declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
1783
+
1784
+ declare var event: Event | undefined;
1785
+ declare var external: External;
1786
+ declare var location: Location;
1787
+ declare var navigator: Navigator;
1788
+ declare var ResizeObserver: {
1789
+ prototype: ResizeObserver;
1790
+ new (callback: ResizeObserverCallback): ResizeObserver;
1791
+ };
1792
+ }