@lynx-js/types 3.4.3 → 3.5.9
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.
- package/CHANGELOG.md +66 -11
- package/package.json +1 -1
- package/types/background-thread/fetch.d.ts +43 -2
- package/types/background-thread/index.d.ts +1 -0
- package/types/background-thread/lynx-performance-entry.d.ts +17 -0
- package/types/background-thread/lynx.d.ts +8 -1
- package/types/background-thread/nodes-ref.d.ts +30 -12
- package/types/background-thread/text-encoder-decoder.d.ts +15 -21
- package/types/common/csstype.d.ts +105 -239
- package/types/common/element/element.d.ts +10 -4
- package/types/common/element/frame.d.ts +25 -0
- package/types/common/element/image.d.ts +84 -74
- package/types/common/element/index.d.ts +2 -0
- package/types/common/element/input.d.ts +10 -2
- package/types/common/element/list-item.d.ts +67 -0
- package/types/common/element/list.d.ts +380 -850
- package/types/common/element/methods.d.ts +175 -18
- package/types/common/element/scroll-view.d.ts +92 -137
- package/types/common/element/text.d.ts +16 -3
- package/types/common/element/textarea.d.ts +11 -1
- package/types/common/events.d.ts +522 -100
- package/types/common/global.d.ts +2 -1
- package/types/common/performance.d.ts +11 -2
- package/types/common/props.d.ts +332 -28
- package/types/common/system-info.d.ts +9 -1
- package/types/main-thread/animation.d.ts +114 -0
- package/types/main-thread/element.d.ts +12 -20
- package/types/main-thread/index.d.ts +1 -0
package/types/common/events.d.ts
CHANGED
|
@@ -64,25 +64,41 @@ export interface ChangedTouch {
|
|
|
64
64
|
export interface BaseCommonEvent<T> extends BaseEventOrig<any, T> {}
|
|
65
65
|
export interface CommonEvent extends BaseCommonEvent<Target | MainThreadElement> {}
|
|
66
66
|
|
|
67
|
-
export interface AppearanceEvent {
|
|
68
|
-
type: 'nodeappear' | 'nodedisappear';
|
|
69
|
-
detail: {
|
|
70
|
-
position: number;
|
|
71
|
-
key: string;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
67
|
export interface BaseTouchEvent<T> extends BaseEventOrig<any, T> {
|
|
76
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Collection of touch points currently on the touch plane.
|
|
70
|
+
* @Android
|
|
71
|
+
* @iOS
|
|
72
|
+
* @Harmony
|
|
73
|
+
* @PC
|
|
74
|
+
*/
|
|
77
75
|
touches: Array<Touch>;
|
|
78
76
|
|
|
79
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Collection of touch points whose state has changed compared to the last touch event.
|
|
79
|
+
* @Android
|
|
80
|
+
* @iOS
|
|
81
|
+
* @Harmony
|
|
82
|
+
* @PC
|
|
83
|
+
*/
|
|
80
84
|
changedTouches: Array<Touch>;
|
|
81
85
|
|
|
82
86
|
detail: {
|
|
83
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* The current position of the touch point relative to the page's x-coordinate.
|
|
89
|
+
* @Android
|
|
90
|
+
* @iOS
|
|
91
|
+
* @Harmony
|
|
92
|
+
* @PC
|
|
93
|
+
*/
|
|
84
94
|
x: number;
|
|
85
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* The current position of the touch point relative to the page's y-coordinate.
|
|
97
|
+
* @Android
|
|
98
|
+
* @iOS
|
|
99
|
+
* @Harmony
|
|
100
|
+
* @PC
|
|
101
|
+
*/
|
|
86
102
|
y: number;
|
|
87
103
|
}
|
|
88
104
|
}
|
|
@@ -90,58 +106,137 @@ export interface BaseTouchEvent<T> extends BaseEventOrig<any, T> {
|
|
|
90
106
|
export interface TouchEvent extends BaseTouchEvent<Target> {}
|
|
91
107
|
|
|
92
108
|
export interface BaseMouseEvent<T> extends BaseEventOrig<{}, T> {
|
|
93
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* The currently pressed mouse button, if multiple buttons are pressed simultaneously, is the last one pressed.
|
|
111
|
+
* @PC
|
|
112
|
+
*/
|
|
94
113
|
button: number;
|
|
95
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* The current mouse button being pressed, if multiple buttons are simultaneously pressed, it is a bit field composed of all button codes.
|
|
116
|
+
* @PC
|
|
117
|
+
*/
|
|
96
118
|
buttons: number;
|
|
97
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* clientX
|
|
121
|
+
* @PC
|
|
122
|
+
*/
|
|
98
123
|
x: number;
|
|
99
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* clientY
|
|
126
|
+
* @PC
|
|
127
|
+
*/
|
|
100
128
|
y: number;
|
|
101
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* The current position of the cursor relative to the page's x-coordinate.
|
|
131
|
+
* @PC
|
|
132
|
+
*/
|
|
102
133
|
pageX: number;
|
|
103
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* The current position of the cursor relative to the page's y-coordinate.
|
|
136
|
+
* @PC
|
|
137
|
+
*/
|
|
104
138
|
pageY: number;
|
|
105
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* The current position of the cursor relative to the element's x-coordinate.
|
|
141
|
+
* @PC
|
|
142
|
+
*/
|
|
106
143
|
clientX: number;
|
|
107
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* The current position of the cursor relative to the element's y-coordinate.
|
|
146
|
+
* @PC
|
|
147
|
+
*/
|
|
108
148
|
clientY: number;
|
|
109
149
|
}
|
|
110
150
|
|
|
111
151
|
export interface MouseEvent extends BaseMouseEvent<Target> {}
|
|
112
152
|
|
|
113
153
|
export interface BaseWheelEvent<T> extends BaseEventOrig<{}, T> {
|
|
114
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* clientX
|
|
156
|
+
* @PC
|
|
157
|
+
*/
|
|
115
158
|
x: number;
|
|
116
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* clientY
|
|
161
|
+
* @PC
|
|
162
|
+
*/
|
|
117
163
|
y: number;
|
|
118
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* The current position of the cursor relative to the page's x-coordinate.
|
|
166
|
+
* @PC
|
|
167
|
+
*/
|
|
119
168
|
pageX: number;
|
|
120
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* The current position of the cursor relative to the page's y-coordinate.
|
|
171
|
+
* @PC
|
|
172
|
+
*/
|
|
121
173
|
pageY: number;
|
|
122
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* The current position of the cursor relative to the element's x-coordinate.
|
|
176
|
+
* @PC
|
|
177
|
+
*/
|
|
123
178
|
clientX: number;
|
|
124
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* The current position of the cursor relative to the element's y-coordinate.
|
|
181
|
+
* @PC
|
|
182
|
+
*/
|
|
125
183
|
clientY: number;
|
|
126
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* The distance of x-axis scrolling on the mouse wheel.
|
|
186
|
+
* @PC
|
|
187
|
+
*/
|
|
127
188
|
deltaX: number;
|
|
128
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* The distance of y-axis scrolling on the mouse wheel.
|
|
191
|
+
* @PC
|
|
192
|
+
*/
|
|
129
193
|
deltaY: number;
|
|
130
194
|
}
|
|
131
195
|
|
|
132
196
|
export interface WheelEvent extends BaseWheelEvent<Target> {}
|
|
133
197
|
|
|
134
198
|
export interface BaseKeyEvent<T> extends BaseEventOrig<{}, T> {
|
|
135
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* Button Name
|
|
201
|
+
* @PC
|
|
202
|
+
*/
|
|
136
203
|
key: string;
|
|
137
204
|
}
|
|
138
205
|
|
|
139
206
|
export interface KeyEvent extends BaseKeyEvent<Target> {}
|
|
140
207
|
|
|
141
208
|
export interface BaseAnimationEvent<T> extends BaseEventOrig<{}, T> {
|
|
209
|
+
/**
|
|
210
|
+
* Animation params.
|
|
211
|
+
* @Android
|
|
212
|
+
* @iOS
|
|
213
|
+
* @Harmony
|
|
214
|
+
* @PC
|
|
215
|
+
*/
|
|
142
216
|
params: {
|
|
217
|
+
/**
|
|
218
|
+
* Animation type.
|
|
219
|
+
* @Android
|
|
220
|
+
* @iOS
|
|
221
|
+
* @Harmony
|
|
222
|
+
* @PC
|
|
223
|
+
*/
|
|
143
224
|
animation_type: 'keyframe-animation';
|
|
225
|
+
/**
|
|
226
|
+
* Animation name.
|
|
227
|
+
* @Android
|
|
228
|
+
* @iOS
|
|
229
|
+
* @Harmony
|
|
230
|
+
* @PC
|
|
231
|
+
*/
|
|
144
232
|
animation_name: string;
|
|
233
|
+
/**
|
|
234
|
+
* If new animator enabled.
|
|
235
|
+
* @Android
|
|
236
|
+
* @iOS
|
|
237
|
+
* @Harmony
|
|
238
|
+
* @PC
|
|
239
|
+
*/
|
|
145
240
|
new_animator?: true;
|
|
146
241
|
};
|
|
147
242
|
}
|
|
@@ -173,33 +268,51 @@ export interface BaseTransitionEvent<T> extends BaseEventOrig<{}, T> {
|
|
|
173
268
|
export interface TransitionEvent extends BaseTransitionEvent<Target> {}
|
|
174
269
|
|
|
175
270
|
export interface BaseImageLoadEvent<T> extends BaseEventOrig<{}, T> {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
271
|
+
/**
|
|
272
|
+
* Image width. In pixels.
|
|
273
|
+
* @Android
|
|
274
|
+
* @iOS
|
|
275
|
+
*/
|
|
276
|
+
width: number;
|
|
277
|
+
/**
|
|
278
|
+
* Image height. In pixels.
|
|
279
|
+
* @Android
|
|
280
|
+
* @iOS
|
|
281
|
+
*/
|
|
282
|
+
height: number;
|
|
180
283
|
}
|
|
181
284
|
|
|
182
285
|
export interface ImageLoadEvent extends BaseImageLoadEvent<Target> {
|
|
183
|
-
detail: {
|
|
184
286
|
width: number;
|
|
185
287
|
height: number;
|
|
186
|
-
};
|
|
187
288
|
}
|
|
188
289
|
|
|
290
|
+
|
|
189
291
|
export interface BaseImageErrorEvent<T> extends BaseEventOrig<{}, T> {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
292
|
+
/**
|
|
293
|
+
* Error message.
|
|
294
|
+
* @Android
|
|
295
|
+
* @iOS
|
|
296
|
+
*/
|
|
297
|
+
errMsg: string;
|
|
298
|
+
/**
|
|
299
|
+
* Error code.
|
|
300
|
+
* @Android
|
|
301
|
+
* @iOS
|
|
302
|
+
*/
|
|
303
|
+
error_code: number;
|
|
304
|
+
/**
|
|
305
|
+
* Categorized error code.
|
|
306
|
+
* @Android
|
|
307
|
+
* @iOS
|
|
308
|
+
*/
|
|
309
|
+
lynx_categorized_code: number;
|
|
195
310
|
}
|
|
196
311
|
|
|
197
312
|
export interface ImageErrorEvent extends BaseImageErrorEvent<Target> {
|
|
198
|
-
detail: {
|
|
199
313
|
errMsg: string;
|
|
200
314
|
error_code: number;
|
|
201
315
|
lynx_categorized_code: number;
|
|
202
|
-
};
|
|
203
316
|
}
|
|
204
317
|
|
|
205
318
|
export interface TextLineInfo {
|
|
@@ -253,23 +366,74 @@ export interface LayoutChangeDetailEvent<T> extends BaseEventOrig<{}, T> {
|
|
|
253
366
|
|
|
254
367
|
/**
|
|
255
368
|
* This field is available on other platforms.
|
|
256
|
-
*
|
|
369
|
+
* @Android
|
|
370
|
+
* @iOS
|
|
371
|
+
* @Harmony
|
|
372
|
+
* @PC
|
|
373
|
+
*/
|
|
257
374
|
detail: {
|
|
258
|
-
/**
|
|
375
|
+
/**
|
|
376
|
+
* The id selector of the target.
|
|
377
|
+
* @Android
|
|
378
|
+
* @iOS
|
|
379
|
+
* @Harmony
|
|
380
|
+
* @PC
|
|
381
|
+
*/
|
|
259
382
|
id: string;
|
|
260
|
-
/**
|
|
383
|
+
/**
|
|
384
|
+
* The width of the target. In pixels.
|
|
385
|
+
* @Android
|
|
386
|
+
* @iOS
|
|
387
|
+
* @Harmony
|
|
388
|
+
* @PC
|
|
389
|
+
*/
|
|
261
390
|
width: number;
|
|
262
|
-
/** The height of the target.
|
|
391
|
+
/** The height of the target. In pixels.
|
|
392
|
+
* @Android
|
|
393
|
+
* @iOS
|
|
394
|
+
* @Harmony
|
|
395
|
+
* @PC
|
|
396
|
+
*/
|
|
263
397
|
height: number;
|
|
264
|
-
/**
|
|
398
|
+
/**
|
|
399
|
+
* The position of the target's top border relative to the page's coordinate. In pixels.
|
|
400
|
+
* @Android
|
|
401
|
+
* @iOS
|
|
402
|
+
* @Harmony
|
|
403
|
+
* @PC
|
|
404
|
+
*/
|
|
265
405
|
top: number;
|
|
266
|
-
/**
|
|
406
|
+
/**
|
|
407
|
+
* The position of the target's right border relative to the page's coordinate. In pixels.
|
|
408
|
+
* @Android
|
|
409
|
+
* @iOS
|
|
410
|
+
* @Harmony
|
|
411
|
+
* @PC
|
|
412
|
+
*/
|
|
267
413
|
right: number;
|
|
268
|
-
/**
|
|
414
|
+
/**
|
|
415
|
+
* The position of the target's bottom border relative to the page's coordinate. In pixels.
|
|
416
|
+
* @Android
|
|
417
|
+
* @iOS
|
|
418
|
+
* @Harmony
|
|
419
|
+
* @PC
|
|
420
|
+
*/
|
|
269
421
|
bottom: number;
|
|
270
|
-
/**
|
|
422
|
+
/**
|
|
423
|
+
* The position of the target's left border relative to the page's coordinate. In pixels.
|
|
424
|
+
* @Android
|
|
425
|
+
* @iOS
|
|
426
|
+
* @Harmony
|
|
427
|
+
* @PC
|
|
428
|
+
*/
|
|
271
429
|
left: number;
|
|
272
|
-
/**
|
|
430
|
+
/**
|
|
431
|
+
* The collection of custom attributes starting with data- on the event target.
|
|
432
|
+
* @Android
|
|
433
|
+
* @iOS
|
|
434
|
+
* @Harmony
|
|
435
|
+
* @PC
|
|
436
|
+
*/
|
|
273
437
|
dataset: {
|
|
274
438
|
[key: string]: any;
|
|
275
439
|
};
|
|
@@ -279,13 +443,37 @@ export interface LayoutChangeDetailEvent<T> extends BaseEventOrig<{}, T> {
|
|
|
279
443
|
export interface UIAppearanceDetailEvent<T> extends BaseEventOrig<{}, T> {
|
|
280
444
|
type: 'uiappear' | 'uidisappear';
|
|
281
445
|
detail: {
|
|
282
|
-
/**
|
|
446
|
+
/**
|
|
447
|
+
* exposure-id set on the target.
|
|
448
|
+
* @Android
|
|
449
|
+
* @iOS
|
|
450
|
+
* @Harmony
|
|
451
|
+
* @PC
|
|
452
|
+
*/
|
|
283
453
|
'exposure-id': string;
|
|
284
|
-
/**
|
|
454
|
+
/**
|
|
455
|
+
* exposure-scene set on the target.
|
|
456
|
+
* @Android
|
|
457
|
+
* @iOS
|
|
458
|
+
* @Harmony
|
|
459
|
+
* @PC
|
|
460
|
+
*/
|
|
285
461
|
'exposure-scene': string;
|
|
286
|
-
/**
|
|
462
|
+
/**
|
|
463
|
+
* uid of the target
|
|
464
|
+
* @Android
|
|
465
|
+
* @iOS
|
|
466
|
+
* @Harmony
|
|
467
|
+
* @PC
|
|
468
|
+
*/
|
|
287
469
|
'unique-id': string;
|
|
288
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* The collection of custom attributes starting with data- on the event target.
|
|
472
|
+
* @Android
|
|
473
|
+
* @iOS
|
|
474
|
+
* @Harmony
|
|
475
|
+
* @PC
|
|
476
|
+
*/
|
|
289
477
|
dataset: {
|
|
290
478
|
[key: string]: any;
|
|
291
479
|
};
|
|
@@ -315,32 +503,66 @@ export interface LepusEventInstance {
|
|
|
315
503
|
export type EventHandler<T> = (event: T, instance?: LepusEventInstance) => void;
|
|
316
504
|
|
|
317
505
|
export interface BaseEvent<T = string, D = any> {
|
|
318
|
-
/**
|
|
506
|
+
/**
|
|
507
|
+
* Event type.
|
|
508
|
+
* @Android
|
|
509
|
+
* @iOS
|
|
510
|
+
* @Harmony
|
|
511
|
+
* @PC
|
|
512
|
+
*/
|
|
319
513
|
type: T;
|
|
320
514
|
|
|
321
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* Timestamp when the event was generated.
|
|
517
|
+
* @Android
|
|
518
|
+
* @iOS
|
|
519
|
+
* @Harmony
|
|
520
|
+
* @PC
|
|
521
|
+
*/
|
|
322
522
|
timestamp: number;
|
|
323
523
|
|
|
324
|
-
/**
|
|
524
|
+
/**
|
|
525
|
+
* Collection of attribute values of the target that triggers the event.
|
|
526
|
+
* @Android
|
|
527
|
+
* @iOS
|
|
528
|
+
* @Harmony
|
|
529
|
+
* @PC
|
|
530
|
+
*/
|
|
325
531
|
target: Target;
|
|
326
532
|
|
|
327
|
-
/**
|
|
533
|
+
/**
|
|
534
|
+
* Collection of attribute values of the target that listens to the event.
|
|
535
|
+
* @Android
|
|
536
|
+
* @iOS
|
|
537
|
+
* @Harmony
|
|
538
|
+
* @PC
|
|
539
|
+
*/
|
|
328
540
|
currentTarget: Target;
|
|
329
541
|
|
|
330
|
-
/**
|
|
542
|
+
/**
|
|
543
|
+
* Additional information.
|
|
544
|
+
* @Android
|
|
545
|
+
* @iOS
|
|
546
|
+
* @Harmony
|
|
547
|
+
* @PC
|
|
548
|
+
*/
|
|
331
549
|
detail: D;
|
|
332
550
|
}
|
|
333
551
|
|
|
334
552
|
export interface LynxEvent<T> {
|
|
335
553
|
/**
|
|
336
554
|
* Listening for background image loading success.
|
|
337
|
-
* @
|
|
555
|
+
* @Android
|
|
556
|
+
* @iOS
|
|
557
|
+
* @since 2.6
|
|
338
558
|
*/
|
|
339
559
|
BGLoad?: EventHandler<BaseImageLoadEvent<T>>;
|
|
340
560
|
|
|
341
561
|
/**
|
|
342
562
|
* Failed to load background image for listening.
|
|
343
|
-
* @
|
|
563
|
+
* @Android
|
|
564
|
+
* @iOS
|
|
565
|
+
* @since 2.8
|
|
344
566
|
*/
|
|
345
567
|
BGError?: EventHandler<BaseImageErrorEvent<T>>;
|
|
346
568
|
|
|
@@ -348,87 +570,206 @@ export interface LynxEvent<T> {
|
|
|
348
570
|
|
|
349
571
|
// NodeDisappear?: EventHandler<ReactLynx.AppearanceEvent>;
|
|
350
572
|
|
|
351
|
-
/**
|
|
573
|
+
/**
|
|
574
|
+
* Finger touch action begins.
|
|
575
|
+
* @Android
|
|
576
|
+
* @iOS
|
|
577
|
+
* @Harmony
|
|
578
|
+
* @PC
|
|
579
|
+
*/
|
|
352
580
|
TouchStart?: EventHandler<BaseTouchEvent<T>>;
|
|
353
581
|
|
|
354
|
-
/**
|
|
582
|
+
/**
|
|
583
|
+
* Moving after touching with fingers.
|
|
584
|
+
* @Android
|
|
585
|
+
* @iOS
|
|
586
|
+
* @Harmony
|
|
587
|
+
* @PC
|
|
588
|
+
*/
|
|
355
589
|
TouchMove?: EventHandler<BaseTouchEvent<T>>;
|
|
356
590
|
|
|
357
|
-
/**
|
|
591
|
+
/**
|
|
592
|
+
* Finger touch actions are interrupted by incoming call reminders and pop-up windows.
|
|
593
|
+
* @Android
|
|
594
|
+
* @iOS
|
|
595
|
+
* @Harmony
|
|
596
|
+
* @PC
|
|
597
|
+
*/
|
|
358
598
|
TouchCancel?: EventHandler<BaseTouchEvent<T>>;
|
|
359
599
|
|
|
360
|
-
/**
|
|
600
|
+
/**
|
|
601
|
+
* Finger touch action ends.
|
|
602
|
+
* @Android
|
|
603
|
+
* @iOS
|
|
604
|
+
* @Harmony
|
|
605
|
+
* @PC
|
|
606
|
+
*/
|
|
361
607
|
TouchEnd?: EventHandler<BaseTouchEvent<T>>;
|
|
362
608
|
|
|
363
|
-
/**
|
|
364
|
-
|
|
609
|
+
/**
|
|
610
|
+
* After touching the finger, if it leaves after more than 350ms and the event callback function is specified and triggered, the tap event will not be triggered.
|
|
611
|
+
* @Android
|
|
612
|
+
* @iOS
|
|
613
|
+
* @Harmony
|
|
614
|
+
* @PC
|
|
615
|
+
*/
|
|
616
|
+
LongPress?: EventHandler<BaseTouchEvent<T>>;
|
|
365
617
|
|
|
366
|
-
/**
|
|
618
|
+
/**
|
|
619
|
+
* It will trigger during a transition animation start.
|
|
620
|
+
* @Android
|
|
621
|
+
* @iOS
|
|
622
|
+
* @Harmony
|
|
623
|
+
* @PC
|
|
624
|
+
*/
|
|
367
625
|
TransitionStart?: EventHandler<BaseTransitionEvent<T>>;
|
|
368
626
|
|
|
369
|
-
/**
|
|
627
|
+
/**
|
|
628
|
+
* It will trigger when a transition animation is cancelled.
|
|
629
|
+
* @Android
|
|
630
|
+
* @iOS
|
|
631
|
+
* @Harmony
|
|
632
|
+
* @PC
|
|
633
|
+
*/
|
|
370
634
|
TransitionCancel?: EventHandler<BaseTransitionEvent<T>>;
|
|
371
635
|
|
|
372
|
-
/**
|
|
636
|
+
/**
|
|
637
|
+
* It will trigger after the transition or createAnimation animation is finished.
|
|
638
|
+
* @Android
|
|
639
|
+
* @iOS
|
|
640
|
+
* @Harmony
|
|
641
|
+
* @PC
|
|
642
|
+
*/
|
|
373
643
|
TransitionEnd?: EventHandler<BaseTransitionEvent<T>>;
|
|
374
644
|
|
|
375
|
-
/**
|
|
645
|
+
/**
|
|
646
|
+
* It will trigger at the beginning of an animation.
|
|
647
|
+
* @Android
|
|
648
|
+
* @iOS
|
|
649
|
+
* @Harmony
|
|
650
|
+
* @PC
|
|
651
|
+
*/
|
|
376
652
|
AnimationStart?: EventHandler<BaseAnimationEvent<T>>;
|
|
377
653
|
|
|
378
|
-
/**
|
|
654
|
+
/**
|
|
655
|
+
* It will trigger during an animation iteration.
|
|
656
|
+
* @Android
|
|
657
|
+
* @iOS
|
|
658
|
+
* @Harmony
|
|
659
|
+
* @PC
|
|
660
|
+
*/
|
|
379
661
|
AnimationIteration?: EventHandler<BaseAnimationEvent<T>>;
|
|
380
662
|
|
|
381
|
-
/**
|
|
663
|
+
/**
|
|
664
|
+
* It will trigger when an animation is cancelled.
|
|
665
|
+
* @Android
|
|
666
|
+
* @iOS
|
|
667
|
+
* @Harmony
|
|
668
|
+
* @PC
|
|
669
|
+
*/
|
|
382
670
|
AnimationCancel?: EventHandler<BaseAnimationEvent<T>>;
|
|
383
671
|
|
|
384
|
-
/**
|
|
672
|
+
/**
|
|
673
|
+
* It will trigger upon completion of an animation.
|
|
674
|
+
* @Android
|
|
675
|
+
* @iOS
|
|
676
|
+
* @Harmony
|
|
677
|
+
* @PC
|
|
678
|
+
*/
|
|
385
679
|
AnimationEnd?: EventHandler<BaseAnimationEvent<T>>;
|
|
386
680
|
|
|
387
|
-
/**
|
|
681
|
+
/**
|
|
682
|
+
* Indicates that a mouse button (primary or secondary) is pressed. The target is the UI that contains the mouse pointer and is closest to the user.
|
|
683
|
+
* @PC
|
|
684
|
+
*/
|
|
388
685
|
MouseDown?: EventHandler<BaseMouseEvent<T>>;
|
|
389
686
|
|
|
390
|
-
/**
|
|
687
|
+
/**
|
|
688
|
+
* Indicates that a mouse button (primary or secondary) is released. The target is the UI that contains the mouse pointer and is closest to the user.
|
|
689
|
+
* @PC
|
|
690
|
+
*/
|
|
391
691
|
MouseUp?: EventHandler<BaseMouseEvent<T>>;
|
|
392
692
|
|
|
393
|
-
/**
|
|
693
|
+
/**
|
|
694
|
+
* Mouse movement.
|
|
695
|
+
* @PC
|
|
696
|
+
*/
|
|
394
697
|
MouseMove?: EventHandler<BaseMouseEvent<T>>;
|
|
395
698
|
|
|
396
|
-
/**
|
|
699
|
+
/**
|
|
700
|
+
* Mouse click.
|
|
701
|
+
* @PC
|
|
702
|
+
*/
|
|
397
703
|
MouseClick?: EventHandler<BaseMouseEvent<T>>;
|
|
398
704
|
|
|
399
|
-
/**
|
|
705
|
+
/**
|
|
706
|
+
* Double-click the mouse.
|
|
707
|
+
* @PC
|
|
708
|
+
*/
|
|
400
709
|
MouseDblClick?: EventHandler<BaseMouseEvent<T>>;
|
|
401
710
|
|
|
402
|
-
/**
|
|
711
|
+
/**
|
|
712
|
+
* Long press on the mouse.
|
|
713
|
+
* @PC
|
|
714
|
+
*/
|
|
403
715
|
MouseLongPress?: EventHandler<BaseMouseEvent<T>>;
|
|
404
716
|
|
|
405
|
-
/**
|
|
717
|
+
/**
|
|
718
|
+
* Mouse (or touchpad) scrolling.
|
|
719
|
+
* @PC
|
|
720
|
+
*/
|
|
406
721
|
Wheel?: EventHandler<BaseWheelEvent<T>>;
|
|
407
722
|
|
|
408
|
-
/**
|
|
723
|
+
/**
|
|
724
|
+
* Keyboard (or remote control) button pressed.
|
|
725
|
+
* @PC
|
|
726
|
+
*/
|
|
409
727
|
KeyDown?: EventHandler<BaseKeyEvent<T>>;
|
|
410
728
|
|
|
411
|
-
/**
|
|
729
|
+
/**
|
|
730
|
+
* Keyboard (or remote control) key released.
|
|
731
|
+
* @PC
|
|
732
|
+
*/
|
|
412
733
|
KeyUp?: EventHandler<BaseKeyEvent<T>>;
|
|
413
734
|
|
|
414
|
-
/**
|
|
735
|
+
/**
|
|
736
|
+
* Element gets focus.
|
|
737
|
+
* @PC
|
|
738
|
+
*/
|
|
415
739
|
Focus?: EventHandler<BaseCommonEvent<T>>;
|
|
416
740
|
|
|
417
|
-
/**
|
|
741
|
+
/**
|
|
742
|
+
* Element loses focus.
|
|
743
|
+
* @PC
|
|
744
|
+
*/
|
|
418
745
|
Blur?: EventHandler<BaseCommonEvent<T>>;
|
|
419
746
|
|
|
420
|
-
/**
|
|
747
|
+
/**
|
|
748
|
+
* Layout info changed event
|
|
749
|
+
* @Android
|
|
750
|
+
* @iOS
|
|
751
|
+
* @Harmony
|
|
752
|
+
* @PC
|
|
753
|
+
*/
|
|
421
754
|
LayoutChange?: EventHandler<LayoutChangeDetailEvent<T>>;
|
|
422
755
|
|
|
423
|
-
/**
|
|
756
|
+
/**
|
|
757
|
+
* Element appear event
|
|
758
|
+
* @Android
|
|
759
|
+
* @iOS
|
|
760
|
+
* @Harmony
|
|
761
|
+
* @PC
|
|
762
|
+
*/
|
|
424
763
|
UIAppear?: EventHandler<UIAppearanceDetailEvent<T>>;
|
|
425
764
|
|
|
426
|
-
/**
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
*
|
|
430
|
-
* @
|
|
765
|
+
/**
|
|
766
|
+
* Element disappear event
|
|
767
|
+
* @Android
|
|
768
|
+
* @iOS
|
|
769
|
+
* @Harmony
|
|
770
|
+
* @PC
|
|
431
771
|
*/
|
|
772
|
+
UIDisappear?: EventHandler<UIAppearanceDetailEvent<T>>;
|
|
432
773
|
|
|
433
774
|
/**
|
|
434
775
|
* The custom actions of the current accessibility element is triggered.
|
|
@@ -447,18 +788,99 @@ export interface UIAppearanceEvent extends UIAppearanceDetailEvent<Target> {}
|
|
|
447
788
|
* This type is different with LynxEvent that they only have `bind` and `catch` event. But not `on` Event.
|
|
448
789
|
*/
|
|
449
790
|
export interface LynxBindCatchEvent<T = any> {
|
|
450
|
-
/**
|
|
791
|
+
/**
|
|
792
|
+
* Triggered when a finger clicks on the touch plane. This event and the `longpress` event are mutually exclusive in event listening. That is, if the front-end listens to both events simultaneously, the two events will not be triggered at the same time, and the `longpress` event takes precedence.
|
|
793
|
+
* @Android
|
|
794
|
+
* @iOS
|
|
795
|
+
* @Harmony
|
|
796
|
+
* @PC
|
|
797
|
+
*/
|
|
451
798
|
Tap?: EventHandler<BaseTouchEvent<T>>;
|
|
452
799
|
|
|
453
|
-
/**
|
|
800
|
+
/**
|
|
801
|
+
* After touching the finger, leave after more than 350ms
|
|
802
|
+
* @deprecated It is recommended to use the longpress event instead
|
|
803
|
+
*/
|
|
454
804
|
LongTap?: EventHandler<BaseTouchEvent<T>>;
|
|
455
805
|
}
|
|
456
806
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
807
|
+
type PrefixedEvent<E> = {
|
|
808
|
+
bind?: E;
|
|
809
|
+
catch?: E;
|
|
810
|
+
'capture-bind'?: E;
|
|
811
|
+
'capture-catch'?: E;
|
|
812
|
+
'global-bind'?: E;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// Helper interfaces for each event, providing explicit properties
|
|
816
|
+
// for bind, catch, capture-bind, capture-catch, and global-bind prefixes.
|
|
817
|
+
interface BGLoadProps<T> { bindbgload?: LynxEvent<T>['BGLoad']; catchbgload?: LynxEvent<T>['BGLoad']; 'capture-bindbgload'?: LynxEvent<T>['BGLoad']; 'capture-catchbgload'?: LynxEvent<T>['BGLoad']; 'global-bindbgload'?: LynxEvent<T>['BGLoad']; }
|
|
818
|
+
interface BGErrorProps<T> { bindbgerror?: LynxEvent<T>['BGError']; catchbgerror?: LynxEvent<T>['BGError']; 'capture-bindbgerror'?: LynxEvent<T>['BGError']; 'capture-catchbgerror'?: LynxEvent<T>['BGError']; 'global-bindbgerror'?: LynxEvent<T>['BGError']; }
|
|
819
|
+
interface TouchStartProps<T> { bindtouchstart?: LynxEvent<T>['TouchStart']; catchtouchstart?: LynxEvent<T>['TouchStart']; 'capture-bindtouchstart'?: LynxEvent<T>['TouchStart']; 'capture-catchtouchstart'?: LynxEvent<T>['TouchStart']; 'global-bindtouchstart'?: LynxEvent<T>['TouchStart']; }
|
|
820
|
+
interface TouchMoveProps<T> { bindtouchmove?: LynxEvent<T>['TouchMove']; catchtouchmove?: LynxEvent<T>['TouchMove']; 'capture-bindtouchmove'?: LynxEvent<T>['TouchMove']; 'capture-catchtouchmove'?: LynxEvent<T>['TouchMove']; 'global-bindtouchmove'?: LynxEvent<T>['TouchMove']; }
|
|
821
|
+
interface TouchCancelProps<T> { bindtouchcancel?: LynxEvent<T>['TouchCancel']; catchtouchcancel?: LynxEvent<T>['TouchCancel']; 'capture-bindtouchcancel'?: LynxEvent<T>['TouchCancel']; 'capture-catchtouchcancel'?: LynxEvent<T>['TouchCancel']; 'global-bindtouchcancel'?: LynxEvent<T>['TouchCancel']; }
|
|
822
|
+
interface TouchEndProps<T> { bindtouchend?: LynxEvent<T>['TouchEnd']; catchtouchend?: LynxEvent<T>['TouchEnd']; 'capture-bindtouchend'?: LynxEvent<T>['TouchEnd']; 'capture-catchtouchend'?: LynxEvent<T>['TouchEnd']; 'global-bindtouchend'?: LynxEvent<T>['TouchEnd']; }
|
|
823
|
+
interface LongPressProps<T> { bindlongpress?: LynxEvent<T>['LongPress']; catchlongpress?: LynxEvent<T>['LongPress']; 'capture-bindlongpress'?: LynxEvent<T>['LongPress']; 'capture-catchlongpress'?: LynxEvent<T>['LongPress']; 'global-bindlongpress'?: LynxEvent<T>['LongPress']; }
|
|
824
|
+
interface TransitionStartProps<T> { bindtransitionstart?: LynxEvent<T>['TransitionStart']; catchtransitionstart?: LynxEvent<T>['TransitionStart']; 'capture-bindtransitionstart'?: LynxEvent<T>['TransitionStart']; 'capture-catchtransitionstart'?: LynxEvent<T>['TransitionStart']; 'global-bindtransitionstart'?: LynxEvent<T>['TransitionStart']; }
|
|
825
|
+
interface TransitionCancelProps<T> { bindtransitioncancel?: LynxEvent<T>['TransitionCancel']; catchtransitioncancel?: LynxEvent<T>['TransitionCancel']; 'capture-bindtransitioncancel'?: LynxEvent<T>['TransitionCancel']; 'capture-catchtransitioncancel'?: LynxEvent<T>['TransitionCancel']; 'global-bindtransitioncancel'?: LynxEvent<T>['TransitionCancel']; }
|
|
826
|
+
interface TransitionEndProps<T> { bindtransitionend?: LynxEvent<T>['TransitionEnd']; catchtransitionend?: LynxEvent<T>['TransitionEnd']; 'capture-bindtransitionend'?: LynxEvent<T>['TransitionEnd']; 'capture-catchtransitionend'?: LynxEvent<T>['TransitionEnd']; 'global-bindtransitionend'?: LynxEvent<T>['TransitionEnd']; }
|
|
827
|
+
interface AnimationStartProps<T> { bindanimationstart?: LynxEvent<T>['AnimationStart']; catchanimationstart?: LynxEvent<T>['AnimationStart']; 'capture-bindanimationstart'?: LynxEvent<T>['AnimationStart']; 'capture-catchanimationstart'?: LynxEvent<T>['AnimationStart']; 'global-bindanimationstart'?: LynxEvent<T>['AnimationStart']; }
|
|
828
|
+
interface AnimationIterationProps<T> { bindanimationiteration?: LynxEvent<T>['AnimationIteration']; catchanimationiteration?: LynxEvent<T>['AnimationIteration']; 'capture-bindanimationiteration'?: LynxEvent<T>['AnimationIteration']; 'capture-catchanimationiteration'?: LynxEvent<T>['AnimationIteration']; 'global-bindanimationiteration'?: LynxEvent<T>['AnimationIteration']; }
|
|
829
|
+
interface AnimationCancelProps<T> { bindanimationcancel?: LynxEvent<T>['AnimationCancel']; catchanimationcancel?: LynxEvent<T>['AnimationCancel']; 'capture-bindanimationcancel'?: LynxEvent<T>['AnimationCancel']; 'capture-catchanimationcancel'?: LynxEvent<T>['AnimationCancel']; 'global-bindanimationcancel'?: LynxEvent<T>['AnimationCancel']; }
|
|
830
|
+
interface AnimationEndProps<T> { bindanimationend?: LynxEvent<T>['AnimationEnd']; catchanimationend?: LynxEvent<T>['AnimationEnd']; 'capture-bindanimationend'?: LynxEvent<T>['AnimationEnd']; 'capture-catchanimationend'?: LynxEvent<T>['AnimationEnd']; 'global-bindanimationend'?: LynxEvent<T>['AnimationEnd']; }
|
|
831
|
+
interface MouseDownProps<T> { bindmousedown?: LynxEvent<T>['MouseDown']; catchmousedown?: LynxEvent<T>['MouseDown']; 'capture-bindmousedown'?: LynxEvent<T>['MouseDown']; 'capture-catchmousedown'?: LynxEvent<T>['MouseDown']; 'global-bindmousedown'?: LynxEvent<T>['MouseDown']; }
|
|
832
|
+
interface MouseUpProps<T> { bindmouseup?: LynxEvent<T>['MouseUp']; catchmouseup?: LynxEvent<T>['MouseUp']; 'capture-bindmouseup'?: LynxEvent<T>['MouseUp']; 'capture-catchmouseup'?: LynxEvent<T>['MouseUp']; 'global-bindmouseup'?: LynxEvent<T>['MouseUp']; }
|
|
833
|
+
interface MouseMoveProps<T> { bindmousemove?: LynxEvent<T>['MouseMove']; catchmousemove?: LynxEvent<T>['MouseMove']; 'capture-bindmousemove'?: LynxEvent<T>['MouseMove']; 'capture-catchmousemove'?: LynxEvent<T>['MouseMove']; 'global-bindmousemove'?: LynxEvent<T>['MouseMove']; }
|
|
834
|
+
interface MouseClickProps<T> { bindmouseclick?: LynxEvent<T>['MouseClick']; catchmouseclick?: LynxEvent<T>['MouseClick']; 'capture-bindmouseclick'?: LynxEvent<T>['MouseClick']; 'capture-catchmouseclick'?: LynxEvent<T>['MouseClick']; 'global-bindmouseclick'?: LynxEvent<T>['MouseClick']; }
|
|
835
|
+
interface MouseDblClickProps<T> { bindmousedblclick?: LynxEvent<T>['MouseDblClick']; catchmousedblclick?: LynxEvent<T>['MouseDblClick']; 'capture-bindmousedblclick'?: LynxEvent<T>['MouseDblClick']; 'capture-catchmousedblclick'?: LynxEvent<T>['MouseDblClick']; 'global-bindmousedblclick'?: LynxEvent<T>['MouseDblClick']; }
|
|
836
|
+
interface MouseLongPressProps<T> { bindmouselongpress?: LynxEvent<T>['MouseLongPress']; catchmouselongpress?: LynxEvent<T>['MouseLongPress']; 'capture-bindmouselongpress'?: LynxEvent<T>['MouseLongPress']; 'capture-catchmouselongpress'?: LynxEvent<T>['MouseLongPress']; 'global-bindmouselongpress'?: LynxEvent<T>['MouseLongPress']; }
|
|
837
|
+
interface WheelProps<T> { bindwheel?: LynxEvent<T>['Wheel']; catchwheel?: LynxEvent<T>['Wheel']; 'capture-bindwheel'?: LynxEvent<T>['Wheel']; 'capture-catchwheel'?: LynxEvent<T>['Wheel']; 'global-bindwheel'?: LynxEvent<T>['Wheel']; }
|
|
838
|
+
interface KeyDownProps<T> { bindkeydown?: LynxEvent<T>['KeyDown']; catchkeydown?: LynxEvent<T>['KeyDown']; 'capture-bindkeydown'?: LynxEvent<T>['KeyDown']; 'capture-catchkeydown'?: LynxEvent<T>['KeyDown']; 'global-bindkeydown'?: LynxEvent<T>['KeyDown']; }
|
|
839
|
+
interface KeyUpProps<T> { bindkeyup?: LynxEvent<T>['KeyUp']; catchkeyup?: LynxEvent<T>['KeyUp']; 'capture-bindkeyup'?: LynxEvent<T>['KeyUp']; 'capture-catchkeyup'?: LynxEvent<T>['KeyUp']; 'global-bindkeyup'?: LynxEvent<T>['KeyUp']; }
|
|
840
|
+
interface FocusProps<T> { bindfocus?: LynxEvent<T>['Focus']; catchfocus?: LynxEvent<T>['Focus']; 'capture-bindfocus'?: LynxEvent<T>['Focus']; 'capture-catchfocus'?: LynxEvent<T>['Focus']; 'global-bindfocus'?: LynxEvent<T>['Focus']; }
|
|
841
|
+
interface BlurProps<T> { bindblur?: LynxEvent<T>['Blur']; catchblur?: LynxEvent<T>['Blur']; 'capture-bindblur'?: LynxEvent<T>['Blur']; 'capture-catchblur'?: LynxEvent<T>['Blur']; 'global-bindblur'?: LynxEvent<T>['Blur']; }
|
|
842
|
+
interface LayoutChangeProps<T> { bindlayoutchange?: LynxEvent<T>['LayoutChange']; catchlayoutchange?: LynxEvent<T>['LayoutChange']; 'capture-bindlayoutchange'?: LynxEvent<T>['LayoutChange']; 'capture-catchlayoutchange'?: LynxEvent<T>['LayoutChange']; 'global-bindlayoutchange'?: LynxEvent<T>['LayoutChange']; }
|
|
843
|
+
interface UIAppearProps<T> { binduiappear?: LynxEvent<T>['UIAppear']; catchuiappear?: LynxEvent<T>['UIAppear']; 'capture-binduiappear'?: LynxEvent<T>['UIAppear']; 'capture-catchuiappear'?: LynxEvent<T>['UIAppear']; 'global-binduiappear'?: LynxEvent<T>['UIAppear']; }
|
|
844
|
+
interface UIDisappearProps<T> { binduidisappear?: LynxEvent<T>['UIDisappear']; catchuidisappear?: LynxEvent<T>['UIDisappear']; 'capture-binduidisappear'?: LynxEvent<T>['UIDisappear']; 'capture-catchuidisappear'?: LynxEvent<T>['UIDisappear']; 'global-binduidisappear'?: LynxEvent<T>['UIDisappear']; }
|
|
845
|
+
interface AccessibilityActionProps<T> { bindaccessibilityaction?: LynxEvent<T>['AccessibilityAction']; catchaccessibilityaction?: LynxEvent<T>['AccessibilityAction']; 'capture-bindaccessibilityaction'?: LynxEvent<T>['AccessibilityAction']; 'capture-catchaccessibilityaction'?: LynxEvent<T>['AccessibilityAction']; 'global-bindaccessibilityaction'?: LynxEvent<T>['AccessibilityAction']; }
|
|
846
|
+
interface TapProps<T> { bindtap?: LynxBindCatchEvent<T>['Tap']; catchtap?: LynxBindCatchEvent<T>['Tap']; 'capture-bindtap'?: LynxBindCatchEvent<T>['Tap']; 'capture-catchtap'?: LynxBindCatchEvent<T>['Tap']; 'global-bindtap'?: LynxBindCatchEvent<T>['Tap']; }
|
|
847
|
+
interface LongTapProps<T> { bindlongtap?: LynxBindCatchEvent<T>['LongTap']; catchlongtap?: LynxBindCatchEvent<T>['LongTap']; 'capture-bindlongtap'?: LynxBindCatchEvent<T>['LongTap']; 'capture-catchlongtap'?: LynxBindCatchEvent<T>['LongTap']; 'global-bindlongtap'?: LynxBindCatchEvent<T>['LongTap']; }
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* A combination of all possible event properties, statically defined for IDE-friendliness.
|
|
851
|
+
* This replaces the previous dynamic mapped type.
|
|
852
|
+
*/
|
|
853
|
+
export type LynxEventPropsBase<T> = BGLoadProps<T> &
|
|
854
|
+
BGErrorProps<T> &
|
|
855
|
+
TouchStartProps<T> &
|
|
856
|
+
TouchMoveProps<T> &
|
|
857
|
+
TouchCancelProps<T> &
|
|
858
|
+
TouchEndProps<T> &
|
|
859
|
+
LongPressProps<T> &
|
|
860
|
+
TransitionStartProps<T> &
|
|
861
|
+
TransitionCancelProps<T> &
|
|
862
|
+
TransitionEndProps<T> &
|
|
863
|
+
AnimationStartProps<T> &
|
|
864
|
+
AnimationIterationProps<T> &
|
|
865
|
+
AnimationCancelProps<T> &
|
|
866
|
+
AnimationEndProps<T> &
|
|
867
|
+
MouseDownProps<T> &
|
|
868
|
+
MouseUpProps<T> &
|
|
869
|
+
MouseMoveProps<T> &
|
|
870
|
+
MouseClickProps<T> &
|
|
871
|
+
MouseDblClickProps<T> &
|
|
872
|
+
MouseLongPressProps<T> &
|
|
873
|
+
WheelProps<T> &
|
|
874
|
+
KeyDownProps<T> &
|
|
875
|
+
KeyUpProps<T> &
|
|
876
|
+
FocusProps<T> &
|
|
877
|
+
BlurProps<T> &
|
|
878
|
+
LayoutChangeProps<T> &
|
|
879
|
+
UIAppearProps<T> &
|
|
880
|
+
UIDisappearProps<T> &
|
|
881
|
+
AccessibilityActionProps<T> &
|
|
882
|
+
TapProps<T> &
|
|
883
|
+
LongTapProps<T>;
|
|
462
884
|
|
|
463
885
|
export type LynxEventProps = LynxEventPropsBase<Target>;
|
|
464
886
|
|