@pixui-dev/pxw 0.1.34 → 0.1.35

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