@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/global.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
5
|
import { SystemInfo } from './system-info';
|
|
6
|
-
import { Lynx as BackgroundLynx, NativeModules as INativeModules, GetElementByIdFunc } from '../background-thread';
|
|
6
|
+
import { Lynx as BackgroundLynx, NativeModules as INativeModules, GetElementByIdFunc, ITextCodecHelper } from '../background-thread';
|
|
7
7
|
import { Lynx as MainThreadLynx } from '../main-thread';
|
|
8
8
|
import { CommonLynx } from './lynx';
|
|
9
9
|
|
|
@@ -25,6 +25,7 @@ declare global {
|
|
|
25
25
|
var getElementById: GetElementByIdFunc;
|
|
26
26
|
|
|
27
27
|
var NativeModules: INativeModules;
|
|
28
|
+
var TextCodecHelper: ITextCodecHelper;
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* @description requestAnimationFrame
|
|
@@ -7,9 +7,18 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export interface TraceOption {
|
|
9
9
|
/**
|
|
10
|
-
* An optional unique identifier for tracing
|
|
10
|
+
* An optional unique identifier for tracing a single event flow.
|
|
11
|
+
*
|
|
12
|
+
* Note: If `flowIds` is set, this parameter will be ignored.
|
|
11
13
|
*/
|
|
12
|
-
flowId?: number;
|
|
14
|
+
flowId?: number | undefined;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* An optional unique identifier for tracing multiple event flows.
|
|
18
|
+
* Support from Lynx 3.5
|
|
19
|
+
*/
|
|
20
|
+
flowIds?: number[];
|
|
21
|
+
|
|
13
22
|
/**
|
|
14
23
|
* An optional collection of key-value pairs providing additional context for the tracing event.
|
|
15
24
|
*/
|
package/types/common/props.d.ts
CHANGED
|
@@ -6,25 +6,79 @@ import { CSSProperties } from './csstype';
|
|
|
6
6
|
import { LynxEventProps } from './events';
|
|
7
7
|
|
|
8
8
|
export interface StandardProps extends LynxEventProps {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The unique identifier of the element, ensuring the uniqueness of the entire page
|
|
11
|
+
* @Android
|
|
12
|
+
* @iOS
|
|
13
|
+
* @Harmony
|
|
14
|
+
* @PC
|
|
15
|
+
*/
|
|
10
16
|
id?: string;
|
|
11
|
-
/** In React, similar to class, className is generally used as an alias for class
|
|
17
|
+
/** In React, similar to class, className is generally used as an alias for class
|
|
18
|
+
* @Android
|
|
19
|
+
* @iOS
|
|
20
|
+
* @Harmony
|
|
21
|
+
* @PC
|
|
22
|
+
*/
|
|
12
23
|
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Used to specify one or more class names for the element. These class names can be used in CSS to apply styles
|
|
26
|
+
* @Android
|
|
27
|
+
* @iOS
|
|
28
|
+
* @Harmony
|
|
29
|
+
* @PC
|
|
30
|
+
*/
|
|
13
31
|
class?: string;
|
|
14
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Element display, All elements is displayed by Default
|
|
34
|
+
* @deprecated Please sse `visibility:hidden` instead
|
|
35
|
+
*/
|
|
15
36
|
hidden?: boolean;
|
|
16
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Animation Properties
|
|
39
|
+
*/
|
|
17
40
|
animation?: { actions: Record<string, unknown>[] };
|
|
18
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Used to flatten the specified element, avoiding the creation of a real renderObject to accelerate rendering performance. Its default value is true on `<view>`
|
|
43
|
+
* @defaultValue true
|
|
44
|
+
* @Android
|
|
45
|
+
*/
|
|
19
46
|
flatten?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The unique identifier of the element, used for the client to find the View
|
|
49
|
+
* @deprecated Please use `id` instead
|
|
50
|
+
* @Android
|
|
51
|
+
* @iOS
|
|
52
|
+
*/
|
|
20
53
|
name?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Used to control overlapRendering on Android
|
|
56
|
+
* @defaultValue false
|
|
57
|
+
* @Android
|
|
58
|
+
*/
|
|
21
59
|
overlap?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Controls whether to overlap the drawing of the background and content to achieve the correct alpha blend effect
|
|
62
|
+
* @defaultValue false
|
|
63
|
+
* @iOS
|
|
64
|
+
*/
|
|
65
|
+
'overlap-ios'?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Layout only
|
|
68
|
+
* @deprecated Legacy API
|
|
69
|
+
*/
|
|
22
70
|
enableLayoutOnly?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Legacy API
|
|
73
|
+
* @deprecated Legacy API
|
|
74
|
+
*/
|
|
23
75
|
cssAlignWithLegacyW3C?: boolean;
|
|
24
76
|
/**
|
|
25
77
|
* Accessibility reading content
|
|
26
78
|
* @Android
|
|
27
79
|
* @iOS
|
|
80
|
+
* @Harmony
|
|
81
|
+
* @PC
|
|
28
82
|
* @spec {@link https://developer.apple.com/documentation/objectivec/nsobject/1615181-accessibilitylabel?language=objc | iOS}
|
|
29
83
|
* @spec {@link https://developer.android.com/reference/android/view/View.html#setContentDescription(java.lang.CharSequence) | Android}
|
|
30
84
|
*/
|
|
@@ -33,6 +87,8 @@ export interface StandardProps extends LynxEventProps {
|
|
|
33
87
|
* The combination of accessibility traits that best characterizes the accessibility element.
|
|
34
88
|
* @defaultValue 'none'
|
|
35
89
|
* @iOS
|
|
90
|
+
* @Harmony
|
|
91
|
+
* @Android
|
|
36
92
|
* @spec {@link https://developer.apple.com/documentation/objectivec/nsobject/1615202-accessibilitytraits?language=objc | iOS}
|
|
37
93
|
*/
|
|
38
94
|
'accessibility-traits'?:
|
|
@@ -55,6 +111,8 @@ export interface StandardProps extends LynxEventProps {
|
|
|
55
111
|
* A Boolean value that indicates whether the element is an accessibility element that an assistive app can access.
|
|
56
112
|
* @iOS
|
|
57
113
|
* @Android
|
|
114
|
+
* @Harmony
|
|
115
|
+
* @PC
|
|
58
116
|
* @spec {@link https://developer.apple.com/documentation/objectivec/nsobject/1615141-isaccessibilityelement?language=objc | iOS}
|
|
59
117
|
* @spec {@link https://developer.android.com/reference/android/view/View.html#setImportantForAccessibility(int) | Android}
|
|
60
118
|
*/
|
|
@@ -90,59 +148,305 @@ export interface StandardProps extends LynxEventProps {
|
|
|
90
148
|
*/
|
|
91
149
|
'accessibility-actions'?: string[];
|
|
92
150
|
|
|
93
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* Whether the element is hidden from the accessibility tree.
|
|
153
|
+
* @defaultValue false
|
|
154
|
+
* @Android
|
|
155
|
+
* @iOS
|
|
156
|
+
* @Harmony
|
|
157
|
+
*/
|
|
158
|
+
'accessibility-elements-hidden'?: boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Whether the element is the only focusable element in the accessibility tree.
|
|
162
|
+
* @defaultValue false
|
|
163
|
+
* @Android
|
|
164
|
+
* @iOS
|
|
165
|
+
* @Harmony
|
|
166
|
+
*/
|
|
167
|
+
'accessibility-exclusive-focus'?: boolean;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Used to specify the accessibility identifier of a UIView in iOS, which is only required when accessing the platform accessibility framework.
|
|
171
|
+
* @iOS
|
|
172
|
+
*/
|
|
173
|
+
'ios-platform-accessibility-id'?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Control whether the component can receive focus
|
|
177
|
+
* @defaultValue false
|
|
178
|
+
* @PC
|
|
179
|
+
*/
|
|
94
180
|
focusable?: boolean;
|
|
95
|
-
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Use two-dimensional coordinates such as "0, 0" to represent the focus priority of the x and y axes respectively. Nodes with the same priority will switch focus based on their position.
|
|
184
|
+
* @PC
|
|
185
|
+
*/
|
|
96
186
|
'focus-index'?: string;
|
|
97
|
-
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Manually specify the node ID that will receive focus when the user presses the "up" arrow key
|
|
190
|
+
* @PC
|
|
191
|
+
*/
|
|
98
192
|
'next-focus-up'?: string;
|
|
99
|
-
|
|
193
|
+
|
|
194
|
+
/** Manually specify the node ID that will receive focus when the user presses the "down" arrow key
|
|
195
|
+
* @PC
|
|
196
|
+
*/
|
|
100
197
|
'next-focus-down'?: string;
|
|
101
|
-
|
|
198
|
+
|
|
199
|
+
/** Manually specify the node ID that will receive focus when the user presses the "left" arrow key
|
|
200
|
+
* @PC
|
|
201
|
+
*/
|
|
102
202
|
'next-focus-left'?: string;
|
|
203
|
+
|
|
103
204
|
/**
|
|
104
|
-
* Manually specify the node id that receives focus when the user presses the "right" arrow key
|
|
205
|
+
* Manually specify the node id that receives focus when the user presses the "right" arrow key
|
|
206
|
+
* @PC
|
|
105
207
|
*/
|
|
106
208
|
'next-focus-right'?: string;
|
|
107
209
|
|
|
108
210
|
/**
|
|
109
|
-
*
|
|
211
|
+
* Custom timing flag
|
|
212
|
+
* @Android
|
|
213
|
+
* @iOS
|
|
214
|
+
* @Harmony
|
|
110
215
|
* @since Lynx 2.10
|
|
111
216
|
*/
|
|
112
217
|
__lynx_timing_flag?: string;
|
|
113
|
-
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Used to apply inline styles to the element
|
|
221
|
+
* @Android
|
|
222
|
+
* @iOS
|
|
223
|
+
* @Harmony
|
|
224
|
+
* @PC
|
|
225
|
+
*/
|
|
114
226
|
style?: string | CSSProperties;
|
|
115
227
|
|
|
116
|
-
|
|
117
228
|
/**
|
|
118
|
-
*
|
|
229
|
+
* We use CAShapeLayer to accelerate rendering of the component's backgrounds on iOS.
|
|
230
|
+
* @deprecated CPU drawing path is no longer needed
|
|
119
231
|
* @defaultValue true
|
|
120
232
|
* @iOS
|
|
121
|
-
* @since
|
|
233
|
+
* @since 3.1
|
|
122
234
|
*/
|
|
123
235
|
'ios-background-shape-layer'?: boolean;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Specify whether the node needs exposure/un-exposure events
|
|
239
|
+
* @Android
|
|
240
|
+
* @iOS
|
|
241
|
+
* @Harmony
|
|
242
|
+
* @PC
|
|
243
|
+
*/
|
|
244
|
+
|
|
124
245
|
'exposure-id'?: string;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Specify the scene of the node that needs exposure/un-exposure events
|
|
249
|
+
* @Android
|
|
250
|
+
* @iOS
|
|
251
|
+
* @Harmony
|
|
252
|
+
* @PC
|
|
253
|
+
*/
|
|
125
254
|
'exposure-scene'?: string;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
'exposure-
|
|
255
|
+
/**
|
|
256
|
+
* Specify the top extension value of the screen boundary referenced by the target node in the exposure detection task, which affects the viewport intersection judgment of the target node. Each node can have its own screen boundary scaling value
|
|
257
|
+
* @defaultValue "0px"
|
|
258
|
+
* @Android
|
|
259
|
+
* @iOS
|
|
260
|
+
* @Harmony
|
|
261
|
+
* @PC
|
|
262
|
+
*/
|
|
263
|
+
'exposure-screen-margin-top'?: `${number}px` | `${number}rpx`;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Specify the right extension value of the screen boundary referenced by the target node in the exposure detection task, which affects the viewport intersection judgment of the target node. Each node can have its own screen boundary scaling value
|
|
267
|
+
* @defaultValue "0px"
|
|
268
|
+
* @Android
|
|
269
|
+
* @iOS
|
|
270
|
+
* @Harmony
|
|
271
|
+
* @PC
|
|
272
|
+
*/
|
|
273
|
+
'exposure-screen-margin-right'?: `${number}px` | `${number}rpx`;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Specify the bottom extension value of the screen boundary referenced by the target node in the exposure detection task, which affects the viewport intersection judgment of the target node. Each node can have its own screen boundary scaling value
|
|
277
|
+
* @defaultValue "0px"
|
|
278
|
+
* @Android
|
|
279
|
+
* @iOS
|
|
280
|
+
* @Harmony
|
|
281
|
+
* @PC
|
|
282
|
+
*/
|
|
283
|
+
'exposure-screen-margin-bottom'?: `${number}px` | `${number}rpx`;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Specify the left extension value of the screen boundary referenced by the target node in the exposure detection task, which affects the viewport intersection judgment of the target node. Each node can have its own screen boundary scaling value
|
|
287
|
+
* @defaultValue "0px"
|
|
288
|
+
* @Android
|
|
289
|
+
* @iOS
|
|
290
|
+
* @Harmony
|
|
291
|
+
* @PC
|
|
292
|
+
*/
|
|
293
|
+
'exposure-screen-margin-left'?: `${number}px` | `${number}rpx`;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Specify the top boundary extension value of the target node itself in the exposure detection, which affects the viewport intersection judgment of the target node. Each node can have its own boundary extension value. Before using this feature, you also need to set `enable-exposure-ui-margin` for the current node.
|
|
297
|
+
* @defaultValue "0px"
|
|
298
|
+
* @Android
|
|
299
|
+
* @iOS
|
|
300
|
+
* @Harmony
|
|
301
|
+
* @PC
|
|
302
|
+
*/
|
|
303
|
+
'exposure-ui-margin-top'?: `${number}px` | `${number}rpx`;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Specify the right boundary extension value of the target node itself in the exposure detection, which affects the viewport intersection judgment of the target node. Each node can have its own boundary extension value. Before using this feature, you also need to set `enable-exposure-ui-margin` for the current node.
|
|
307
|
+
* @defaultValue "0px"
|
|
308
|
+
* @Android
|
|
309
|
+
* @iOS
|
|
310
|
+
* @Harmony
|
|
311
|
+
* @PC
|
|
312
|
+
*/
|
|
313
|
+
'exposure-ui-margin-right'?: `${number}px` | `${number}rpx`;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Specify the bottom boundary extension value of the target node itself in the exposure detection, which affects the viewport intersection judgment of the target node. Each node can have its own boundary extension value. Before using this feature, you also need to set `enable-exposure-ui-margin` for the current node.
|
|
317
|
+
* @defaultValue "0px"
|
|
318
|
+
* @Android
|
|
319
|
+
* @iOS
|
|
320
|
+
* @Harmony
|
|
321
|
+
* @PC
|
|
322
|
+
*/
|
|
323
|
+
'exposure-ui-margin-bottom'?: `${number}px` | `${number}rpx`;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Specify the left boundary extension value of the target node itself in the exposure detection, which affects the viewport intersection judgment of the target node. Each node can have its own boundary extension value. Before using this feature, you also need to set `enable-exposure-ui-margin` for the current node.
|
|
327
|
+
* @defaultValue "0px"
|
|
328
|
+
* @Android
|
|
329
|
+
* @iOS
|
|
330
|
+
* @Harmony
|
|
331
|
+
* @PC
|
|
332
|
+
*/
|
|
333
|
+
'exposure-ui-margin-left'?: `${number}px` | `${number}rpx`;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Specifies the viewport intersection ratio at which the target node can trigger an exposure event. An exposure event is triggered when the ratio is greater than this value, and an un-exposure event is triggered when the ratio is less than this value. By default, the exposure event is triggered as soon as the target node is visible.
|
|
337
|
+
* @defaultValue "0%"
|
|
338
|
+
* @Android
|
|
339
|
+
* @iOS
|
|
340
|
+
* @Harmony
|
|
341
|
+
* @PC
|
|
342
|
+
*/
|
|
343
|
+
'exposure-area'?: `${number}%`;
|
|
344
|
+
/**
|
|
345
|
+
* Specifies whether the target node needs to extend the viewport intersection area for exposure detection. If set to true, the target node will be extended by the values specified in `exposure-ui-margin-top`, `exposure-ui-margin-right`, `exposure-ui-margin-bottom`, and `exposure-ui-margin-left`. The default value is `true` on Harmony
|
|
346
|
+
* @defaultValue false
|
|
347
|
+
* @Android
|
|
348
|
+
* @iOS
|
|
349
|
+
* @Harmony
|
|
350
|
+
* @PC
|
|
351
|
+
*/
|
|
135
352
|
'enable-exposure-ui-margin'?: boolean;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Specify whether the exposure detection task takes into account the viewport clipping of the parent node. When set to true, nodes outside the parent node viewport cannot trigger exposure, and when set to false, nodes outside the parent node viewport can trigger exposure.
|
|
356
|
+
* @defaultValue false
|
|
357
|
+
* @Android
|
|
358
|
+
* @iOS
|
|
359
|
+
* @Harmony
|
|
360
|
+
* @since 3.4
|
|
361
|
+
*/
|
|
362
|
+
'enable-exposure-ui-clip'?: boolean;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Specifies whether the target node and its child nodes can respond to Lynx touch events. This property does not affect platform gestures (such as scrolling of the `<scroll-view>`)
|
|
366
|
+
* @defaultValue true
|
|
367
|
+
* @Android
|
|
368
|
+
* @iOS
|
|
369
|
+
* @Harmony
|
|
370
|
+
* @PC
|
|
371
|
+
*/
|
|
136
372
|
'user-interaction-enabled'?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Specifies whether the target node and its child nodes can consume platform touch events. This property does not affect platform gestures (such as scrolling of the `<scroll-view>`). The default value is `true` on iOS and Harmony and `false` on Android.
|
|
375
|
+
* @Android
|
|
376
|
+
* @iOS
|
|
377
|
+
* @Harmony
|
|
378
|
+
*/
|
|
137
379
|
'native-interaction-enabled'?: boolean;
|
|
380
|
+
/**
|
|
381
|
+
* Specifies whether the target node blocks platform gestures outside Lynx when it is on the event response chain, which can achieve an effect like blocking the platform swipe-back gesture.
|
|
382
|
+
* @defaultValue false
|
|
383
|
+
* @Android
|
|
384
|
+
* @iOS
|
|
385
|
+
* @Harmony
|
|
386
|
+
*/
|
|
138
387
|
'block-native-event'?: boolean;
|
|
139
|
-
|
|
140
|
-
|
|
388
|
+
/**
|
|
389
|
+
* Specifies whether to block platform gestures outside Lynx when the target node is on the event response chain and the touch is within the specified area of the target node. This can achieve an effect similar to blocking the platform swipe-back gesture. The inner array is an array containing four numbers: x, y, width, and height, representing the position of the touch area within the target node.
|
|
390
|
+
* @Android
|
|
391
|
+
* @iOS
|
|
392
|
+
*/
|
|
393
|
+
'block-native-event-areas'?: [`${number}px` | `${number}%`, `${number}px` | `${number}%`, `${number}px` | `${number}%`, `${number}px` | `${number}%`][];
|
|
394
|
+
/**
|
|
395
|
+
* Specifies whether the platform gestures should respond when the target node is on the event response chain and a swipe occurs at a specific angle. This does not affect Lynx touch events and can be used to implement a front - end scroll container that consumes swipes in a specified direction. The inner array contains two numbers, start and end, representing the start and end angles respectively.
|
|
396
|
+
* @Android
|
|
397
|
+
* @iOS
|
|
398
|
+
* @Harmony
|
|
399
|
+
* @PC
|
|
400
|
+
*/
|
|
401
|
+
'consume-slide-event'?: [number, number][];
|
|
402
|
+
/**
|
|
403
|
+
* Specifies whether the platform touch events should be dispatched to Lynx when the touch occurs on the target node. This can achieve an effect similar to displaying content without interaction. This property supports inheritance. This property can only ensure that Lynx does not consume platform touch events, but the parent view of LynxView may consume touch events, causing the penetration effect to fail.
|
|
404
|
+
* @defaultValue false
|
|
405
|
+
* @Android
|
|
406
|
+
* @iOS
|
|
407
|
+
* @Harmony
|
|
408
|
+
*/
|
|
141
409
|
'event-through'?: boolean;
|
|
410
|
+
/**
|
|
411
|
+
* Specifies whether the target node supports the :active pseudo-class to continue bubbling up the event response chain when a touch event occurs.
|
|
412
|
+
* @defaultValue false
|
|
413
|
+
* @Android
|
|
414
|
+
* @iOS
|
|
415
|
+
* @Harmony
|
|
416
|
+
* @PC
|
|
417
|
+
*/
|
|
142
418
|
'enable-touch-pseudo-propagation'?: boolean;
|
|
143
|
-
|
|
419
|
+
/**
|
|
420
|
+
* Specify the touch event response hot zone of the target node without affecting platform gestures
|
|
421
|
+
* @defaultValue "0px"
|
|
422
|
+
* @Android
|
|
423
|
+
* @iOS
|
|
424
|
+
* @Harmony
|
|
425
|
+
* @PC
|
|
426
|
+
*/
|
|
427
|
+
'hit-slop'?: `${number}px` | {top: `${number}px`, left: `${number}px`, right: `${number}px`, bottom: `${number}px`};
|
|
428
|
+
/**
|
|
429
|
+
* Specifies whether the target node should not抢占 focus when touched. By default, the node will抢占 focus when clicked, which can achieve an effect similar to preventing the keyboard from closing when clicking other areas. Additionally, it supports inheritance, meaning the default value of child nodes is the `ignore-focus` value of the parent node, and child nodes can override this value.
|
|
430
|
+
* @defaultValue false
|
|
431
|
+
* @Android
|
|
432
|
+
* @iOS
|
|
433
|
+
* @Harmony
|
|
434
|
+
* @PC
|
|
435
|
+
*/
|
|
144
436
|
'ignore-focus'?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
* Specifies whether to force the triggering of touch events when the target node is on the event response chain, which can solve the problem of touch events not being triggered on iOS
|
|
439
|
+
* @defaultValue false
|
|
440
|
+
* @iOS
|
|
441
|
+
*/
|
|
145
442
|
'ios-enable-simultaneous-touch'?: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* Used in conjunction with `event-through` to specify the event penetration definition for the target node in specific areas. The inner array is in the form of [x, y, width, height], with units of px or %. The x/y positions are relative to the viewport coordinate system of the target node.
|
|
445
|
+
* @iOS
|
|
446
|
+
* @Android
|
|
447
|
+
* @Harmony
|
|
448
|
+
*/
|
|
449
|
+
'event-through-active-regions'?: [`${number}%` | `${number}px`, `${number}%` | `${number}px`, `${number}%` | `${number}px`, `${number}%` | `${number}px`][];
|
|
146
450
|
}
|
|
147
451
|
|
|
148
452
|
export interface NoProps {
|
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* use 'windows' and 'macOS' instead of 'pc' since 3.3
|
|
7
|
+
*/
|
|
8
|
+
export type PlatformType = 'Android' | 'iOS' | 'Harmony' | 'windows' | 'macOS' | PCPlatform;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use 'windows' and 'macOS' instead since 3.3
|
|
12
|
+
*/
|
|
13
|
+
type PCPlatform = 'pc';
|
|
6
14
|
|
|
7
15
|
export interface SystemInfo {
|
|
8
16
|
/**
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Copyright 2025 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { Element } from './element'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Animation timing options configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface AnimationOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The length of time for the animation to run.
|
|
12
|
+
* @default 0
|
|
13
|
+
*/
|
|
14
|
+
duration?: number;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The length of time to wait before starting the animation.
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
20
|
+
delay?: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The number of times the animation should repeat. You can set this to `Infinity`
|
|
24
|
+
* to make the animation loop indefinitely.
|
|
25
|
+
* @default 1
|
|
26
|
+
*/
|
|
27
|
+
iterations?: number | typeof Infinity;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Whether the animation runs forwards (`normal`), backwards (`reverse`),
|
|
31
|
+
* switches direction after each iteration (`alternate`), or runs backwards
|
|
32
|
+
* and switches direction after each iteration (`alternate-reverse`).
|
|
33
|
+
* @default "normal"
|
|
34
|
+
*/
|
|
35
|
+
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The rate of the animation's change over time. Accepts a timing-function,
|
|
39
|
+
* such as `"linear"`, `"ease-in"`, or `"cubic-bezier(0.42, 0, 0.58, 1)"`.
|
|
40
|
+
* @default "linear"
|
|
41
|
+
*/
|
|
42
|
+
easing?: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Dictates whether the animation's effects should be reflected by the
|
|
46
|
+
* element(s) prior to playing (`"backwards"`), retained after the animation
|
|
47
|
+
* has completed playing (`"forwards"`), or both.
|
|
48
|
+
* @default "none"
|
|
49
|
+
*/
|
|
50
|
+
fill?: 'none' | 'forwards' | 'backwards' | 'both';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The name of the animation, which can be used to uniquely identify it.
|
|
54
|
+
* This name appears in the animation events parameters and is typically used
|
|
55
|
+
* to determine if a particular animation event is the one you're interested in.
|
|
56
|
+
* @since 2.12
|
|
57
|
+
* @default "An internal unique ID"
|
|
58
|
+
*/
|
|
59
|
+
name?: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Animation motion state, which defines whether an animation is running or paused.
|
|
63
|
+
* Accepts an `animation-play-state`.
|
|
64
|
+
* @default "running"
|
|
65
|
+
*/
|
|
66
|
+
'play-state'?: 'running' | 'paused';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Represents a keyframe effect for animations.
|
|
71
|
+
*/
|
|
72
|
+
export interface KeyframeEffect {
|
|
73
|
+
/**
|
|
74
|
+
* The target element of the animation.
|
|
75
|
+
*/
|
|
76
|
+
readonly target: Element;
|
|
77
|
+
/**
|
|
78
|
+
* The keyframes for the animation.
|
|
79
|
+
*/
|
|
80
|
+
readonly keyframes: Record<string, string | number>[];
|
|
81
|
+
/**
|
|
82
|
+
* The options for the animation.
|
|
83
|
+
*/
|
|
84
|
+
readonly options: AnimationOptions;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Represents a CSS animation.
|
|
89
|
+
*/
|
|
90
|
+
export interface Animation {
|
|
91
|
+
/**
|
|
92
|
+
* The keyframe effect associated with the animation.
|
|
93
|
+
*/
|
|
94
|
+
readonly effect: KeyframeEffect;
|
|
95
|
+
/**
|
|
96
|
+
* The unique identifier for the animation.
|
|
97
|
+
*/
|
|
98
|
+
readonly id: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Cancel the animation.
|
|
102
|
+
*/
|
|
103
|
+
cancel(): void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Pause the animation.
|
|
107
|
+
*/
|
|
108
|
+
pause(): void;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Play the animation.
|
|
112
|
+
*/
|
|
113
|
+
play(): void;
|
|
114
|
+
}
|
|
@@ -3,28 +3,9 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
5
|
import { CSSProperties } from '../common';
|
|
6
|
+
import { Animation, AnimationOptions } from './animation'
|
|
6
7
|
|
|
7
8
|
export interface Element {
|
|
8
|
-
styles: CSSProperties;
|
|
9
|
-
attributes: Record<string, any>;
|
|
10
|
-
scrollBy: (
|
|
11
|
-
width: number,
|
|
12
|
-
height: number
|
|
13
|
-
) => {
|
|
14
|
-
consumedX: number;
|
|
15
|
-
consumedY: number;
|
|
16
|
-
unconsumedX: number;
|
|
17
|
-
unconsumedY: number;
|
|
18
|
-
};
|
|
19
|
-
getBoundingClientRect: () => {
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
top: number;
|
|
23
|
-
bottom: number;
|
|
24
|
-
left: number;
|
|
25
|
-
right: number;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
9
|
/**
|
|
29
10
|
* Set an attribute.
|
|
30
11
|
* @param attributeName The name of the attribute.
|
|
@@ -82,4 +63,15 @@ export interface Element {
|
|
|
82
63
|
* @since Lynx 2.14
|
|
83
64
|
*/
|
|
84
65
|
invoke(methodName: string, params?: Record<string, any>): Promise<any>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Animate the element.
|
|
69
|
+
* @param keyframes The keyframes for the animation.
|
|
70
|
+
* @param options The options for the animation.
|
|
71
|
+
* @since Lynx 3.4
|
|
72
|
+
*/
|
|
73
|
+
animate(
|
|
74
|
+
keyframes: Record<string, number | string>[],
|
|
75
|
+
options?: number | AnimationOptions,
|
|
76
|
+
): Animation;
|
|
85
77
|
}
|