@pixui-dev/pxw 0.1.35 → 0.1.37

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