@pixui-dev/pxw 0.1.16

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